@phtngyn/cms 0.1.0-beta.0 → 0.1.0-beta.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.
Files changed (123) hide show
  1. package/README.md +72 -1
  2. package/package.json +5 -5
  3. package/src/Authoring.d.ts +13 -1
  4. package/src/{AuthoringSchema-BQ5kbhVB.js → Configuration-DyKo0sLS.js} +595 -367
  5. package/src/Configuration-DyKo0sLS.js.map +1 -0
  6. package/src/{DocumentEngine-Da0kWotL.js → DocumentEngine-DYObwMDY.js} +44 -66
  7. package/src/DocumentEngine-DYObwMDY.js.map +1 -0
  8. package/src/DocumentModel.d.ts +4 -0
  9. package/src/DocumentModel.js.map +1 -1
  10. package/src/{HttpPaths-86qLGB90.js → HttpPaths-BbS21Jy8.js} +4 -2
  11. package/src/{HttpPaths-86qLGB90.js.map → HttpPaths-BbS21Jy8.js.map} +1 -1
  12. package/src/Module.js +27 -76
  13. package/src/Module.js.map +1 -1
  14. package/src/{StudioHttp-BTLLooh0.js → StudioHttp-jR2-bc01.js} +44 -242
  15. package/src/StudioHttp-jR2-bc01.js.map +1 -0
  16. package/src/{connection-ZGtL54qY.js → connection-CBTY-TzB.js} +3 -3
  17. package/src/{connection-ZGtL54qY.js.map → connection-CBTY-TzB.js.map} +1 -1
  18. package/src/{installation-BNKaVjni.js → installation-DeuBiFRE.js} +488 -236
  19. package/src/installation-DeuBiFRE.js.map +1 -0
  20. package/src/internal/authoring-catalog.js +147 -0
  21. package/src/internal/authoring-catalog.js.map +1 -0
  22. package/src/internal/authoring-compiler.js +2 -1
  23. package/src/internal/authoring-compiler.js.map +1 -1
  24. package/src/internal/authoring-metadata.js +67 -48
  25. package/src/internal/authoring-metadata.js.map +1 -1
  26. package/src/internal/configuration.js +5 -6
  27. package/src/internal/configuration.js.map +1 -1
  28. package/src/internal/document-model.js +3 -2
  29. package/src/internal/document-model.js.map +1 -1
  30. package/src/internal/studio-app.js +66 -0
  31. package/src/internal/studio-app.js.map +1 -0
  32. package/src/location-DtYv2aes.js +36 -0
  33. package/src/location-DtYv2aes.js.map +1 -0
  34. package/src/{metadata-Czvi3E4K.js → metadata-DE1Mc2td.js} +2 -2
  35. package/src/{metadata-Czvi3E4K.js.map → metadata-DE1Mc2td.js.map} +1 -1
  36. package/src/{models-Citx8jBi.js → models-BkMgeaOL.js} +252 -3
  37. package/src/models-BkMgeaOL.js.map +1 -0
  38. package/src/{models-DS5ClMsH.js → models-C3witQBK.js} +8 -31
  39. package/src/models-C3witQBK.js.map +1 -0
  40. package/src/runtime/blocks.js +17 -0
  41. package/src/runtime/blocks.js.map +1 -0
  42. package/src/runtime/collaboration.js +9 -4
  43. package/src/runtime/collaboration.js.map +1 -1
  44. package/src/runtime/delivery/DocumentRenderer.js +6 -3
  45. package/src/runtime/delivery/DocumentRenderer.js.map +1 -1
  46. package/src/runtime/delivery/blocks.js +6 -0
  47. package/src/runtime/delivery/blocks.js.map +1 -0
  48. package/src/runtime/delivery/context.js +12 -0
  49. package/src/runtime/delivery/context.js.map +1 -0
  50. package/src/runtime/delivery/document-page.js +5 -3
  51. package/src/runtime/delivery/document-page.js.map +1 -1
  52. package/src/runtime/delivery/document.js +18 -2
  53. package/src/runtime/delivery/document.js.map +1 -1
  54. package/src/runtime/delivery/error.js +11 -0
  55. package/src/runtime/delivery/error.js.map +1 -0
  56. package/src/runtime/delivery/plugin.js +21 -0
  57. package/src/runtime/delivery/plugin.js.map +1 -0
  58. package/src/runtime/delivery/useDocument.js +6 -3
  59. package/src/runtime/delivery/useDocument.js.map +1 -1
  60. package/src/runtime/delivery/useDocumentQuery.js +6 -3
  61. package/src/runtime/delivery/useDocumentQuery.js.map +1 -1
  62. package/src/runtime/installation.js +1 -1
  63. package/src/runtime/plugin.js +3 -3
  64. package/src/runtime/plugin.js.map +1 -1
  65. package/src/runtime/preview/connection.js +1 -1
  66. package/src/runtime/preview/controller.js +29 -10
  67. package/src/runtime/preview/controller.js.map +1 -1
  68. package/src/runtime/preview/overlay.js +65 -0
  69. package/src/runtime/preview/overlay.js.map +1 -0
  70. package/src/runtime/preview/plugin.client.js +21 -34
  71. package/src/runtime/preview/plugin.client.js.map +1 -1
  72. package/src/runtime/preview/preview.css +72 -4
  73. package/src/runtime/preview/store.js +1 -1
  74. package/src/runtime/studio-app.js +5 -1
  75. package/src/runtime/studio-app.js.map +1 -1
  76. package/src/runtime/studio-entry.js +36 -0
  77. package/src/runtime/studio-entry.js.map +1 -0
  78. package/src/runtime/studio-navigation.js +11 -0
  79. package/src/runtime/studio-navigation.js.map +1 -0
  80. package/src/{store-Nl4uxEXx.js → store-CfFFx9Ua.js} +3 -3
  81. package/src/{store-Nl4uxEXx.js.map → store-CfFFx9Ua.js.map} +1 -1
  82. package/studio/CreateDocumentDialog--L9lTfx6.js +256 -0
  83. package/studio/collaboration-DUuu678R.js +4565 -0
  84. package/studio/documentPlanning-BXX04Woe.js +28989 -0
  85. package/studio/dom-to-image-more.min-D6jGGdrW.js +877 -0
  86. package/studio/editor-PexnXkJY.js +30817 -0
  87. package/studio/host.css +3 -0
  88. package/studio/host.js +44179 -0
  89. package/studio/rolldown-runtime-B0aSnxlc.js +20 -0
  90. package/dist/studio/assets/ActivityEntryRow-D--fRvWI.js +0 -1
  91. package/dist/studio/assets/ActivityView-D-XBBUHb.js +0 -1
  92. package/dist/studio/assets/CreateDocumentDialog-CH8UH1QM.js +0 -1
  93. package/dist/studio/assets/DocumentsView-CxRpmAxt.js +0 -34
  94. package/dist/studio/assets/DropdownMenu-BSb1l7fr.js +0 -1
  95. package/dist/studio/assets/Input-DVao38h7.js +0 -3
  96. package/dist/studio/assets/MediaView-BHrPIjxB.js +0 -1
  97. package/dist/studio/assets/Modal-VNrXGa5C.js +0 -1
  98. package/dist/studio/assets/OverviewView-DfP6-mLZ.js +0 -1
  99. package/dist/studio/assets/Select-BJZIs9sY.js +0 -1
  100. package/dist/studio/assets/SettingsView-CerHe-ua.js +0 -1
  101. package/dist/studio/assets/Skeleton-CWJNi3nS.js +0 -1
  102. package/dist/studio/assets/StudioPageHeader-DP9HDAF2.js +0 -1
  103. package/dist/studio/assets/UsersView-cP3REkH2.js +0 -1
  104. package/dist/studio/assets/collaboration-BLnCzfvV.js +0 -4
  105. package/dist/studio/assets/context-dY4fNbn3.js +0 -1
  106. package/dist/studio/assets/editor-CE07wW83.js +0 -137
  107. package/dist/studio/assets/gateway-BAyQgCse.js +0 -10
  108. package/dist/studio/assets/index-CjoaPLhZ.js +0 -28
  109. package/dist/studio/assets/index-s2rPqCmP.css +0 -2
  110. package/dist/studio/assets/render-BkxbK2St.js +0 -83
  111. package/dist/studio/assets/rolldown-runtime-DK3Fl9T5.js +0 -1
  112. package/dist/studio/assets/useMediaLibrary-D7qR7aBf.js +0 -1
  113. package/dist/studio/index.html +0 -76
  114. package/src/AuthoringSchema-BQ5kbhVB.js.map +0 -1
  115. package/src/Configuration-BGYFD2N1.js +0 -150
  116. package/src/Configuration-BGYFD2N1.js.map +0 -1
  117. package/src/DocumentEngine-Da0kWotL.js.map +0 -1
  118. package/src/StudioHttp-BTLLooh0.js.map +0 -1
  119. package/src/installation-BNKaVjni.js.map +0 -1
  120. package/src/internal/component-metadata.js +0 -37
  121. package/src/internal/component-metadata.js.map +0 -1
  122. package/src/models-Citx8jBi.js.map +0 -1
  123. package/src/models-DS5ClMsH.js.map +0 -1
@@ -1,34 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{$ as t,$t as n,A as r,At as i,Bt as a,C as o,Ct as s,D as c,Dt as l,E as u,Et as d,F as f,G as p,It as m,J as h,K as g,Kt as _,L as v,M as y,Mt as b,N as x,Nt as S,O as C,P as w,Pt as T,Q as E,Qt as D,R as O,Rt as k,S as A,T as j,Tt as M,W as N,Wt as ee,X as te,Yt as P,Z as F,Zt as I,_ as ne,a as re,b as ie,bt as ae,c as oe,cn as se,ct as ce,d as le,dt as ue,en as de,et as L,f as fe,g as pe,h as me,ht as he,i as ge,in as R,it as z,jt as _e,kt as ve,l as ye,ln as B,lt as be,m as xe,mt as V,n as Se,nn as Ce,o as we,on as H,ot as U,p as Te,pt as W,qt as Ee,r as De,rt as G,s as Oe,sn as ke,st as Ae,t as je,tn as Me,tt as K,u as Ne,v as Pe,vt as Fe,w as Ie,wt as Le,x as Re,xt as ze,y as Be,z as Ve,zt as He}from"./editor-CE07wW83.js";import{B as Ue,C as q,F as We,G as Ge,H as Ke,I as qe,K as Je,L as Ye,M as Xe,N as Ze,O as Qe,R as $e,S as et,T as tt,U as nt,V as rt,W as it,X as at,_ as ot,b as st,bt as ct,dt as lt,f as ut,ft as dt,g as ft,h as pt,i as mt,lt as ht,m as gt,n as _t,p as vt,r as yt,tt as bt,ut as xt,v as St,x as Ct,xt as wt,y as J,z as Tt}from"./context-dY4fNbn3.js";import{$ as Et,A as Dt,D as Ot,F as kt,G as At,H as jt,I as Mt,J as Nt,K as Pt,L as Ft,M as It,N as Lt,O as Rt,P as zt,R as Bt,U as Vt,W as Ht,c as Ut,ct as Wt,d as Gt,et as Kt,i as qt,it as Jt,j as Yt,k as Xt,nt as Zt,o as Qt,ot as $t,r as en,rt as tn,s as nn,t as rn,u as an,w as on,z as sn}from"./Input-DVao38h7.js";import{c as cn,d as ln,h as un,l as dn,m as fn,n as pn,o as mn,p as hn,s as gn,t as _n,u as vn}from"./DropdownMenu-BSb1l7fr.js";import{n as yn,r as bn,t as xn}from"./Select-BJZIs9sY.js";import{i as Sn,r as Cn,t as wn}from"./Modal-VNrXGa5C.js";import{a as Tn,i as En,n as Dn,r as On,t as kn}from"./useMediaLibrary-D7qR7aBf.js";import{$t as An,A as jn,At as Mn,Bt as Nn,Ct as Pn,D as Fn,Dt as In,E as Ln,Et as Rn,F as zn,Ft as Bn,G as Vn,Gt as Hn,H as Un,Ht as Wn,I as Gn,It as Kn,J as qn,Jt as Jn,K as Yn,Kt as Xn,L as Zn,Lt as Qn,M as $n,Mt as er,N as tr,Nt as nr,O as rr,Ot as ir,P as ar,Pt as or,Qt as sr,Rt as cr,S as lr,St as ur,T as dr,Tt as fr,U as pr,Ut as mr,V as hr,Vt as gr,W as _r,Wt as vr,X as yr,Xt as br,Y as xr,Yt as Sr,Z as Cr,Zt as wr,_n as Tr,_t as Er,a as Dr,an as Or,at as kr,b as Ar,bn as Y,bt as jr,c as Mr,cn as Nr,ct as Pr,d as Fr,dt as Ir,en as Lr,et as Rr,f as zr,ft as Br,g as Vr,gn as Hr,gt as Ur,hn as Wr,ht as Gr,i as Kr,in as qr,it as Jr,j as Yr,jt as Xr,k as Zr,kt as Qr,l as $r,lt as ei,m as ti,mt as ni,n as ri,nn as ii,nt as ai,o as oi,ot as si,pt as ci,q as li,qt as ui,r as di,rn as fi,rt as pi,s as mi,sn as hi,st as gi,tn as _i,u as vi,ut as yi,v as bi,vn as xi,vt as Si,w as Ci,wt as wi,x as Ti,xn as Ei,xt as Di,yn as Oi,yt as ki,z as Ai,zt as ji}from"./gateway-BAyQgCse.js";import{C as Mi,S as Ni,T as Pi,_ as Fi,a as Ii,b as Li,c as Ri,d as zi,f as Bi,g as Vi,h as Hi,i as Ui,l as Wi,m as Gi,n as Ki,o as qi,r as Ji,s as Yi,t as Xi,u as Zi,v as Qi,w as $i,x as ea,y as ta}from"./index-CjoaPLhZ.js";import{t as na}from"./Skeleton-CWJNi3nS.js";import{S as ra,_ as ia,a as aa,b as oa,c as sa,d as ca,f as la,g as ua,h as da,i as fa,l as pa,m as ma,n as ha,o as ga,p as _a,r as va,s as ya,t as ba,u as xa,v as Sa,x as Ca,y as wa}from"./render-BkxbK2St.js";import{D as Ta,O as Ea,c as Da,p as Oa,t as ka,v as Aa}from"./collaboration-BLnCzfvV.js";function ja(){let e=Ae()?.vnode?.scopeId;return e?{[e]:``}:{}}function Ma(e){let t=jt({locale:P(`en`)});return F(()=>e?.value||t.locale?.value||`en`)}function Na(e,t){let n=P(),r=(r,i)=>{if(t.multiple&&Array.isArray(e.value)){if(t.selectionBehavior===`replace`)e.value=[r],n.value=r;else{let t=e.value.findIndex(e=>i(e));e.value=t===-1?[...e.value,r]:e.value.filter((e,n)=>n!==t)}}else e.value=t.selectionBehavior===`replace`?{...r}:!Array.isArray(e.value)&&i(e.value)?void 0:{...r};return e.value};function i(r,i,a,o){if(!n?.value||!t.multiple||!Array.isArray(e.value))return;let s=a().filter(e=>e.ref.dataset.disabled!==``).find(e=>e.ref===i)?.value;if(!s)return;let c=null;switch(r){case`prev`:case`next`:c=Pi(o,n.value,s);break;case`first`:c=Pi(o,n.value,o?.[0]);break;case`last`:c=Pi(o,n.value,o.at(-1))}e.value=c}return{firstValue:n,onSelectItem:r,handleMultipleReplace:i}}var[Pa,Fa]=Qe(`ComboboxRoot`),Ia=U({__name:`ComboboxRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},resetSearchTermOnBlur:{type:Boolean,required:!1,default:!0},resetSearchTermOnSelect:{type:Boolean,required:!1,default:!0},openOnFocus:{type:Boolean,required:!1,default:!1},openOnClick:{type:Boolean,required:!1,default:!1},ignoreFilter:{type:Boolean,required:!1},resetModelValueOnClear:{type:Boolean,required:!1,default:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},multiple:{type:Boolean,required:!1},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1},highlightOnHover:{type:Boolean,required:!1,default:!0},by:{type:[String,Function],required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`highlight`,`update:open`],setup(e,{expose:n,emit:r}){let i=e,a=r,{primitiveElement:o,currentElement:c}=Rt(),{multiple:l,disabled:u,ignoreFilter:f,resetSearchTermOnSelect:p,openOnFocus:m,openOnClick:h,dir:g,resetModelValueOnClear:_,highlightOnHover:v}=Me(i),y=Bt(g),b=Wt(i,`modelValue`,a,{defaultValue:i.defaultValue??(l.value?[]:void 0),passive:i.modelValue===void 0,deep:!0}),x=Wt(i,`open`,a,{defaultValue:i.defaultOpen,passive:i.open===void 0});async function S(e){x.value=e,N.value=``,e?(await he(),o.value?.highlightSelected(),w.value=!0,E.value?.focus()):(w.value=!1,setTimeout(()=>{!e&&i.resetSearchTermOnBlur&&C.trigger()},1))}let C=at(),w=P(!1),T=P(!1),E=P(),D=P(),O=F(()=>o.value?.highlightedElement??void 0),A=P(new Map),j=P(new Map),{contains:M}=hn({sensitivity:`base`}),N=P(``),te=F(e=>{if(!N.value||i.ignoreFilter||T.value)return{count:A.value.size,items:e?.items??new Map,groups:e?.groups??new Set(j.value.keys())};let t=0,n=new Map,r=new Set;for(let[e,r]of A.value){let i=M(r,N.value);n.set(e,+!!i),i&&t++}for(let[e,t]of j.value)for(let i of t)if(n.get(i)>0){r.add(e);break}return{count:t,items:n,groups:r}}),I=Ae();return ae(()=>{I?.exposed&&(I.exposed.highlightItem=o.value?.highlightItem,I.exposed.highlightFirstItem=o.value?.highlightFirstItem,I.exposed.highlightSelected=o.value?.highlightSelected)}),n({filtered:te,highlightedElement:O,highlightItem:o.value?.highlightItem,highlightFirstItem:o.value?.highlightFirstItem,highlightSelected:o.value?.highlightSelected}),Fa({modelValue:b,multiple:l,disabled:u,open:x,onOpenChange:S,contentId:``,isUserInputted:w,isVirtual:T,inputElement:E,highlightedElement:O,onInputElementChange:e=>E.value=e,triggerElement:D,onTriggerElementChange:e=>D.value=e,parentElement:c,resetSearchTermOnSelect:p,onResetSearchTerm:C.on,allItems:A,allGroups:j,filterSearch:N,filterState:te,ignoreFilter:f,openOnFocus:m,openOnClick:h,resetModelValueOnClear:_}),(e,n)=>(s(),t(R(Ut),null,{default:k(()=>[z(R(ea),V({ref_key:`primitiveElement`,ref:o},e.$attrs,{modelValue:R(b),"onUpdate:modelValue":n[0]||=e=>ee(b)?b.value=e:null,style:{pointerEvents:R(x)?`auto`:void 0},as:e.as,"as-child":e.asChild,dir:R(y),multiple:R(l),name:e.name,required:e.required,disabled:R(u),"highlight-on-hover":R(v),by:i.by,onHighlight:n[1]||=e=>a(`highlight`,e)}),{default:k(()=>[d(e.$slots,`default`,{open:R(x),modelValue:R(b)})]),_:3},16,[`modelValue`,`style`,`as`,`as-child`,`dir`,`multiple`,`name`,`required`,`disabled`,`highlight-on-hover`,`by`])]),_:3}))}}),La=U({__name:`ComboboxAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let{forwardRef:n}=kt();return(e,r)=>(s(),t(R(nn),{"as-child":``,reference:e.reference},{default:k(()=>[z(R(q),V({ref:R(n),"as-child":e.asChild,as:e.as},e.$attrs),{default:k(()=>[d(e.$slots,`default`)]),_:3},16,[`as-child`,`as`])]),_:3},8,[`reference`]))}}),[Ra,za]=Qe(`ComboboxContent`),Ba=U({__name:`ComboboxContentImpl`,props:{position:{type:String,required:!1,default:`inline`},bodyLock:{type:Boolean,required:!1},hideWhenEmpty:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`],setup(e,{emit:n}){let r=e,i=n,{position:a}=Me(r),o=Pa(),c=F(()=>o.ignoreFilter.value?o.allItems.value.size===0:o.filterState.value.count===0),{forwardRef:u,currentElement:f}=kt();sn(r.bodyLock),Ft(),Lt(o.parentElement);let p=F(()=>r.position===`popper`?r:{}),m=tt(p.value),h={boxSizing:`border-box`,"--reka-combobox-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-combobox-content-available-width":`var(--reka-popper-available-width)`,"--reka-combobox-content-available-height":`var(--reka-popper-available-height)`,"--reka-combobox-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-combobox-trigger-height":`var(--reka-popper-anchor-height)`};za({position:a});let _=P(!1);ae(()=>{o.inputElement.value&&(_.value=f.value.contains(o.inputElement.value),_.value&&o.inputElement.value.focus())}),ze(()=>{let e=At();_.value&&(!e||e===document.body)&&o.triggerElement.value?.focus()});function v(e){if(o.parentElement.value?.contains(e))return!0;let t=(e instanceof Element?e.closest(`label`):null)?.control;return!!t&&!!o.parentElement.value?.contains(t)}return(e,n)=>(s(),t(R(Li),{"as-child":``},{default:k(()=>[z(R(on),{"as-child":``,onMountAutoFocus:n[5]||=g(()=>{},[`prevent`]),onUnmountAutoFocus:n[6]||=g(()=>{},[`prevent`])},{default:k(()=>[z(R(Ot),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onDismiss:n[0]||=e=>R(o).onOpenChange(!1),onFocusOutside:n[1]||=e=>{v(e.target)&&e.preventDefault(),i(`focusOutside`,e)},onInteractOutside:n[2]||=e=>i(`interactOutside`,e),onEscapeKeyDown:n[3]||=e=>i(`escapeKeyDown`,e),onPointerDownOutside:n[4]||=e=>{v(e.target)&&e.preventDefault(),i(`pointerDownOutside`,e)}},{default:k(()=>[(s(),t(l(R(a)===`popper`?R(Qt):R(q)),V({...e.$attrs,...R(m)},{id:R(o).contentId,ref:R(u),"memo-dependencies":R(a)===`popper`?[R(o).filterSearch.value,R(o).filterState.value]:void 0,"data-state":R(o).open.value?`open`:`closed`,"data-empty":c.value?``:void 0,style:{display:r.hideWhenEmpty&&c.value?`none`:`flex`,flexDirection:`column`,outline:`none`,...R(a)===`popper`?h:{}}}),{default:k(()=>[d(e.$slots,`default`)]),_:3},16,[`id`,`memo-dependencies`,`data-state`,`data-empty`,`style`]))]),_:3},8,[`disable-outside-pointer-events`])]),_:3})]),_:3}))}}),Va=U({__name:`ComboboxArrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let n=e,r=Pa(),i=Ra();return kt(),(e,a)=>R(r).open.value&&R(i).position.value===`popper`?(s(),t(R(qt),ke(V({key:0},n)),{default:k(()=>[d(e.$slots,`default`)]),_:3},16)):L(`v-if`,!0)}}),Ha=U({__name:`ComboboxCancel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let n=e;kt();let r=Pa();function i(){r.filterSearch.value=``,r.inputElement.value&&(r.inputElement.value.value=``,r.inputElement.value.focus()),r.resetModelValueOnClear?.value&&(r.modelValue.value=r.multiple.value?[]:null)}return(e,r)=>(s(),t(R(q),V({type:e.as===`button`?`button`:void 0},n,{tabindex:`-1`,onClick:i}),{default:k(()=>[d(e.$slots,`default`)]),_:3},16,[`type`]))}}),Ua=U({__name:`ComboboxContent`,props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},hideWhenEmpty:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`],setup(e,{emit:n}){let r=zt(e,n),{forwardRef:i}=kt(),a=Pa();return a.contentId||=It(void 0,`reka-combobox-content`),(e,n)=>(s(),t(R(Xt),{present:e.forceMount||R(a).open.value},{default:k(()=>[z(Ba,V({...R(r),...e.$attrs},{ref:R(i)}),{default:k(()=>[d(e.$slots,`default`)]),_:3},16)]),_:3},8,[`present`]))}}),Wa=U({__name:`ComboboxEmpty`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let n=e,r=Pa(),i=F(()=>r.ignoreFilter.value?r.allItems.value.size===0:r.filterState.value.count===0);return(e,r)=>i.value?(s(),t(R(q),ke(V({key:0},n)),{default:k(()=>[d(e.$slots,`default`,{},()=>[r[0]||=G(`No options`)])]),_:3},16)):L(`v-if`,!0)}}),[Ga,Ka]=Qe(`ComboboxGroup`),qa=U({__name:`ComboboxGroup`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let n=e,r=It(void 0,`reka-combobox-group`),i=Pa(),a=F(()=>i.ignoreFilter.value?!0:!i.filterSearch.value||i.filterState.value.groups.has(r)),o=Ka({id:r,labelId:``});return ae(()=>{i.allGroups.value.has(r)||i.allGroups.value.set(r,new Set)}),ze(()=>{i.allGroups.value.delete(r)}),(e,i)=>(s(),t(R(Qi),V({id:R(r),"aria-labelledby":R(o).labelId},n,{hidden:!a.value||void 0}),{default:k(()=>[d(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`,`hidden`]))}}),Ja=U({__name:`ComboboxInput`,props:{displayValue:{type:Function,required:!1},modelValue:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`input`}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,a=Pa(),o=Ni(),{primitiveElement:c,currentElement:l}=Rt(),u=Wt(r,`modelValue`,i,{passive:r.modelValue===void 0});ae(()=>{l.value&&a.onInputElementChange(l.value)});let{isComposing:f,shouldDeferInput:m,handleCompositionStart:h,handleCompositionUpdate:g,handleCompositionEnd:_}=fn(e=>{let t=e.target;t&&y(t.value)});function v(e){f.value||(e.preventDefault(),a.open.value||a.onOpenChange(!0))}function y(e){a.open.value?a.filterSearch.value=e:(a.onOpenChange(!0),he(()=>{e&&(a.filterSearch.value=e,o.highlightFirstItem())}))}function b(e){m.value||y(e.target.value)}function x(){a.openOnFocus.value&&!a.open.value&&a.onOpenChange(!0)}function S(e){if(!a.open.value)return;let t=e.relatedTarget;if(!t)return;let n=a.parentElement.value?.contains(t),r=document.getElementById(a.contentId)?.contains(t);!n&&!r&&requestAnimationFrame(()=>{if(!a.open.value)return;let e=document.activeElement;!a.parentElement.value?.contains(e)&&!document.getElementById(a.contentId)?.contains(e)&&a.onOpenChange(!1)})}function C(){a.openOnClick.value&&!a.open.value&&a.onOpenChange(!0)}function w(){let e=a.modelValue.value;r.displayValue?u.value=r.displayValue(e):!a.multiple.value&&e&&!Array.isArray(e)?typeof e==`object`?u.value=``:u.value=e.toString():u.value=``,he(()=>{u.value=u.value})}return a.onResetSearchTerm(()=>{w()}),T(a.modelValue,async()=>{!a.isUserInputted.value&&a.resetSearchTermOnSelect.value&&w()},{immediate:!0,deep:!0}),T(a.filterState,(e,t)=>{!a.isVirtual.value&&t.count===0&&o.highlightFirstItem()}),(e,n)=>(s(),t(R(ta),{ref_key:`primitiveElement`,ref:c,modelValue:R(u),"onUpdate:modelValue":n[0]||=e=>ee(u)?u.value=e:null,as:e.as,"as-child":e.asChild,"auto-focus":e.autoFocus,disabled:e.disabled,"aria-expanded":R(a).open.value,"aria-controls":R(a).contentId,"aria-autocomplete":`list`,role:`combobox`,autocomplete:`off`,onClick:C,onInput:b,onKeydown:p(v,[`down`,`up`]),onFocus:x,onBlur:S,onCompositionstart:R(h),onCompositionupdate:R(g),onCompositionend:R(_)},{default:k(()=>[d(e.$slots,`default`)]),_:3},8,[`modelValue`,`as`,`as-child`,`auto-focus`,`disabled`,`aria-expanded`,`aria-controls`,`onCompositionstart`,`onCompositionupdate`,`onCompositionend`]))}}),Ya=U({__name:`ComboboxItem`,props:{textValue:{type:String,required:!1},value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n,o=It(void 0,`reka-combobox-item`),c=Pa(),l=Ga(null),{primitiveElement:u,currentElement:f}=Rt();if(r.value===``)throw Error(`A <ComboboxItem /> must have a value prop that is not an empty string. This is because the Combobox value can be set to an empty string to clear the selection and show the placeholder.`);let p=F(()=>{if(c.isVirtual.value||c.ignoreFilter.value||!c.filterSearch.value)return!0;{let e=c.filterState.value.items.get(o);return e===void 0||e>0}});return ae(()=>{c.allItems.value.set(o,r.textValue||f.value.textContent||f.value.innerText);let e=l?.id;e&&(c.allGroups.value.has(e)?c.allGroups.value.get(e)?.add(o):c.allGroups.value.set(e,new Set([o])))}),ze(()=>{c.allItems.value.delete(o)}),(e,n)=>p.value?a([p.value,R(c).filterSearch.value,R(c).disabled.value,e.disabled,r.value,r.as,r.asChild,...Object.values(e.$attrs)],()=>(s(),t(R(Fi),V({key:0},r,{id:R(o),ref_key:`primitiveElement`,ref:u,disabled:R(c).disabled.value||e.disabled,onSelect:n[0]||=t=>{i(`select`,t),!t.defaultPrevented&&(!R(c).multiple.value&&!e.disabled&&!R(c).disabled.value?(t.preventDefault(),R(c).onOpenChange(!1),R(c).modelValue.value=r.value):R(c).multiple.value&&R(c).inputElement.value?.focus())}}),{default:k(()=>[d(e.$slots,`default`,{},()=>[G(B(e.value),1)])]),_:3},16,[`id`,`disabled`])),n,1):L(`v-if`,!0)}}),Xa=U({__name:`ComboboxItemIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let n=e;return(e,r)=>(s(),t(R(Vi),ke(ce(n)),{default:k(()=>[d(e.$slots,`default`)]),_:3},16))}}),Za=U({__name:`ComboboxLabel`,props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let n=e;kt();let r=Ga({id:``,labelId:``});return r.labelId||=It(void 0,`reka-combobox-group-label`),(e,i)=>(s(),t(R(q),V(n,{id:R(r).labelId}),{default:k(()=>[d(e.$slots,`default`)]),_:3},16,[`id`]))}}),Qa=U({__name:`ComboboxPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let n=e;return(e,r)=>(s(),t(R(Gt),ke(ce(n)),{default:k(()=>[d(e.$slots,`default`)]),_:3},16))}}),$a=U({__name:`ComboboxSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let n=e;return kt(),(e,r)=>(s(),t(R(q),V(n,{"aria-hidden":`true`}),{default:k(()=>[d(e.$slots,`default`)]),_:3},16))}}),eo=U({__name:`ComboboxTrigger`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let n=e,{forwardRef:r,currentElement:i}=kt(),a=Pa(),o=F(()=>n.disabled||a.disabled.value||!1);return ae(()=>{i.value&&a.onTriggerElementChange(i.value)}),(e,i)=>(s(),t(R(q),V(n,{ref:R(r),type:e.as===`button`?`button`:void 0,tabindex:`-1`,"aria-label":`Show popup`,"aria-haspopup":`listbox`,"aria-expanded":R(a).open.value,"aria-controls":R(a).contentId,"data-state":R(a).open.value?`open`:`closed`,disabled:o.value,"data-disabled":o.value?``:void 0,"aria-disabled":o.value??void 0,onClick:i[0]||=e=>R(a).onOpenChange(!R(a).open.value)}),{default:k(()=>[d(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`aria-disabled`]))}}),to=U({__name:`ComboboxVirtualizer`,props:{options:{type:Array,required:!0},overscan:{type:Number,required:!1},estimateSize:{type:[Number,Function],required:!1},textContent:{type:Function,required:!1}},setup(e){let n=e,r=Pa();return r.isVirtual.value=!0,(e,r)=>(s(),t(Gi,ke(ce(n)),{default:k(t=>[d(e.$slots,`default`,ke(ce(t)))]),_:3},16))}}),no=U({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let n=e,r=gn(),i=It(),a=F(()=>n.tabStopId||i),o=F(()=>r.currentTabStopId.value===a.value),{getItems:c,CollectionItem:l}=an();ae(()=>{n.focusable&&r.onFocusableItemAdd()}),ze(()=>{n.focusable&&r.onFocusableItemRemove()}),T(()=>n.focusable,(e,t)=>{e!==t&&(e?r.onFocusableItemAdd():r.onFocusableItemRemove())});function u(e){if(e.key===`Tab`&&e.shiftKey){r.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=vn(e,r.orientation.value,r.dir.value);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!n.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...c().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(t===`last`)i.reverse();else if(t===`prev`||t===`next`){t===`prev`&&i.reverse();let n=i.indexOf(e.currentTarget);i=r.loop.value?ln(i,n+1):i.slice(n+1)}he(()=>dn(i))}}return(e,n)=>(s(),t(R(l),null,{default:k(()=>[z(R(q),{tabindex:o.value?0:-1,"data-orientation":R(r).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:n[0]||=t=>{e.focusable?R(r).onItemFocus(a.value):t.preventDefault()},onFocus:n[1]||=e=>R(r).onItemFocus(a.value),onKeydown:u},{default:k(()=>[d(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),ro=new Map,io=!1;try{io=new Intl.NumberFormat(`de-DE`,{signDisplay:`exceptZero`}).resolvedOptions().signDisplay===`exceptZero`}catch{}var ao=!1;try{ao=new Intl.NumberFormat(`de-DE`,{style:`unit`,unit:`degree`}).resolvedOptions().style===`unit`}catch{}var oo={degree:{narrow:{default:`°`,"ja-JP":` 度`,"zh-TW":`度`,"sl-SI":` °`}}},so=class{constructor(e,t={}){this.numberFormatter=co(e,t),this.options=t}format(e){let t=``;if(t=!io&&this.options.signDisplay!=null?lo(this.numberFormatter,this.options.signDisplay,e):this.numberFormatter.format(e),this.options.style===`unit`&&!ao){let{unit:e,unitDisplay:n=`short`,locale:r}=this.resolvedOptions();if(!e)return t;let i=oo[e]?.[n];t+=i[r]||i.default}return t}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if(typeof this.numberFormatter.formatRange==`function`)return this.numberFormatter.formatRange(e,t);if(t<e)throw RangeError(`End date must be >= start date`);return`${this.format(e)} \u{2013} ${this.format(t)}`}formatRangeToParts(e,t){if(typeof this.numberFormatter.formatRangeToParts==`function`)return this.numberFormatter.formatRangeToParts(e,t);if(t<e)throw RangeError(`End date must be >= start date`);let n=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!io&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!ao&&this.options.style===`unit`&&(e={...e,style:`unit`,unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}};function co(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes(`-nu-`)&&(e.includes(`-u-`)||(e+=`-u-`),e+=`-nu-${n}`),t.style===`unit`&&!ao){let{unit:e,unitDisplay:n=`short`}=t;if(!e)throw Error(`unit option must be provided with style: "unit"`);if(!oo[e]?.[n])throw Error(`Unsupported unit ${e} with unitDisplay = ${n}`);t={...t,style:`decimal`}}let r=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():``);if(ro.has(r))return ro.get(r);let i=new Intl.NumberFormat(e,t);return ro.set(r,i),i}function lo(e,t,n){if(t===`auto`)return e.format(n);if(t===`never`)return e.format(Math.abs(n));{let r=!1;if(t===`always`?r=n>0||Object.is(n,0):t===`exceptZero`&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let t=e.format(-n),r=e.format(n),i=t.replace(r,``).replace(/\u200e|\u061C/,``);return[...i].length!==1&&console.warn(`@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case`),t.replace(r,`!!!`).replace(i,`+`).replace(`!!!`,r)}return e.format(n)}}var uo=RegExp(`^.*\\(.*\\).*$`),fo=[`latn`,`arab`,`hanidec`,`deva`,`beng`,`fullwide`],po=class{constructor(e,t={}){this.locale=e,this.options=t}parse(e){return ho(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,t,n){return ho(this.locale,this.options,e).isValidPartialNumber(e,t,n)}getNumberingSystem(e){return ho(this.locale,this.options,e).options.numberingSystem}},mo=new Map;function ho(e,t,n){let r=go(e,t);if(!e.includes(`-nu-`)&&!r.isValidPartialNumber(n)){for(let i of fo)if(i!==r.options.numberingSystem){let r=go(e+(e.includes(`-u-`)?`-nu-`:`-u-nu-`)+i,t);if(r.isValidPartialNumber(n))return r}}return r}function go(e,t){let n=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():``),r=mo.get(n);return r||(r=new _o(e,t),mo.set(n,r)),r}var _o=class{constructor(e,t={}){this.locale=e,t.roundingIncrement!==1&&t.roundingIncrement!=null&&(t.maximumFractionDigits==null&&t.minimumFractionDigits==null?(t.maximumFractionDigits=0,t.minimumFractionDigits=0):t.maximumFractionDigits==null?t.maximumFractionDigits=t.minimumFractionDigits:t.minimumFractionDigits??=t.maximumFractionDigits),this.formatter=new Intl.NumberFormat(e,t),this.options=this.formatter.resolvedOptions(),this.symbols=bo(e,this.formatter,this.options,t),this.options.style===`percent`&&((this.options.minimumFractionDigits??0)>18||(this.options.maximumFractionDigits??0)>18)&&console.warn(`NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.`)}parse(e){let t=this.formatter.resolvedOptions().useGrouping,n=this.sanitize(e);if(!t&&this.symbols.group&&n.includes(this.symbols.group))return NaN;if(this.symbols.group&&(n=n.replaceAll(this.symbols.group,``)),this.symbols.decimal&&(n=n.replace(this.symbols.decimal,`.`)),this.symbols.minusSign&&(n=n.replace(this.symbols.minusSign,`-`)),n=n.replace(this.symbols.numeral,this.symbols.index),this.options.style===`percent`){let e=n.indexOf(`-`);n=n.replace(`-`,``),n=n.replace(`+`,``);let t=n.indexOf(`.`);t===-1&&(t=n.length),n=n.replace(`.`,``),n=t-2==0?`0.${n}`:t-2==-1?`0.0${n}`:t-2==-2?`0.00`:`${n.slice(0,t-2)}.${n.slice(t-2)}`,e>-1&&(n=`-${n}`)}let r=n?+n:NaN;if(isNaN(r))return NaN;if(this.options.style===`percent`){let e={...this.options,style:`decimal`,minimumFractionDigits:Math.min((this.options.minimumFractionDigits??0)+2,20),maximumFractionDigits:Math.min((this.options.maximumFractionDigits??0)+2,20)};return new po(this.locale,e).parse(new so(this.locale,e).format(r))}return this.options.currencySign===`accounting`&&uo.test(e)&&(r=-1*r),r}sanitize(e){let t=this.formatter.resolvedOptions().useGrouping;return this.symbols.noNumeralUnits.length>0&&this.symbols.noNumeralUnits.find(t=>t.unit===e)?this.symbols.noNumeralUnits.find(t=>t.unit===e).value.toString():(e=e.replace(this.symbols.literals,``),this.symbols.minusSign&&(e=e.replace(`-`,this.symbols.minusSign)),this.options.numberingSystem===`arab`&&(this.symbols.decimal&&(e=xo(e,`,`,this.symbols.decimal),e=xo(e,`،`,this.symbols.decimal)),this.symbols.group&&t&&(e=xo(e,`.`,this.symbols.group))),this.symbols.group===`’`&&e.includes(`'`)&&t&&(e=xo(e,`'`,this.symbols.group)),this.symbols.group===`'`&&e.includes(`’`)&&t&&(e=xo(e,`’`,this.symbols.group)),this.options.locale===`fr-FR`&&this.symbols.group&&t&&(e=xo(e,` `,this.symbols.group),e=xo(e,/\u00A0/g,this.symbols.group)),e)}isValidPartialNumber(e,t=-1/0,n=1/0){let r=this.formatter.resolvedOptions().useGrouping;return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&t<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&n>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&r&&(e=xo(e,this.symbols.group,``)),e=e.replace(this.symbols.numeral,``),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,``)),e.length===0)}},vo=new Set([`decimal`,`fraction`,`integer`,`minusSign`,`plusSign`,`group`]),yo=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function bo(e,t,n,r){let i=new Intl.NumberFormat(e,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:`auto`,roundingMode:`halfExpand`,useGrouping:!0}),a=i.formatToParts(-10000.111),o=i.formatToParts(10000.111),s=yo.map(e=>i.formatToParts(e)),c=s.map((e,t)=>{let n=e.find(e=>e.type===`unit`);return n&&!e.some(e=>e.type===`integer`||e.type===`fraction`)?{unit:n.value,value:yo[t]}:null}).filter(e=>!!e),l=a.find(e=>e.type===`minusSign`)?.value??`-`,u=o.find(e=>e.type===`plusSign`)?.value;!u&&(r?.signDisplay===`exceptZero`||r?.signDisplay===`always`)&&(u=`+`);let d=new Intl.NumberFormat(e,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(e=>e.type===`decimal`)?.value,f=a.find(e=>e.type===`group`)?.value,p=a.filter(e=>!vo.has(e.type)).map(e=>So(e.value)),m=s.flatMap(e=>e.filter(e=>!vo.has(e.type)).map(e=>So(e.value))),h=[...new Set([...p,...m])].sort((e,t)=>t.length-e.length),g=h.length===0?RegExp(`\\p{White_Space}|\\p{Cf}`,`gu`):RegExp(`${h.join(`|`)}|\\p{White_Space}|\\p{Cf}`,`gu`),_=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),v=new Map(_.map((e,t)=>[e,t])),y=RegExp(`[${_.join(``)}]`,`g`);return{minusSign:l,plusSign:u,decimal:d,group:f,literals:g,numeral:y,numerals:_,index:e=>String(v.get(e)),noNumeralUnits:c}}function xo(e,t,n){return e.replaceAll?e.replaceAll(t,n):e.split(t).join(n)}function So(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Co(e){let{disabled:t}=e,n=P(),r=at(),i=()=>window.clearTimeout(n.value),a=e=>{i(),!t.value&&(r.trigger(),n.value=window.setTimeout(()=>{a(60)},e))},o=()=>{a(400)},s=()=>{i()},c=P(!1),l=F(()=>Nt(e.target)),u=e=>{e.button!==0||c.value||(e.preventDefault(),c.value=!0,o())},d=()=>{c.value=!1,s()};return bt&&(Kt(l||window,`pointerdown`,u),Kt(window,`pointerup`,d),Kt(window,`pointercancel`,d)),{isPressed:c,onTrigger:r.on}}function wo(e,t=P({})){return ht(()=>new so(e.value,t.value))}function To(e,t=P({})){return ht(()=>new po(e.value,t.value))}function Eo(e,t,n){let r=e===`+`?t+n:t-n;if(t%1!=0||n%1!=0){let i=t.toString().split(`.`),a=n.toString().split(`.`),o=i[1]&&i[1].length||0,s=a[1]&&a[1].length||0,c=10**Math.max(o,s);t=Math.round(t*c),n=Math.round(n*c),r=e===`+`?t+n:t-n,r/=c}return r}var[Do,Oo]=Qe(`NumberFieldRoot`),ko=U({inheritAttrs:!1,__name:`NumberFieldRoot`,props:{defaultValue:{type:Number,required:!1,default:void 0},modelValue:{type:[Number,null],required:!1},min:{type:Number,required:!1},max:{type:Number,required:!1},step:{type:Number,required:!1,default:1},stepSnapping:{type:Boolean,required:!1,default:!0},focusOnChange:{type:Boolean,required:!1,default:!0},formatOptions:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1},readonly:{type:Boolean,required:!1},disableWheelChange:{type:Boolean,required:!1},invertWheelChange:{type:Boolean,required:!1},id:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,{disabled:a,readonly:o,disableWheelChange:c,invertWheelChange:l,min:u,max:f,step:p,stepSnapping:m,formatOptions:h,id:g,locale:_}=Me(r),v=Wt(r,`modelValue`,i,{defaultValue:r.defaultValue,passive:r.modelValue===void 0}),{primitiveElement:y,currentElement:b}=Rt(),x=Ma(_),S=Mt(b),C=P(),w=F(()=>Vt(v.value)||isNaN(v.value)?!1:E(`decrease`,v.value)>=v.value),T=F(()=>Vt(v.value)||isNaN(v.value)?!1:E(`increase`,v.value)<=v.value);function E(e,t,n=1){let r=p.value??1,i=e===`increase`?`+`:`-`,a;if(m.value&&!isNaN(r)){let o=bn(t,u.value,f.value,r);if(o===t)a=Eo(i,t,r*n);else{let s=e===`increase`?o>t?o:Eo(`+`,o,r):o<t?o:Eo(`-`,o,r);a=n>1?Eo(i,s,r*(n-1)):s}}else a=Eo(i,t,r*n);return ie(a)}function D(e,t=1){if(r.focusOnChange&&C.value?.focus(),r.disabled||r.readonly)return;let n=N.parse(C.value?.value??``);if(isNaN(n)){v.value=ie(u.value??0);return}v.value=E(e,n,t)}function O(e=1){D(`increase`,e)}function A(e=1){D(`decrease`,e)}function j(e){e===`min`&&u.value!==void 0?v.value=ie(u.value):e===`max`&&f.value!==void 0&&(v.value=ie(f.value))}let M=wo(x,h),N=To(x,h),ee=F(()=>M.resolvedOptions().maximumFractionDigits>0?`decimal`:`numeric`),te=wo(x,h),I=F(()=>Vt(v.value)||isNaN(v.value)?``:te.format(v.value));function ne(e){return N.isValidPartialNumber(e,u.value,f.value)}function re(e){C.value&&(C.value.value=e)}function ie(e){let t;return t=p.value===void 0||isNaN(p.value)||!m.value?yn(e,u.value,f.value):bn(e,u.value,f.value,p.value),t=N.parse(M.format(t)),t}function ae(e){let t=N.parse(e);return v.value=isNaN(t)?void 0:ie(t),e.length?re(I.value):re(e)}return Oo({modelValue:v,handleDecrease:A,handleIncrease:O,handleMinMaxValue:j,inputMode:ee,inputEl:C,onInputElement:e=>C.value=e,textValue:I,readonly:o,validate:ne,applyInputValue:ae,disabled:a,disableWheelChange:c,invertWheelChange:l,max:f,min:u,isDecreaseDisabled:w,isIncreaseDisabled:T,id:g}),(e,n)=>(s(),t(R(q),V(e.$attrs,{ref_key:`primitiveElement`,ref:y,role:`group`,as:e.as,"as-child":e.asChild,"data-disabled":R(a)?``:void 0,"data-readonly":R(o)?``:void 0}),{default:k(()=>[d(e.$slots,`default`,{modelValue:R(v),textValue:I.value,readonly:R(o)}),R(S)&&e.name?(s(),t(R(Mi),{key:0,type:`text`,value:R(v),name:e.name,disabled:R(a),readonly:R(o),required:e.required},null,8,[`value`,`name`,`disabled`,`readonly`,`required`])):L(`v-if`,!0)]),_:3},16,[`as`,`as-child`,`data-disabled`,`data-readonly`]))}}),Ao=U({__name:`NumberFieldDecrement`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let n=e,r=Do(),i=F(()=>r.disabled?.value||r.readonly.value||n.disabled||r.isDecreaseDisabled.value),{primitiveElement:a,currentElement:o}=Rt(),{isPressed:c,onTrigger:l}=Co({target:o,disabled:i});return l(()=>{r.handleDecrease()}),(e,r)=>(s(),t(R(q),V(n,{ref_key:`primitiveElement`,ref:a,tabindex:`-1`,"aria-label":`Decrease`,type:e.as===`button`?`button`:void 0,style:{userSelect:R(c)?`none`:void 0},disabled:i.value?``:void 0,"data-disabled":i.value?``:void 0,"data-pressed":R(c)?`true`:void 0,onContextmenu:r[0]||=g(()=>{},[`prevent`])}),{default:k(()=>[d(e.$slots,`default`)]),_:3},16,[`type`,`style`,`disabled`,`data-disabled`,`data-pressed`]))}}),jo=U({__name:`NumberFieldIncrement`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let n=e,r=Do(),i=F(()=>r.disabled?.value||r.readonly.value||n.disabled||r.isIncreaseDisabled.value),{primitiveElement:a,currentElement:o}=Rt(),{isPressed:c,onTrigger:l}=Co({target:o,disabled:i});return l(()=>{r.handleIncrease()}),(e,r)=>(s(),t(R(q),V(n,{ref_key:`primitiveElement`,ref:a,tabindex:`-1`,"aria-label":`Increase`,type:e.as===`button`?`button`:void 0,style:{userSelect:R(c)?`none`:void 0},disabled:i.value?``:void 0,"data-disabled":i.value?``:void 0,"data-pressed":R(c)?`true`:void 0,onContextmenu:r[0]||=g(()=>{},[`prevent`])}),{default:k(()=>[d(e.$slots,`default`)]),_:3},16,[`type`,`style`,`disabled`,`data-disabled`,`data-pressed`]))}}),Mo=U({__name:`NumberFieldInput`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`input`}},setup(e){let n=e,{primitiveElement:r,currentElement:i}=Rt(),a=Do(),o=$i(),{isComposing:c,handleCompositionStart:l,handleCompositionEnd:u}=fn();function f(e){if(!(c.value||e.isComposing))switch(e.key){case o.ARROW_UP:e.preventDefault(),a.handleIncrease();break;case o.ARROW_DOWN:e.preventDefault(),a.handleDecrease();break;case o.PAGE_UP:e.preventDefault(),a.handleIncrease(10);break;case o.PAGE_DOWN:e.preventDefault(),a.handleDecrease(10);break;case o.HOME:e.preventDefault(),a.handleMinMaxValue(`min`);break;case o.END:e.preventDefault(),a.handleMinMaxValue(`max`);break;case o.ENTER:a.applyInputValue(e.target?.value)}}function p(e){a.disableWheelChange.value||e.target===At()&&(Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.preventDefault(),e.deltaY>0?a.invertWheelChange.value?a.handleDecrease():a.handleIncrease():e.deltaY<0&&(a.invertWheelChange.value?a.handleIncrease():a.handleDecrease())))}ae(()=>{a.onInputElement(i.value)});let m=P(a.textValue.value);T(()=>a.textValue.value,()=>{m.value=a.textValue.value},{immediate:!0,deep:!0});function h(){requestAnimationFrame(()=>{m.value=a.textValue.value})}return(e,i)=>(s(),t(R(q),V(n,{id:R(a).id.value,ref_key:`primitiveElement`,ref:r,value:m.value,role:`spinbutton`,type:`text`,tabindex:`0`,inputmode:R(a).inputMode.value,disabled:R(a).disabled.value?``:void 0,"data-disabled":R(a).disabled.value?``:void 0,readonly:R(a).readonly.value?``:void 0,"data-readonly":R(a).readonly.value?``:void 0,autocomplete:`off`,autocorrect:`off`,spellcheck:`false`,"aria-roledescription":`Number field`,"aria-valuenow":R(a).modelValue.value,"aria-valuemin":R(a).min.value,"aria-valuemax":R(a).max.value,onKeydown:f,onWheel:p,onBeforeinput:i[0]||=e=>{if(e.isComposing||e.inputType.startsWith(`delete`)||e.inputType.startsWith(`history`))return;let t=e.target,n=t.value.slice(0,t.selectionStart??void 0)+(e.data??``)+t.value.slice(t.selectionEnd??void 0);R(a).validate(n)||e.preventDefault()},onInput:i[1]||=e=>{let t=e.target;m.value=t.value},onChange:h,onBlur:i[2]||=e=>R(a).applyInputValue(e.target?.value),onCompositionstart:R(l),onCompositionend:R(u)}),{default:k(()=>[d(e.$slots,`default`)]),_:3},16,[`id`,`value`,`inputmode`,`disabled`,`data-disabled`,`readonly`,`data-readonly`,`aria-valuenow`,`aria-valuemin`,`aria-valuemax`,`onCompositionstart`,`onCompositionend`]))}}),No=U({__name:`BaseSeparator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let n=e,r=[`horizontal`,`vertical`];function i(e){return r.includes(e)}let a=F(()=>i(n.orientation)?n.orientation:`horizontal`),o=F(()=>a.value===`vertical`?n.orientation:void 0),c=F(()=>n.decorative?{role:`none`}:{"aria-orientation":o.value,role:`separator`});return(e,n)=>(s(),t(R(q),V({as:e.as,"as-child":e.asChild,"data-orientation":a.value},c.value),{default:k(()=>[d(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`data-orientation`]))}}),Po=U({__name:`Separator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let n=e;return(e,r)=>(s(),t(No,ke(ce(n)),{default:k(()=>[d(e.$slots,`default`)]),_:3},16))}}),[Fo,Io]=Qe(`SwitchRoot`),Lo=U({inheritAttrs:!1,__name:`SwitchRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},value:{type:String,required:!1,default:`on`},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,{disabled:a}=Me(r),o=Wt(r,`modelValue`,i,{defaultValue:r.defaultValue??r.falseValue,passive:r.modelValue===void 0}),c=F(()=>o.value===r.trueValue);function l(){a.value||(o.value=c.value?r.falseValue:r.trueValue)}let{forwardRef:u,currentElement:f}=kt(),m=Mt(f),_=ja(),v=F(()=>r.id&&f.value?document.querySelector(`[for="${r.id}"]`)?.innerText:void 0);return Io({checked:c,toggleCheck:l,disabled:a}),(e,n)=>(s(),K(h,null,[z(R(q),V({id:e.id,ref:R(u),role:`switch`,type:e.as===`button`?`button`:void 0,value:e.value,"aria-label":e.$attrs[`aria-label`]||v.value,"aria-checked":c.value,"aria-required":e.required,"data-state":c.value?`checked`:`unchecked`,"data-disabled":R(a)?``:void 0,"as-child":e.asChild,as:e.as,disabled:R(a)},{...R(_),...e.$attrs},{onClick:l,onKeydown:p(g(l,[`prevent`]),[`enter`])}),{default:k(()=>[d(e.$slots,`default`,{modelValue:R(o),checked:c.value})]),_:3},16,[`id`,`type`,`value`,`aria-label`,`aria-checked`,`aria-required`,`data-state`,`data-disabled`,`as-child`,`as`,`disabled`,`onKeydown`]),R(m)&&e.name?(s(),t(R(Mi),V({key:0,type:`checkbox`,name:e.name,disabled:R(a),required:e.required,value:e.value,checked:c.value},R(_)),null,16,[`name`,`disabled`,`required`,`value`,`checked`])):L(`v-if`,!0)],64))}}),Ro=U({__name:`SwitchThumb`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let n=Fo();return kt(),(e,r)=>(s(),t(R(q),{"data-state":R(n).checked.value?`checked`:`unchecked`,"data-disabled":R(n).disabled.value?``:void 0,"as-child":e.asChild,as:e.as},{default:k(()=>[d(e.$slots,`default`)]),_:3},8,[`data-state`,`data-disabled`,`as-child`,`as`]))}}),[zo,Bo]=Qe(`TabsRoot`),Vo=U({__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:n}){let r=e,i=n,{orientation:a,unmountOnHide:o,dir:c}=Me(r),l=Bt(c);kt();let u=Wt(r,`modelValue`,i,{defaultValue:r.defaultValue,passive:r.modelValue===void 0}),f=P(),p=D(new Set);return Bo({modelValue:u,changeModelValue:e=>{u.value=e},orientation:a,dir:l,unmountOnHide:o,activationMode:r.activationMode,baseId:It(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,n)=>(s(),t(R(q),{dir:R(l),"data-orientation":R(a),"as-child":e.asChild,as:e.as},{default:k(()=>[d(e.$slots,`default`,{modelValue:R(u)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}});function Ho(e,t){return`${e}-trigger-${t}`}function Uo(e,t){return`${e}-content-${t}`}var Wo=U({__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 n=e,{forwardRef:r}=kt(),i=zo(),a=F(()=>Ho(i.baseId,n.value)),o=F(()=>Uo(i.baseId,n.value)),c=F(()=>n.value===i.modelValue.value),l=P(c.value);return ae(()=>{i.registerContent(n.value),requestAnimationFrame(()=>{l.value=!1})}),Fe(()=>{i.unregisterContent(n.value)}),(e,n)=>(s(),t(R(Xt),{present:e.forceMount||c.value,"force-mount":``},{default:k(({present:t})=>[z(R(q),{id:o.value,ref:R(r),"as-child":e.asChild,as:e.as,role:`tabpanel`,"data-state":c.value?`active`:`inactive`,"data-orientation":R(i).orientation.value,"aria-labelledby":a.value,hidden:!t,tabindex:`0`,style:se({animationDuration:l.value?`0s`:void 0})},{default:k(()=>[!R(i).unmountOnHide.value||t?d(e.$slots,`default`,{key:0}):L(`v-if`,!0)]),_:2},1032,[`id`,`as-child`,`as`,`data-state`,`data-orientation`,`aria-labelledby`,`hidden`,`style`])]),_:3},8,[`present`]))}}),Go=U({__name:`TabsIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:n}){let r=e,i=zo();n({updateIndicatorStyle:l}),kt();let a=tn(),o=P({size:null,thickness:null,position:null}),c=P([]);T(()=>[i.modelValue.value,i?.dir.value],()=>{l()},{immediate:!0,flush:`post`}),m(()=>{c.value=Array.from(i.tabsList.value?.querySelectorAll(`[role="tab"]`)||[])}),$t(F(()=>[i.tabsList.value,...c.value]),l);function l(){let e=i.tabsList.value?.querySelector(`[role="tab"][data-state="active"]`);e&&(i.orientation.value===`horizontal`?o.value={size:e.offsetWidth,thickness:e.offsetHeight,position:e.offsetLeft}:o.value={size:e.offsetHeight,thickness:e.offsetWidth,position:e.offsetTop})}return(e,n)=>R(a)&&typeof o.value.size==`number`?(s(),t(R(q),V({key:0},r,{style:{"--reka-tabs-indicator-size":`${o.value.size}px`,"--reka-tabs-indicator-thickness":`${o.value.thickness}px`,"--reka-tabs-indicator-position":`${o.value.position}px`}}),{default:k(()=>[d(e.$slots,`default`)]),_:3},16,[`style`])):L(`v-if`,!0)}}),Ko=U({__name:`TabsList`,props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let{loop:n}=Me(e),{forwardRef:r,currentElement:i}=kt(),a=zo();return a.tabsList=i,(e,i)=>(s(),t(R(mn),{"as-child":``,orientation:R(a).orientation.value,dir:R(a).dir.value,loop:R(n)},{default:k(()=>[z(R(q),{ref:R(r),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":R(a).orientation.value},{default:k(()=>[d(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),qo=U({__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(e){let n=e,{forwardRef:r}=kt(),i=zo(),a=F(()=>Ho(i.baseId,n.value)),o=F(()=>i.contentIds.value.has(n.value)?Uo(i.baseId,n.value):void 0),c=F(()=>n.value===i.modelValue.value);return(e,n)=>(s(),t(R(no),{"as-child":``,focusable:!e.disabled,active:c.value},{default:k(()=>[z(R(q),{id:a.value,ref:R(r),role:`tab`,type:e.as===`button`?`button`:void 0,as:e.as,"as-child":e.asChild,"aria-selected":c.value?`true`:`false`,"aria-controls":o.value,"data-state":c.value?`active`:`inactive`,disabled:e.disabled,"data-disabled":e.disabled?``:void 0,"data-orientation":R(i).orientation.value,onMousedown:n[0]||=g(t=>{!e.disabled&&t.ctrlKey===!1?R(i).changeModelValue(e.value):t.preventDefault()},[`left`]),onKeydown:n[1]||=p(t=>R(i).changeModelValue(e.value),[`enter`,`space`]),onFocus:n[2]||=()=>{let t=R(i).activationMode!==`manual`;!c.value&&!e.disabled&&t&&R(i).changeModelValue(e.value)}},{default:k(()=>[d(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}}),[Jo,Yo]=Qe(`TagsInputRoot`),Xo=U({__name:`TagsInputRoot`,props:{modelValue:{type:[Array,null],required:!1},defaultValue:{type:Array,required:!1,default:()=>[]},addOnPaste:{type:Boolean,required:!1},addOnTab:{type:Boolean,required:!1},addOnBlur:{type:Boolean,required:!1},duplicate:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},delimiter:{type:null,required:!1,default:`,`},dir:{type:String,required:!1},max:{type:Number,required:!1,default:0},id:{type:String,required:!1},convertValue:{type:Function,required:!1},displayValue:{type:Function,required:!1,default:e=>e.toString()},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`invalid`,`addTag`,`removeTag`],setup(e,{emit:n}){let r=e,i=n,{addOnPaste:a,disabled:o,delimiter:c,max:l,id:u,dir:f,addOnBlur:p,addOnTab:m}=Me(r),h=Bt(f),g=Wt(r,`modelValue`,i,{defaultValue:r.defaultValue,passive:!0,deep:!0}),{forwardRef:_,currentElement:v}=kt(),{focused:y}=Zt(v),b=Mt(v),{getItems:x,CollectionSlot:S}=an({isProvider:!0}),C=P(),w=P(!1),T=F(()=>Array.isArray(g.value)?[...g.value]:[]);function E(e){if(e!==-1){let t=g.value[e];g.value=g.value.filter((t,n)=>n!==e),i(`removeTag`,t)}}return Yo({modelValue:g,onAddValue:e=>{let t=[...T.value],n=t.length>0&&typeof t[0]==`object`,a=t.length>0&&typeof r.defaultValue[0]==`object`;if((n||a)&&typeof r.convertValue!=`function`)throw Error("You must provide a `convertValue` function when using objects as values.");let o=r.convertValue?r.convertValue(e):e;if(t.length>=l.value&&l.value)return i(`invalid`,o),!1;if(r.duplicate)return g.value=[...t,o],i(`addTag`,o),!0;if(t.includes(o))w.value=!0;else return g.value=[...t,o],i(`addTag`,o),!0;return i(`invalid`,o),!1},onRemoveValue:E,onInputKeydown:e=>{if(e.isComposing)return;let t=e.target,n=x().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);if(!n.length)return;let r=n.at(-1);switch(e.key){case`Delete`:case`Backspace`:if(t.selectionStart!==0||t.selectionEnd!==0)break;if(C.value){let t=n.findIndex(e=>e===C.value),i=x().find(e=>e.ref===C.value);E(i?g.value.findIndex(e=>it(e,i.value)):-1),C.value=C.value===r?n.at(t-1):n.at(t+1),e.preventDefault()}else e.key===`Backspace`&&(C.value=r,e.preventDefault());break;case`Home`:case`End`:case`ArrowRight`:case`ArrowLeft`:{let i=e.key===`ArrowRight`&&h.value===`ltr`||e.key===`ArrowLeft`&&h.value===`rtl`,a=!i;if(t.selectionStart!==0||t.selectionEnd!==0)break;if(a&&!C.value)C.value=r,e.preventDefault();else if(i&&r&&C.value===r)C.value=void 0,e.preventDefault();else if(C.value){let t=un(e,C.value,void 0,{itemsArray:n,loop:!1,dir:h.value});t&&(C.value=t),e.preventDefault()}break}case`ArrowUp`:case`ArrowDown`:C.value&&e.preventDefault();break;default:C.value=void 0}},selectedElement:C,isInvalidInput:w,addOnPaste:a,addOnBlur:p,addOnTab:m,dir:h,disabled:o,delimiter:c,max:l,id:u,displayValue:r.displayValue}),(e,n)=>(s(),t(R(S),null,{default:k(()=>[z(R(q),{ref:R(_),dir:R(h),as:e.as,"as-child":e.asChild,"data-invalid":w.value?``:void 0,"data-disabled":R(o)?``:void 0,"data-focused":R(y)?``:void 0},{default:k(()=>[d(e.$slots,`default`,{modelValue:R(g)}),R(b)&&e.name?(s(),t(R(Mi),{key:0,name:e.name,value:R(g),required:e.required,disabled:R(o)},null,8,[`name`,`value`,`required`,`disabled`])):L(`v-if`,!0)]),_:3},8,[`dir`,`as`,`as-child`,`data-invalid`,`data-disabled`,`data-focused`])]),_:3}))}}),Zo=U({__name:`TagsInputInput`,props:{placeholder:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},maxLength:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`input`}},setup(e){let n=e,r=Jo(),{forwardRef:i,currentElement:a}=kt();function o(e){if(r.selectedElement.value=void 0,!r.addOnBlur.value)return;let t=e.target,n=e.relatedTarget,i=t.getAttribute(`aria-controls`);i&&n?.closest(`#${CSS.escape(i)}`)||t.value&&r.onAddValue(t.value)&&(t.value=``)}function c(e){r.addOnTab.value&&m(e)}let{isComposing:l,handleCompositionStart:u,handleCompositionEnd:f}=fn();async function m(e){if(l.value||(await he(),e.defaultPrevented))return;let t=e.target;t.value&&(r.onAddValue(t.value)&&(t.value=``),e.preventDefault())}function h(e){if(l.value||(r.isInvalidInput.value=!1,e.data===null))return;let t=r.delimiter.value;if(t===e.data||t instanceof RegExp&&t.test(e.data)){let n=e.target;if(n.value=n.value.replace(t,``),n.value.trim()===``){n.value=``;return}r.onAddValue(n.value)&&(n.value=``)}}function g(e){l.value||r.onInputKeydown(e)}function _(e){if(r.addOnPaste.value){e.preventDefault();let t=e.clipboardData;if(!t)return;let n=t.getData(`text`);r.delimiter.value?n.split(r.delimiter.value).forEach(e=>{r.onAddValue(e)}):r.onAddValue(n)}}return ae(()=>{let e=a.value.nodeName===`INPUT`?a.value:a.value.querySelector(`input`);e&&setTimeout(()=>{n.autoFocus&&e?.focus()},1)}),(e,n)=>(s(),t(R(q),{id:R(r).id?.value,ref:R(i),type:`text`,autocomplete:`off`,autocorrect:`off`,autocapitalize:`off`,as:e.as,"as-child":e.asChild,maxlength:e.maxLength,placeholder:e.placeholder,disabled:R(r).disabled.value,"data-invalid":R(r).isInvalidInput.value?``:void 0,onInput:h,onKeydown:[p(m,[`enter`]),p(c,[`tab`]),g],onBlur:o,onCompositionstart:R(u),onCompositionend:R(f),onPaste:_},{default:k(()=>[d(e.$slots,`default`)]),_:3},8,[`id`,`as`,`as-child`,`maxlength`,`placeholder`,`disabled`,`data-invalid`,`onCompositionstart`,`onCompositionend`]))}}),[Qo,$o]=Qe(`TagsInputItem`),es=U({__name:`TagsInputItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let n=e,{value:r}=Me(n),i=Jo(),{forwardRef:a,currentElement:o}=kt(),{CollectionItem:c}=an(),l=F(()=>i.selectedElement.value===o.value),u=F(()=>n.disabled||i.disabled.value),f=$o({value:r,isSelected:l,disabled:u,textId:``,displayValue:F(()=>i.displayValue(r.value))});return(e,n)=>(s(),t(R(c),{value:R(r)},{default:k(()=>[z(R(q),{ref:R(a),as:e.as,"as-child":e.asChild,"aria-labelledby":R(f).textId,"aria-current":l.value,"data-disabled":u.value?``:void 0,"data-state":l.value?`active`:`inactive`},{default:k(()=>[d(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-labelledby`,`aria-current`,`data-disabled`,`data-state`])]),_:3},8,[`value`]))}}),ts=U({__name:`TagsInputItemDelete`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let n=e;kt();let r=Jo(),i=Qo(),a=F(()=>i.disabled?.value||r.disabled.value);function o(){if(a.value)return;let e=r.modelValue.value.findIndex(e=>it(e,i.value.value));r.onRemoveValue(e)}return(e,r)=>(s(),t(R(q),V({tabindex:`-1`},n,{"aria-labelledby":R(i).textId,"aria-current":R(i).isSelected.value,"data-state":R(i).isSelected.value?`active`:`inactive`,"data-disabled":a.value?``:void 0,type:e.as===`button`?`button`:void 0,onClick:o}),{default:k(()=>[d(e.$slots,`default`)]),_:3},16,[`aria-labelledby`,`aria-current`,`data-state`,`data-disabled`,`type`]))}}),ns=U({__name:`TagsInputItemText`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let n=e,r=Qo();return kt(),r.textId||=It(void 0,`reka-tags-input-item-text`),(e,i)=>(s(),t(R(q),V(n,{id:R(r).textId}),{default:k(()=>[d(e.$slots,`default`,{},()=>[G(B(R(r).displayValue.value),1)])]),_:3},16,[`id`]))}});function rs(e){return e.reduce((e,t)=>(e.push(t),t.children&&e.push(...rs(t.children)),e),[])}var[is,as]=Qe(`TreeRoot`),os=U({__name:`TreeRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},items:{type:Array,required:!1},expanded:{type:Array,required:!1},defaultExpanded:{type:Array,required:!1},getKey:{type:Function,required:!0},getChildren:{type:Function,required:!1,default:e=>e.children},selectionBehavior:{type:String,required:!1,default:`toggle`},multiple:{type:Boolean,required:!1,skipCheck:!0},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1},propagateSelect:{type:Boolean,required:!1},bubbleSelect:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`ul`}},emits:[`update:modelValue`,`update:expanded`],setup(e,{emit:n}){let r=e,i=n,{items:a,multiple:o,disabled:c,propagateSelect:l,dir:u,bubbleSelect:f}=Me(r),{handleTypeaheadSearch:m}=Yt(),h=Bt(u),_=P(),v=P(!1),y=at(),b=Wt(r,`modelValue`,i,{defaultValue:r.defaultValue??(o.value?[]:void 0),passive:!0,deep:!0}),x=Wt(r,`expanded`,i,{defaultValue:r.defaultExpanded??[],passive:r.expanded===void 0,deep:!0}),{onSelectItem:S,handleMultipleReplace:C}=Na(b,r),w=F(()=>o.value&&Array.isArray(b.value)?b.value.map(e=>r.getKey(e)):[r.getKey(b.value??{})]);function T(e,t=1,n){return e.reduce((i,a,o)=>{let s=r.getKey(a),c=r.getChildren(a),l=x.value.includes(s),u={_id:s,value:a,index:o,level:t,parentItem:n,hasChildren:!!c,bind:{value:a,level:t,"aria-setsize":e.length,"aria-posinset":o+1}};return i.push(u),c&&l&&i.push(...T(c,t+1,a)),i},[])}let E=F(()=>{let e=r.items;return x.value.map(e=>e),T(e??[])});function D(e){if(v.value)y.trigger(e);else{let t=_.value?.getItems()??[];m(e.key,t)}}function O(e){if(v.value)return;let t=cn[e.key];he(()=>{C(t,At(),_.value?.getItems,E.value.map(e=>e.value))})}function A(e){if(e.parentItem!=null&&Array.isArray(b.value)&&r.multiple){let t=E.value.find(t=>e.parentItem!=null&&r.getKey(t.value)===r.getKey(e.parentItem));t!=null&&(r.getChildren(t.value)?.every(e=>b.value.find(t=>r.getKey(t)===r.getKey(e)))?b.value=[...b.value,t.value]:b.value=b.value.filter(e=>r.getKey(e)!==r.getKey(t.value)),A(t))}}return as({modelValue:b,selectedKeys:w,onSelect:e=>{let t=t=>r.getKey(t??{})===r.getKey(e),n=r.multiple&&Array.isArray(b.value)?b.value?.findIndex(t)!==-1:void 0;if(S(e,t),r.bubbleSelect&&r.multiple&&Array.isArray(b.value)){let t=E.value.find(t=>r.getKey(t.value)===r.getKey(e));t!=null&&A(t)}if(r.propagateSelect&&r.multiple&&Array.isArray(b.value)){let t=rs(r.getChildren(e)??[]);n?b.value=[...b.value].filter(e=>!t.some(t=>r.getKey(e??{})===r.getKey(t))):b.value=[...b.value,...t]}},expanded:x,onToggle(e){if(!(e&&r.getChildren(e)))return;let t=r.getKey(e)??e;x.value.includes(t)?x.value=x.value.filter(e=>e!==t):x.value=[...x.value,t]},getKey:r.getKey,getChildren:r.getChildren,items:a,expandedItems:E,disabled:c,multiple:o,dir:h,propagateSelect:l,bubbleSelect:f,isVirtual:v,virtualKeydownHook:y,handleMultipleReplace:C}),(e,n)=>(s(),t(R(mn),{ref_key:`rovingFocusGroupRef`,ref:_,"as-child":``,orientation:`vertical`,dir:R(h)},{default:k(()=>[z(R(q),{role:`tree`,as:e.as,"as-child":e.asChild,"aria-multiselectable":R(o)?!0:void 0,onKeydown:[D,p(g(O,[`shift`]),[`up`,`down`])]},{default:k(()=>[d(e.$slots,`default`,{flattenItems:E.value,modelValue:R(b),expanded:R(x)})]),_:3},8,[`as`,`as-child`,`aria-multiselectable`,`onKeydown`])]),_:3},8,[`dir`]))}}),ss=`tree.select`,cs=`tree.toggle`,ls=U({inheritAttrs:!1,__name:`TreeItem`,props:{value:{type:null,required:!0},level:{type:Number,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`li`}},emits:[`select`,`toggle`],setup(e,{expose:n,emit:r}){let i=e,a=r,o=is(),{getItems:c}=an(),l=F(()=>!!o.getChildren(i.value)),u=F(()=>{let e=o.getKey(i.value);return o.expanded.value.includes(e)}),f=F(()=>{let e=o.getKey(i.value);return o.selectedKeys.value.includes(e)}),m=F(()=>{if(o.bubbleSelect.value&&l.value&&Array.isArray(o.modelValue.value)){let e=rs(o.getChildren(i.value)||[]);return e.some(e=>o.modelValue.value.find(t=>o.getKey(t)===o.getKey(e)))&&!e.every(e=>o.modelValue.value.find(t=>o.getKey(t)===o.getKey(e)))}if(o.propagateSelect.value&&f.value&&l.value&&Array.isArray(o.modelValue.value))return!rs(o.getChildren(i.value)||[]).every(e=>o.modelValue.value.find(t=>o.getKey(t)===o.getKey(e)))}),h=F(()=>o.disabled.value||i.disabled);function _(e){if(!h.value&&l.value){if(u.value){let e=c().map(e=>e.ref),t=At(),n=e.indexOf(t),r=[...e].slice(n).find(e=>Number(e.getAttribute(`data-indent`))===i.level+1);r&&r.focus()}else S(e)}}function v(e){if(!h.value){if(u.value)S(e);else{let e=c().map(e=>e.ref),t=At(),n=e.indexOf(t),r=[...e].slice(0,n).reverse().find(e=>Number(e.getAttribute(`data-indent`))===i.level-1);r&&r.focus()}}}async function y(e){h.value||(a(`select`,e),!e?.defaultPrevented&&o.onSelect(i.value))}async function b(e){h.value||(a(`toggle`,e),!e?.defaultPrevented&&o.onToggle(i.value))}async function x(e){if(!e)return;let t={originalEvent:e,value:i.value,isExpanded:u.value,isSelected:f.value};Ht(ss,y,t)}async function S(e){if(!e)return;let t={originalEvent:e,value:i.value,isExpanded:u.value,isSelected:f.value};Ht(cs,b,t)}return n({isExpanded:u,isSelected:f,isIndeterminate:m,isDisabled:h,handleToggle:()=>o.onToggle(i.value),handleSelect:()=>o.onSelect(i.value)}),(e,n)=>(s(),t(R(no),{"as-child":``,value:e.value,"allow-shift-key":``,focusable:!h.value},{default:k(()=>[z(R(q),V(e.$attrs,{role:`treeitem`,as:e.as,"as-child":e.asChild,"aria-selected":f.value,"aria-expanded":l.value?u.value:void 0,"aria-level":e.level,"aria-disabled":h.value?!0:void 0,"data-indent":e.level,"data-selected":f.value?``:void 0,"data-expanded":u.value?``:void 0,"data-disabled":h.value?``:void 0,onKeydown:[p(g(x,[`self`,`prevent`]),[`enter`,`space`]),n[0]||=p(g(e=>R(o).dir.value===`ltr`?_(e):v(e),[`prevent`]),[`right`]),n[1]||=p(g(e=>R(o).dir.value===`ltr`?v(e):_(e),[`prevent`]),[`left`])],onClick:n[2]||=g(e=>{x(e),S(e)},[`stop`])}),{default:k(()=>[d(e.$slots,`default`,{isExpanded:u.value,isSelected:f.value,isIndeterminate:m.value,isDisabled:h.value,handleSelect:()=>R(o).onSelect(e.value),handleToggle:()=>R(o).onToggle(e.value)})]),_:3},16,[`as`,`as-child`,`aria-selected`,`aria-expanded`,`aria-level`,`aria-disabled`,`data-indent`,`data-selected`,`data-expanded`,`data-disabled`,`onKeydown`])]),_:3},8,[`value`,`focusable`]))}}),us=U({__name:`TreeVirtualizer`,props:{overscan:{type:Number,required:!1},estimateSize:{type:[Number,Function],required:!1},textContent:{type:Function,required:!1}},setup(e){let n=e,r=b(),i=is(),a=Jt(),{getItems:o}=an(),c=dt(``,1e3),u=F(()=>{let e=e=>n.textContent?n.textContent(e):e.toString().toLowerCase();return i.expandedItems.value.map((t,n)=>({index:n,textContent:e(t.value)}))});i.isVirtual.value=!0;let d=F(()=>{let e=a.value;if(e){let t=window.getComputedStyle(e);return{start:Number.parseFloat(t.paddingBlockStart||t.paddingTop),end:Number.parseFloat(t.paddingBlockEnd||t.paddingBottom)}}return{start:0,end:0}}),f=Hi({get scrollPaddingStart(){return d.value.start},get scrollPaddingEnd(){return d.value.end},get count(){return i.expandedItems.value.length??0},get horizontal(){return!1},getItemKey(e){return e+i.getKey(i.expandedItems.value[e].value)},estimateSize(e){return typeof n.estimateSize==`function`?n.estimateSize(e):n.estimateSize??28},getScrollElement(){return a.value},overscan:n.overscan??12}),p=F(()=>f.value.getVirtualItems().map(e=>({item:e,is:te(r.default({item:i.expandedItems.value[e.index],virtualizer:f.value,virtualItem:e})[0],{"data-index":e.index,style:{position:`absolute`,top:0,left:0,transform:`translateY(${e.start}px)`,overflowAnchor:`none`}})})));function m(e){f.value.scrollToIndex(e,{align:`start`}),requestAnimationFrame(()=>{let t=a.value.querySelector(`[data-index="${e}"]`);t instanceof HTMLElement&&t.focus()})}return i.virtualKeydownHook.on(e=>{let t=e.altKey||e.ctrlKey||e.metaKey;if(e.key===`Tab`&&!t)return;let n=cn[e.key];if([`first`,`last`].includes(n)){e.preventDefault();let t=n===`first`?0:i.expandedItems.value.length-1;f.value.scrollToIndex(t),requestAnimationFrame(()=>{let e=o().filter(e=>e.ref.dataset.disabled!==``);e.length&&(n===`first`?e[0]:e.at(-1)).ref.focus()})}else if(n===`prev`&&e.key!==`ArrowUp`){let e=At(),t=Number(e.getAttribute(`data-index`)),n=Number(e.getAttribute(`data-indent`)),r=i.expandedItems.value.slice(0,t).map((e,t)=>({...e,index:t})).reverse().find(e=>e.level===n-1);r&&m(r.index)}else if(!n&&!t){c.value+=e.key;let t=Number(At()?.getAttribute(`data-index`)),n=u.value[t].textContent,r=u.value.map(e=>e.textContent),i=Dt(r,c.value,n),a=u.value.find(e=>e.textContent===i);a&&m(a.index)}he(()=>{e.shiftKey&&n&&i.handleMultipleReplace(n,At(),o,i.expandedItems.value.map(e=>e.value))})}),(e,n)=>(s(),K(`div`,{"data-reka-virtualizer":``,style:se({position:`relative`,width:`100%`,height:`${R(f).getTotalSize()}px`})},[(s(!0),K(h,null,M(p.value,({is:e,item:n})=>(s(),t(l(e),{key:n.key}))),128))],4))}});function ds(e,t){if(!t?.schema)return!1;let n=typeof e==`string`?e:e.name;return t.schema.spec.marks.get(n)!==void 0}function fs(e,t){if(!e)return!1;let{selection:n}=e.state,{$from:r,to:i}=n;return t.some(t=>e.state.doc.nodesBetween(r.pos,i,e=>e.type.name===t))}function ps(e,t){return e?e.extensionManager.extensions.some(e=>e.name===t):!1}function ms(e){let t=`toggle${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:e=>e.can()[t](),execute:e=>e.chain().focus()[t](),isActive:t=>t.isActive(e),isDisabled:e=>fs(e,[`image`])||e.isActive(`code`)}}function hs(e){let t=`set${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:e=>e.can()[t](),execute:e=>e.chain().focus()[t](),isActive:t=>t.isActive(e),isDisabled:e=>fs(e,[`image`])||e.isActive(`code`)}}function gs(e){return{canExecute:t=>t.can()[e](),execute:t=>t.chain()[e](),isActive:()=>!1,isDisabled:void 0}}function _s(){return{canExecute:(e,t)=>e.can().toggleMark(t.mark),execute:(e,t)=>e.chain().focus().toggleMark(t.mark),isActive:(e,t)=>e.isActive(t.mark),isDisabled:(e,t)=>!ds(t.mark,e)||fs(e,[`image`])}}function vs(){return{canExecute:(e,t)=>e.can().setTextAlign(t.align),execute:(e,t)=>e.chain().focus().setTextAlign(t.align),isActive:(e,t)=>e.isActive({textAlign:t.align}),isDisabled:e=>!ps(e,`textAlign`)||fs(e,[`image`,`horizontalRule`])}}function ys(){return{canExecute:(e,t)=>e.can().toggleHeading({level:t.level}),execute:(e,t)=>e.chain().focus().toggleHeading({level:t.level}),isActive:(e,t)=>e.isActive(`heading`,{level:t.level}),isDisabled:e=>fs(e,[`image`])||e.isActive(`code`)}}function bs(){return{canExecute:e=>e.can().setLink({href:``})||e.can().unsetLink(),execute:(e,t)=>{let n=e.chain(),r=e.getAttributes(`link`).href,i=e.isActive(`code`);if(r)return n.focus().unsetLink();let a=t?.href||prompt(`Enter the URL:`);return a?i?n.focus().extendMarkRange(`code`).setLink({href:a}):n.focus().setLink({href:a}):n},isActive:e=>e.isActive(`link`),isDisabled:e=>{if(!ps(e,`link`)||fs(e,[`image`]))return!0;let{selection:t}=e.state;return t.empty&&!e.isActive(`link`)}}}function xs(){return{canExecute:e=>e.can().setImage({src:``}),execute:(e,t)=>{let n=e.chain().focus();if(t?.src)return n.setImage({src:t.src});let r=prompt(`Enter the image URL:`);return r?n.setImage({src:r}):n},isActive:e=>e.isActive(`image`),isDisabled:e=>!ps(e,`image`)}}function Ss(e){let t={bulletList:`toggleBulletList`,orderedList:`toggleOrderedList`,taskList:`toggleTaskList`}[e],n=e===`taskList`?`taskItem`:`listItem`,r=[`bulletList`,`orderedList`,`taskList`];return{canExecute:e=>e.can()[t]()||e.isActive(`listItem`)||r.some(t=>ps(e,t)&&e.isActive(t)),execute:i=>{let{state:a}=i,{selection:o}=a,s=i.chain().focus();if(o.node){let e=o.node,t=e.firstChild?.firstChild,n=e.lastChild?.lastChild,r=t?o.from+t.nodeSize:o.from+1,i=n?o.to-n.nodeSize:o.to-1;s=s.setTextSelection({from:r,to:i}).clearNodes()}if(i.isActive(e)){let e=s.liftListItem(n);for(let t of r)ps(i,t)&&(e=e.lift(t));return e.selectTextblockEnd()}if(r.some(e=>ps(i,e)&&i.isActive(e))){let e=i.isActive(`taskList`)?`taskItem`:`listItem`,n=s.liftListItem(e);for(let e of r)ps(i,e)&&(n=n.lift(e));return n[t]().selectTextblockEnd()}return s[t]().selectTextblockEnd()},isActive:t=>t.isActive(e),isDisabled:t=>!ps(t,e)||fs(t,[`image`])||t.isActive(`code`)}}function Cs(e){return{canExecute:(t,n)=>{if(n?.pos==null||!t.state.doc.nodeAt(n.pos))return!1;let r=t.state.doc.resolve(n.pos),i=r.parent,a=r.index();return e===`up`?a>0:a<i.childCount-1},execute:(t,n)=>{if(n?.pos==null)return t.chain();let r=t.state.doc.nodeAt(n.pos);if(!r)return t.chain();let i=t.state.doc.resolve(n.pos),a=i.parent,o=i.index();if(e===`up`&&o>0){let e=a.child(o-1),i=n.pos-e.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+r.nodeSize}).insertContentAt(i,r.toJSON())}if(e===`down`&&o<a.childCount-1){let e=a.child(o+1),i=n.pos+e.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+r.nodeSize}).insertContentAt(i,r.toJSON())}return t.chain()},isActive:()=>!1,isDisabled:void 0}}function ws(){return{mark:_s(),textAlign:vs(),heading:ys(),link:bs(),image:xs(),blockquote:ms(`blockquote`),bulletList:Ss(`bulletList`),orderedList:Ss(`orderedList`),taskList:Ss(`taskList`),codeBlock:ms(`codeBlock`),horizontalRule:hs(`horizontalRule`),paragraph:hs(`paragraph`),undo:gs(`undo`),redo:gs(`redo`),clearFormatting:{canExecute:(e,t)=>t?.pos==null?e.can().clearNodes()||e.can().unsetAllMarks():!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos!=null){let n=e.state.doc.nodeAt(t.pos);if(!n)return e.chain();let r=t.pos+1,i=t.pos+n.nodeSize-1;return e.chain().focus().setTextSelection({from:r,to:i}).clearNodes().unsetAllMarks()}return e.chain().focus().clearNodes().unsetAllMarks()},isActive:()=>!1,isDisabled:void 0},duplicate:{canExecute:(e,t)=>t?.pos!=null&&!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();let n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().insertContentAt(t.pos+n.nodeSize,n.toJSON()):e.chain()},isActive:()=>!1,isDisabled:void 0},delete:{canExecute:(e,t)=>t?.pos!=null&&!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();let n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().deleteRange({from:t.pos,to:t.pos+n.nodeSize}):e.chain()},isActive:()=>!1,isDisabled:void 0},moveUp:Cs(`up`),moveDown:Cs(`down`),suggestion:{canExecute:()=>!0,execute:(e,t)=>{let{state:n}=e,{selection:r}=n,{$from:i}=r;if(t?.pos!==void 0){let r=n.doc.nodeAt(t.pos);if(r){let n=t.pos+r.nodeSize;return e.chain().focus().insertContentAt(n,{type:`paragraph`,content:[{type:`text`,text:`/`}]})}}let a=i.node(i.depth),o=i.before(i.depth)+a.nodeSize;return e.chain().focus().insertContentAt(o,{type:`paragraph`,content:[{type:`text`,text:`/`}]})},isActive:()=>!1,isDisabled:void 0},mention:{canExecute:()=>!0,execute:e=>{let{state:t}=e,{selection:n}=t,{$from:r}=n,i=r.parent.textBetween(Math.max(0,r.parentOffset-1),r.parentOffset,void 0,` `),a=i&&i!==` `;return e.chain().focus().insertContent(a?` @`:`@`)},isActive:()=>!1,isDisabled:void 0},emoji:{canExecute:()=>!0,execute:e=>{let{state:t}=e,{selection:n}=t,{$from:r}=n,i=r.parent.textBetween(Math.max(0,r.parentOffset-1),r.parentOffset,void 0,` `),a=i&&i!==` `;return e.chain().focus().insertContent(a?` :`:`:`)},isActive:()=>!1,isDisabled:void 0}}}function Ts(e){let t=[];return e.offset&&t.push(v(typeof e.offset==`boolean`?void 0:e.offset)),e.flip&&t.push(x(typeof e.flip==`boolean`?void 0:e.flip)),e.shift&&t.push(O(typeof e.shift==`boolean`?void 0:e.shift)),e.size&&t.push(Ve(typeof e.size==`boolean`?void 0:e.size)),e.autoPlacement&&t.push(r(typeof e.autoPlacement==`boolean`?void 0:e.autoPlacement)),e.hide&&t.push(w(typeof e.hide==`boolean`?void 0:e.hide)),e.inline&&t.push(f(typeof e.inline==`boolean`?void 0:e.inline)),t}function Es(e){let t=P([]),n=P(0),r=P(`closed`),i=e.searchTerm??P(``),a=null,o=null,s=null,l=null,u=null,d=null,f=null,p=null,m=null,h=null,g=null,{score:_}=pn(),v=()=>{r.value!==`closed`&&(r.value=`closed`,d&&=(document.removeEventListener(`keydown`,d,!0),null),f&&=(e.editor.view.dom.removeEventListener(`blur`,f),null),h&&=(window.removeEventListener(`scroll`,h,!0),null),o&&s&&(o.removeEventListener(`mousedown`,s),s=null),a&&=(a.destroy(),null),o&&=(o.remove(),null))},b=e.filterFields??[`label`],x=e.filter||((e,t)=>{if(!t)return e;let n=[];for(let r of e){let e=null;for(let n of b){let i=Ye(r,n);if(i==null)continue;let a=Array.isArray(i)?i.map(String):[String(i)];for(let n of a){let r=n.replace(/[\s_-]/g,``),i=Math.min(_(n,t)??3,_(r,t)??3);if((e===null||i<e)&&(e=i),e===0)break}if(e===0)break}e!==null&&e<3&&n.push({item:r,score:e})}return n.sort((e,t)=>e.score-t.score),n.map(({item:e})=>e)}),S=e.limit??42,C=typeof e.pluginKey==`string`?new c(e.pluginKey):e.pluginKey,w=F(()=>{let t=R(e.items);return t?.length?Tt(t)?t:[t]:[]}),E=F(()=>w.value.flatMap(e=>e)),D=F(()=>t.value.length?e.ignoreFilter?[t.value]:w.value.map(e=>{let n=e.filter(e=>t.value.includes(e));return n.sort((e,n)=>t.value.indexOf(e)-t.value.indexOf(n)),n}).filter(e=>e.length>0):[]),O=F(()=>t.value.filter(e=>e.type!==`label`&&e.type!==`separator`)),k=Ge(e.options,{strategy:`absolute`,placement:`bottom-start`,offset:8,flip:{},shift:{padding:8},size:!1,autoPlacement:!1,hide:!1,inline:!1}),A=Ts(k),j=e=>{if(!p)return;let t=p();t&&y({getBoundingClientRect:()=>t},e,{placement:k.placement,strategy:k.strategy,middleware:A}).then(({x:t,y:n,strategy:r})=>{e.style.width=`max-content`,e.style.position=r,e.style.top=`0`,e.style.left=`0`,e.style.transform=`translate(${Math.round(t)}px, ${Math.round(n)}px)`})},M=()=>{r.value=`open`,d||(d=e=>{u&&u({event:e})&&(e.preventDefault(),e.stopPropagation())},document.addEventListener(`keydown`,d,!0)),f||(f=()=>{setTimeout(()=>{if(r.value===`open`){let t=e.editor.view.state.tr.setMeta(C,{exit:!0});e.editor.view.dispatch(t)}},0)},e.editor.view.dom.addEventListener(`blur`,f)),h||(h=()=>{o&&j(o)},window.addEventListener(`scroll`,h,!0)),m=e=>{n.value=e,a&&a.updateProps({groups:D.value,selectedIndex:e,onSelect:l,onHover:m,state:r.value})},a=new Be(N,{props:{groups:D.value,selectedIndex:n.value,onSelect:l,onHover:m,state:r.value},editor:e.editor}),o=document.createElement(`div`),o.style.position=k.strategy,o.style.zIndex=`50`,s=e=>{e.preventDefault()},o.addEventListener(`mousedown`,s),((typeof e.appendTo==`function`?e.appendTo():e.appendTo)??e.editor.view.dom.parentElement)?.appendChild(o),a.element&&o.appendChild(a.element),j(o)};e.ignoreFilter&&(g=T(()=>R(e.items),e=>{if(!p)return;let i=e?.length?Tt(e)?e.flat():e:[];if(t.value=i.slice(0,S),!t.value.length){v();return}if(n.value>=O.value.length&&(n.value=Math.max(0,O.value.length-1)),r.value===`closed`&&t.value.length){M();return}a&&a.updateProps({groups:D.value,selectedIndex:n.value,onSelect:l,onHover:m,state:r.value}),o&&j(o)},{deep:!0,flush:`sync`}));let N={props:{groups:{type:Array,required:!0},selectedIndex:{type:Number,required:!0},onSelect:{type:Function,required:!0},onHover:{type:Function,required:!0},state:{type:String,required:!0}},setup(t){function n(e,n,r){e.preventDefault(),t.onSelect(n,r)}function r(e){t.onHover(e)}return()=>{let i=t.groups,a=new Map,o=0;for(let e of i)for(let t of e){let e=t;e.type!==`label`&&e.type!==`separator`&&a.set(t,o++)}return be(`div`,{class:e.ui.value.content(),role:`listbox`,"data-state":t.state},[be(`div`,{class:e.ui.value.viewport(),role:`presentation`},i.map((i,o)=>be(`div`,{key:`group-${o}`,class:e.ui.value.group(),role:`group`},i.map((i,s)=>{let c=i;if(c.type===`label`)return be(`div`,{key:`label-${o}-${s}`,class:e.ui.value.label({class:c.class})},e.renderItem(i,e.ui));if(c.type===`separator`)return be(`div`,{key:`separator-${o}-${s}`,class:e.ui.value.separator({class:c.class}),role:`separator`});let l=a.get(i),u=l===t.selectedIndex;return be(`div`,{key:`item-${l}`,class:e.ui.value.item({class:c.class,active:!1}),role:`option`,"aria-selected":u,"data-highlighted":u?``:void 0,"data-disabled":c.disabled?``:void 0,onMousedown:e=>n(e,i,l),onMouseenter:()=>r(l),ref:e=>{e&&u&&e.scrollIntoView({block:`nearest`,inline:`nearest`})}},e.renderItem(i,e.ui))}))))])}}};return{plugin:Te({...e.suggestion||{},pluginKey:C,editor:e.editor,char:e.char,items:({query:t})=>(i.value=t,e.ignoreFilter?E.value.slice(0,S):x(E.value,t).slice(0,S)),command:({editor:t,range:n,props:r})=>{e.onSelect(t,n,r)},render:()=>(u=e=>{let{event:t}=e;if(!a||!O.value.length)return!1;if(t.key===`Escape`)return v(),!0;if(t.key===`ArrowUp`)return n.value=(n.value+O.value.length-1)%O.value.length,a?.updateProps({groups:D.value,selectedIndex:n.value,onSelect:l,onHover:m,state:r.value}),!0;if(t.key===`ArrowDown`)return n.value=(n.value+1)%O.value.length,a?.updateProps({groups:D.value,selectedIndex:n.value,onSelect:l,onHover:m,state:r.value}),!0;if(t.key===`Enter`||t.key===`Tab`){let e=O.value[n.value];return e&&l&&l(e),!0}return!1},{onStart:r=>{n.value=0,l=e=>r.command(e),p=r.clientRect,!r.loading&&(t.value=e.ignoreFilter?E.value.slice(0,S):r.items,t.value.length&&M())},onUpdate:i=>{if(l=e=>i.command(e),!i.loading){if(t.value=e.ignoreFilter?E.value.slice(0,S):i.items,n.value>=O.value.length&&(n.value=Math.max(0,O.value.length-1)),!t.value.length){v();return}a?a.updateProps({groups:D.value,selectedIndex:n.value,onSelect:l,onHover:m,state:r.value}):M(),o&&j(o)}},onKeyDown:u,onExit:()=>{v(),p=null,i.value=``}})}),destroy:()=>{r.value=`closed`,d&&=(document.removeEventListener(`keydown`,d,!0),null),f&&=(e.editor.view.dom.removeEventListener(`blur`,f),null),h&&=(window.removeEventListener(`scroll`,h,!0),null),o&&s&&(o.removeEventListener(`mousedown`,s),s=null),a&&=(a.destroy(),null),o&&=(o.remove(),null),g&&=(g(),null)},filteredItems:t,searchTerm:i}}var Ds=`~effect/platform/PlatformError`,Os=class extends hi(`BadArgument`){get message(){return`${this.module}.${this.method}${this.description?`: ${this.description}`:``}`}},ks=class extends hi(`PlatformError`){constructor(e){`cause`in e?super({reason:e,cause:e.cause}):super({reason:e})}[Ds]=Ds;get message(){return this.reason.message}},As=e=>new ks(new Os(e)),js=e=>e.toString(16).padStart(2,`0`),Ms=e=>[e.subarray(0,4),e.subarray(4,6),e.subarray(6,8),e.subarray(8,10),e.subarray(10,16)].map(e=>Array.from(e,js).join(``)).join(`-`),Ns=()=>globalThis.crypto.getRandomValues(new Uint8Array(16));function Ps(e=Ns()){return e[6]=e[6]&15|64,e[8]=e[8]&63|128,e}var Fs=e=>Ms(e===void 0?Ps():Ps(e)),Is=2**48-1;function Ls(e,t=Ns()){let n=Math.min(Math.max(0,Math.trunc(e)),Is);return t[0]=Math.floor(n/2**40),t[1]=Math.floor(n/2**32)&255,t[2]=Math.floor(n/2**24)&255,t[3]=Math.floor(n/2**16)&255,t[4]=Math.floor(n/256)&255,t[5]=n&255,t[6]=t[6]&15|112,t[8]=t[8]&63|128,t}var Rs=(e,t)=>Ms(t===void 0?Ls(e):Ls(e,t)),zs=`~effect/platform/Crypto`,Bs=Nr(`effect/Crypto`),Vs=e=>{let t=e.randomBytes,n=e=>Ur(Hs(`randomBytes`,e),t),r=e=>(e[0]&31)*2**48+e[1]*2**40+e[2]*2**32+e[3]*2**24+e[4]*2**16+e[5]*256+e[6],i=()=>r(t(7))/2**53,a=()=>{for(;;){let e=t(7),n=r(e);if(!(e[0]&32))return n+-(2**53-1);if(n<2**53-1)return n+1}};return Bs.of({[zs]:zs,randomBytes:n,nextDoubleUnsafe:i,nextIntUnsafe:a,digest:e.digest,random:Qn(()=>i()),randomBoolean:Qn(()=>i()>.5),randomInt:Qn(()=>a()),randomBetween:(e,t)=>Qn(()=>i()*(t-e)+e),randomIntBetween(e,t,n){let r=n?.halfOpen===!0?0:1;return Qn(()=>{let n=Math.ceil(e),a=Math.floor(t);return Math.floor(i()*(a-n+r))+n})},randomShuffle:e=>Qn(()=>{let t=Array.from(e);for(let e=t.length-1;e>=1;--e){let n=Math.min(e,Math.floor(i()*(e+1))),r=t[e];t[e]=t[n],t[n]=r}return t}),randomUUIDv4:Qn(()=>Fs(t(16))),randomUUIDv7:kr(e=>Bn(Rs(e.currentTimeMillisUnsafe(),t(16))))})},Hs=(e,t)=>Number.isSafeInteger(t)&&t>=0?Bn(t):yi(As({module:`Crypto`,method:e,description:`size must be a non-negative safe integer`})),Us=`~effect/ManagedRuntime`,Ws=(e,t)=>{let n=t?.memoMap??Xn(),r=sr(`parallel`),i=br(r,`sequential`),a={onFiberStart:Cr(r)},o=e=>e?{...e,onFiberStart:e.onFiberStart?t=>{a.onFiberStart(t),e.onFiberStart(t)}:a.onFiberStart}:a,s,c=mr(t=>(s||=fr(cr(Hn(e,n,i),e=>Qn(()=>{l.cachedContext=e})),{...a,scheduler:t.currentScheduler}),Br(yr(s)))),l={[Us]:Us,memoMap:n,scope:r,contextEffect:c,cachedContext:void 0,context(){return l.cachedContext===void 0?In(l.contextEffect):Promise.resolve(l.cachedContext)},dispose(){return In(l.disposeEffect)},[Symbol.asyncDispose](){return l.dispose()},disposeEffect:Kn(()=>(l.contextEffect=Pr(`ManagedRuntime disposed`),l.cachedContext=void 0,Sr(l.scope,qr))),runFork(e,t){return l.cachedContext===void 0?fr(Gs(l,e),o(t)):Rn(l.cachedContext)(e,o(t))},runCallback(e,t){return l.cachedContext===void 0?Pn(Gs(l,e),o(t)):wi(l.cachedContext)(e,o(t))},runSyncExit(e){return l.cachedContext===void 0?er(Gs(l,e)):nr(l.cachedContext)(e)},runSync(e){return l.cachedContext===void 0?Xr(Gs(l,e)):or(l.cachedContext)(e)},runPromiseExit(e,t){return l.cachedContext===void 0?ir(Gs(l,e),o(t)):Qr(l.cachedContext)(e,o(t))},runPromise(e,t){return l.cachedContext===void 0?In(Gs(l,e),o(t)):Mn(l.cachedContext)(e,o(t))}};return l};function Gs(e,t){return Ir(e.contextEffect,e=>jr(t,e))}function Ks(e){return ai(si().pipe(Ur(t=>qs(e,Rn(t)))),e=>Qn(()=>e.close())).pipe(Ur(({close:e,...t})=>t))}function qs(e,t){let n=new Set,r,i=`connecting`,a=()=>{r!==void 0&&(r.interruptUnsafe(),r=void 0)},o=t=>{let n=e.target();return n?(n.postMessage(Js(e.sessionId,t),e.targetOrigin),!0):!1},s=()=>{o({type:`studio:connect`})},c=()=>{if(i===`closed`)return;i=`connecting`,a();let n=e.handshakeIntervalMs??250;r=t(Qn(s).pipe(ur(vr(n)),gi(n))),s()},l=t=>{let r=e.target();if(!r)return;let o=Ys(t,r,e.targetOrigin,e.sessionId);if(o&&Xs(o)){o.type===`preview:ready`&&(i=`ready`,a());for(let e of n)e(o)}};return e.view.addEventListener(`message`,l),c(),{close:()=>{i!==`closed`&&(i=`closed`,a(),e.view.removeEventListener(`message`,l),n.clear())},reconnect:c,send:e=>i===`ready`&&o(e),state:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e))}}function Js(e,t){return hr(Kr)({channel:di,sessionId:e,...t})}function Ys(e,t,n,r){if(e.origin===n&&e.source===t&&Mr(e.data))return e.data.sessionId===r?e.data:void 0}function Xs(e){return e.type.startsWith(`preview:`)}var Zs=`_cms_preview`,Qs=`_cms_preview_editor_origin`,$s=`_cms_preview_session`;zn({editorOrigin:oi,sessionId:mi});function ec(e,t){let n=new URL(e);return n.searchParams.set(Zs,`1`),n.searchParams.set(Qs,t.editorOrigin),n.searchParams.set($s,t.sessionId),n}function tc(e){let t=new URL(e);return t.searchParams.delete(Zs),t.searchParams.delete(Qs),t.searchParams.delete($s),t}var nc=oa(`AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg`),rc={slots:{root:`relative inline-flex items-center`,base:[`w-full rounded-md border-0 appearance-none placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75`,`transition-colors`],leading:`absolute start-0 flex items-start`,leadingIcon:`shrink-0 text-dimmed`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailing:`absolute end-0 flex items-start`,trailingIcon:`shrink-0 text-dimmed`},variants:{fieldGroup:{horizontal:{root:`group has-focus-visible:z-[1]`,base:`group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none`},vertical:{root:`group has-focus-visible:z-[1]`,base:`group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none`}},size:{xs:{base:`px-2 py-1 text-sm/4 gap-1`,leading:`ps-2 inset-y-1`,trailing:`pe-2 inset-y-1`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`},sm:{base:`px-2.5 py-1.5 text-sm/4 gap-1.5`,leading:`ps-2.5 inset-y-1.5`,trailing:`pe-2.5 inset-y-1.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`},md:{base:`px-2.5 py-1.5 text-base/5 gap-1.5`,leading:`ps-2.5 inset-y-1.5`,trailing:`pe-2.5 inset-y-1.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`},lg:{base:`px-3 py-2 text-base/5 gap-2`,leading:`ps-3 inset-y-2`,trailing:`pe-3 inset-y-2`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`},xl:{base:`px-3 py-2 text-base gap-2`,leading:`ps-3 inset-y-2`,trailing:`pe-3 inset-y-2`,leadingIcon:`size-6`,leadingAvatarSize:`xs`,trailingIcon:`size-6`}},variant:{outline:`text-highlighted bg-default ring ring-inset ring-accented`,soft:`text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50`,subtle:`text-highlighted bg-elevated ring ring-inset ring-accented`,ghost:`text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent`,none:`text-highlighted bg-transparent focus:outline-none`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},leading:{true:``},trailing:{true:``},loading:{true:``},highlight:{true:``},fixed:{false:``},type:{file:`file:me-1.5 file:font-medium file:text-muted file:outline-none`},autoresize:{true:{base:`resize-none`}}},compoundVariants:[{color:`primary`,variant:[`outline`,`subtle`],class:`outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary`},{color:`secondary`,variant:[`outline`,`subtle`],class:`outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary`},{color:`success`,variant:[`outline`,`subtle`],class:`outline-success/25 focus-visible:outline-3 focus-visible:ring-success`},{color:`info`,variant:[`outline`,`subtle`],class:`outline-info/25 focus-visible:outline-3 focus-visible:ring-info`},{color:`warning`,variant:[`outline`,`subtle`],class:`outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning`},{color:`error`,variant:[`outline`,`subtle`],class:`outline-error/25 focus-visible:outline-3 focus-visible:ring-error`},{color:`primary`,variant:[`soft`,`ghost`],class:`outline-primary/25 focus-visible:outline-3`},{color:`secondary`,variant:[`soft`,`ghost`],class:`outline-secondary/25 focus-visible:outline-3`},{color:`success`,variant:[`soft`,`ghost`],class:`outline-success/25 focus-visible:outline-3`},{color:`info`,variant:[`soft`,`ghost`],class:`outline-info/25 focus-visible:outline-3`},{color:`warning`,variant:[`soft`,`ghost`],class:`outline-warning/25 focus-visible:outline-3`},{color:`error`,variant:[`soft`,`ghost`],class:`outline-error/25 focus-visible:outline-3`},{color:`primary`,highlight:!0,class:`ring ring-inset ring-primary`},{color:`secondary`,highlight:!0,class:`ring ring-inset ring-secondary`},{color:`success`,highlight:!0,class:`ring ring-inset ring-success`},{color:`info`,highlight:!0,class:`ring ring-inset ring-info`},{color:`warning`,highlight:!0,class:`ring ring-inset ring-warning`},{color:`error`,highlight:!0,class:`ring ring-inset ring-error`},{color:`neutral`,variant:[`outline`,`subtle`],class:`outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted`},{color:`neutral`,variant:[`soft`,`ghost`],class:`outline-inverted/25 focus-visible:outline-3`},{color:`neutral`,highlight:!0,class:`ring ring-inset ring-inverted`},{leading:!0,size:`xs`,class:`ps-7`},{leading:!0,size:`sm`,class:`ps-8`},{leading:!0,size:`md`,class:`ps-9`},{leading:!0,size:`lg`,class:`ps-10`},{leading:!0,size:`xl`,class:`ps-11`},{trailing:!0,size:`xs`,class:`pe-7`},{trailing:!0,size:`sm`,class:`pe-8`},{trailing:!0,size:`md`,class:`pe-9`},{trailing:!0,size:`lg`,class:`pe-10`},{trailing:!0,size:`xl`,class:`pe-11`},{loading:!0,leading:!0,class:{leadingIcon:`animate-spin`}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:`animate-spin`}},{fixed:!1,size:`xs`,class:`md:text-xs`},{fixed:!1,size:`sm`,class:`md:text-xs`},{fixed:!1,size:`md`,class:`md:text-sm`},{fixed:!1,size:`lg`,class:`md:text-sm`}],defaultVariants:{size:`md`,color:`primary`,variant:`outline`}},ic=[`id`,`value`,`name`,`rows`,`placeholder`,`disabled`,`required`],ac=Object.assign({inheritAttrs:!1},{__name:`Textarea`,props:{as:{type:null,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},autoresize:{type:Boolean,required:!1},autoresizeDelay:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},rows:{type:Number,required:!1,default:3},maxrows:{type:Number,required:!1,default:0},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:[`update:modelValue`,`blur`,`change`],setup(e,{expose:n,emit:r,attrs:i}){let a=e,o=r,c=b(),l=et(`textarea`,a),u=Wt(l,`modelValue`,o,{defaultValue:l.defaultValue}),f=Je(),{emitFormFocus:p,emitFormBlur:m,emitFormInput:h,emitFormChange:g,size:v,color:y,id:x,name:C,highlight:w,disabled:D,ariaAttrs:O}=ut(a,{deferInputValidation:!0}),A=F(()=>y.value??l.color),j=F(()=>w.value??l.highlight),M=F(()=>v.value??l.size),N=F(()=>D.value??l.disabled),{isLeading:ee,isTrailing:te,leadingIconName:P,trailingIconName:I}=ft(l),ne=F(()=>st({extend:rc,...f.ui?.textarea||{}})({color:A.value,variant:l.variant,size:M.value,loading:l.loading,highlight:j.value,fixed:l.fixed,autoresize:l.autoresize,leading:ee.value||!!l.avatar||!!c.leading,trailing:te.value||!!c.trailing})),re=S(`textareaRef`);function ie(e){l.modelModifiers?.trim&&(typeof e==`string`||e==null)&&(e=e?.trim()??null),l.modelModifiers?.number&&(e=Ue(e)),l.modelModifiers?.nullable&&(e||=null),l.modelModifiers?.optional&&!l.modelModifiers?.nullable&&e!==null&&(e||=void 0),u.value=e,h()}function oe(e){ue(),l.modelModifiers?.lazy||ie(e.target.value)}function se(e){let t=e.target.value;l.modelModifiers?.lazy&&ie(t),l.modelModifiers?.trim&&(e.target.value=t.trim()),g(),o(`change`,e)}function ce(e){m(),o(`blur`,e)}function le(){l.autofocus&&re.value?.focus()}function ue(){if(l.autoresize&&re.value){re.value.rows=l.rows;let e=re.value.style.overflow;re.value.style.overflow=`hidden`;let t=window.getComputedStyle(re.value),n=Number.parseInt(t.paddingTop)+Number.parseInt(t.paddingBottom),r=Number.parseInt(t.lineHeight),{scrollHeight:i}=re.value,a=(i-n)/r;a>l.rows&&(re.value.rows=l.maxrows?Math.min(a,l.maxrows):a),re.value.style.overflow=e}}T(u,()=>{he(ue)});let de,fe;return ae(()=>{de=setTimeout(()=>{le()},l.autofocusDelay),fe=setTimeout(async()=>{await he(),ue()},l.autoresizeDelay)}),_(()=>{clearTimeout(de),clearTimeout(fe)}),n({textareaRef:re,autoResize:ue}),(e,n)=>(s(),t(R(q),{as:R(l).as,"data-slot":i[`data-slot`]??`root`,class:H(ne.value.root({class:[R(l).ui?.root,R(l).class]}))},{default:k(()=>[E(`textarea`,V({id:R(x),ref_key:`textareaRef`,ref:re,value:R(u),name:R(C),rows:R(l).rows,placeholder:R(l).placeholder,class:ne.value.base({class:R(l).ui?.base}),disabled:N.value,required:R(l).required},{...i,...R(O)},{"data-slot":`base`,onInput:oe,onBlur:ce,onChange:se,onFocus:n[0]||=(...e)=>R(p)&&R(p)(...e)}),null,16,ic),d(e.$slots,`default`,{ui:ne.value}),R(ee)||R(l).avatar||c.leading?(s(),K(`span`,{key:0,"data-slot":`leading`,class:H(ne.value.leading({class:R(l).ui?.leading}))},[d(e.$slots,`leading`,{ui:ne.value},()=>[R(ee)&&R(P)?(s(),t(J,{key:0,name:R(P),"data-slot":`leadingIcon`,class:H(ne.value.leadingIcon({class:R(l).ui?.leadingIcon}))},null,8,[`name`,`class`])):R(l).avatar?(s(),t(ot,V({key:1,size:R(l).ui?.leadingAvatarSize||ne.value.leadingAvatarSize()},R(l).avatar,{"data-slot":`leadingAvatar`,class:ne.value.leadingAvatar({class:R(l).ui?.leadingAvatar})}),null,16,[`size`,`class`])):L(``,!0)])],2)):L(``,!0),R(te)||c.trailing?(s(),K(`span`,{key:1,"data-slot":`trailing`,class:H(ne.value.trailing({class:R(l).ui?.trailing}))},[d(e.$slots,`trailing`,{ui:ne.value},()=>[R(I)?(s(),t(J,{key:0,name:R(I),"data-slot":`trailingIcon`,class:H(ne.value.trailingIcon({class:R(l).ui?.trailingIcon}))},null,8,[`name`,`class`])):L(``,!0)])],2)):L(``,!0)]),_:3},8,[`as`,`data-slot`,`class`]))}}),oc={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`}},sc={__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:n,emit:r}){let i=e,a=r,o=b(),c=et(`tabs`,i),l=Je(),u=Ct(lt(c,`as`,`unmountOnHide`),a),f=F(()=>st({extend:oc,...l.ui?.tabs||{}})({color:c.color,variant:c.variant,size:c.size,orientation:c.orientation})),p=P([]);function m(e,t){p.value[e]=t}return n({triggersRef:p}),(e,n)=>(s(),t(R(Vo),V(R(u),{"model-value":R(c).modelValue,"default-value":R(c).defaultValue,orientation:R(c).orientation,"activation-mode":R(c).activationMode,"data-slot":`root`,class:f.value.root({class:[R(c).ui?.root,R(c).class]})}),{default:k(()=>[z(R(Ko),{"data-slot":`list`,class:H(f.value.list({class:R(c).ui?.list}))},{default:k(()=>[z(R(Go),{"data-slot":`indicator`,class:H(f.value.indicator({class:R(c).ui?.indicator}))},null,8,[`class`]),d(e.$slots,`list-leading`),(s(!0),K(h,null,M(R(c).items,(n,r)=>(s(),t(R(qo),{key:R(Ye)(n,R(c).valueKey)??r,ref_for:!0,ref:e=>m(r,e),value:R(Ye)(n,R(c).valueKey)??String(r),disabled:n.disabled,"data-slot":`trigger`,class:H(f.value.trigger({class:[R(c).ui?.trigger,n.ui?.trigger]}))},{default:k(()=>[d(e.$slots,`leading`,{item:n,index:r,ui:f.value},()=>[n.icon?(s(),t(J,{key:0,name:n.icon,"data-slot":`leadingIcon`,class:H(f.value.leadingIcon({class:[R(c).ui?.leadingIcon,n.ui?.leadingIcon]}))},null,8,[`name`,`class`])):n.avatar?(s(),t(ot,V({key:1,size:n.ui?.leadingAvatarSize||R(c).ui?.leadingAvatarSize||f.value.leadingAvatarSize()},{ref_for:!0},n.avatar,{"data-slot":`leadingAvatar`,class:f.value.leadingAvatar({class:[R(c).ui?.leadingAvatar,n.ui?.leadingAvatar]})}),null,16,[`size`,`class`])):L(``,!0)]),R(Ye)(n,R(c).labelKey)||o.default?(s(),K(`span`,{key:0,"data-slot":`label`,class:H(f.value.label({class:[R(c).ui?.label,n.ui?.label]}))},[d(e.$slots,`default`,{item:n,index:r},()=>[G(B(R(Ye)(n,R(c).labelKey)),1)])],2)):L(``,!0),d(e.$slots,`trailing`,{item:n,index:r,ui:f.value},()=>[n.badge||n.badge===0?(s(),t(Bi,V({key:0,color:`neutral`,variant:`outline`,size:n.ui?.trailingBadgeSize||R(c).ui?.trailingBadgeSize||f.value.trailingBadgeSize()},{ref_for:!0},typeof n.badge==`string`||typeof n.badge==`number`?{label:n.badge}:n.badge,{"data-slot":`trailingBadge`,class:f.value.trailingBadge({class:[R(c).ui?.trailingBadge,n.ui?.trailingBadge]})}),null,16,[`size`,`class`])):L(``,!0)])]),_:2},1032,[`value`,`disabled`,`class`]))),128)),d(e.$slots,`list-trailing`)]),_:3},8,[`class`]),R(c).content?(s(!0),K(h,{key:0},M(R(c).items,(n,r)=>(s(),t(R(Wo),{key:R(Ye)(n,R(c).valueKey)??r,value:R(Ye)(n,R(c).valueKey)??String(r),"data-slot":`content`,class:H(f.value.content({class:[R(c).ui?.content,n.ui?.content,n.class]}))},{default:k(()=>[d(e.$slots,n.slot||`content`,{item:n,index:r,ui:f.value},()=>[G(B(n.content),1)])]),_:2},1032,[`value`,`class`]))),128)):L(``,!0)]),_:3},16,[`model-value`,`default-value`,`orientation`,`activation-mode`,`class`]))}},cc={slots:{root:`relative isolate`,item:`w-full`,listWithChildren:`border-s border-default`,itemWithChildren:`ps-1.5 -ms-px`,link:`relative group w-full flex items-center text-sm select-none before:absolute before:inset-y-px before:inset-x-0 before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none focus-visible:before:outline-3`,linkLeadingIcon:`shrink-0 relative`,linkLabel:`truncate`,linkTrailing:`ms-auto inline-flex gap-1.5 items-center`,linkTrailingIcon:`shrink-0 transform transition-transform duration-200 ease-out motion-reduce:transition-none group-data-expanded:rotate-180`},variants:{virtualize:{true:{root:`overflow-y-auto`}},color:{primary:{link:`before:outline-primary/25`},secondary:{link:`before:outline-secondary/25`},success:{link:`before:outline-success/25`},info:{link:`before:outline-info/25`},warning:{link:`before:outline-warning/25`},error:{link:`before:outline-error/25`},neutral:{link:`before:outline-inverted/25`}},size:{xs:{listWithChildren:`ms-4`,link:`px-2 py-1 text-xs gap-1`,linkLeadingIcon:`size-4`,linkTrailingIcon:`size-4`},sm:{listWithChildren:`ms-4.5`,link:`px-2.5 py-1.5 text-xs gap-1.5`,linkLeadingIcon:`size-4`,linkTrailingIcon:`size-4`},md:{listWithChildren:`ms-5`,link:`px-2.5 py-1.5 text-sm gap-1.5`,linkLeadingIcon:`size-5`,linkTrailingIcon:`size-5`},lg:{listWithChildren:`ms-5.5`,link:`px-3 py-2 text-sm gap-2`,linkLeadingIcon:`size-5`,linkTrailingIcon:`size-5`},xl:{listWithChildren:`ms-6`,link:`px-3 py-2 text-base gap-2`,linkLeadingIcon:`size-6`,linkTrailingIcon:`size-6`}},selected:{true:{link:`before:bg-elevated`}},disabled:{true:{link:`cursor-not-allowed opacity-75`}}},compoundVariants:[{color:`primary`,selected:!0,class:{link:`text-primary`}},{color:`secondary`,selected:!0,class:{link:`text-secondary`}},{color:`success`,selected:!0,class:{link:`text-success`}},{color:`info`,selected:!0,class:{link:`text-info`}},{color:`warning`,selected:!0,class:{link:`text-warning`}},{color:`error`,selected:!0,class:{link:`text-error`}},{color:`neutral`,selected:!0,class:{link:`text-highlighted`}},{selected:!1,disabled:!1,class:{link:[`hover:text-highlighted hover:before:bg-elevated/50`,`transition-colors before:transition-colors`]}}],defaultVariants:{color:`primary`,size:`md`}},lc=Object.assign({inheritAttrs:!1},{__name:`Tree`,props:{as:{type:null,required:!1},color:{type:null,required:!1},size:{type:null,required:!1},getKey:{type:Function,required:!1},labelKey:{type:null,required:!1,default:`label`},trailingIcon:{type:null,required:!1},expandedIcon:{type:null,required:!1},collapsedIcon:{type:null,required:!1},items:{type:null,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},multiple:{type:Boolean,required:!1},nested:{type:Boolean,required:!1,default:!0},virtualize:{type:[Boolean,Object],required:!1,default:!1},onSelect:{type:Function,required:!1},onToggle:{type:Function,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},expanded:{type:Array,required:!1},defaultExpanded:{type:Array,required:!1},selectionBehavior:{type:String,required:!1},propagateSelect:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},bubbleSelect:{type:Boolean,required:!1}},emits:[`update:modelValue`,`update:expanded`],setup(e,{expose:n,emit:r,attrs:i}){let a=e,o=r,c=b(),u=et(`tree`,a),f=Je(),p=Ct(lt(u,`items`,`multiple`,`expanded`,`disabled`,`propagateSelect`,`bubbleSelect`),o),m=F(()=>typeof u.as==`string`||typeof u.as?.render==`function`?{root:u.as,link:`button`}:Ge(u.as,{root:`ul`,link:`button`})),g=F(()=>!u.virtualize&&u.nested),_=F(()=>{let e={xs:{base:2,perLevel:5.5},sm:{base:2.5,perLevel:6},md:{base:2.5,perLevel:6.5},lg:{base:3,perLevel:7},xl:{base:3,perLevel:7.5}}[u.size||`md`];return t=>`calc(var(--spacing) * ${(t-1)*e.perLevel+e.base})`}),v=de(()=>u.virtualize?Ge(typeof u.virtualize==`boolean`?{}:u.virtualize,{estimateSize:zi(u.items||[],u.size||`md`)}):!1),[y,x]=Pt(),[C,w]=Pt({props:{item:{type:Object,required:!0},index:{type:Number,required:!0},level:{type:Number,required:!0}}}),T=F(()=>st({extend:cc,...f.ui?.tree||{}})({color:u.color,size:u.size,virtualize:!!u.virtualize})),D=S(`rootRef`);function O(e){return Ye(e,u.labelKey)}function A(e){return u.getKey&&u.getKey(e)||O(e)}function j(e){return[e.defaultExpanded?A(e):null,...e.children?.flatMap(e=>j(e))??[]].filter(Boolean)}let N=F(()=>u.defaultExpanded??u.items?.flatMap(e=>j(e)));return n({get $el(){return D.value?.$el}}),(e,n)=>(s(),K(h,null,[z(R(C),null,{default:k(({item:n,index:r,level:i})=>[E(`li`,{role:`presentation`,class:H(g.value&&i>1?T.value.itemWithChildren({class:[R(u).ui?.itemWithChildren,n.ui?.itemWithChildren]}):T.value.item({class:[R(u).ui?.item,n.ui?.item]}))},[z(R(ls),{level:i,value:n,"as-child":``,onToggle:e=>(n.onToggle??R(u).onToggle)?.(e,n),onSelect:e=>(n.onSelect??R(u).onSelect)?.(e,n)},{default:k(({isExpanded:a,isSelected:o,isIndeterminate:p,handleSelect:h,handleToggle:v})=>[d(e.$slots,n.slot?`${n.slot}-wrapper`:`item-wrapper`,V({index:r,level:i,expanded:a,selected:o,indeterminate:p,handleSelect:h,handleToggle:v,ui:T.value},{item:n}),()=>[(s(),t(l(m.value.link),{type:m.value.link===`button`?`button`:void 0,disabled:n.disabled||R(u).disabled,"data-slot":`link`,class:H(T.value.link({class:[R(u).ui?.link,n.ui?.link,n.class],selected:o,disabled:n.disabled||R(u).disabled})),style:se(!g.value&&i>1?{paddingInlineStart:_.value(i)}:void 0)},{default:k(()=>[d(e.$slots,n.slot||`item`,V({index:r,level:i,expanded:a,selected:o,indeterminate:p,handleSelect:h,handleToggle:v,ui:T.value},{item:n}),()=>[d(e.$slots,n.slot?`${n.slot}-leading`:`item-leading`,V({index:r,level:i,expanded:a,selected:o,indeterminate:p,handleSelect:h,handleToggle:v,ui:T.value},{item:n}),()=>[n.icon?(s(),t(J,{key:0,name:n.icon,"data-slot":`linkLeadingIcon`,class:H(T.value.linkLeadingIcon({class:[R(u).ui?.linkLeadingIcon,n.ui?.linkLeadingIcon]}))},null,8,[`name`,`class`])):n.children?.length?(s(),t(J,{key:1,name:a?R(u).expandedIcon??R(f).ui.icons.folderOpen:R(u).collapsedIcon??R(f).ui.icons.folder,"data-slot":`linkLeadingIcon`,class:H(T.value.linkLeadingIcon({class:[R(u).ui?.linkLeadingIcon,n.ui?.linkLeadingIcon]}))},null,8,[`name`,`class`])):L(``,!0)]),O(n)||c[n.slot?`${n.slot}-label`:`item-label`]?(s(),K(`span`,{key:0,"data-slot":`linkLabel`,class:H(T.value.linkLabel({class:[R(u).ui?.linkLabel,n.ui?.linkLabel]}))},[d(e.$slots,n.slot?`${n.slot}-label`:`item-label`,V({index:r,level:i,expanded:a,selected:o,indeterminate:p,handleSelect:h,handleToggle:v,ui:T.value},{item:n}),()=>[G(B(O(n)),1)])],2)):L(``,!0),n.trailingIcon||n.children?.length||c[n.slot?`${n.slot}-trailing`:`item-trailing`]?(s(),K(`span`,{key:1,"data-slot":`linkTrailing`,class:H(T.value.linkTrailing({class:[R(u).ui?.linkTrailing,n.ui?.linkTrailing]}))},[d(e.$slots,n.slot?`${n.slot}-trailing`:`item-trailing`,V({index:r,level:i,expanded:a,selected:o,indeterminate:p,handleSelect:h,handleToggle:v,ui:T.value},{item:n}),()=>[n.trailingIcon?(s(),t(J,{key:0,name:n.trailingIcon,"data-slot":`linkTrailingIcon`,class:H(T.value.linkTrailingIcon({class:[R(u).ui?.linkTrailingIcon,n.ui?.linkTrailingIcon]}))},null,8,[`name`,`class`])):n.children?.length?(s(),t(J,{key:1,name:R(u).trailingIcon??R(f).ui.icons.chevronDown,"data-slot":`linkTrailingIcon`,class:H(T.value.linkTrailingIcon({class:[R(u).ui?.linkTrailingIcon,n.ui?.linkTrailingIcon]}))},null,8,[`name`,`class`])):L(``,!0)])],2)):L(``,!0)])]),_:2},1032,[`type`,`disabled`,`class`,`style`]))]),g.value&&n.children?.length&&a?(s(),K(`ul`,{key:0,role:`group`,"data-slot":`listWithChildren`,class:H(T.value.listWithChildren({class:[R(u).ui?.listWithChildren,n.ui?.listWithChildren]}))},[z(R(x),{items:n.children,level:i+1},null,8,[`items`,`level`])],2)):L(``,!0)]),_:2},1032,[`level`,`value`,`onToggle`,`onSelect`])],2)]),_:3}),z(R(y),null,{default:k(({items:e,level:n})=>[(s(!0),K(h,null,M(e,(e,r)=>(s(),t(R(w),{key:`${n}-${r}`,item:e,index:r,level:n},null,8,[`item`,`index`,`level`]))),128))]),_:1}),z(R(os),V({ref_key:`rootRef`,ref:D,"data-slot":`root`},{...R(p),...i},{as:m.value.root,"model-value":R(u).modelValue,"default-value":R(u).defaultValue,class:T.value.root({class:[R(u).ui?.root,R(u).class]}),"get-key":A,"default-expanded":N.value,"selection-behavior":R(u).selectionBehavior}),{default:k(({flattenItems:e})=>[R(u).virtualize?(s(),t(R(us),V({key:0,"text-content":e=>O(e.value)},v.value),{default:k(({item:e,virtualItem:t})=>[z(R(w),{item:e.value,index:t.index,level:e.level},null,8,[`item`,`index`,`level`])]),_:1},16,[`text-content`])):g.value?(s(),t(R(x),{key:2,items:R(u).items,level:1},null,8,[`items`])):(s(!0),K(h,{key:1},M(e,(e,n)=>(s(),t(R(w),{key:e._id,item:e.value,index:n,level:e.level},null,8,[`item`,`index`,`level`]))),128))]),_:1},16,[`as`,`model-value`,`default-value`,`class`,`default-expanded`,`selection-behavior`])],64))}}),uc=[`title`],dc={class:`min-w-0 max-w-44 sm:max-w-64 lg:max-w-80`},fc={class:`block truncate text-sm font-medium leading-4 text-highlighted`},pc={key:0,class:`mt-0.5 flex min-w-0 items-center gap-1 text-[11px] leading-3 text-muted`},mc={key:0,class:`shrink-0`},hc={key:1,"aria-hidden":`true`,class:`text-dimmed`},gc={class:`truncate`},_c={class:`w-md max-w-[calc(100vw-2rem)] overflow-hidden`},vc={class:`flex items-center gap-2 border-b border-default p-2`},yc={class:`flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-default px-3 py-2 text-xs text-muted`},bc={key:0,class:`flex items-center gap-2`},xc={class:`ml-auto flex items-center gap-2`},Sc={"aria-label":`Website pages`,class:`max-h-96 overflow-y-auto p-2`},Cc={class:`px-2 py-1.5 text-xs font-medium text-muted`},wc=[`title`,`onClick`],Tc={key:0,class:`px-6 py-10 text-center`},Ec=U({__name:`DocumentSelector`,props:{canWrite:{type:Boolean},documentId:{},entries:{}},emits:[`create`,`select`],setup(e,{emit:n}){let r=e,i=n,a=[{label:`All documents`,value:`all`},{label:`Published`,value:`published`},{label:`Unpublished`,value:`draft`},{label:`Needs attention`,value:`issues`}],o=_t().bootstrap.documents,c=new Map(o.types.map(e=>[e.collection,e.label])),l=(o.locales?.locales??[]).map(e=>({label:ie(e),value:e})),u=l.length>1,d=P(!1),f=P(``),p=P(`all`),m=P(o.locales?.defaultLocale??``),_=F(()=>r.entries.find(e=>e.document.id===r.documentId)),v=F(()=>_.value?.document.locale?ie(_.value.document.locale):``),y=F(()=>{let e=new Map;for(let t of r.entries){if(m.value&&t.document.locale!==m.value)continue;let n=e.get(t.document.collection)??[];n.push(t),e.set(t.document.collection,n)}return[...e.entries()].map(([e,t])=>({items:O(S(t,e)),label:c.get(e)??re(e),name:e})).filter(e=>e.items.length).sort((e,t)=>e.label.localeCompare(t.label))}),b=F(()=>{for(let e of y.value){let t=ee(e.items,r.documentId);if(t)return t}}),x=F(()=>`${m.value}:${p.value}:${f.value.trim().toLocaleLowerCase()}`);T(d,e=>{if(!e){f.value=``;return}let t=_.value?.document.locale;t&&l.some(e=>e.value===t)&&(m.value=t)});function S(e,t){let n=[],r=new Map;for(let i of e){let e=i.document.key;if(e===`/`){let a=C(t,e,i.document.title);D(a,i),n.push(a),r.set(e,a);continue}let a=e.replace(/^\//u,``).split(`/`).filter(Boolean),o;for(let e=0;e<a.length;e++){let s=`/${a.slice(0,e+1).join(`/`)}`,c=r.get(s);c||(c=C(t,s,re(a[e]??``)),r.set(s,c),o?o.children=[...o.children??[],c]:n.push(c)),e===a.length-1&&D(c,i),o=c}}return te(n),n}function C(e,t,n){return{key:`${e}:${t}`,label:n}}function w(){d.value=!1,i(`create`)}function D(e,t){e.documentId=t.document.id,e.entry=t,e.label=t.document.title}function O(e){let t=f.value.trim().toLocaleLowerCase();return e.flatMap(e=>{let n=O(e.children??[]);if(!(e.entry&&j(e.entry)&&A(e.entry,t))&&!n.length)return[];let i=n.some(e=>N(e,r.documentId));return[{...e,children:n.length?n:void 0,defaultExpanded:n.length>0&&(!!t||p.value!==`all`||i)}]})}function A(e,t){return!t||[e.document.title,e.document.path,e.document.key,c.get(e.document.collection)??e.document.collection].some(e=>e.toLocaleLowerCase().includes(t))}function j(e){return p.value===`all`||p.value===`draft`&&e.document.draft||p.value===`published`&&!e.document.draft||p.value===`issues`&&e.document.issues.length>0}function N(e,t){return e.documentId===t||(e.children??[]).some(e=>N(e,t))}function ee(e,t){for(let n of e){if(n.documentId===t)return n;let e=ee(n.children??[],t);if(e)return e}}function te(e){e.sort((e,t)=>{let n=e.entry?.document.key===`/`;return n===(t.entry?.document.key===`/`)?e.label.localeCompare(t.label):n?-1:1});for(let t of e)te(t.children??[])}function I(e,t){if(!t.documentId){e.preventDefault();return}d.value=!1,i(`select`,t.documentId)}function ne(e,t){e.detail.originalEvent.type===`click`&&t.documentId&&e.preventDefault()}function re(e){let t=decodeURIComponent(e).replace(/[-_]+/gu,` `);return t.charAt(0).toLocaleUpperCase()+t.slice(1)}function ie(e){try{return new Intl.DisplayNames(void 0,{type:`language`}).of(e)??e.toLocaleUpperCase()}catch{return e.toLocaleUpperCase()}}return(n,r)=>{let i=J,o=rn,c=mt,S=xn,C=Bi,T=lc,D=Wi;return s(),t(D,{open:d.value,"onUpdate:open":r[3]||=e=>d.value=e,content:{align:`start`,side:`bottom`,sideOffset:8}},{content:k(()=>[E(`div`,_c,[E(`div`,vc,[z(o,{modelValue:f.value,"onUpdate:modelValue":r[0]||=e=>f.value=e,autofocus:``,icon:`i-lucide-search`,placeholder:`Search pages`,size:`sm`,class:`min-w-0 flex-1`},null,8,[`modelValue`]),e.canWrite?(s(),t(c,{key:0,color:`neutral`,variant:`soft`,size:`sm`,icon:`i-lucide-plus`,label:`New document`,onClick:w})):L(``,!0)]),E(`div`,yc,[u?(s(),K(`label`,bc,[r[4]||=E(`span`,null,`Language`,-1),z(S,{modelValue:m.value,"onUpdate:modelValue":r[1]||=e=>m.value=e,items:R(l),"value-key":`value`,size:`xs`,class:`w-32`},null,8,[`modelValue`,`items`])])):L(``,!0),E(`label`,xc,[r[5]||=E(`span`,null,`Show`,-1),z(S,{modelValue:p.value,"onUpdate:modelValue":r[2]||=e=>p.value=e,items:a,"value-key":`value`,size:`xs`,class:`w-36`},null,8,[`modelValue`])])]),E(`nav`,Sc,[(s(!0),K(h,null,M(y.value,e=>(s(),K(`section`,{key:e.name,class:`mb-3 last:mb-0`},[E(`h2`,Cc,B(e.label),1),(s(),t(T,{key:`${x.value}:${e.name}`,items:e.items,"model-value":b.value,"get-key":e=>e.key,color:`neutral`,size:`sm`,"on-select":I,"on-toggle":ne,ui:{root:`space-y-0.5`,link:`cursor-pointer`}},{"item-leading":k(({item:e,expanded:n,handleToggle:r})=>[e.children?.length?(s(),K(`span`,{key:0,class:`grid size-4 shrink-0 place-items-center rounded text-dimmed transition-colors hover:bg-muted hover:text-highlighted`,title:n?`Collapse section`:`Expand section`,onClick:g(r,[`stop`])},[z(i,{name:n?`i-lucide-chevron-down`:`i-lucide-chevron-right`,class:`size-3.5`},null,8,[`name`])],8,wc)):(s(),t(i,{key:1,name:`i-lucide-file-text`,class:`size-3.5 shrink-0 text-dimmed`}))]),"item-trailing":k(({item:e})=>[e.entry?.document.issues.length?(s(),t(C,{key:0,color:`error`,variant:`subtle`,size:`xs`},{default:k(()=>[...r[6]||=[G(` Needs attention `,-1)]]),_:1})):e.entry?.document.draft?(s(),t(C,{key:1,color:`warning`,variant:`subtle`,size:`xs`},{default:k(()=>[...r[7]||=[G(` Unpublished `,-1)]]),_:1})):L(``,!0)]),_:1},8,[`items`,`model-value`,`get-key`]))]))),128)),y.value.length?L(``,!0):(s(),K(`div`,Tc,[z(i,{name:`i-lucide-search-x`,class:`mx-auto size-5 text-muted`}),r[8]||=E(`p`,{class:`mt-2 text-sm font-medium text-highlighted`},`No pages found`,-1),r[9]||=E(`p`,{class:`mt-1 text-xs text-muted`},`Try another search, language, or filter.`,-1)]))])])]),default:k(()=>[E(`button`,{type:`button`,class:`group flex h-11 max-w-full min-w-0 cursor-pointer items-center gap-2 rounded-md px-2 text-left transition-colors hover:bg-muted`,"aria-label":`Choose a page`,title:_.value?`${_.value.document.title} · ${_.value.document.path||`/`}`:`Choose a page`},[E(`span`,dc,[E(`span`,fc,B(_.value?.document.title||`Choose a page`),1),_.value?(s(),K(`span`,pc,[v.value?(s(),K(`span`,mc,B(v.value),1)):L(``,!0),v.value?(s(),K(`span`,hc,`·`)):L(``,!0),E(`span`,gc,B(_.value.document.path||`/`),1)])):L(``,!0)]),z(i,{name:`i-lucide-chevrons-up-down`,class:`size-3.5 shrink-0 text-dimmed transition-colors group-hover:text-muted`})],8,uc)]),_:1},8,[`open`])}}}),Dc={class:`flex h-14 min-w-0 shrink-0 items-center justify-between gap-2 border-b border-default bg-default px-2.5 sm:px-4`},Oc={class:`min-w-0 flex-1`},kc={class:`flex min-w-0 shrink-0 items-center gap-1`},Ac={class:`hidden items-center gap-1.5 rounded-md px-1.5 py-1 text-[11px] text-muted sm:flex`},jc=[`aria-label`],Mc={key:0,class:`-ml-1 grid size-7 place-items-center rounded-full border-2 border-default bg-elevated text-[9px] font-semibold text-muted`},Nc={class:`max-[520px]:hidden`},Pc=U({__name:`DocumentHeader`,props:{canPublish:{type:Boolean},canWrite:{type:Boolean},connection:{},documentId:{},documentKey:{},draft:{type:Boolean},entries:{},hasWorkingChanges:{type:Boolean},historyDisabled:{type:Boolean},mobileMode:{},participants:{},persistence:{},publishing:{type:Boolean}},emits:[`createDocument`,`history`,`openDocument`,`primary`,`remove`,`trash`,`update:mobileMode`,`viewSite`],setup(e,{emit:n}){let r=e,i=n,a=[{label:`Edit`,value:`edit`,icon:`i-lucide-pencil-line`},{label:`Preview`,value:`preview`,icon:`i-lucide-monitor`}],o=F(()=>r.participants.slice(0,3)),c=F(()=>Math.max(0,r.participants.length-o.value.length)),l=F(()=>{if(r.connection===`offline`)return{color:`text-warning`,icon:`i-lucide-cloud-off`,label:`Offline`,title:`Changes stay on this device and sync when the connection returns.`};if(r.connection===`connecting`)return{color:`text-muted`,icon:`i-lucide-loader-circle`,label:`Connecting`,spin:!0,title:`Connecting to the shared working document.`};if(r.persistence===`error`)return{color:`text-error`,icon:`i-lucide-circle-alert`,label:`Save failed`,title:`Your latest changes could not be saved.`};if(r.persistence===`saving`)return{color:`text-muted`,icon:`i-lucide-loader-circle`,label:`Saving`,spin:!0,title:`Saving your changes.`}}),u=F(()=>r.hasWorkingChanges||r.draft),d=F(()=>{let e=[{label:`Revision history`,icon:`i-lucide-history`,disabled:r.historyDisabled,onSelect:()=>i(`history`)},{label:`View trash`,icon:`i-lucide-archive-restore`,onSelect:()=>i(`trash`)}];return r.documentKey===`/`?[e]:[e,[{label:`Move page to trash`,icon:`i-lucide-trash-2`,color:`error`,disabled:!r.canWrite||r.hasWorkingChanges||r.persistence!==`saved`,onSelect:()=>i(`remove`)}]]});function f(e){(e===`edit`||e===`preview`)&&i(`update:mobileMode`,e)}function p(e){return e.split(/\s+/u).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join(``)||`?`}return(n,r)=>{let m=sc,g=J,_=Ri,v=mt,y=_n,b=Bi;return s(),K(`header`,Dc,[E(`div`,Oc,[z(Ec,{"can-write":e.canWrite,"document-id":e.documentId,entries:e.entries,onCreate:r[0]||=e=>i(`createDocument`),onSelect:r[1]||=e=>i(`openDocument`,e)},null,8,[`can-write`,`document-id`,`entries`])]),z(m,{items:a,"model-value":e.mobileMode,content:!1,color:`neutral`,variant:`pill`,size:`xs`,class:`hidden shrink-0 max-[900px]:block`,ui:{root:`w-auto`,list:`w-auto`},"onUpdate:modelValue":f},null,8,[`model-value`]),E(`div`,kc,[l.value?(s(),t(_,{key:0,text:l.value.title},{default:k(()=>[E(`div`,Ac,[z(g,{name:l.value.icon,class:H([`size-3.5`,[l.value.color,{"animate-spin":l.value.spin}]])},null,8,[`name`,`class`]),E(`span`,null,B(l.value.label),1)])]),_:1},8,[`text`])):L(``,!0),e.participants.length?(s(),K(`div`,{key:1,class:`mr-1 hidden items-center sm:flex`,"aria-label":`${e.participants.length} active ${e.participants.length===1?`editor`:`editors`}`},[(s(!0),K(h,null,M(o.value,(e,n)=>(s(),t(_,{key:e.id,text:n===0?`${e.name} (You)`:e.name},{default:k(()=>[E(`span`,{class:`-ml-1 grid size-7 place-items-center rounded-full border-2 border-default text-[9px] font-semibold text-white first:ml-0`,style:se({backgroundColor:e.color})},B(p(e.name)),5)]),_:2},1032,[`text`]))),128)),c.value?(s(),K(`span`,Mc,`+`+B(c.value),1)):L(``,!0)],8,jc)):L(``,!0),z(y,{items:d.value,content:{align:`end`}},{default:k(()=>[z(v,{color:`neutral`,variant:`ghost`,size:`sm`,square:``,icon:`i-lucide-ellipsis-vertical`,"aria-label":`Page actions`})]),_:1},8,[`items`]),z(v,{color:`neutral`,variant:`ghost`,size:`sm`,icon:`i-lucide-external-link`,"aria-label":`View page`,onClick:r[2]||=e=>i(`viewSite`)},{default:k(()=>[...r[4]||=[E(`span`,{class:`hidden min-[1024px]:inline`},`View page`,-1)]]),_:1}),e.canWrite?(s(),t(v,{key:2,color:u.value?`primary`:`neutral`,variant:u.value?`solid`:`soft`,size:`sm`,icon:u.value?`i-lucide-send`:`i-lucide-check`,loading:e.publishing,disabled:!e.canPublish,onClick:r[3]||=e=>i(`primary`)},{default:k(()=>[E(`span`,Nc,B(u.value?`Publish`:`Published`),1)]),_:1},8,[`color`,`variant`,`icon`,`loading`,`disabled`])):(s(),t(b,{key:3,color:`neutral`,variant:`subtle`},{default:k(()=>[...r[5]||=[G(` Read only `,-1)]]),_:1}))])])}}}),Fc={key:1,class:`space-y-3 p-5`},Ic={key:2,class:`divide-y divide-default`},Lc={class:`grid size-9 shrink-0 place-items-center rounded-md bg-muted`},Rc={class:`min-w-0 flex-1`},zc={class:`truncate font-mono text-xs font-medium text-highlighted`},Bc={class:`mt-0.5 text-[11px] text-muted`},Vc={key:3,class:`grid min-h-52 place-items-center p-8 text-center`},Hc={class:`mx-auto grid size-10 place-items-center rounded-full bg-muted`},Uc={class:`flex w-full justify-end`},Wc=U({__name:`DocumentTrashDialog`,props:{open:{type:Boolean}},emits:[`restored`,`update:open`],setup(e,{emit:n}){let r=e,i=n,{gateway:a}=_t(),{catalog:o}=Yi(),c=D([]),l=D(``),u=D(!1),d=D();T(()=>r.open,e=>{e&&f()},{immediate:!0});async function f(){u.value=!0,l.value=``;try{c.value=await a.documents.trash()}catch(e){l.value=ri(e)}finally{u.value=!1}}async function p(e){if(!d.value){d.value=e.documentId,l.value=``;try{await a.documents.undelete(e.documentId,e.version),await o.refresh(!0),c.value=c.value.filter(t=>t.documentId!==e.documentId),i(`restored`,e.documentId)}catch(e){l.value=ri(e)}finally{d.value=void 0}}}function m(e){return`Deleted ${Rr(e).toLocaleString()}`}return(n,r)=>{let a=yt,o=na,f=J,g=mt,_=wn;return s(),t(_,{open:e.open,title:`Trash`,description:`Restore deleted pages as unpublished drafts.`,ui:{content:`max-w-2xl`,body:`p-0 sm:p-0`},"onUpdate:open":r[1]||=e=>i(`update:open`,e)},{body:k(()=>[l.value?(s(),t(a,{key:0,description:l.value,color:`error`,variant:`subtle`,class:`m-4`},null,8,[`description`])):L(``,!0),u.value?(s(),K(`div`,Fc,[(s(),K(h,null,M(4,e=>z(o,{key:e,class:`h-14`})),64))])):c.value.length?(s(),K(`div`,Ic,[(s(!0),K(h,null,M(c.value,e=>(s(),K(`div`,{key:e.documentId,class:`flex items-center gap-4 px-5 py-3`},[E(`span`,Lc,[z(f,{name:`i-lucide-file-x-2`,class:`size-4 text-muted`})]),E(`div`,Rc,[E(`p`,zc,B(e.sourcePath),1),E(`p`,Bc,B(m(e.deletedAt)),1)]),z(g,{color:`neutral`,variant:`outline`,size:`sm`,icon:`i-lucide-undo-2`,label:`Restore`,loading:d.value===e.documentId,disabled:!!d.value&&d.value!==e.documentId,onClick:t=>p(e)},null,8,[`loading`,`disabled`,`onClick`])]))),128))])):(s(),K(`div`,Vc,[E(`div`,null,[E(`span`,Hc,[z(f,{name:`i-lucide-trash-2`,class:`size-4 text-muted`})]),r[2]||=E(`p`,{class:`mt-3 text-sm font-medium text-highlighted`},`Trash is empty`,-1),r[3]||=E(`p`,{class:`mt-1 text-xs text-muted`},`Deleted pages will appear here.`,-1)])]))]),footer:k(()=>[E(`div`,Uc,[z(g,{color:`neutral`,variant:`ghost`,label:`Close`,onClick:r[0]||=e=>i(`update:open`,!1)})])]),_:1},8,[`open`])}}}),Gc={class:`space-y-4`},Kc={class:`rounded-md border border-default bg-muted/30 px-3 py-2.5`},qc={class:`truncate text-sm font-medium text-highlighted`},Jc={class:`mt-0.5 truncate font-mono text-xs text-muted`},Yc={class:`flex w-full justify-end gap-2`},Xc=U({__name:`DeleteDocumentDialog`,props:{entry:{},open:{type:Boolean}},emits:[`removed`,`update:open`],setup(e,{emit:n}){let r=e,i=n,{gateway:a}=_t(),o=D(``),c=D(!1),l=F(()=>r.entry?.document.key===`/`);T(()=>r.open,e=>{e&&(o.value=``)});async function u(){if(r.entry&&!c.value){if(l.value){o.value=`The homepage cannot be moved to trash.`;return}c.value=!0,o.value=``;try{await a.documents.remove(r.entry.document.id,r.entry.version),i(`removed`,r.entry.document.id),i(`update:open`,!1)}catch(e){o.value=ri(e)}finally{c.value=!1}}}return(n,r)=>{let a=yt,d=mt,f=wn;return s(),t(f,{open:e.open,title:`Move page to trash?`,description:`The page will stop being published and can be restored later.`,ui:{content:`max-w-md`},"onUpdate:open":r[1]||=e=>i(`update:open`,e)},{body:k(()=>[E(`div`,Gc,[o.value?(s(),t(a,{key:0,description:o.value,color:`error`,variant:`subtle`},null,8,[`description`])):L(``,!0),E(`div`,Kc,[E(`p`,qc,B(e.entry?.document.title),1),E(`p`,Jc,B(e.entry?.document.path),1)]),r[2]||=E(`p`,{class:`text-xs leading-5 text-muted`},` Removal is blocked when another page links here, so existing links cannot silently break. `,-1)])]),footer:k(()=>[E(`div`,Yc,[z(d,{color:`neutral`,variant:`ghost`,label:`Cancel`,disabled:c.value,onClick:r[0]||=e=>i(`update:open`,!1)},null,8,[`disabled`]),z(d,{color:`error`,icon:`i-lucide-trash-2`,label:`Move to trash`,loading:c.value,disabled:l.value,onClick:u},null,8,[`loading`,`disabled`])])]),_:1},8,[`open`])}}}),Zc=li(jn),Qc=pr(Zr);function $c(e,t){let n=new Map;for(let[r,i]of Object.entries(_a(la(e),t,{parseJson:!0}))){if(Ei(i)){n.set(r,void 0);continue}let e=Qc(i);if(Hr(e))throw Error(`Comark resolved non-JSON attribute "${r}".`);n.set(r,e.value)}return n}function el(e,t){let n=$c(e,t),r={};for(let[e,t]of n)Ei(t)||(r[e]=xa(t));let i={};for(let[t,r]of Object.entries(e)){if(!t.startsWith(`:`)||t.length===1)continue;let e=t.slice(1);if(!n.has(e))continue;let a=rl(r);if(!Y(r)||a!==r){i[e]={kind:`literal`};continue}let o=n.get(e);i[e]=Object.assign({expression:r,kind:`expression`},Ei(o)?void 0:{resolved:xa(o)})}return{bindings:i,props:r,renderData:nl(t,n)}}function tl(e,t){let n=ca(e);for(let[r,i]of Object.entries(t)){let t=il(i),a=t.kind;if(a!==`literal`&&a!==`expression`)continue;let o=e[r];if(Ei(o)){let e=t.expression;a===`expression`&&Y(e)&&(n[`:${r}`]=e);continue}delete n[r];let s=t.expression,c=t.resolved;n[`:${r}`]=a===`expression`&&Y(s)&&Object.hasOwn(t,`resolved`)&&al(o,c)?s:xa(o)}return n}function nl(e,t){return t.size>0?{...e,props:Object.fromEntries(t)}:e}function rl(e){if(!Y(e))return e;try{let t=Qc(JSON.parse(e));return Tr(t)?t.value:e}catch{return e}}function il(e){return Zc(e)?e:{}}function al(e,t){return!Ei(t)&&JSON.stringify(e)===JSON.stringify(t)}function ol(e){return Object.fromEntries(Object.entries(e).filter(e=>e[1]!==void 0))}function sl(e){return Y(e)&&e?e:void 0}function cl(e,t){let n=Oi(e)?e:Number(e);return Number.isFinite(n)?n:t}var ll=li(jn),ul=Yr([`natural`,`content`,`full`]),dl=li(ul),fl=`data-cms-layout`,pl=`data-cms-decorative`,ml=new Set([`alt`,pl,fl,`src`,`title`]);function hl(e){let t=Object.fromEntries(Object.entries(e).filter(([e])=>!ml.has(e)));return ol({alt:e[pl]===void 0?Y(e.alt)?e.alt:null:``,cmsProps:Object.keys(t).length?t:null,layout:_l(e[fl]),src:yl(e.src)||null,title:yl(e.title)||null})}function gl(e){let t=vl(e),n=t.alt,r=_l(t.layout);return ol(Object.assign({},vl(t.cmsProps),{alt:Y(n)?n:void 0,[pl]:n===``?`true`:void 0,[fl]:r===`natural`?void 0:r,src:yl(t.src)||void 0,title:yl(t.title)||void 0}))}function _l(e){return dl(e)?e:`natural`}function vl(e){return ll(e)?e:{}}function yl(e){return Y(e)||Oi(e)?String(e):``}var bl=[[`bold`,`strong`],[`code`,`code`],[`italic`,`em`],[`link`,`a`],[`strike`,`del`],[`underline`,`u`]],xl=bl.map(([e])=>e),Sl=new Map(bl),Cl=new Map(bl.map(([e,t])=>[t,e]));function wl(e){return Sl.get(e)}function Tl(e){return Cl.get(e)}function El(e){return Sl.has(e)}function Dl(e){return Cl.has(e)}var Ol=li(jn),kl=new Set([`math`,`table`,`tbody`,`td`,`th`,`thead`,`tr`]);function Al(e,t={data:{},frontmatter:{},meta:{},props:{}}){return jl(e,{usedIds:new Set},t)}function jl(e,t,n,r=!1){let i=[],a=[],o=()=>{let e=Il(a,t,n);e.length&&i.push({type:`paragraph`,attrs:r?{cmsSynthetic:!0}:{cmsNodeId:Ll(t)},content:e}),a=[]};for(let r of e){if(Y(r)||Gl(r)){a.push(r);continue}o(),i.push(Ml(r,t,n))}return o(),i}function Ml(e,t,n){if(e[0]===null)return zl(e,`Comment`,Ll(t,e[1]));let[r,i,...a]=e,o=Ul(i),s=nl(n,$c(i,n)),c=va(i),l=Ll(t,i),u=ol({cmsNodeId:l,cmsProps:o});if(/^h[1-6]$/u.test(r))return{type:`heading`,attrs:Xl(u,{level:Number(r.slice(1))}),content:Il(a,t,s)};switch(r){case`p`:return{type:`paragraph`,attrs:u,content:Il(a,t,s)};case`blockquote`:return{type:`blockquote`,attrs:u,content:jl(a,t,s)};case`ul`:return{type:`bulletList`,attrs:u,content:Fl(a,t,s)};case`ol`:return{type:`orderedList`,attrs:Xl(u,{start:cl(o.start,1)}),content:Fl(a,t,s)};case`li`:return{type:`listItem`,attrs:u,content:jl(a,t,s)};case`pre`:{let e=a.find(ql);return{type:`codeBlock`,attrs:Xl(u,{language:sl(o.language)??sl(e?.[1].class)?.replace(/^language-/u,``)}),content:Wl(e?Jl(e):a)}}case`hr`:return{type:`horizontalRule`,attrs:u};default:if(kl.has(r))return zl(e,r,l);let d=el(i,n);return{type:`cmsBlock`,attrs:ol({bindings:d.bindings,cmsNodeId:l,props:d.props,tag:r}),content:Nl(a,t,d.renderData,c?.implicitSlotId)}}}function Nl(e,t,n,r){let i=e.filter(Kl),a=e.filter(e=>!Kl(e)),o=i.map(e=>Pl(e,t,n));if(!a.length)return o;let s=Vl(jl(a,t,n,!0)),c=o.find(e=>e.attrs?.name==="default");return c?(c.content=[...c.content??[],...s],o):[{type:`cmsSlot`,attrs:{cmsNodeId:Rl(t,r),implicit:!0,name:`default`,props:{}},content:s},...o]}function Pl(e,t,n){let r=Ul(e[1]),i=nl(n,$c(e[1],n)),a=Hl(r),{name:o,...s}=r;return{type:`cmsSlot`,attrs:{cmsNodeId:Ll(t,e[1]),implicit:!1,name:a,props:s},content:Vl(jl(Jl(e),t,i,!0))}}function Fl(e,t,n){return e.filter(ql).filter(e=>e[0]===`li`).map(e=>Ml(e,t,n))}function Il(e,t,n,r=[]){let i=[];for(let a of e){if(Y(a)){a&&i.push(Zl({type:`text`,text:a},r));continue}if(a[0]===null){i.push(Zl({type:`cmsInlineOpaque`,attrs:{label:`Comment`,node:Bl(a)}},r));continue}let e=Tl(a[0]);if(e){let o=Ul(a[1]),s=nl(n,$c(a[1],n)),c=e===`link`?Xl(o,{cmsProps:o}):Object.keys(o).length?{cmsProps:o}:void 0,l=c===void 0?{type:e}:{attrs:c,type:e};i.push(...Il(Jl(a),t,s,[...r,l]));continue}if(a[0]===`br`){i.push(Zl({type:`hardBreak`},r));continue}if(a[0]===`img`){i.push(Zl({type:`image`,attrs:Xl(hl(Ul(a[1])),{cmsNodeId:Ll(t,a[1])})},r));continue}i.push(Zl({type:`cmsInlineOpaque`,attrs:{label:a[0],node:Bl(a)}},r))}return i}function Ll(e,t){return Rl(e,t?va(t)?.nodeId:void 0)}function Rl(e,t){let n=ga(t);if(n!==void 0&&!e.usedIds.has(n))return e.usedIds.add(n),n;for(let t=0;t<100;t++){let t=aa();if(!e.usedIds.has(t))return e.usedIds.add(t),t}throw Error(`The editor identity factory did not produce a unique identity.`)}function zl(e,t,n){return{type:`cmsOpaque`,attrs:{cmsNodeId:n,label:t,node:Bl(e)}}}function Bl(e){if(e[0]===null)return[null,Ul(e[1]),e[2]];let[t,n,...r]=e;return[t,Ul(n),...r.map(e=>Y(e)?e:Bl(e))]}function Vl(e){return e.length?e:[{type:`paragraph`,attrs:{cmsSynthetic:!0}}]}function Hl(e){return sl(e.name)??`default`}function Ul(e){let{$:t,"data-cms-node":n,...r}=e;return structuredClone(r)}function Wl(e){let t=e.map(e=>Y(e)?e:e[0]===null?e[2]:Wl(Jl(e))?.map(e=>e.text??``).join(``)??``).join(``);return t?[{type:`text`,text:t}]:void 0}function Gl(e){return e[0]!==null&&(Dl(e[0])||e[0]===`br`||e[0]===`img`||Yl(e[1].$).block===0)}function Kl(e){return ql(e)&&e[0]===`template`}function ql(e){return Array.isArray(e)&&Y(e[0])}function Jl(e){let[,,...t]=e;return t}function Yl(e){return Ol(e)?e:{}}function Xl(e,t){return ol(Object.assign({},e,t))}function Zl(e,t){return t.length?Object.assign({},e,{marks:t}):e}var Ql=ie.create({name:`cmsNodeIdentity`,priority:1e4,dispatchTransaction({transaction:e,next:t}){e.docChanged&&(e.getMeta(ye)?.isChangeOrigin?eu(e.doc):$l(e)),t(e)}});function $l(e,t=aa){eu(e.before);let n=tu(e.doc),r=nu(e),i=new Set;for(let e of n.values()){let t=e.find(e=>r.has(au(e)))||e[0];i.add(t.id)}for(let a of n.values()){let n=a.find(e=>r.has(au(e)))||a[0];for(let r of a)r!==n&&ru(e,r.position,i,t)}return e.doc.descendants((n,r)=>{iu(n)&&ga(n.attrs.cmsNodeId)===void 0&&ru(e,r,i,t)}),eu(e.doc),e}function eu(e){let t=new Set;e.descendants((e,n)=>{if(!iu(e))return;let r=ga(e.attrs.cmsNodeId);if(r===void 0)throw Error(`Authorable ${e.type.name} at position ${n} has no valid node identity.`);if(t.has(r))throw Error(`Authorable ${e.type.name} at position ${n} duplicates node identity "${r}".`);t.add(r)})}function tu(e){let t=new Map;return e.descendants((e,n)=>{if(!iu(e))return;let r=ga(e.attrs.cmsNodeId);if(r===void 0)return;let i={id:r,position:n};t.set(i.id,[...t.get(i.id)??[],i])}),t}function nu(e){let t=new Set;return e.before.descendants((n,r)=>{if(!iu(n))return;let i=ga(n.attrs.cmsNodeId);if(i===void 0)return;let a=e.mapping.mapResult(r,1);!a.deleted&&e.doc.nodeAt(a.pos)?.attrs.cmsNodeId===i&&t.add(au({id:i,position:a.pos}))}),t}function ru(e,t,n,r){let i=r();for(;n.has(i);)i=r();n.add(i);let a=e.doc.nodeAt(t);if(!a)throw Error(`Cannot assign node identity at missing position ${t}.`);e.setNodeMarkup(t,void 0,{...a.attrs,cmsNodeId:i})}function iu(e){return!Object.hasOwn(e.type.spec.attrs??{},`cmsNodeId`)||e.attrs.cmsSynthetic===!0||e.attrs.cmsTransient===!0?!1:e.type.name!==`paragraph`||e.content.size>0}function au(e){return`${e.id}:${e.position}`}var ou=[`blockquote`,`bulletList`,`codeBlock`,`heading`,`horizontalRule`,`listItem`,`orderedList`,`paragraph`],su=li(jn),cu=Re.create({name:`doc`,topNode:!0,content:`cmsFrontmatter block*`}),lu=ie.create({name:`cmsEditorAttributes`,addGlobalAttributes(){return[{types:ou,attributes:{cmsNodeId:bu(),cmsProps:yu(null),cmsSynthetic:yu(!1)}},{types:[`paragraph`],attributes:{cmsTransient:yu(!1)}},{types:xl,attributes:{cmsProps:yu(null)}}]}}),uu=Re.create({name:`cmsFrontmatter`,atom:!0,isolating:!0,selectable:!1,addAttributes(){return{frontmatter:yu({})}},parseHTML(){return[{tag:`section[data-cms-frontmatter]`}]},renderHTML(){return[`section`,{"data-cms-frontmatter":``,hidden:`hidden`}]}}),du=Re.create({name:`cmsBlock`,group:`block`,content:`cmsSlot*`,defining:!0,isolating:!0,selectable:!0,addAttributes(){return{bindings:yu({}),cmsNodeId:bu(),props:yu({}),tag:yu(`component`)}},parseHTML(){return[{tag:`section[data-cms-component]`}]},renderHTML({node:e}){return[`section`,{"data-cms-component":``,"data-component-name":e.attrs.tag},[`header`,{contenteditable:`false`},`<${String(e.attrs.tag)}>`],[`div`,0]]}}),fu=Re.create({name:`cmsSlot`,content:`block+`,defining:!0,isolating:!0,selectable:!1,addAttributes(){return{cmsNodeId:bu(),implicit:yu(!1),name:yu(`default`),props:yu({})}},parseHTML(){return[{tag:`div[data-cms-slot]`}]},renderHTML({node:e}){return[`div`,{"data-cms-slot":``,"data-slot-name":e.attrs.name},[`span`,{contenteditable:`false`},String(e.attrs.name)],[`div`,0]]}}),pu=Re.create({name:`cmsOpaque`,group:`block`,atom:!0,selectable:!0,addAttributes(){return{cmsNodeId:bu(),label:yu(`Unsupported content`),node:yu(null)}},parseHTML(){return[{tag:`div[data-cms-opaque]`}]},renderHTML({node:e}){return[`div`,{"data-cms-opaque":``,contenteditable:`false`},String(e.attrs.label)]}}),mu=Re.create({name:`cmsInlineOpaque`,group:`inline`,inline:!0,atom:!0,selectable:!0,addAttributes(){return{label:yu(`Unsupported content`),node:yu(null)}},parseHTML(){return[{tag:`span[data-cms-inline-opaque]`}]},renderHTML({node:e}){return[`span`,{"data-cms-inline-opaque":``,contenteditable:`false`},String(e.attrs.label)]}}),hu=Re.create({name:`image`,group:`inline`,inline:!0,atom:!0,draggable:!0,addAttributes(){return{alt:{default:null,parseHTML:e=>e.getAttribute(`alt`)},cmsNodeId:bu(),cmsProps:{default:null,parseHTML:e=>xu(e),renderHTML:e=>Su(e.cmsProps)},cmsSynthetic:yu(!1),layout:{default:`natural`,rendered:!1,parseHTML:e=>_l(e.getAttribute(fl))},src:{default:null,parseHTML:e=>e.getAttribute(`src`)},title:{default:null,parseHTML:e=>e.getAttribute(`title`)}}},parseHTML(){return[{tag:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e,node:t}){let n=_l(t.attrs.layout);return[`img`,Ie(e,{[fl]:n===`natural`?void 0:n})]}});function gu(e={}){let t=e.nodeViews??{};return[Ql,le.configure({document:!1,trailingNode:{node:`paragraph`,notAfter:[`paragraph`]},undoRedo:!1}),cu,vu(hu,t.image),lu,uu,vu(du,t.block),vu(fu,t.slot),vu(pu,t.opaque),vu(mu,t.inlineOpaque)]}function _u(){return A(gu())}function vu(e,t){return t?e.extend({addNodeView:()=>t}):e}function yu(e){return{default:e,rendered:!1}}function bu(){return{default:null,keepOnSplit:!1,rendered:!1}}function xu(e){let t=Object.fromEntries([[`class`,e.getAttribute(`class`)],[`height`,e.getAttribute(`height`)],[`width`,e.getAttribute(`width`)]].filter(e=>!!e[1]));return Object.keys(t).length?t:null}function Su(e){return su(e)?Object.fromEntries([`class`,`height`,`width`].flatMap(t=>{let n=e[t];return Y(n)&&n?[[t,n]]:[]})):{}}var Cu=li(jn);function wu(e){return ha(e),Tu(e.content)}function Tu(e){let t=[];for(let n of e??[]){if(Bu(n)||Vu(n))continue;if(n.type===`cmsSlot`){t.push(...Eu(n));continue}let e=Du(n);e!==void 0&&t.push(e)}return t}function Eu(e){let t=e.attrs,n=sl(t?.name)??`default`;if(n==="default"&&t?.implicit===!0)return Tu(e.content);let r=Iu(t?.props),i=Tu(e.content);return[[`template`,fa(ol(Object.assign({},r,{name:n})),t?.cmsNodeId),...Nu(i)]]}function Du(e){let t=e.attrs,n=e.type===`cmsFrontmatter`||t?.cmsSynthetic===!0?Iu(t?.cmsProps):fa(Iu(t?.cmsProps),t?.cmsNodeId);switch(e.type){case`paragraph`:return[`p`,n,...Ou(e.content)];case`heading`:return[`h${Math.min(6,Math.max(1,cl(t?.level,1)))}`,n,...Ou(e.content)];case`blockquote`:return[`blockquote`,n,...Nu(Tu(e.content))];case`bulletList`:return[`ul`,n,...Tu(e.content)];case`orderedList`:{let r=cl(t?.start,1);return[`ol`,ol(Object.assign({},n,{start:r===1?void 0:r})),...Tu(e.content)]}case`listItem`:return[`li`,n,...Pu(Tu(e.content))];case`codeBlock`:{let r=sl(t?.language);return[`pre`,ol(Object.assign({},n,{language:r})),[`code`,r?{class:`language-${r}`}:{},Lu(e.content)]]}case`horizontalRule`:return[`hr`,n];case`cmsBlock`:{let n=sl(t?.tag)??`component`,r=tl(Iu(t?.props),Iu(t?.bindings)),i=e.content?.find(e=>e.type===`cmsSlot`&&e.attrs?.implicit===!0&&e.attrs?.name==="default")?.attrs?.cmsNodeId;return[n,fa(r,t?.cmsNodeId,i),...Nu(Tu(e.content))]}case`cmsOpaque`:return Fu(t?.node,t?.cmsNodeId);default:return}}function Ou(e){let t=[];for(let n of e??[]){let e,r=n.attrs;switch(n.type){case`text`:e=n.text??``;break;case`hardBreak`:e=[`br`,{}];break;case`image`:e=[`img`,fa(gl(r),r?.cmsNodeId)];break;case`cmsInlineOpaque`:e=Fu(r?.node)}e!==void 0&&e!==``&&t.push({node:e,marks:ju(n.marks)})}return ku(t,0)}function ku(e,t){let n=[];for(let r=0;r<e.length;){let i=e[r];if(i===void 0)break;let a=i.marks[t];if(a===void 0){n.push(i.node),r++;continue}let o=r+1;for(;o<e.length&&Mu(a,e[o]?.marks[t]);)o++;n.push(Au(a,ku(e.slice(r,o),t+1))),r=o}return n}function Au(e,t){let n=Iu(e.attrs?.cmsProps);return e.type===`link`?[`a`,ol(Object.assign({},n,{href:sl(e.attrs?.href),title:sl(e.attrs?.title)})),...t]:[wl(e.type)??`span`,n,...t]}function ju(e){return(e??[]).filter(e=>El(e.type)).sort((e,t)=>Number(e.type===`code`)-Number(t.type===`code`)).map(e=>{let t=e.attrs===void 0?void 0:Iu(e.attrs);return t===void 0?{type:e.type}:{attrs:t,type:e.type}})}function Mu(e,t){return t!==void 0&&e.type===t.type&&JSON.stringify(e.attrs)===JSON.stringify(t.attrs)}function Nu(e){let t=e[0];return e.length===1&&Ru(t)&&t[0]===`p`?zu(t):e}function Pu(e){let[t,...n]=e;return Ru(t)&&t[0]===`p`?[...zu(t),...n]:e}function Fu(e,t){let n=pr(Vr)(e);if(n._tag===`None`||Y(n.value))return;let r=structuredClone(n.value);if(t===void 0)return r;if(r[0]===null)return[null,fa(r[1],t),r[2]];let[i,a,...o]=r;return[i,fa(a,t),...o]}function Iu(e){return Cu(e)?structuredClone(e):{}}function Lu(e){return(e??[]).map(e=>e.text??Lu(e.content)).join(``)}function Ru(e){return Array.isArray(e)&&Y(e[0])}function zu(e){let[,,...t]=e;return t}function Bu(e){return e.attrs?.cmsTransient===!0}function Vu(e){return e.type===`paragraph`&&!e.content?.length}var Hu=`cmsDocumentFocusRequest`,Uu=li(bi),Wu=li(lr);function Gu(e,t){let n;return e.descendants((r,i)=>r.attrs.cmsNodeId===t?(n=r.isTextblock||r.type.name===`cmsSlot`?Qu(e,r,i):j.create(e,i),!1):n===void 0),n}function Ku(e,t,n){let r=e.view.state,i=Gu(r.doc,t);if(!i)return!1;let a=r.tr.setSelection(i).setMeta(Hu,n).scrollIntoView();return e.view.dispatch(a),e.view.focus(),!0}function qu(e){let t=e.getMeta(Hu);return Wu(t)?t:void 0}function Ju(e,t,n){return qu(e)!==void 0&&e.selection.from>=t+1&&e.selection.to<=t+n-1}function Yu(e){let{doc:t,selection:n}=e.view.state;if(o(n)){let e=$u(n.node.attrs.cmsNodeId);if(e)return Xu(t,e)}for(let e=n.$from.depth;e>0;e--){let r=$u(n.$from.node(e).attrs.cmsNodeId);if(r)return Xu(t,r)}}function Xu(e,t){let n;return e.descendants(e=>e.attrs.cmsNodeId===t?(n={label:Zu(e),nodeId:t},!1):n===void 0),n}function Zu(e){let t=e.textContent.trim().replace(/\s+/gu,` `).slice(0,40),n=t?` “${t}${e.textContent.trim().length>40?`…`:``}”`:``;return e.type.name===`heading`?`Heading${n}`:e.type.name===`paragraph`?`Text${n}`:e.type.name===`image`?`Image${ed(e.attrs.alt)?` “${String(e.attrs.alt)}”`:``}`:e.type.name===`cmsBlock`?`${String(e.attrs.tag||`Component`)} section`:e.type.name===`cmsSlot`?`${String(e.attrs.name||`Default`)} content`:`${e.type.name.replace(/([a-z])([A-Z])/gu,`$1 $2`)} content`}function Qu(e,t,n){if(t.isTextblock){let r=n+1,i=r+t.content.size;return r<i?C.create(e,r,i):C.near(e.resolve(r),1)}let r,i;return t.descendants((e,t)=>{if(!e.isTextblock)return;let a=n+t+2;return r??=a,i=a+e.content.size,!1}),r!==void 0&&i!==void 0&&r<i?C.create(e,r,i):C.near(e.resolve(n+1),1)}function $u(e){return Uu(e)?e:void 0}function ed(e){return Y(e)&&e?e:void 0}var td=Object.defineProperty,nd=(e,t)=>{let n={};for(var r in e)td(n,r,{get:e[r],enumerable:!0});return t&&td(n,Symbol.toStringTag,{value:`Module`}),n},rd=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),id=String.fromCodePoint??(e=>{let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t});function ad(e){return e>=55296&&e<=57343||e>1114111?65533:rd.get(e)??e}function od(e){let t=typeof atob==`function`?atob(e):typeof Buffer.from==`function`?Buffer.from(e,`base64`).toString(`binary`):new Buffer(e,`base64`).toString(`binary`),n=t.length&-2,r=new Uint16Array(n/2);for(let e=0,i=0;e<n;e+=2){let n=t.charCodeAt(e),a=t.charCodeAt(e+1);r[i++]=n|a<<8}return r}var sd=od(`QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlA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hY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg`),cd;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(cd||={});var ld;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(ld||={});var ud=32;function dd(e){return e>=ld.ZERO&&e<=ld.NINE}function fd(e){return e>=ld.UPPER_A&&e<=ld.UPPER_F||e>=ld.LOWER_A&&e<=ld.LOWER_F}function pd(e){return e>=ld.UPPER_A&&e<=ld.UPPER_Z||e>=ld.LOWER_A&&e<=ld.LOWER_Z||dd(e)}function md(e){return e===ld.EQUALS||pd(e)}var hd;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(hd||={});var gd;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(gd||={});var _d=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=hd.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=gd.Strict,this.runConsumed=0}startEntity(e){this.decodeMode=e,this.state=hd.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case hd.EntityStart:return e.charCodeAt(t)===ld.NUM?(this.state=hd.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=hd.NamedEntity,this.stateNamedEntity(e,t));case hd.NumericStart:return this.stateNumericStart(e,t);case hd.NumericDecimal:return this.stateNumericDecimal(e,t);case hd.NumericHex:return this.stateNumericHex(e,t);case hd.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|ud)===ld.LOWER_X?(this.state=hd.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=hd.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(dd(n)||fd(n)){let e=n<=ld.NINE?n-ld.ZERO:(n|ud)-ld.LOWER_A+10;this.result=this.result*16+e,this.consumed++,t++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(dd(n))this.result=this.result*10+(n-ld.ZERO),this.consumed++,t++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ld.SEMI)this.consumed+=1;else if(this.decodeMode===gd.Strict)return 0;return this.emitCodePoint(ad(this.result),this.consumed),this.errors&&(e!==ld.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&cd.VALUE_LENGTH)>>14;for(;t<e.length;){if(i===0&&(r&cd.FLAG13)!==0){let a=(r&cd.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let n=r&cd.JUMP_TABLE;if(e.charCodeAt(t)!==n)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(t>=e.length)return-1;let r=this.runConsumed-1,i=n[this.treeIndex+1+(r>>1)],a=r%2==0?i&255:i>>8&255;if(e.charCodeAt(t)!==a)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),r=n[this.treeIndex],i=(r&cd.VALUE_LENGTH)>>14}if(t>=e.length)break;let a=e.charCodeAt(t);if(a===ld.SEMI&&i!==0&&(r&cd.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);if(this.treeIndex=yd(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===gd.Attribute&&(i===0||md(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&cd.VALUE_LENGTH)>>14,i!==0){if(a===ld.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==gd.Strict&&(r&cd.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&cd.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~(cd.VALUE_LENGTH|cd.FLAG13):r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case hd.NamedEntity:return this.result!==0&&(this.decodeMode!==gd.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case hd.NumericDecimal:return this.emitNumericEntity(0,2);case hd.NumericHex:return this.emitNumericEntity(0,3);case hd.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case hd.EntityStart:return 0}}};function vd(e){let t=``,n=new _d(e,e=>t+=id(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function yd(e,t,n,r){let i=(t&cd.BRANCH_LENGTH)>>7,a=t&cd.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=i+1>>1,s=0,c=i-1;for(;s<=c;){let t=s+c>>>1,i=e[n+(t>>1)]>>(t&1)*8&255;if(i<r)s=t+1;else if(i>r)c=t-1;else return e[n+o+t]}return-1}var bd=vd(sd);function xd(e,t=gd.Legacy){return bd(e,t)}function Sd(e){return bd(e,gd.Strict)}var Cd={};function wd(e){let t=Cd[e];if(t)return t;t=Cd[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function Td(e,t){typeof t!=`string`&&(t=Td.defaultChars);let n=wd(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;t+=e<128?`��`:String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;t+=e<2048||e>=55296&&e<=57343?`���`:String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}Td.defaultChars=`;/?:@&=+$,#`,Td.componentChars=``;var Ed={};function Dd(e){let t=Ed[e];if(t)return t;t=Ed[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Od(e,t,n){typeof t!=`string`&&(n=t,t=Od.defaultChars),n===void 0&&(n=!0);let r=Dd(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}Od.defaultChars=`;/?:@&=+$,-_.!~*'()#`,Od.componentChars=`-_.!~*'()`;function kd(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function Ad(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var jd=/^([a-z0-9.+-]+:)/i,Md=/:[0-9]*$/,Nd=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Pd=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
2
- `,` `],Fd=[`/`,`?`,`#`],Id=255,Ld=/^[+a-z0-9A-Z_-]{0,63}$/,Rd=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,zd={javascript:!0,"javascript:":!0},Bd={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Vd(e,t){if(e&&e instanceof Ad)return e;let n=new Ad;return n.parse(e,t),n}Ad.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=Nd.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=jd.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&zd[o])&&(a=a.substr(2),this.slashes=!0)),!zd[o]&&(i||o&&!Bd[o])){let e=-1;for(let t=0;t<Fd.length;t++)r=a.indexOf(Fd[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<Pd.length;t++)r=a.indexOf(Pd[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(Ld)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(Ld)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(Rd);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>Id&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),Bd[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},Ad.prototype.parseHost=function(e){let t=Md.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Hd=e({decode:()=>Td,encode:()=>Od,format:()=>kd,parse:()=>Vd}),Ud=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Wd=/[\0-\x1F\x7F-\x9F]/,Gd=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Kd=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,qd=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Jd=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Yd=e({Any:()=>Ud,Cc:()=>Wd,Cf:()=>Gd,P:()=>Kd,S:()=>qd,Z:()=>Jd});function Xd(e){let t={};e||={},t.src_Any=Ud.source,t.src_Cc=Wd.source,t.src_Z=Jd.source,t.src_P=Kd.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><|]`;return t.src_pseudo_letter=`(?:(?!${n}|${t.src_ZPCc})${t.src_Any})`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!${t.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|${n}|${t.src_ZPCc})(?!${e[`---`]?`-(?!--)|`:`-|`}_|:\\d|\\.-|\\.(?!$|${t.src_ZPCc}))`,t.src_path=`(?:[/?#](?:(?!${t.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${t.src_ZCc}|\\]).)*\\]|\\((?:(?!${t.src_ZCc}|[)]).)*\\)|\\{(?:(?!${t.src_ZCc}|[}]).)*\\}|\\"(?:(?!${t.src_ZCc}|["]).)+\\"|\\'(?:(?!${t.src_ZCc}|[']).)+\\'|\\'(?=${t.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${t.src_ZCc}|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!${t.src_ZCc}|$)|;(?!${t.src_ZCc}|$)|\\!+(?!${t.src_ZCc}|[!]|$)|\\?(?!${t.src_ZCc}|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|${t.src_pseudo_letter}{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:${t.src_pseudo_letter})|(?:${t.src_pseudo_letter}(?:-|${t.src_pseudo_letter}){0,61}${t.src_pseudo_letter}))`,t.src_host=`(?:(?:(?:(?:${t.src_domain})\\.)*${t.src_domain}))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${t.src_ZPCc}|>|$))`,t.tpl_email_fuzzy=`(^|${n}|"|\\(|${t.src_ZCc})(${t.src_email_name}@${t.tpl_host_fuzzy_strict})`,t.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_fuzzy_strict}${t.src_path})`,t.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_no_ip_fuzzy_strict}${t.src_path})`,t}function Zd(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Qd(e){return Object.prototype.toString.call(e)}function $d(e){return Qd(e)===`[object String]`}function ef(e){return Qd(e)===`[object Object]`}function tf(e){return Qd(e)===`[object RegExp]`}function nf(e){return Qd(e)===`[object Function]`}function rf(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var af={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function of(e){return Object.keys(e||{}).reduce(function(e,t){return e||af.hasOwnProperty(t)},!1)}var sf={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},cf=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,lf=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function uf(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function df(){return function(e,t){t.normalize(e)}}function ff(e){let t=e.re=Xd(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(cf),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),`ig`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),`ig`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),`ig`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "${e}": ${t}`)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,ef(n)){tf(n.validate)?r.validate=uf(n.validate):nf(n.validate)?r.validate=n.validate:a(t,n),nf(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=df();return}if($d(n)){i.push(t);return}a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:df()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(rf).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`ig`),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,`i`),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,`i`)}function pf(e,t,n,r){let i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function mf(e,t){if(!(this instanceof mf))return new mf(e,t);t||of(e)&&(t=e,e={}),this.__opts__=Zd({},af,t),this.__schemas__=Zd({},sf,e),this.__compiled__={},this.__tlds__=lf,this.__tlds_replaced__=!1,this.re={},ff(this)}mf.prototype.add=function(e,t){return this.__schemas__[e]=t,ff(this),this},mf.prototype.set=function(e){return this.__opts__=Zd(this.__opts__,e),this},mf.prototype.test=function(e){if(!e.length)return!1;let t,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&e.indexOf(`@`)>=0&&e.match(this.re.email_fuzzy)!==null)},mf.prototype.pretest=function(e){return this.re.pretest.test(e)},mf.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},mf.prototype.match=function(e){let t=[],n=[],r=[],i=[],a,o,s;function c(e,t){return e?t?e.index===t.index?e.lastIndex>=t.lastIndex?e:t:e.index<t.index?e:t:e:t}if(!e.length)return null;if(this.re.schema_test.test(e))for(s=this.re.schema_search,s.lastIndex=0;(a=s.exec(e))!==null;)o=this.testSchemaAt(e,a[2],s.lastIndex),o&&n.push({schema:a[2],index:a.index+a[1].length,lastIndex:a.index+a[0].length+o});if(this.__opts__.fuzzyLink&&this.__compiled__[`http:`])for(s=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)r.push({schema:``,index:a.index+a[1].length,lastIndex:a.index+a[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`])for(s=this.re.email_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)i.push({schema:`mailto:`,index:a.index+a[1].length,lastIndex:a.index+a[0].length});let l=[0,0,0],u=0;for(;;){let a=[n[l[0]],i[l[1]],r[l[2]]],o=c(c(a[0],a[1]),a[2]);if(!o)break;if(o===a[0]?l[0]++:o===a[1]?l[1]++:l[2]++,o.index<u)continue;let s=new pf(e,o.schema,o.index,o.lastIndex);this.__compiled__[s.schema].normalize(s,this),t.push(s),u=o.lastIndex}return t.length?t:null},mf.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new pf(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},mf.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),ff(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,ff(this),this)},mf.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)},mf.prototype.onCompile=function(){};var hf=2147483647,gf=36,_f=1,vf=26,yf=38,bf=700,xf=72,Sf=128,Cf=`-`,wf=/^xn--/,Tf=/[^\0-\x7F]/,Ef=/[\x2E\u3002\uFF0E\uFF61]/g,Df={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},Of=35,kf=Math.floor,Af=String.fromCharCode;function jf(e){throw RangeError(Df[e])}function Mf(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function Nf(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(Ef,`.`);let i=Mf(e.split(`.`),t).join(`.`);return r+i}function Pf(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var Ff=e=>String.fromCodePoint(...e),If=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:gf},Lf=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Rf=function(e,t,n){let r=0;for(e=n?kf(e/bf):e>>1,e+=kf(e/t);e>455;r+=gf)e=kf(e/Of);return kf(r+36*e/(e+yf))},zf=function(e){let t=[],n=e.length,r=0,i=Sf,a=xf,o=e.lastIndexOf(Cf);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&jf(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=gf;;i+=gf){s>=n&&jf(`invalid-input`);let o=If(e.charCodeAt(s++));o>=gf&&jf(`invalid-input`),o>kf((hf-r)/t)&&jf(`overflow`),r+=o*t;let c=i<=a?_f:i>=a+vf?vf:i-a;if(o<c)break;let l=gf-c;t>kf(hf/l)&&jf(`overflow`),t*=l}let c=t.length+1;a=Rf(r-o,c,o==0),kf(r/c)>hf-i&&jf(`overflow`),i+=kf(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},Bf=function(e){let t=[];e=Pf(e);let n=e.length,r=Sf,i=0,a=xf;for(let n of e)n<128&&t.push(Af(n));let o=t.length,s=o;for(o&&t.push(Cf);s<n;){let n=hf;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>kf((hf-i)/c)&&jf(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>hf&&jf(`overflow`),n===r){let e=i;for(let n=gf;;n+=gf){let r=n<=a?_f:n>=a+vf?vf:n-a;if(e<r)break;let i=e-r,o=gf-r;t.push(Af(Lf(r+i%o,0))),e=kf(i/o)}t.push(Af(Lf(e,0))),a=Rf(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},Vf={version:`2.3.1`,ucs2:{decode:Pf,encode:Ff},decode:zf,encode:Bf,toASCII:function(e){return Nf(e,function(e){return Tf.test(e)?`xn--`+Bf(e):e})},toUnicode:function(e){return Nf(e,function(e){return wf.test(e)?zf(e.slice(4).toLowerCase()):e})}},Hf=nd({arrayReplaceAt:()=>qf,asciiTrim:()=>hp,assign:()=>Kf,escapeHtml:()=>op,escapeRE:()=>cp,fromCodePoint:()=>Yf,has:()=>Gf,isMdAsciiPunct:()=>fp,isPromiseLike:()=>gp,isPunctChar:()=>up,isPunctCharCode:()=>dp,isSpace:()=>X,isString:()=>Uf,isValidEntityCode:()=>Jf,isWhiteSpace:()=>lp,lib:()=>_p,normalizeReference:()=>pp,unescapeAll:()=>tp,unescapeMd:()=>ep});function Uf(e){return typeof e==`string`}var Wf=Object.prototype.hasOwnProperty;function Gf(e,t){return Wf.call(e,t)}function Kf(e,...t){for(let n of t)if(n){if(typeof n!=`object`)throw TypeError(`source must be object`);Object.assign(e,n)}return e}function qf(e,t,n){return e.slice(0,t).concat(n,e.slice(t+1))}function Jf(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Yf(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var Xf=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Zf=RegExp(`${Xf.source}|&([a-z#][a-z0-9]{1,31});`,`gi`),Qf=/^#(x[a-f0-9]{1,8}|\d{1,8})$/i;function $f(e,t){if(t.charCodeAt(0)===35&&Qf.test(t)){let n=t[1].toLowerCase()===`x`?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Jf(n)?Yf(n):e}let n=xd(e);return n===e?e:n}function ep(e){return e.includes(`\\`)?e.replace(Xf,`$1`):e}function tp(e){return!e.includes(`\\`)&&!e.includes(`&`)?e:e.replace(Zf,(e,t,n)=>t||$f(e,n))}var np=/[&<>"]/,rp=/[&<>"]/g,ip={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`};function ap(e){return ip[e]}function op(e){return np.test(e)?e.replace(rp,ap):e}var sp=/[.?*+^$[\]\\(){}|-]/g;function cp(e){return e.replace(sp,`\\$&`)}function X(e){switch(e){case 9:case 32:return!0}return!1}function lp(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function up(e){return Kd.test(e)||qd.test(e)}function dp(e){return up(Yf(e))}function fp(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function pp(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function mp(e){return e===32||e===9||e===10||e===13}function hp(e){let t=0;for(;t<e.length&&mp(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&mp(e.charCodeAt(n));n--);return e.slice(t,n+1)}function gp(e){return typeof e?.then==`function`}var _p={mdurl:Hd,ucmicro:Yd},vp=class{type;tag;attrs=null;map=null;nesting;level=0;children=null;content=``;markup=``;info=``;meta=null;block=!1;hidden=!1;constructor(e,t,n){this.type=e,this.tag=t,this.nesting=n}attrIndex(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r}attrGet(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},yp=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType=`root`;level=0;Token=vp;constructor(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r;let i=this.src,a=i.length;for(let e=0;e<a;){let t=i.indexOf(`
3
- `,e),n=t===-1?a:t,r=0,o=0,s=e;for(;s<n;){let e=i.charCodeAt(s);if(X(e)){r++,o+=e===9?4-o%4:1,s++;continue}break}this.bMarks.push(e),this.eMarks.push(n),this.tShift.push(r),this.sCount.push(o),this.bsCount.push(0),e=n+1}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){let r=new vp(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e}skipSpaces(e){let t=this.src;for(let n=t.length;e<n&&X(t.charCodeAt(e));e++);return e}skipSpacesBack(e,t){if(e<=t)return e;let n=this.src;for(;e>t;)if(!X(n.charCodeAt(--e)))return e+1;return e}skipChars(e,t){let n=this.src;for(let r=n.length;e<r&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;let r=this.src;for(;e>n;)if(t!==r.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return``;let i=Array(t-e),a=this.src;for(let o=0,s=e;s<t;s++,o++){let e=0,c=this.bMarks[s],l=c,u;for(u=s+1<t||r?this.eMarks[s]+1:this.eMarks[s];l<u&&e<n;){let t=a.charCodeAt(l);if(X(t))t===9?e+=4-(e+this.bsCount[s])%4:e++;else if(l-c<this.tShift[s])e++;else break;l++}e>n?i[o]=` `.repeat(e-n)+this.src.slice(l,u):i[o]=this.src.slice(l,u)}return i.join(``)}},bp=class{src;env;tokens=[];inlineMode=!1;md;constructor(e,t,n){this.src=e,this.env=n,this.md=t}Token=vp},xp=class{src;env;md;tokens;tokens_meta;pos=0;posMax;level=0;pending=``;pendingLevel=0;cache={};delimiters=[];_prev_delimiters=[];backticks={};backticksScanned=!1;linkLevel=0;constructor(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.posMax=this.src.length}pushPending(){let e=new vp(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e}push(e,t,n){this.pending&&this.pushPending();let r=new vp(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()??[]),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r}scanDelims(e,t){let n=this.src,r=this.posMax,i=n.charCodeAt(e),a;if(e===0)a=32;else if(e===1)a=this.src.charCodeAt(0),(a&63488)==55296&&(a=65533);else if(a=this.src.charCodeAt(e-1),(a&64512)==56320){let t=this.src.charCodeAt(e-2);a=(t&64512)==55296?65536+(t-55296<<10)+(a-56320):65533}else(a&64512)==55296&&(a=65533);let o=e;for(;o<r&&n.charCodeAt(o)===i;)o++;let s=o-e,c=o<r?this.src.charCodeAt(o):32;if((c&64512)==55296){let e=this.src.charCodeAt(o+1);c=(e&64512)==56320?65536+(c-55296<<10)+(e-56320):65533}else(c&64512)==56320&&(c=65533);let l=fp(a)||dp(a),u=fp(c)||dp(c),d=lp(a),f=lp(c),p=!f&&(!u||d||l),m=!d&&(!l||f||u);return{can_open:p&&(t||!m||l),can_close:m&&(t||!p||u),length:s}}Token=vp},Sp=class{__rules__=[];__cache__=null;__find__(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1}__compile__(){let e=new Set([``]);for(let t of this.__rules__)if(t.enabled)for(let n of t.alt)e.add(n);this.__cache__={};for(let t of e){let e=[];for(let n of this.__rules__)n.enabled&&(!t||n.alt.includes(t))&&e.push(n.fn);this.__cache__[t]=e}}at(e,t,n={}){let r=this.__find__(e),i=n||{};if(r===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null}before(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null}after(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null}push(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null}enable(e,t){Array.isArray(e)||(e=[e]);let n=[];for(let r of e){let e=this.__find__(r);if(e<0){if(t)continue;throw Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[e].enabled=!0,n.push(r)}return this.__cache__=null,n}enableOnly(e,t){Array.isArray(e)||(e=[e]);for(let e of this.__rules__)e.enabled=!1;this.enable(e,t)}disable(e,t){Array.isArray(e)||(e=[e]);let n=[];for(let r of e){let e=this.__find__(r);if(e<0){if(t)continue;throw Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[e].enabled=!1,n.push(r)}return this.__cache__=null,n}getRules(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]}};function Cp(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(X(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function wp(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=`${e.getLines(t,i,4+e.blkIndent,!1)}\n`,a.map=[t,e.line],!0}function Tp(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.includes(String.fromCharCode(o)))return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function Ep(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!X(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&X(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h${String(s)}`,1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=hp(e.src.slice(i,a)),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h${String(s)}`,-1);return d.markup=`########`.slice(0,s),!0}function Dp(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!X(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=String.fromCharCode(o).repeat(s),!0}var Op=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),kp=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Ap=`<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>`,jp=RegExp(`^(?:${kp}|${Ap}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Mp=RegExp(`^(?:${kp}|${Ap})`),Np=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(${Op.join(`|`)})(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(`${Mp.source}\\s*$`),/^$/,!1]];function Pp(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<Np.length&&!Np[s][0].test(o);s++);if(s===Np.length)return!1;if(r)return Np[s][2];let c=t+1,l=Np[s][1].test(``);if(!Np[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(l||!e.isEmpty(c)));c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),Np[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let u=e.push(`html_block`,``,0);return u.map=[t,c],u.content=e.getLines(t,c,e.blkIndent,!0),!0}function Fp(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a||o===void 0)return e.parentType=i,!1;let c=hp(e.getLines(t,s,e.blkIndent,!1));e.line=s+1;let l=e.push(`heading_open`,`h${String(a)}`,1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h${String(a)}`,-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function Ip(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!X(e.src.charCodeAt(r))?-1:r}function Lp(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!X(a))?-1:i}function Rp(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function zp(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p=Lp(e,c);if(p>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if(p=Ip(e,c),p>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f.toString()]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){C=!0;break}if(C)break;if(d){if(p=Lp(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=Ip(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&Rp(e,h),!0}function Bp(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=hp(e.getLines(t,a,e.blkIndent,!1));e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}function Vp(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!X(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!X(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&X(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&X(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=pp(c.slice(1,l));if(!_)return!1;if(r)return!0;e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o;let v=e.push(`reference`,``,0);return v.map=[t,e.line],v.info=_,v.meta={title:g,href:d},!0}var Hp=65536;function Up(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function Wp(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function Gp(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!X(s)||o===45&&X(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!X(t))return!1;a++}let c=Up(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=Up(e,t).trim(),!c.includes(`|`)||e.sCount[t]-e.blkIndent>=4)return!1;l=Wp(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:${u[t]}`]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=Up(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=Wp(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>Hp))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:${u[t]}`]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}var Kp=[[`table`,Gp,[`paragraph`,`reference`]],[`code`,wp],[`fence`,Tp,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,Cp,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,Dp,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,zp,[`paragraph`,`reference`,`blockquote`]],[`reference`,Vp],[`html_block`,Pp,[`paragraph`,`reference`,`blockquote`]],[`heading`,Ep,[`paragraph`,`reference`,`blockquote`]],[`lheading`,Fp],[`paragraph`,Bp]],qp=class{ruler;constructor(){this.ruler=new Sp;for(let e=0;e<Kp.length;e++)this.ruler.push(Kp[e][0],Kp[e][1],{alt:(Kp[e][2]||[]).slice()})}tokenize(e,t,n,r){let i=this.ruler.getRules(``),a=i.length,o=e.md.options.maxNesting,s=t,c=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n||e.sCount[s]<e.blkIndent));){if(e.level>=o){e.line=n;break}let t=e.line,r=!1;for(let o=0;o<a;o++)if(r=i[o](e,s,n,!1),r){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!r)throw Error(`none of the block rules matched`);e.tight=!c,e.isEmpty(e.line-1)&&(c=!0),s=e.line,s<n&&e.isEmpty(s)&&(c=!0,s++,e.line=s)}}parse(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)}State=yp};function Jp(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function Yp(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function Xp(e){return/^<a[>\s]/i.test(e)}function Zp(e){return/^<\/a\s*>/i.test(e)}function Qp(e){if(!e.md.options.linkify)return;let t=e.tokens,n=e.md.linkify;for(let r=0,i=t.length;r<i;r++){if(t[r].type!==`inline`||!n.pretest(t[r].content))continue;let i=t[r].children,a=0;for(let t=i.length-1;t>=0;t--){let r=i[t];if(r.type===`link_close`){for(t--;i[t].level!==r.level&&i[t].type!==`link_open`;)t--;continue}if(r.type===`html_inline`&&(Xp(r.content)&&a>0&&a--,Zp(r.content)&&a++),!(a>0)&&r.type===`text`){let a=r.content;if(!n.pretest(a))continue;let o=n.match(a);if(!o?.length)continue;let s=[],c=r.level,l=0,u=+(o[0].index===0&&t>0&&i[t-1].type===`text_special`);for(let t=u;t<o.length;t++){let n=o[t],r=e.md.normalizeLink(n.url);if(!e.md.validateLink(r))continue;let i=n.text;i=n.schema?n.schema===`mailto:`&&!/^mailto:/i.test(i)?e.md.normalizeLinkText(`mailto:${i}`).replace(/^mailto:/,``):e.md.normalizeLinkText(i):e.md.normalizeLinkText(`http://${i}`).replace(/^http:\/\//,``);let u=n.index;if(u>l){let t=new e.Token(`text`,``,0);t.content=a.slice(l,u),t.level=c,s.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=c++,d.markup=`linkify`,d.info=`auto`,s.push(d);let f=new e.Token(`text`,``,0);f.content=i,f.level=c,s.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--c,p.markup=`linkify`,p.info=`auto`,s.push(p),l=n.lastIndex}if(l<a.length){let t=new e.Token(`text`,``,0);t.content=a.slice(l),t.level=c,s.push(t)}i.splice(t,1,...s)}}}}var $p=/\r\n?|\n/g,em=/\0/g;function tm(e){let t=e.src,n=t.includes(`\r`),r=t.includes(`\0`);(n||r)&&(n&&(t=t.replace($p,`
4
- `)),r&&(t=t.replace(em,`�`)),e.src=t)}var nm=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,rm=/\((?:c|tm|r)\)/i,im=/\((c|tm|r)\)/gi,am={c:`©`,r:`®`,tm:`™`};function om(e,t){return am[t.toLowerCase()]}function sm(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(im,om)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function cm(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&nm.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function lm(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(rm.test(e.tokens[t].content)&&sm(e.tokens[t].children),nm.test(e.tokens[t].content)&&cm(e.tokens[t].children))}var um=/['"]/,dm=/['"]/g,fm=`’`;function pm(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function mm(e,t){let n=``,r=0;t.sort((e,t)=>e.pos-t.pos);for(let i=0;i<t.length;i++){let a=t[i];n+=e.slice(r,a.pos)+a.ch,r=a.pos+1}return n+e.slice(r)}function hm(e,t){let n,r=[],i={};for(let a=0;a<e.length;a++){let o=e[a],s=e[a].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!==`text`)continue;let c=o.content,l=0,u=c.length;OUTER:for(;l<u;){dm.lastIndex=l;let o=dm.exec(c);if(!o)break;let d=!0,f=!0;l=o.index+1;let p=o[0]===`'`,m=32;if(o.index-1>=0)m=c.charCodeAt(o.index-1);else for(n=a-1;n>=0&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(l<u)h=c.charCodeAt(l);else for(n=a+1;n<e.length&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=fp(m)||dp(m),_=fp(h)||dp(h),v=lp(m),y=lp(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&o[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&pm(i,a,o.index,fm);continue}if(f)for(n=r.length-1;n>=0;n--){let e=r[n];if(r[n].level<s)break;if(e.single===p&&r[n].level===s){e=r[n];let s,c;p?(s=t.md.options.quotes[2],c=t.md.options.quotes[3]):(s=t.md.options.quotes[0],c=t.md.options.quotes[1]),pm(i,a,o.index,c),pm(i,e.token,e.pos,s),r.length=n;continue OUTER}}d?r.push({token:a,pos:o.index,single:p,level:s}):f&&p&&pm(i,a,o.index,fm)}}Object.keys(i).forEach(t=>{e[t].content=mm(e[t].content,i[t])})}function gm(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&um.test(e.tokens[t].content)&&hm(e.tokens[t].children,e)}function _m(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var vm=[[`normalize`,tm],[`block`,Jp],[`inline`,Yp],[`linkify`,Qp],[`replacements`,lm],[`smartquotes`,gm],[`text_join`,_m]],ym=class{ruler;constructor(){this.ruler=new Sp;for(let e=0;e<vm.length;e++)this.ruler.push(vm[e][0],vm[e][1])}process(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)}State=bp};function bm(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=tp(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=tp(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function xm(e,t,n=!1){let r,i=!1,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function Sm(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=tp(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=tp(e.slice(t,a)),o}var Cm={parseLinkDestination:bm,parseLinkLabel:xm,parseLinkTitle:Sm},wm=/^([\w.!#$%&'*+/=?^`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*)$/i,Tm=/^([a-z][a-z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/i;function Em(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(Tm.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if(wm.test(a)){let n=e.md.normalizeLink(`mailto:${a}`);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function Dm(e,t){let n=e.pos,r=e.src;if(r.charCodeAt(n)!==96)return!1;let i=n;n++;let a=e.posMax;for(;n<a&&r.charCodeAt(n)===96;)n++;let o=r.slice(i,n),s=o.length;if(e.backticksScanned&&(e.backticks[s]||0)<=i)return t||(e.pending+=o),e.pos+=s,!0;let c=n,l;for(;l=r.indexOf("`",c),l!==-1;){for(c=l+1;c<a&&r.charCodeAt(c)===96;)c++;let i=c-l;if(i===s){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=o,t.content=r.slice(n,l).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=c,!0}e.backticks[i]=l}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=s,!0}function Om(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function km(e){let t=e.tokens_meta,n=e.tokens_meta.length;Om(e.delimiters);for(let e=0;e<n;e++){let n=t[e]?.delimiters;n&&Om(n)}}function Am(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function jm(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function Mm(e){let t=e.tokens_meta,n=e.tokens_meta.length;jm(e,e.delimiters);for(let r=0;r<n;r++){let n=t[r]?.delimiters;n&&jm(e,n)}}var Nm={tokenize:Am,postProcess:Mm},Pm=/^&#(x[a-f0-9]{1,6}|\d{1,7});/i,Fm=/^&([a-z][a-z0-9]{1,31});/i;function Im(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(Pm);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?Number.parseInt(r[1].slice(1),16):Number.parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=Jf(t)?Yf(t):Yf(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(Fm);if(r){let n=Sd(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}var Lm=[];for(let e=0;e<256;e++)Lm.push(0);for(let e of`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``))Lm[e.charCodeAt(0)]=1;function Rm(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),X(i));)n++;return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\${a}`;if(!t){let t=e.push(`text_special`,``,0);t.content=i<256&&Lm[i]!==0?a:o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function zm(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}function Bm(e){return/^<a[>\s]/i.test(e)}function Vm(e){return/^<\/a\s*>/i.test(e)}function Hm(e){let t=e|32;return t>=97&&t<=122}function Um(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!Hm(i))return!1;let a=e.src.slice(r).match(jp);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],Bm(t.content)&&e.linkLevel++,Vm(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}function Wm(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),X(n)||n===10);a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),X(n)||n===10);a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),X(n)||n===10);a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[pp(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}function Gm(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),X(n)||n===10);m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),X(n)||n===10);m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),X(n)||n===10);m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[pp(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}var Km=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function qm(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(Km);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function Jm(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t){if(r>=0&&e.pending.charCodeAt(r)===32){if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0)}else e.push(`softbreak`,`br`,0)}for(n++;n<i&&X(e.src.charCodeAt(n));)n++;return e.pos=n,!0}function Ym(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function Xm(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function Zm(e){let t=e.tokens_meta,n=e.tokens_meta.length;Xm(e,e.delimiters);for(let r=0;r<n;r++){let n=t[r]?.delimiters;n&&Xm(e,n)}}var Qm={tokenize:Ym,postProcess:Zm};function $m(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function eh(e,t){let n=e.pos,r=e.src;for(;n<e.posMax&&!$m(r.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=r.slice(e.pos,n)),e.pos=n,!0)}var th=[[`text`,eh],[`linkify`,qm],[`newline`,Jm],[`escape`,Rm],[`backticks`,Dm],[`strikethrough`,Qm.tokenize],[`emphasis`,Nm.tokenize],[`link`,Gm],[`image`,Wm],[`autolink`,Em],[`html_inline`,Um],[`entity`,Im]],nh=[[`balance_pairs`,km],[`strikethrough`,Qm.postProcess],[`emphasis`,Nm.postProcess],[`fragments_join`,zm]],rh=class{ruler;ruler2;constructor(){this.ruler=new Sp;for(let e=0;e<th.length;e++)this.ruler.push(th[e][0],th[e][1]);this.ruler2=new Sp;for(let e=0;e<nh.length;e++)this.ruler2.push(nh[e][0],nh[e][1])}skipToken(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache,o=a[t];if(o!==void 0){e.pos=o;return}let s=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,s=n[i](e,!0),e.level--,s){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;s||e.pos++,a[t]=e.pos}tokenize(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)}State=xp},ih=/^(vbscript|javascript|file|data):/,ah=/^data:image\/(gif|png|jpeg|webp);/;function oh(e){let t=e.trim().toLowerCase();return!ih.test(t)||ah.test(t)}var sh=[`http:`,`https:`,`mailto:`];function ch(e){let t=Vd(e,!0);if(t.hostname&&(!t.protocol||sh.includes(t.protocol)))try{t.hostname=Vf.toASCII(t.hostname)}catch{}return Od(kd(t))}function lh(e){let t=Vd(e,!0);if(t.hostname&&(!t.protocol||sh.includes(t.protocol)))try{t.hostname=Vf.toUnicode(t.hostname)}catch{}return Td(kd(t),`${Td.defaultChars}%`)}var uh={html:!1,linkify:!1,typographer:!1,quotes:`“”‘’`,maxNesting:100},dh=class{inline=new rh;block=new qp;core=new ym;linkify=new mf;validateLink=oh;normalizeLink=ch;normalizeLinkText=lh;helpers={...Cm};options={...uh};parse(e,t={}){if(typeof e!=`string`)throw TypeError(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}parseInline(e,t={}){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}},fh={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}},ph={options:{...uh,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,highlight:null},components:{core:{},block:{},inline:{}}},mh={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},hh={};hh.code_inline=function(e,t,n,r,i){let a=e[t];return`<code${i.renderAttrs(a)}>${op(a.content)}</code>`},hh.code_block=function(e,t,n,r,i){let a=e[t];return`<pre${i.renderAttrs(a)}><code>${op(e[t].content)}</code></pre>\n`},hh.fence=function(e,t,n,r,i){let a=e[t],o=a.info?tp(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}function l(e){if(e.indexOf(`<pre`)===0)return`${e}\n`;if(o){let t=a.attrIndex(`class`),r=a.attrs?a.attrs.slice():[];t<0?r.push([`class`,n.langPrefix+s]):(r[t]=r[t].slice(),r[t][1]+=` ${n.langPrefix}${s}`);let o={attrs:r};return`<pre><code${i.renderAttrs(o)}>${e}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${e}</code></pre>\n`}let u=(()=>{if(!n.highlight)return op(a.content);let e=n.highlight(a.content,s,c,r);return gp(e)?e.then(e=>e||op(a.content)):e||op(a.content)})();return gp(u)?u.then(l):l(u)},hh.image=function(e,t,n,r,i){let a=e[t];return a.attrs[a.attrIndex(`alt`)][1]=i.renderInlineAsText(a.children,n,r),i.renderToken(e,t,n)},hh.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
5
- `:`<br>
6
- `},hh.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
7
- `:`<br>
8
- `:`
9
- `},hh.text=function(e,t){return op(e[t].content)},hh.html_block=function(e,t){return e[t].content},hh.html_inline=function(e,t){return e[t].content},hh.reference=function(e,t){return e[t].content};var gh=class{rules=Kf({},hh);constructor(){}renderAttrs(e){let t=e.attrs;if(!t)return``;let n=t.length;if(n===0)return``;let r=``;for(let e=0;e<n;e++)r+=` ${op(t[e][0])}="${op(t[e][1])}"`;return r}renderToken(e,t,n,r={}){let i=e[t],a=``;if(i.hidden)return``;i.block&&i.nesting!==-1&&t&&e[t-1].hidden&&(a+=`
10
- `),a+=(i.nesting===-1?`</`:`<`)+i.tag,a+=this.renderAttrs(i),i.nesting===0&&n.xhtmlOut&&(a+=` /`);let o=!1;if(i.block&&(o=!0,i.nesting===1&&t+1<e.length)){let n=e[t+1];(n.type===`inline`||n.type===`reference`||n.hidden||n.nesting===-1&&n.tag===i.tag)&&(o=!1)}return a+=o?`>
11
- `:`>`,a}renderInline(e,t,n={}){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=i[e[a].type];if(o){let i=o(e,a,t,n,this);if(gp(i))throw Error(`Renderer.renderInline: async rule detected, use renderInlineAsync()`);r+=i}else r+=this.renderToken(e,a,t,n)}return r}renderInlineAsText(e,t,n={}){let r=``;for(let i=0,a=e.length;i<a;i++){let a=e[i];switch(a.type){case`text`:r+=a.content;break;case`image`:r+=this.renderInlineAsText(a.children,t,n);break;case`html_inline`:case`html_block`:r+=a.content;break;case`softbreak`:case`hardbreak`:r+=`
12
- `}}return r}render(e,t,n={}){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;if(o===`inline`)r+=this.renderInline(e[a].children,t,n);else{let s=i[o];if(s){let i=s(e,a,t,n,this);if(gp(i))throw Error(`Renderer.render: async rule detected, use renderAsync()`);r+=i}else r+=this.renderToken(e,a,t,n)}}return r}async renderInlineAsync(e,t,n){let r=[],i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=i[e[a].type];o?r.push(Promise.resolve(o(e,a,t,n,this))):r.push(Promise.resolve(this.renderToken(e,a,t,n)))}return(await Promise.all(r)).join(``)}async renderAsync(e,t,n){let r=[],i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a],s=o.type;if(s===`inline`)r.push(this.renderInlineAsync(o.children,t,n));else{let o=i[s];o?r.push(Promise.resolve(o(e,a,t,n,this))):r.push(Promise.resolve(this.renderToken(e,a,t,n)))}}return(await Promise.all(r)).join(``)}},_h={default:ph,zero:mh,commonmark:fh},vh=class extends dh{renderer=new gh;utils=Hf;options={..._h.default.options};constructor(e,t){super();let[n,r]=typeof e==`string`?[e,t]:[`default`,e];this.configure(n),r&&this.set(r)}set(e){return Kf(this.options,e),this}configure(e){if(typeof e==`string`){let t=e;if(e=_h[t],!e)throw Error(`Wrong \`markdown-exit\` preset "${t}", check name`)}if(!e)throw Error("Wrong `markdown-exit` preset, can't be empty");if(e.options&&this.set(e.options),e.components)for(let t of Object.keys(e.components)){let n=e.components[t];n.rules&&this[t].ruler.enableOnly(n.rules),n.rules2&&this[t].ruler2?.enableOnly(n.rules2)}return this}enable(e,t){let n=[];Array.isArray(e)||(e=[e]);for(let t of[`core`,`block`,`inline`])n=n.concat(this[t].ruler.enable(e,!0));n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(e=>!n.includes(e));if(r.length&&!t)throw Error(`MarkdownExit. Failed to enable unknown rule(s): ${r}`);return this}disable(e,t){let n=[];Array.isArray(e)||(e=[e]);for(let t of[`core`,`block`,`inline`])n=n.concat(this[t].ruler.disable(e,!0));n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(e=>!n.includes(e));if(r.length&&!t)throw Error(`MarkdownExit. Failed to disable unknown rule(s): ${r}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}renderAsync(e,t={}){return this.renderer.renderAsync(this.parse(e,t),this.options,t)}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}renderInlineAsync(e,t={}){return this.renderer.renderAsync(this.parseInline(e,t),this.options,t)}};function yh(e){function t(...t){return new e(...t)}return Object.setPrototypeOf(t,vh),t.prototype=vh.prototype,t.prototype.constructor=t,t}var bh=yh(vh);function xh(e){let t=new Set,n=[];for(let r of e)t.has(r.name)||(t.add(r.name),n.push(r));return n}function Sh(e){return e}function Ch(e,t){if(e[t]!==`[`)return-1;let n=t+1,r=0;for(;n<e.length;){if(e[n]===`\\`&&n+1<e.length){n+=2;continue}if(e[n]===`[`)r++;else if(e[n]===`]`){if(r===0)return n;r--}n+=1}return-1}function wh(e,t){let n=Ch(e,t);return n===-1?null:{content:e.slice(t+1,n),endIndex:n+1}}var Th={"[":`]`,"{":`}`,"(":`)`},Eh={"'":`'`,'"':`"`,"`":"`"};function Dh(e,t=0){if(e[t]!==`{`)throw Error(`Invalid props, expected \`{\` but got '${e[t]}'`);let n=[];if(e[t+1]===`{`)return;for(t+=1;t<e.length;)if(e[t]===`\\`)t+=2;else if(e[t]===`}`){t+=1;break}else if(e[t]===` `)t+=1;else if(e[t]===`.`)t+=1,n.push([`class`,r(` #.}`)]);else if(e[t]===`#`)t+=1,n.push([`id`,r(` #.}`)]);else{let r=t;for(;t<e.length&&(t+=1,!` }=`.includes(e[t])););let a=e[t];if(r!==t){let o=e.slice(r,t).trim(),s=``;a===`=`?(t+=1,s=i()):(o=o[0]===`:`?o:`:${o}`,s=`true`),o.match(/^:?[a-z_][a-z0-9_-]*$/gi)&&n.push([o,s])}}function r(n){let r=t;for(;t<e.length&&(t+=1,e[t]===`\\`&&(t+=2),!n.includes(e[t])););return e.slice(r,t)}function i(){let n=t;return e[t]in Th?(a(Th[e[t]]),t+=1,e.slice(n,t)):e[t]in Eh?(o(Eh[e[t]]),t+=1,e.slice(n,t)):r(` }`)}function a(n){for(;t<e.length;)if(t++,e[t]in Eh)o(Eh[e[t]]);else if(e[t]in Th)a(Th[e[t]]);else if(e[t]===n)return}function o(e){return r(e)}return n.forEach(e=>{/^(['"`]).*\1$/.test(e[1])&&(e[1]=e[1].slice(1,-1))}),{props:n,index:t}}var Oh=/^[a-z$][$\w.-]*/i;function kh(e){if(e=e.trim(),!e)return{name:``};let t=e.match(Oh)?.[0];if(!t)throw Error(`Invalid block params: ${e}`);let n=e.slice(t.length).trim(),r,i,a;if(n.startsWith(`[`)){let e=wh(n,0);e&&(r=e.content,n=n.slice(e.endIndex).trim())}if(n.startsWith(`{`)){let e=Dh(n,0);if(e){i=e.props;let t=n.slice(e.index).trim();t&&(a=t)}}else n&&(a=n);let o={name:ma(t)};return r!==void 0&&(o.content=r),i!==void 0&&(o.props=i),a&&(o.remaining=a),o}var Ah=/^[a-z$][\w$-]*/i;function jh(e){return Ah.test(e)}var Mh={"---":`---`,"```yaml [props]":"```","~~~yaml [props]":`~~~`,"```yml [props]":"```","~~~yml [props]":`~~~`},Nh=e=>{e.block.ruler.before(`fence`,`comark_block_shorthand`,function(e,t,n,r){let i=e.src.slice(e.bMarks[t]+e.tShift[t],e.eMarks[t]);if(i[0]!==`:`||!jh(i.slice(1)))return!1;let{name:a,content:o,props:s,remaining:c}=kh(i.slice(1));if(c)return!1;if(!r){if(o!==void 0){let n=e.push(`mdc_block_shorthand`,a,1);s?.forEach(([e,t])=>{e===`class`?n.attrJoin(e,t):n.attrSet(e,t)}),n.map=[t,t+1];let r=e.push(`inline`,``,0);r.content=o,r.children=[];let i=e.push(`mdc_block_shorthand`,a,-1);i.map=[t,t+1]}else{let n=e.push(`mdc_block_shorthand`,a,0);n.map=[t,t+1],s?.forEach(([e,t])=>{e===`class`?n.attrJoin(e,t):n.attrSet(e,t)})}}return e.line=t+1,!0}),e.block.ruler.before(`fence`,`comark_block`,function(e,t,n,r){let i,a,o=!1,s=e.bMarks[t]+e.tShift[t],c=e.eMarks[t],l=e.sCount[t],u=!1,d=0,f=0,p=0;if(e.src[s]!==`:`)return!1;for(i=s+1;i<=c&&e.src[i]===`:`;i++);let m=Math.floor(i-s);if(m<2)return!1;let h=e.src.slice(s,i),g=e.skipSpaces(i);if(g<c&&!jh(e.src.slice(g,c)))return!1;let _=kh(e.src.slice(i,c));if(!_.name)return!1;if(r)return!0;for(a=t;a++,!(a>=n||(s=e.bMarks[a]+e.tShift[a],c=e.eMarks[a],s<c&&e.sCount[a]<e.blkIndent));){let t=e.src.charCodeAt(s);if(u){if(t===d){let t=s+1;for(;t<c&&e.src.charCodeAt(t)===d;)t++;t-s>=f&&e.skipSpaces(t)>=c&&(u=!1)}continue}if(t===96||t===126){let n=s+1;for(;n<c&&e.src.charCodeAt(n)===t;)n++;if(n-s>=3){u=!0,d=t,f=n-s;continue}}if(t===58){for(i=s+1;i<=c&&e.src[i]===`:`;i++);if(i-s===m){if(i=e.skipSpaces(i),i<c){p++;continue}if(p>0){p--;continue}o=!0;break}}}let v=e.parentType,y=e.lineMax;e.parentType=`comark_block`,e.lineMax=a;let b=e.push(`mdc_block_open`,_.name,1);if(b.markup=h,b.block=!0,b.info=_.name,b.map=[t,a],_.props?.forEach(([e,t])=>{e===`class`?b.attrJoin(e,t):b.attrSet(e,t)}),_.content!==void 0){let n=e.push(`paragraph_open`,`p`,1);n.map=[t,t+1];let r=e.push(`inline`,``,0);r.content=_.content,r.children=[],e.push(`paragraph_close`,`p`,-1)}let x=e.blkIndent;e.blkIndent=l,e.env.comarkBlockTokens||=[],e.env.comarkBlockTokens.unshift(b),e.md.block.tokenize(e,t+1,a),e.blkIndent=x,e.env.comarkBlockTokens.shift();let S=e.push(`mdc_block_close`,_.name,-1);return S.map=[t,a],S.markup=e.src.slice(s,i),S.block=!0,e.tokens.slice(e.tokens.indexOf(b)+1,e.tokens.indexOf(S)).filter(e=>e.level===b.level+1).forEach((e,t,n)=>{n.length<=2&&e.tag===`p`&&(e.hidden=!0)}),e.parentType=v,e.lineMax=y,e.line=a+ +!!o,!0},{alt:[`paragraph`,`reference`,`blockquote`,`list`]}),e.block.ruler.after(`code`,`comark_block_yaml`,function(e,t,n,r){if(!e.env.comarkBlockTokens?.length)return!1;let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.src.slice(i,a),s=Mh[o]||``;if(!s)return!1;if(o===`---`){let n=e.env.comarkBlockTokens[0].map?.[0];if(n===void 0||t!==n+1)return!1}let c=t+1,l=!1;for(;c<n;){if(e.src.slice(e.bMarks[c]+e.tShift[t],e.eMarks[c])===s){l=!0;break}c+=1}if(!l)return!1;if(!r){let n=e.src.slice(e.bMarks[t+1],e.eMarks[c-1]),r=ra(n),i=e.env.comarkBlockTokens[0];Object.entries(r||{}).forEach(([e,t])=>{e===`class`?i.attrJoin(e,t):i.attrSet(e,typeof t==`string`?t:JSON.stringify(t))})}return e.line=c+1,!0}),e.block.ruler.after(`code`,`comark_block_slots`,function(e,t,n,r){if(!e.env.comarkBlockTokens?.length)return!1;let i=e.bMarks[t]+e.tShift[t];if(e.src[i]!==`#`||e.src[i+1]===` `||e.src[i+1]===`#`)return!1;let{name:a,props:o}=kh(e.src.slice(i,e.eMarks[t]).slice(1)),s=t+1,c=!1,l=``,u=0;for(;s<n;){let n=e.src.slice(e.bMarks[s]+e.tShift[t],e.eMarks[s]);if(c){if(n[0]===l){let e=1;for(;e<n.length&&n[e]===l;)e++;e>=u&&n.slice(e).trim()===``&&(c=!1)}s+=1;continue}if(n[0]==="`"||n[0]===`~`){let e=n[0],t=1;for(;t<n.length&&n[t]===e;)t++;if(t>=3){c=!0,l=e,u=t,s+=1;continue}}if(/^#\w+/.test(n)||n.startsWith(`::`))break;s+=1}if(r)return e.line=s,!0;let d=e.lineMax,f=e.push(`mdc_block_slot`,`template`,1);return f.attrSet(`#${a}`,``),o?.forEach(([e,t])=>{e===`class`?f.attrJoin(e,t):f.attrSet(e,t)}),e.line=t+1,e.lineMax=s,e.md.block.tokenize(e,t+1,s),e.push(`mdc_block_slot`,`template`,-1),e.line=s,e.lineMax=d,!0})},Ph=new Set([` `,` `,`
13
- `,`*`,`_`,`[`]),Fh=e=>{e.inline.ruler.after(`entity`,`comark_inline_component`,(e,t)=>{let n=e.pos;if(e.src[n]!==`:`)return!1;let r=e.src[n-1];if(n>0&&!Ph.has(r))return!1;let i=n+1,a=-1,o=-1,s=-1;for(;i<e.src.length;){let t=e.src[i];if(t===`[`){a=i;let t=wh(e.src,i);t&&(o=i+1,s=t.endIndex-1,i=t.endIndex);break}if(!/[\w$-]/.test(t))break;i+=1}if(a===-1&&(a=i),a<=n+1)return!1;let c=e.src.slice(n+1,a);if(!jh(c))return!1;if(e.pos=i,t)return!0;if(o!==-1){e.push(`mdc_inline_component`,c,1);let t=e.pos,n=e.posMax;e.pos=o,e.posMax=s,e.md.inline.tokenize(e),e.pos=t,e.posMax=n,e.push(`mdc_inline_component`,c,-1)}else e.push(`mdc_inline_component`,c,0);return!0})},Ih=e=>{e.inline.ruler.before(`link`,`comark_inline_span`,(e,t)=>{let n=e.pos;if(e.src[n]!==`[`)return!1;let r=Ch(e.src,n),i=r===-1?e.src.length:r,a=e.src[i+1];if(a===`(`||a===`[`||e.linkLevel>0&&a!==`{`||t)return!1;e.push(`mdc_inline_span`,`span`,1);let o=e.pos,s=e.posMax;return e.pos=n+1,e.posMax=i,e.md.inline.tokenize(e),e.pos=o,e.posMax=s,e.push(`mdc_inline_span`,`span`,-1),e.pos=i+1,!0})},Lh=e=>{e.use(Nh),e.use(Ih),e.use(Fh)},Rh=Sh(()=>({name:`components`,markdownItPlugins:[Lh]})),zh=e=>{e.inline.ruler.after(`entity`,`comark_inline_props`,(e,t)=>{let n=e.pos;if(e.src[n]!==`{`||e.src[n+1]===`{`||e.src[n-1]===`{`||e.src[n-1]===`$`)return!1;let r=Dh(e.src,n);if(!r)return!1;let{props:i,index:a}=r;if(a===n)return!1;if(e.pos=a,t)return!0;let o=e.push(`mdc_inline_props`,`span`,0);return o.attrs=i,o.hidden=!0,!0}),e.renderer.rules.mdc_inline_props=()=>``;let t=e.parse;e.parse=function(e,n){let r=t.call(this,e,n);return r.forEach((e,t)=>{let n=r[t-1],i=r[t+1];if(!n||![`heading_open`,`paragraph_open`,`list_item_open`].includes(n.type)||n.hidden||(e.hidden&&i?.type===`inline`&&(e=i),e.type!==`inline`||!e.children?.length))return;let a=e.children[e.children.length-1];if(a.type!==`mdc_inline_props`)return;let o=e.children.length-2;for(;o>=0;){let t=e.children[o];if(t.type===`text`&&!t.content){o--;continue}break}let s=o>=0?e.children[o]:void 0;if(!s||s.type!==`text`)return;typeof s.content==`string`&&(s.content=s.content.replace(/[ \t]+$/,``));let c=a.attrs;e.children.length=s.content?o+1:o,c?.forEach(([e,t])=>{e===`class`?n.attrJoin(`class`,t):n.attrSet(e,t)})}),r},e.renderer.renderInline=Bh(e.renderer.renderInline),`renderInlineAsync`in e.renderer&&(e.renderer.renderInlineAsync=Bh(e.renderer.renderInlineAsync))};function Bh(e){return function(t,n,r){return t=[...t],t.forEach((e,n)=>{if(e.type!==`mdc_inline_props`)return;let r=n-1,i=t[r];for(;r>=0&&i.type===`text`&&!i.content.trim();)r--,i=t[r];if(!i.tag&&i.type===`text`){i=new vp(`mdc_inline_span`,`span`,1),t.splice(n-1,0,i);let e=new vp(`mdc_inline_span`,`span`,-1);t.splice(n+2,0,e)}else if(i.nesting===-1){let e=n-1;for(;e>=0;){let n=t[e];if(n.nesting===1&&n.tag===i.tag&&n.level===i.level){i=n;break}e--}}if(i.nesting===-1)throw Error(`No matching opening tag found for ${JSON.stringify(i)}`);e.attrs?.forEach(([e,t])=>{e===`class`?i.attrJoin(`class`,t):i.attrSet(e,t)})}),e.call(this,t,n,r)}}var Vh=zh,Hh=Sh(()=>({name:`attributes`,markdownItPlugins:[Vh]}));function Uh(e,t,n){let r=e.attrIndex(t),i=[t,n];r<0?(e.attrs||=[],e.attrs.push(i)):e.attrs[r]=i}function Wh(e,t){for(let n=t-1;n>=0;n--){if(e[n].type===`list_item_open`)return n;if(e[n].type===`list_item_close`)return-1}return-1}function Gh(e,t){let n=e[t].level-1;for(let r=t-1;r>=0;r--)if(e[r].level===n&&(e[r].type===`bullet_list_open`||e[r].type===`ordered_list_open`))return r;return-1}function Kh(e,t){let n=!(t?.enabled??!1);e.core.ruler.before(`inline`,`task-lists-mdc`,e=>{let t=e.tokens;for(let e=0;e<t.length;e++){let n=t[e];if(n.type===`inline`&&n.content){let r=Wh(t,e);if(r>=0){let e=n.content.match(/^(\[[ x]\])\s+/i);if(e){let i=e[1].toLowerCase()===`[x]`;Uh(t[r],`class`,`task-list-item`);let a=Gh(t,r);a>=0&&Uh(t[a],`class`,`contains-task-list`);let o=`TASK_CHECKBOX_${i?`CHECKED`:`UNCHECKED`} `;n.content=n.content.replace(/^\[[ x]\]\s+/i,o)}}}}}),e.core.ruler.after(`inline`,`task-lists-mdc-post`,e=>{let t=e.tokens;for(let r=0;r<t.length;r++){let i=t[r];if(i.type===`inline`&&i.children)for(let t=0;t<i.children.length;t++){let r=i.children[t];if(r.type===`text`&&r.content){let a=r.content.match(/^TASK_CHECKBOX_CHECKED/),o=r.content.match(/^TASK_CHECKBOX_UNCHECKED/);if(a||o){let o=!!a,s=new e.Token(`mdc_inline_component`,`input`,0);s.attrs=[[`class`,`task-list-item-checkbox`],[`type`,`checkbox`]],n&&s.attrs.push([`:disabled`,`true`]),o&&s.attrs.push([`:checked`,`true`]),r.content=r.content.replace(/^TASK_CHECKBOX_(CHECKED|UNCHECKED)/,``),i.children.splice(t,0,s),t++}}}}})}var qh=Sh(()=>({name:`task-list`,markdownItPlugins:[Kh]})),Jh={"!TIP":{type:`tip`,title:`Tip`,color:`#238636`},"!NOTE":{type:`note`,title:`Note`,color:`#1f6feb`},"!IMPORTANT":{type:`important`,title:`Important`,color:`#8957e5`},"!WARNING":{type:`warning`,title:`Warning`,color:`#9e6a03`},"!CAUTION":{type:`caution`,title:`Caution`,color:`#da3633`}},Yh=Sh(()=>({name:`alert`,post(e){da(e.tree,e=>Array.isArray(e)&&e[0]===`blockquote`,e=>{let t=e;if(e[2]?.[0]===`span`){let n=Jh[String(e[2][2]).toUpperCase()];n&&(typeof e[3]==`string`&&(t[3]=String(t[3]).trimStart()),t.splice(2,1),t[1].as=n.type)}else if(e[2]?.[0]===`p`){let n=e[2];if(n[2]?.[0]===`span`){let e=Jh[String(n[2][2]).toUpperCase()];e&&(typeof n[3]==`string`&&(n[3]=String(n[3]).trimStart()),n.splice(2,1),t[1].as=e.type)}}})}})),Xh=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Zh=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Qh=`<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>`,$h=RegExp(`^(?:${Zh}|${Qh}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),eg=RegExp(`^(?:${Zh}|${Qh})`),tg=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(${Xh.join(`|`)})(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(`${eg.source}\\s*$`),/^$/,!1]];function ng(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<tg.length&&!tg[s][0].test(o);s++);if(s===tg.length)return!1;if(r)return tg[s][2];let c=t+1;if(!tg[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),tg[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let l=e.push(`html_block`,``,1);return l.map=[t,c],l.content=e.getLines(t,c,e.blkIndent,!0),!0}function rg(e){return/^<a[>\s]/i.test(e)}function ig(e){return/^<\/a\s*>/i.test(e)}function ag(e){let t=e|32;return t>=97&&t<=122}function og(e,t){let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!ag(i))return!1;let a=e.src.slice(r).match($h);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],rg(t.content)&&e.linkLevel++,ig(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}function sg(e){e.set({html:!0}),e.inline.ruler.before(`text`,`comark_html_inline`,og),e.block.ruler.before(`html_block`,`comark_html_block`,ng,{alt:[`paragraph`,`reference`,`blockquote`]})}var cg=Sh(()=>({name:`html`,markdownItPlugins:[sg]})),lg=Sh(()=>({name:`frontmatter`,pre(e){let{content:t,data:n,frontmatterText:r}=Ca(e.markdown);e.markdown=t,e.frontmatter=n,e.frontmatterText=r,t&&r&&(e.parsedLines=(e.parsedLines??0)+r.split(`
14
- `).length+1)}}));function ug(e){if(typeof e==`string`||e.length<2)return e;let[t,n,...r]=e,i=r.filter(e=>typeof e!=`string`||e&&e.trim());if(i.length===0)return e;if(i.length>1||typeof i[0]==`string`||i[0][0]!==`p`)return[t,n,...r.map(e=>ug(e))];let a=i[0][1];return[t,a&&Object.keys(a).length>0?{...a,...n}:n,...i[0].slice(2)]}function dg(e){return e?e===!0?[`p`]:typeof e==`string`?e.split(/[,\s]/).map(e=>e.trim()).filter(Boolean):e.filter(Boolean):[]}function fg(e){return Array.isArray(e)&&typeof e[0]==`string`}function pg(e,t){return fg(e)&&(t===`*`||e[0]===t)}function mg(e,t){if(t.length===0)return e;let[n,...r]=t,i=[];for(let t of e){let e=pg(t,n)?t.slice(2):[t];for(let t of mg(e,r))i.push(t)}return i.filter(e=>typeof e!=`string`||e.trim()!==``)}function hg(e,t){if(t.length===0)return e;let n=mg(e,t),r=[];for(let e of n)typeof e==`string`&&typeof r[r.length-1]==`string`?r[r.length-1]=r[r.length-1]+e:r.push(e);return r}var Z;(function(e){e[e.Tab=9]=`Tab`,e[e.NewLine=10]=`NewLine`,e[e.FormFeed=12]=`FormFeed`,e[e.CarriageReturn=13]=`CarriageReturn`,e[e.Space=32]=`Space`,e[e.ExclamationMark=33]=`ExclamationMark`,e[e.Number=35]=`Number`,e[e.Amp=38]=`Amp`,e[e.SingleQuote=39]=`SingleQuote`,e[e.DoubleQuote=34]=`DoubleQuote`,e[e.Dash=45]=`Dash`,e[e.Slash=47]=`Slash`,e[e.Zero=48]=`Zero`,e[e.Nine=57]=`Nine`,e[e.Semi=59]=`Semi`,e[e.Lt=60]=`Lt`,e[e.Eq=61]=`Eq`,e[e.Gt=62]=`Gt`,e[e.Questionmark=63]=`Questionmark`,e[e.UpperA=65]=`UpperA`,e[e.LowerA=97]=`LowerA`,e[e.UpperF=70]=`UpperF`,e[e.LowerF=102]=`LowerF`,e[e.UpperZ=90]=`UpperZ`,e[e.LowerZ=122]=`LowerZ`,e[e.LowerX=120]=`LowerX`,e[e.OpeningSquareBracket=91]=`OpeningSquareBracket`})(Z||={});var Q;(function(e){e[e.Text=1]=`Text`,e[e.BeforeTagName=2]=`BeforeTagName`,e[e.InTagName=3]=`InTagName`,e[e.InSelfClosingTag=4]=`InSelfClosingTag`,e[e.BeforeClosingTagName=5]=`BeforeClosingTagName`,e[e.InClosingTagName=6]=`InClosingTagName`,e[e.AfterClosingTagName=7]=`AfterClosingTagName`,e[e.BeforeAttributeName=8]=`BeforeAttributeName`,e[e.InAttributeName=9]=`InAttributeName`,e[e.AfterAttributeName=10]=`AfterAttributeName`,e[e.BeforeAttributeValue=11]=`BeforeAttributeValue`,e[e.InAttributeValueDq=12]=`InAttributeValueDq`,e[e.InAttributeValueSq=13]=`InAttributeValueSq`,e[e.InAttributeValueNq=14]=`InAttributeValueNq`,e[e.BeforeDeclaration=15]=`BeforeDeclaration`,e[e.InDeclaration=16]=`InDeclaration`,e[e.InProcessingInstruction=17]=`InProcessingInstruction`,e[e.BeforeComment=18]=`BeforeComment`,e[e.CDATASequence=19]=`CDATASequence`,e[e.DeclarationSequence=20]=`DeclarationSequence`,e[e.InSpecialComment=21]=`InSpecialComment`,e[e.InCommentLike=22]=`InCommentLike`,e[e.SpecialStartSequence=23]=`SpecialStartSequence`,e[e.InSpecialTag=24]=`InSpecialTag`,e[e.InPlainText=25]=`InPlainText`,e[e.InEntity=26]=`InEntity`})(Q||={});function gg(e){return e===Z.Space||e===Z.NewLine||e===Z.Tab||e===Z.FormFeed||e===Z.CarriageReturn}function _g(e){return e===Z.Slash||e===Z.Gt||gg(e)}function vg(e){return e>=Z.LowerA&&e<=Z.LowerZ||e>=Z.UpperA&&e<=Z.UpperZ}var yg;(function(e){e[e.NoValue=0]=`NoValue`,e[e.Unquoted=1]=`Unquoted`,e[e.Single=2]=`Single`,e[e.Double=3]=`Double`})(yg||={});var $={Empty:new Uint8Array,Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,33,62]),Doctype:new Uint8Array([100,111,99,116,121,112,101]),IframeEnd:new Uint8Array([60,47,105,102,114,97,109,101]),NoembedEnd:new Uint8Array([60,47,110,111,101,109,98,101,100]),NoframesEnd:new Uint8Array([60,47,110,111,102,114,97,109,101,115]),Plaintext:new Uint8Array([60,47,112,108,97,105,110,116,101,120,116]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])},bg=new Map([[$.IframeEnd[2],$.IframeEnd],[$.NoembedEnd[2],$.NoembedEnd],[$.Plaintext[2],$.Plaintext],[$.ScriptEnd[2],$.ScriptEnd],[$.TitleEnd[2],$.TitleEnd],[$.XmpEnd[2],$.XmpEnd]]),xg=class{cbs;state=Q.Text;buffer=``;sectionStart=0;index=0;entityStart=0;baseState=Q.Text;isSpecial=!1;running=!0;offset=0;xmlMode;decodeEntities;recognizeSelfClosing;entityDecoder;constructor({xmlMode:e=!1,decodeEntities:t=!0,recognizeSelfClosing:n=e},r){this.cbs=r,this.xmlMode=e,this.decodeEntities=t,this.recognizeSelfClosing=n,this.entityDecoder=new Sa(e?nc:wa,(e,t)=>this.emitCodePoint(e,t))}reset(){this.state=Q.Text,this.buffer=``,this.sectionStart=0,this.index=0,this.baseState=Q.Text,this.isSpecial=!1,this.currentSequence=$.Empty,this.sequenceIndex=0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(e){e===Z.Lt||!this.decodeEntities&&this.fastForwardTo(Z.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=Q.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===Z.Amp&&this.startEntity()}currentSequence=$.Empty;sequenceIndex=0;enterTagBody(){this.currentSequence===$.Plaintext?(this.currentSequence=$.Empty,this.state=Q.InPlainText):this.isSpecial?(this.state=Q.InSpecialTag,this.sequenceIndex=0):this.state=Q.Text}stateSpecialStartSequence(e){let t=e|32;if(this.sequenceIndex<this.currentSequence.length){if(t===this.currentSequence[this.sequenceIndex]){this.sequenceIndex++;return}if(this.sequenceIndex===3){if(this.currentSequence===$.ScriptEnd&&t===$.StyleEnd[3]){this.currentSequence=$.StyleEnd,this.sequenceIndex=4;return}if(this.currentSequence===$.TitleEnd&&t===$.TextareaEnd[3]){this.currentSequence=$.TextareaEnd,this.sequenceIndex=4;return}}else if(this.sequenceIndex===4&&this.currentSequence===$.NoembedEnd&&t===$.NoframesEnd[4]){this.currentSequence=$.NoframesEnd,this.sequenceIndex=5;return}}else if(_g(e)){this.sequenceIndex=0,this.state=Q.InTagName,this.stateInTagName(e);return}this.isSpecial=!1,this.currentSequence=$.Empty,this.sequenceIndex=0,this.state=Q.InTagName,this.stateInTagName(e)}stateCDATASequence(e){e===$.Cdata[this.sequenceIndex]?++this.sequenceIndex===$.Cdata.length&&(this.state=Q.InCommentLike,this.currentSequence=$.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.xmlMode?(this.state=Q.InDeclaration,this.stateInDeclaration(e)):(this.state=Q.InSpecialComment,this.stateInSpecialComment(e)))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}emitComment(e){this.cbs.oncomment(this.sectionStart,this.index,e),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=Q.Text}stateInCommentLike(e){!this.xmlMode&&this.currentSequence===$.CommentEnd&&this.sequenceIndex<=1&&this.index===this.sectionStart+this.sequenceIndex&&e===Z.Gt?this.emitComment(this.sequenceIndex):this.currentSequence===$.CommentEnd&&this.sequenceIndex===2&&e===Z.Gt?this.emitComment(2):this.currentSequence===$.CommentEnd&&this.sequenceIndex===this.currentSequence.length-1&&e!==Z.Gt?this.sequenceIndex=Number(e===Z.Dash):e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===$.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,3),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=Q.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!_g(e):vg(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(_g(e)){let t=this.index-this.currentSequence.length;if(this.sectionStart<t){let e=this.index;this.index=t,this.cbs.ontext(this.sectionStart,t),this.index=e}this.isSpecial=!1,this.sectionStart=t+2,this.stateInClosingTagName(e);return}this.sequenceIndex=0}(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===$.TitleEnd||this.currentSequence===$.TextareaEnd?this.decodeEntities&&e===Z.Amp&&this.startEntity():this.fastForwardTo(Z.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=Number(e===Z.Lt)}stateBeforeTagName(e){if(e===Z.ExclamationMark)this.state=Q.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===Z.Questionmark)this.xmlMode?(this.state=Q.InProcessingInstruction,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.state=Q.InSpecialComment,this.sectionStart=this.index);else if(this.isTagStartChar(e)){this.sectionStart=this.index;let t=this.xmlMode||this.cbs.isInForeignContext?.()?void 0:bg.get(e|32);t===void 0?this.state=Q.InTagName:(this.isSpecial=!0,this.currentSequence=t,this.sequenceIndex=3,this.state=Q.SpecialStartSequence)}else e===Z.Slash?this.state=Q.BeforeClosingTagName:(this.state=Q.Text,this.stateText(e))}stateInTagName(e){_g(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=Q.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){gg(e)?this.xmlMode||(this.state=Q.InSpecialComment,this.sectionStart=this.index):e===Z.Gt?(this.state=Q.Text,this.xmlMode||(this.sectionStart=this.index+1)):(this.state=this.isTagStartChar(e)?Q.InClosingTagName:Q.InSpecialComment,this.sectionStart=this.index)}stateInClosingTagName(e){_g(e)&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=Q.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===Z.Gt||this.fastForwardTo(Z.Gt))&&(this.state=Q.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===Z.Gt?(this.cbs.onopentagend(this.index),this.enterTagBody(),this.sectionStart=this.index+1):e===Z.Slash?this.state=Q.InSelfClosingTag:gg(e)||(this.state=Q.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){if(e===Z.Gt){if(this.cbs.onselfclosingtag(this.index),this.sectionStart=this.index+1,!this.recognizeSelfClosing){this.enterTagBody();return}this.state=Q.Text,this.isSpecial=!1,this.currentSequence=$.Empty}else gg(e)||(this.state=Q.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===Z.Eq||_g(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=Q.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===Z.Eq?this.state=Q.BeforeAttributeValue:e===Z.Slash||e===Z.Gt?(this.cbs.onattribend(yg.NoValue,this.sectionStart),this.sectionStart=-1,this.state=Q.BeforeAttributeName,this.stateBeforeAttributeName(e)):gg(e)||(this.cbs.onattribend(yg.NoValue,this.sectionStart),this.state=Q.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===Z.DoubleQuote?(this.state=Q.InAttributeValueDq,this.sectionStart=this.index+1):e===Z.SingleQuote?(this.state=Q.InAttributeValueSq,this.sectionStart=this.index+1):gg(e)||(this.sectionStart=this.index,this.state=Q.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,t){e===t||!this.decodeEntities&&this.fastForwardTo(t)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(t===Z.DoubleQuote?yg.Double:yg.Single,this.index+1),this.state=Q.BeforeAttributeName):this.decodeEntities&&e===Z.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,Z.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,Z.SingleQuote)}stateInAttributeValueNoQuotes(e){gg(e)||e===Z.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(yg.Unquoted,this.index),this.state=Q.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===Z.Amp&&this.startEntity()}stateBeforeDeclaration(e){e===Z.OpeningSquareBracket?(this.state=Q.CDATASequence,this.sequenceIndex=0):this.xmlMode?this.state=e===Z.Dash?Q.BeforeComment:Q.InDeclaration:(e|32)===$.Doctype[0]?(this.state=Q.DeclarationSequence,this.currentSequence=$.Doctype,this.sequenceIndex=1):e===Z.Gt?(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=Q.Text,this.sectionStart=this.index+1):this.state=e===Z.Dash?Q.BeforeComment:Q.InSpecialComment}stateDeclarationSequence(e){this.sequenceIndex===this.currentSequence.length?(this.state=Q.InDeclaration,this.stateInDeclaration(e)):(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:e===Z.Gt?(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=Q.Text,this.sectionStart=this.index+1):this.state=Q.InSpecialComment}stateInDeclaration(e){(e===Z.Gt||this.fastForwardTo(Z.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=Q.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){e===Z.Questionmark?this.sequenceIndex=1:e===Z.Gt&&this.sequenceIndex===1?(this.cbs.onprocessinginstruction(this.sectionStart,this.index-1),this.sequenceIndex=0,this.state=Q.Text,this.sectionStart=this.index+1):this.sequenceIndex=Number(this.fastForwardTo(Z.Questionmark))}stateBeforeComment(e){e===Z.Dash?(this.state=Q.InCommentLike,this.currentSequence=$.CommentEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):this.xmlMode?this.state=Q.InDeclaration:e===Z.Gt?(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=Q.Text,this.sectionStart=this.index+1):this.state=Q.InSpecialComment}stateInSpecialComment(e){(e===Z.Gt||this.fastForwardTo(Z.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=Q.Text,this.sectionStart=this.index+1)}startEntity(){this.baseState=this.state,this.state=Q.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?ia.Strict:this.baseState===Q.Text||this.baseState===Q.InSpecialTag?ia.Legacy:ia.Attribute)}stateInEntity(){let e=this.index-this.offset,t=this.entityDecoder.write(this.buffer,e);if(t>=0)this.state=this.baseState,t===0&&--this.index;else{if(e<this.buffer.length&&this.buffer.charCodeAt(e)===Z.Amp){this.state=this.baseState,--this.index;return}this.index=this.offset+this.buffer.length-1}}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===Q.Text||this.state===Q.InPlainText||this.state===Q.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===Q.InAttributeValueDq||this.state===Q.InAttributeValueSq||this.state===Q.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){let e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case Q.Text:this.stateText(e);break;case Q.InPlainText:this.index=this.buffer.length+this.offset-1;break;case Q.SpecialStartSequence:this.stateSpecialStartSequence(e);break;case Q.InSpecialTag:this.stateInSpecialTag(e);break;case Q.CDATASequence:this.stateCDATASequence(e);break;case Q.DeclarationSequence:this.stateDeclarationSequence(e);break;case Q.InAttributeValueDq:this.stateInAttributeValueDoubleQuotes(e);break;case Q.InAttributeName:this.stateInAttributeName(e);break;case Q.InCommentLike:this.stateInCommentLike(e);break;case Q.InSpecialComment:this.stateInSpecialComment(e);break;case Q.BeforeAttributeName:this.stateBeforeAttributeName(e);break;case Q.InTagName:this.stateInTagName(e);break;case Q.InClosingTagName:this.stateInClosingTagName(e);break;case Q.BeforeTagName:this.stateBeforeTagName(e);break;case Q.AfterAttributeName:this.stateAfterAttributeName(e);break;case Q.InAttributeValueSq:this.stateInAttributeValueSingleQuotes(e);break;case Q.BeforeAttributeValue:this.stateBeforeAttributeValue(e);break;case Q.BeforeClosingTagName:this.stateBeforeClosingTagName(e);break;case Q.AfterClosingTagName:this.stateAfterClosingTagName(e);break;case Q.InAttributeValueNq:this.stateInAttributeValueNoQuotes(e);break;case Q.InSelfClosingTag:this.stateInSelfClosingTag(e);break;case Q.InDeclaration:this.stateInDeclaration(e);break;case Q.BeforeDeclaration:this.stateBeforeDeclaration(e);break;case Q.BeforeComment:this.stateBeforeComment(e);break;case Q.InProcessingInstruction:this.stateInProcessingInstruction(e);break;case Q.InEntity:this.stateInEntity()}this.index++}this.cleanup()}finish(){this.state===Q.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingCommentLikeData(e){if(this.state!==Q.InCommentLike)return!1;if(this.currentSequence===$.CdataEnd){if(this.xmlMode)this.sectionStart<e&&this.cbs.oncdata(this.sectionStart,e,0);else{let t=this.sectionStart-$.Cdata.length-1;this.cbs.oncomment(t,e,0)}}else{let t=this.xmlMode?0:Math.min(this.sequenceIndex,$.CommentEnd.length-1);this.cbs.oncomment(this.sectionStart,e,t)}return!0}handleTrailingMarkupDeclaration(e){if(this.xmlMode)switch(this.state){case Q.InSpecialComment:case Q.BeforeComment:case Q.CDATASequence:case Q.DeclarationSequence:case Q.InDeclaration:return this.cbs.ontext(this.sectionStart,e),!0;default:return!1}switch(this.state){case Q.BeforeDeclaration:case Q.InSpecialComment:case Q.BeforeComment:case Q.CDATASequence:return this.cbs.oncomment(this.sectionStart,e,0),!0;case Q.DeclarationSequence:return this.sequenceIndex!==$.Doctype.length&&this.cbs.oncomment(this.sectionStart,e,0),!0;case Q.InDeclaration:return!0;default:return!1}}handleTrailingData(){let e=this.buffer.length+this.offset;if(!(this.handleTrailingCommentLikeData(e)||this.handleTrailingMarkupDeclaration(e))&&!(this.sectionStart>=e))switch(this.state){case Q.InTagName:case Q.BeforeAttributeName:case Q.BeforeAttributeValue:case Q.AfterAttributeName:case Q.InAttributeName:case Q.InAttributeValueSq:case Q.InAttributeValueDq:case Q.InAttributeValueNq:case Q.InClosingTagName:break;default:this.cbs.ontext(this.sectionStart,e)}}emitCodePoint(e,t){this.baseState!==Q.Text&&this.baseState!==Q.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.onattribentity(e)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.ontextentity(e,this.sectionStart))}},{fromCodePoint:Sg}=String,Cg=new Set([`input`,`option`,`optgroup`,`select`,`button`,`datalist`,`textarea`]),wg=new Set([`p`]),Tg=new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`p`]),Eg=new Set([`thead`,`tbody`]),Dg=new Set([`dd`,`dt`]),Og=new Set([`rt`,`rp`]),kg=new Map([[`tr`,new Set([`tr`,`th`,`td`])],[`th`,new Set([`th`])],[`td`,new Set([`thead`,`th`,`td`])],[`body`,new Set([`head`,`link`,`script`])],[`a`,new Set([`a`])],[`li`,new Set([`li`])],[`p`,wg],[`h1`,Tg],[`h2`,Tg],[`h3`,Tg],[`h4`,Tg],[`h5`,Tg],[`h6`,Tg],[`select`,Cg],[`input`,Cg],[`output`,Cg],[`button`,Cg],[`datalist`,Cg],[`textarea`,Cg],[`option`,new Set([`option`])],[`optgroup`,new Set([`optgroup`,`option`])],[`dd`,Dg],[`dt`,Dg],[`address`,wg],[`article`,wg],[`aside`,wg],[`blockquote`,wg],[`details`,wg],[`div`,wg],[`dl`,wg],[`fieldset`,wg],[`figcaption`,wg],[`figure`,wg],[`footer`,wg],[`form`,wg],[`header`,wg],[`hr`,wg],[`main`,wg],[`nav`,wg],[`ol`,wg],[`pre`,wg],[`section`,wg],[`table`,wg],[`ul`,wg],[`rt`,Og],[`rp`,Og],[`tbody`,Eg],[`tfoot`,Eg]]),Ag=`doctype`,jg=new Set([`area`,`base`,`basefont`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`img`,`input`,`isindex`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),Mg=new Set([`math`,`svg`]),Ng=new Set([`mi`,`mo`,`mn`,`ms`,`mtext`,`annotation-xml`,`foreignObject`,`desc`,`title`]),Pg=new Map([[`altglyph`,`altGlyph`],[`altglyphdef`,`altGlyphDef`],[`altglyphitem`,`altGlyphItem`],[`animatecolor`,`animateColor`],[`animatemotion`,`animateMotion`],[`animatetransform`,`animateTransform`],[`clippath`,`clipPath`],[`feblend`,`feBlend`],[`fecolormatrix`,`feColorMatrix`],[`fecomponenttransfer`,`feComponentTransfer`],[`fecomposite`,`feComposite`],[`feconvolvematrix`,`feConvolveMatrix`],[`fediffuselighting`,`feDiffuseLighting`],[`fedisplacementmap`,`feDisplacementMap`],[`fedistantlight`,`feDistantLight`],[`fedropshadow`,`feDropShadow`],[`feflood`,`feFlood`],[`fefunca`,`feFuncA`],[`fefuncb`,`feFuncB`],[`fefuncg`,`feFuncG`],[`fefuncr`,`feFuncR`],[`fegaussianblur`,`feGaussianBlur`],[`feimage`,`feImage`],[`femerge`,`feMerge`],[`femergenode`,`feMergeNode`],[`femorphology`,`feMorphology`],[`feoffset`,`feOffset`],[`fepointlight`,`fePointLight`],[`fespecularlighting`,`feSpecularLighting`],[`fespotlight`,`feSpotLight`],[`fetile`,`feTile`],[`feturbulence`,`feTurbulence`],[`foreignobject`,`foreignObject`],[`glyphref`,`glyphRef`],[`lineargradient`,`linearGradient`],[`radialgradient`,`radialGradient`],[`textpath`,`textPath`]]),Fg;(function(e){e[e.None=0]=`None`,e[e.Svg=1]=`Svg`,e[e.MathML=2]=`MathML`})(Fg||={});var Ig=/\s|\//,Lg=class{options;startIndex=0;endIndex=0;openTagStart=0;tagname=``;attribname=``;attribvalue=``;attribs=null;stack=[];foreignContext;cbs;lowerCaseTagNames;lowerCaseAttributeNames;recognizeSelfClosing;htmlMode;tokenizer;buffers=[];bufferOffset=0;writeIndex=0;ended=!1;constructor(e,t={}){this.options=t,this.cbs=e??{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=t.lowerCaseTags??this.htmlMode,this.lowerCaseAttributeNames=t.lowerCaseAttributeNames??this.htmlMode,this.recognizeSelfClosing=t.recognizeSelfClosing??!this.htmlMode,this.tokenizer=new(t.Tokenizer??xg)(this.options,this),this.foreignContext=[Fg.None],this.cbs.onparserinit?.(this)}ontext(e,t){let n=this.getSlice(e,t);this.endIndex=t-1,this.cbs.ontext?.(n),this.startIndex=t}ontextentity(e,t){this.endIndex=t-1,this.cbs.ontext?.(Sg(e)),this.startIndex=t}isInForeignContext(){return this.foreignContext[0]!==Fg.None}isVoidElement(e){return this.htmlMode&&jg.has(e)}readTagName(e,t){let n=this.lowerCaseTagNames?this.getSlice(e,t).toLowerCase():this.getSlice(e,t);if(!(this.lowerCaseTagNames&&this.htmlMode))return n;if(this.foreignContext[0]===Fg.Svg)return Pg.get(n)??n;if(this.foreignContext.length>1){let e=Pg.get(n);if(e!==void 0&&this.stack.includes(e))return e}return this.isInForeignContext()?n:n===`image`?`img`:n}onopentagname(e,t){this.endIndex=t,this.emitOpenTag(this.readTagName(e,t))}emitOpenTag(e){if(this.openTagStart=this.startIndex,this.tagname=e,this.htmlMode&&e===`form`&&this.stack.includes(`form`)){this.tagname=``;return}let t=this.htmlMode&&kg.get(e);if(t)for(;this.stack.length>0&&t.has(this.stack[0]);)this.popElement(!0);this.isVoidElement(e)||(this.stack.unshift(e),this.htmlMode&&(e===`svg`?this.foreignContext.unshift(Fg.Svg):e===`math`?this.foreignContext.unshift(Fg.MathML):Ng.has(e)&&this.foreignContext.unshift(Fg.None))),this.cbs.onopentagname?.(e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){this.startIndex=this.openTagStart,this.attribs&&=(this.cbs.onopentag?.(this.tagname,this.attribs,e),null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=``}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,t){this.endIndex=t;let n=this.readTagName(e,t);if(this.isVoidElement(n))this.htmlMode&&n===`br`&&(this.cbs.onopentagname?.(`br`),this.cbs.onopentag?.(`br`,{},!0),this.cbs.onclosetag?.(`br`,!1));else{let e=this.stack.indexOf(n);if(e!==-1){for(let t=0;t<e;t++)this.popElement(!0);this.popElement(!1)}else this.htmlMode&&n===`p`&&(this.emitOpenTag(`p`),this.closeCurrentTag(!0))}this.startIndex=t+1}onselfclosingtag(e){this.endIndex=e,this.recognizeSelfClosing||this.isInForeignContext()?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}popElement(e){let t=this.stack.shift();this.htmlMode&&(Mg.has(t)||Ng.has(t))&&this.foreignContext.shift(),this.cbs.onclosetag?.(t,e)}closeCurrentTag(e){let t=this.tagname;this.endOpenTag(e),this.stack[0]===t&&this.popElement(!e)}onattribname(e,t){this.startIndex=e;let n=this.getSlice(e,t);this.attribname=this.lowerCaseAttributeNames?n.toLowerCase():n}onattribdata(e,t){this.attribvalue+=this.getSlice(e,t)}onattribentity(e){this.attribvalue+=Sg(e)}onattribend(e,t){this.endIndex=t,this.cbs.onattribute?.(this.attribname,this.attribvalue,e===yg.Double?`"`:e===yg.Single?`'`:e===yg.NoValue?void 0:null),this.attribs&&!Object.hasOwn(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=``}getInstructionName(e){let t=e.search(Ig),n=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(n=n.toLowerCase()),n}ondeclaration(e,t){this.endIndex=t;let n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){let e=this.htmlMode?this.lowerCaseTagNames?Ag:n.slice(0,7):this.getInstructionName(n);this.cbs.onprocessinginstruction(`!${e}`,`!${n}`)}this.startIndex=t+1}onprocessinginstruction(e,t){this.endIndex=t;let n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){let e=this.getInstructionName(n);this.cbs.onprocessinginstruction(`?${e}`,`?${n}`)}this.startIndex=t+1}oncomment(e,t,n){this.endIndex=t,this.cbs.oncomment?.(this.getSlice(e,t-n)),this.cbs.oncommentend?.(),this.startIndex=t+1}oncdata(e,t,n){this.endIndex=t;let r=this.getSlice(e,t-n);!this.htmlMode||this.options.recognizeCDATA?(this.cbs.oncdatastart?.(),this.cbs.ontext?.(r),this.cbs.oncdataend?.()):this.isInForeignContext()?this.cbs.ontext?.(r):(this.cbs.oncomment?.(`[CDATA[${r}]]`),this.cbs.oncommentend?.()),this.startIndex=t+1}onend(){if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let e=0;e<this.stack.length;e++)this.cbs.onclosetag(this.stack[e],!0)}this.cbs.onend?.()}reset(){this.cbs.onreset?.(),this.tokenizer.reset(),this.tagname=``,this.attribname=``,this.attribvalue=``,this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,this.cbs.onparserinit?.(this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(Fg.None),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,t){if(e===t)return``;for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let n=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);for(;t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),n+=this.buffers[0].slice(0,t-this.bufferOffset);return n}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){if(this.ended){this.cbs.onerror?.(Error(`.write() after done!`));return}this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++)}end(e){if(this.ended){this.cbs.onerror?.(Error(`.end() after done!`));return}e&&this.write(e),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}},Rg=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function zg(e,t=!1){let n={$:{html:1,block:+!t}};for(let t in e){let r=e[t];r===``?n[`:${t}`]=`true`:n[t]=r}return n}function Bg(e){let t=e.trim();if(!t.startsWith(`<`))return null;let n=t.match(/^<\/([a-z][a-z0-9]*)\s*>/i);if(n)return{tag:n[1].toLowerCase(),attrs:{},isVoid:!1,isClose:!0};let r=null,i=new Lg({onopentag(e,t){r={tag:e,attrs:zg(t,!0),isVoid:Rg.has(e),isClose:!1}}},{decodeEntities:!1});return i.write(t),i.end(),r}function Vg(e){let t=[],n=[],r=new Lg({onopentag(e,r){let i=zg(r);if(Rg.has(e)){let r=[e,i];n.length>0?n[n.length-1].children.push(r):t.push(r);return}n.push({tag:e,attrs:i,children:[]})},ontext(e){let r=e.trim();r&&(n.length>0?n[n.length-1].children.push(r):t.push(r))},onclosetag(e){if(Rg.has(e))return;let r=n.length-1;for(;r>=0&&n[r].tag!==e;)r--;if(r>=0)for(;n.length>r;){let e=n.pop(),r=e.children.length>0?[e.tag,e.attrs,...e.children]:[e.tag,e.attrs];n.length>0?n[n.length-1].children.push(r):t.push(r)}},oncomment(e){let r=[null,{},e];n.length>0?n[n.length-1].children.push(r):t.push(r)}},{decodeEntities:!0});return r.write(e.trim()),r.end(),t}var Hg=new Set([`ul`,`ol`,`table`,`blockquote`,`pre`]),Ug={blockquote_open:`blockquote`,ordered_list_open:`ol`,bullet_list_open:`ul`,list_item_open:`li`,paragraph_open:`p`,table_open:`table`,thead_open:`thead`,tbody_open:`tbody`,tr_open:`tr`,th_open:`th`,td_open:`td`},Wg={strong_open:`strong`,em_open:`em`,s_open:`del`,sub_open:`sub`,sup_open:`sup`};function Gg(e,t){let n={startLine:0,preservePositions:!1,headingIds:!0,...t},r={headingSlugCounts:new Map,headingStack:[],preservePositions:n.preservePositions,headingIds:n.headingIds??!0},i=[],a=0,o=n.startLine;for(;a<e.length;){if(e[a].type===`html_block`){let t=Kg(e,a);i.push(...t.nodes),a=t.nextIndex;continue}let t=Xg(e,a,!1,r);if(t.node){if(n.preservePositions){for(let r=a;r<t.nextIndex;r++)e[r].map&&e[r].map[1]&&(o=e[r].map[1]+n.startLine+ +!!e[r].type?.endsWith(`_close`));t.node[1].$||(t.node[1].$={}),t.node[1].$.line=o}i.push(t.node)}a=t.nextIndex}return i}function Kg(e,t){return{nodes:Vg(typeof e[t]?.content==`string`?e[t].content:``),nextIndex:t+1}}function qg(e,t={}){let{handleJSON:n=!0,filterEmpty:r=!1}=t,i={};if(!e||!Array.isArray(e))return i;for(let t of e)if(Array.isArray(t)&&t.length>=2){let[e]=t,a=t[1];if(r&&(a===``||a==null))continue;if(n&&typeof a==`string`){if(a.startsWith(`{`)&&a.endsWith(`}`))try{a=JSON.parse(a)}catch{}else if(a.startsWith(`[`)&&a.endsWith(`]`))try{a=JSON.parse(a)}catch{}}i[e]=e===`class`&&typeof i[e]==`string`?`${i[e]} ${a}`:a}return i}function Jg(e){if(!e)return{language:``};let t={language:``},n=e.trim(),r=n.match(/^([^\s[{]+)/);for(r&&(t.language=r[1],n=n.slice(r[1].length).trim());n&&(n.startsWith(`{`)||n.startsWith(`[`));)if(n.startsWith(`{`)){let e=n.match(/^\{([^}]+)\}/);if(e){let r=e[1];n=n.slice(e[0].length).trim();let i=[],a=r.split(`,`);for(let e of a){let t=e.trim();if(t.includes(`-`)){let[e,n]=t.split(`-`).map(e=>Number.parseInt(e.trim(),10));if(!Number.isNaN(e)&&!Number.isNaN(n))for(let t=e;t<=n;t++)i.push(t)}else{let e=Number.parseInt(t,10);Number.isNaN(e)||i.push(e)}}i.length>0&&(t.highlights=i)}else break}else if(n.startsWith(`[`)){let e=0,r=0;for(;r<n.length;r++)if(n[r]===`[`)e++;else if(n[r]===`]`&&(e--,e===0)){t.filename=n.slice(1,r).replace(/\\\\/g,``),n=n.slice(r+1).trim();break}if(e!==0)break}return n&&(t.meta=n),t}function Yg(e,t,n=!0){let r=t;if(n)for(;r<e.length&&e[r].type===`text`&&!e[r].content?.trim();)r++;if(r<e.length&&e[r].type===`mdc_inline_props`){let t=e[r];return{attrs:qg(t.attrs),nextIndex:r+1}}return{attrs:{},nextIndex:t}}function Xg(e,t,n=!1,r){let i=e[t];if(i.type===`hr`)return{node:[`hr`,{}],nextIndex:t+1};if(i.type===`html_block`){let n=Kg(e,t);return{node:n.nodes[0]??null,nextIndex:n.nextIndex}}if(i.type===`mdc_block_open`){let n=i.tag||`component`,a=qg(i.attrs),o=Zg(e,t+1,`mdc_block_close`,r);if(Hg.has(n)&&o.nodes.length===1&&Array.isArray(o.nodes[0])&&o.nodes[0][0]===n){let e=o.nodes[0],t=e[1],r=e.slice(2);return{node:[n,{...t,...a},...r],nextIndex:o.nextIndex+1}}return{node:[n,a,...o.nodes],nextIndex:o.nextIndex+1}}if(i.type===`mdc_block_shorthand`){let n=t+1,r=i.tag||`component`,a=qg(i.attrs,{handleJSON:!1}),o=[];if(i.nesting===1)for(;n<e.length;){let t=e[n];if(n++,t.type===`mdc_block_shorthand`&&t.nesting===-1)break;if(t.type===`inline`){let e=i_(t.children||[],!1);o.push(...e)}}return{node:[r,a,...o],nextIndex:n}}if(i.type===`math_block`)return{node:[`math`,{class:`math block`,content:i.content},i.content],nextIndex:t+1};if(i.type===`fence`||i.type===`fenced_code_block`||i.type===`code_block`){let e=i.content||``,n=Jg(i.info||i.params||``),r={};n.language&&n.language.trim()&&(r.language=n.language),n.filename&&(r.filename=n.filename),n.highlights&&(r.highlights=n.highlights),n.meta&&(r.meta=n.meta);let a={};return n.language&&n.language.trim()&&(a.class=`language-${n.language}`),{node:[`pre`,r,[`code`,a,e.endsWith(`
15
- `)?e.slice(0,-1):e]],nextIndex:t+1}}if(i.type===`heading_open`){let a=Number.parseInt(i.tag.replace(`h`,``),10),o=`h${a}`,s=qg(i.attrs,{handleJSON:!1}),c=Qg(e,t+1,`heading_close`,!0,!0,n,r);if(c.nodes.length>0){let e;return e=r?.headingIds?{id:r_(n_(t_(c.nodes)),a,r),...s}:s,{node:[o,e,...c.nodes],nextIndex:c.nextIndex+1}}return{node:null,nextIndex:c.nextIndex+1}}if(i.type===`list_item_open`){let n=qg(i.attrs,{handleJSON:!1}),a=Qg(e,t+1,`list_item_close`,!1,!1,!0,r);return a.nodes.length>0?{node:[`li`,n,...a.nodes],nextIndex:a.nextIndex+1}:{node:null,nextIndex:a.nextIndex+1}}let a=Ug[i.type];if(a){let n=qg(i.attrs,{handleJSON:!1}),o=i.type.replace(`_open`,`_close`),s=[`td`,`th`].includes(a),c=Qg(e,t+1,o,!1,!1,s,r);return{node:[a,n,...c.nodes],nextIndex:c.nextIndex+1}}return{node:[i.tag||`component`,qg(i.attrs,{handleJSON:!1})],nextIndex:t+1}}function Zg(e,t,n,r){let i=[],a=t,o=null,s={},c=[];for(;a<e.length&&e[a].type!==n;){let t=e[a];if(t.type===`html_block`){let t=Kg(e,a);o===null?i.push(...t.nodes):c.push(...t.nodes),a=t.nextIndex;continue}if(t.type===`mdc_block_slot`){if(t.attrs&&Array.isArray(t.attrs)&&t.attrs.length>0){let e=t.attrs[0];if(Array.isArray(e)&&e.length>0){let n=e[0];if(n.startsWith(`#`)){let e=n.substring(1),r=qg(t.attrs.slice(1));o!==null&&c.length>0&&(i.push([`template`,{name:o,...s},...c]),c=[]),o=e,s=r,a++;continue}}}a++;continue}let n=Xg(e,a,!1,r);a=n.nextIndex,n.node&&(o===null?i.push(n.node):c.push(n.node))}return o!==null&&c.length>0&&i.push([`template`,{name:o,...s},...c]),{nodes:i,nextIndex:a}}function Qg(e,t,n,r,i=!1,a=!1,o){let s=[],c=t;for(;c<e.length&&e[c].type!==n;){let t=e[c];if(t.type===`html_block`){let t=Kg(e,c);s.push(...t.nodes),c=t.nextIndex;continue}if(t.type===`inline`){let e=i_(t.children||[],i);s.push(...e),c++}else if(t.type===`hardbreak`||t.type===`hard_break`)s.push([`br`,{}]),c++;else if(t.type===`softbreak`)s.push(`
16
- `),c++;else if(r&&(t.type===`text`||t.type===`code_inline`))t.content&&s.push(t.content),c++;else{let t=Xg(e,c,a,o);c=t.nextIndex,t.node&&s.push(t.node)}}return{nodes:$g(s),nextIndex:c}}function $g(e){let t=[];for(let n of e){let e=t[t.length-1];typeof n==`string`&&typeof e==`string`?t[t.length-1]=e+n:t.push(n)}return t}var e_=new Set(`a.abbr.b.bdi.bdo.cite.code.data.del.dfn.em.i.img.ins.kbd.mark.q.rp.rt.ruby.s.samp.small.span.strong.sub.sup.time.u.var.wbr`.split(`.`));function t_(e){let t=``;for(let n of e)if(typeof n==`string`)t+=n;else if(Array.isArray(n)){let e=n[0],r=n.slice(2);if(e===`br`||e===`html_inline`)continue;typeof e==`string`&&!e_.has(e)&&(t+=` `+e+` `),r.length>0&&(t+=t_(r))}return t}function n_(e){let t=e.toLowerCase().trim().replace(/\s+/g,`-`).replace(/[^\w-]+/g,``).replace(/-{2,}/g,`-`).replace(/^-+|-+$/g,``);return/^\d/.test(t)&&(t=`_`+t),t}function r_(e,t,n){if(!n)return e;for(;n.headingStack.length>0&&n.headingStack[n.headingStack.length-1].level>=t;)n.headingStack.pop();if(n.headingStack.length>0){let t=n.headingStack[n.headingStack.length-1];t.level>=2&&(e=t.id+`-`+e)}n.headingStack.push({level:t,id:e});let r=n.headingSlugCounts.get(e)??0;return n.headingSlugCounts.set(e,r+1),r===0?e:`${e}-${r}`}function i_(e,t=!1){let n=[],r=0;for(;r<e.length;){let i=e[r];if(i.type===`mdc_inline_props`&&i.hidden){r++;continue}let a=a_(e,r,t);r=a.nextIndex,a.node&&n.push(a.node)}return $g(n)}function a_(e,t,n=!1){let r=e[t];if(r.type===`text`||r.type===`emoji`)return{node:r.content||null,nextIndex:t+1};if(r.type===`html_inline`){let i=r.content||``,a=Bg(i);if(!a)return{node:i||null,nextIndex:t+1};if(a.isClose)return{node:null,nextIndex:t+1};if(a.isVoid)return{node:[a.tag,a.attrs],nextIndex:t+1};let o=[],s=t+1;for(;s<e.length;){let t=e[s];if(t.type===`html_inline`){let e=Bg(t.content||``);if(e?.isClose&&e.tag===a.tag){s++;break}}let r=a_(e,s,n);s=r.nextIndex,r.node&&o.push(r.node)}return{node:o.length>0?[a.tag,a.attrs,...o]:[a.tag,a.attrs],nextIndex:s}}if(r.type===`mdc_inline_span`&&r.nesting===1){let r={},i=t+1,a=[];for(;i<e.length;){let t=e[i];if(t.type===`mdc_inline_span`&&t.nesting===-1)break;if(t.type===`text`&&!t.content?.trim()){i++;continue}let r=a_(e,i,n);i=r.nextIndex,r.node&&a.push(r.node)}let{attrs:o,nextIndex:s}=Yg(e,i+1);return Object.assign(r,o),a.length>0||Object.keys(r).length>0?{node:[`span`,r,...a],nextIndex:s}:{node:null,nextIndex:s}}if(r.type===`mdc_inline_span`&&r.nesting===-1)return{node:null,nextIndex:t+1};if(r.type===`code_inline`){let{attrs:n,nextIndex:i}=Yg(e,t+1);return r.content?{node:[`code`,n,r.content],nextIndex:i}:{node:null,nextIndex:i}}if(r.type===`hardbreak`||r.type===`hard_break`)return{node:[`br`,{}],nextIndex:t+1};if(r.type===`softbreak`)return{node:`
17
- `,nextIndex:t+1};if(r.type===`mdc_inline_component`){let i=r.tag||`component`;if(r.nesting===1){let r=[],a=t+1;for(;a<e.length;){let t=e[a];if(t.type===`mdc_inline_component`&&t.nesting===-1){let{attrs:t,nextIndex:n}=Yg(e,a+1,!1);return{node:[i,t,...r],nextIndex:n}}let o=a_(e,a,n);a=o.nextIndex,o.node&&r.push(o.node)}return{node:[i,{},...r],nextIndex:a}}if(r.nesting===-1)return{node:null,nextIndex:t+1};{let n={},{attrs:a,nextIndex:o}=Yg(e,t+1,!1);Object.assign(n,a);let s=qg(r.attrs,{handleBoolean:!1});Object.assign(n,s);let c=Object.keys(a).length>0?o:t+1;return{node:[i,n],nextIndex:c}}}if(r.type===`image`){let n=qg(r.attrs,{handleJSON:!1,filterEmpty:!0});r.content&&(n.alt=r.content);let{attrs:i,nextIndex:a}=Yg(e,t+1);return Object.assign(n,i),{node:[`img`,n],nextIndex:a}}if(r.type===`link_open`){let i=qg(r.attrs,{handleJSON:!1}),a=o_(e,t+1,`link_close`,n),{attrs:o,nextIndex:s}=Yg(e,a.nextIndex+1);return Object.assign(i,o),a.nodes.length>0?{node:[`a`,i,...a.nodes],nextIndex:s}:{node:null,nextIndex:s}}if(r.type===`math_inline`)return{node:[`math`,{class:`math inline`,content:r.content},r.content],nextIndex:t+1};let i=Wg[r.type];if(i){let a=r.type.replace(`_open`,`_close`),o=o_(e,t+1,a,n),{attrs:s,nextIndex:c}=Yg(e,o.nextIndex+1);return o.nodes.length>0?{node:[i,s,...o.nodes],nextIndex:c}:{node:null,nextIndex:c}}if(r.children){let e=i_(r.children,n);return{node:e.length===1?e[0]:null,nextIndex:t+1}}return{node:null,nextIndex:t+1}}function o_(e,t,n,r=!1){let i=[],a=t;for(;a<e.length;){let t=e[a];if(t.type===n&&(n===`mdc_inline_span`&&t.nesting===-1||n!==`mdc_inline_span`))break;if(t.type===`mdc_inline_props`&&t.hidden){a++;continue}if(t.type===`mdc_inline_component`&&r){let n=t.tag||`component`,r={},{attrs:o,nextIndex:s}=Yg(e,a+1,!1);Object.assign(r,o),Object.keys(o).length>0?a=s:a++,i.push([n,r]);continue}let o=a_(e,a,r);a=o.nextIndex,o.node&&i.push(o.node)}return{nodes:$g(i),nextIndex:a}}function s_(e){let t=[],n=``,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=a===`|`&&i>0&&e[i-1]===`\\`;a===`|`&&!o?(r&&n&&(t.push(n.length),n=``),r=!0):r&&(n+=a)}return r&&n&&t.push(n.length),t}function c_(e){let t=[],n=``,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=a===`|`&&i>0&&e[i-1]===`\\`;a===`|`&&!o?(r&&(t.push(n.trim()),n=``),r=!0):r&&(n+=a)}return n.trim()&&t.push(n.trim()),t}function l_(e){let t=e.split(`
18
- `),n=[],r=-1;for(let e=0;e<t.length;e++)t[e].trim().startsWith(`|`)?r===-1&&(r=e):r!==-1&&(n.push({start:r,end:e-1}),r=-1);if(r!==-1&&n.push({start:r,end:t.length-1}),n.length===0)return e;let{start:i,end:a}=n[n.length-1];t[i].trim().endsWith(`|`)||(t[i]+=` |`);let o=s_(t[i].trim()).length,s=()=>`| `+Array(o).fill(`---`).join(` | `)+` |`,c=a-i>=1?t[i+1].trim():``,l=c.startsWith(`|`)&&(c.includes(`-`)||c.includes(`:`)),u=t[a].trim();if(u.startsWith(`|`)&&(u.includes(`-`)||u.includes(`:`))){let e=c_(u).map(e=>{let t=e.startsWith(`:`),n=e.endsWith(`:`)&&e.length>1,r=e.replace(/^:/,``).replace(/:$/,``);if(t&&n)return r.length<1&&(r=`-`),`:`+r+`:`;if(t)return r.length<1&&(r=`-`),`:`+r;if(n)return r.length<1&&(r=`-`),r+`:`;for(;r.length<3;)r+=`-`;return r});for(;e.length<o;)e.push(`---`);t[a]=`| `+e.join(` | `)+` |`}else if(u.startsWith(`|`)&&!u.endsWith(`|`)){let e=t[i].trim();for(let n=i+(l?2:1);n<a;n++){let r=t[n].trim();if(r.startsWith(`|`)&&r.endsWith(`|`)&&!r.includes(`-`)){e=r;break}}let n=s_(e);t[a]=`| `+c_(u).map((e,t)=>{let r=n[t]||e.length+2;return e+` `.repeat(Math.max(0,r-e.length-2))}).join(` | `)+` |`}return l||t.splice(i+1,0,s()),t.join(`
19
- `)}function u_(e,t={}){if(!e||e===``)return e;let n=t.syntax!==!1,r=e.split(`
20
- `),i=r.length,a=!1,o=!1,s=!1,c=-1,l=null,u=/^<(script|pre|style|textarea)(\s|>|$)/i,d=[];for(let e=0;e<i;e++){let f=r[e],p=f.trim();if(l){RegExp(`</${l}\\s*>`,`i`).test(f)&&(l=null);continue}let m=p.match(u);if(m){let e=m[1].toLowerCase();RegExp(`</${e}\\s*>`,`i`).test(f)||(l=e);continue}if(e===0&&t.frontmatter&&p===`---`){a=!0;continue}if(a){p===`---`?a=!1:p!==``&&(o=!0);continue}if(p===`$$`){s=!s;continue}if(p===`---`&&d.length>0){d[d.length-1].hasYamlProps=!d[d.length-1].hasYamlProps;continue}if(p.startsWith(`|`)?c=c===-1?e:c:c!==-1&&(c=-1),e===i-1&&n&&p[0]===`:`&&d.length===0){let t=0;for(;t<p.length&&p[t]===`:`;)t++;p.slice(t).trim()===``&&(r[e]=``)}if(n&&p[0]===`:`){let e=0;for(;e<p.length&&p[e]===`:`;)e++;if(e>=2){let t=0;for(;t<f.length&&(f[t]===` `||f[t]===` `);)t++;let n=f.slice(0,t),r=p[e]??``;if(r>=`a`&&r<=`z`||r>=`A`&&r<=`Z`||r===`$`){let t=e;for(;t<p.length;){let e=p[t];if(!(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`$`||e===`.`||e===`-`||e===`_`))break;t++}d.push({depth:e,name:p.slice(e,t),indent:n,hasYamlProps:!1})}else e===p.length&&d.length>0&&d[d.length-1].depth===e&&d.pop()}}}let f=i-1;!a&&!s&&r[f].trim()!==`$$`&&(r[f]=p_(r[f],n));let p=r.join(`
21
- `);if(c!==-1&&(p=l_(p)),a&&o){let e=r[f].trim();p+=e===`-`||e===`--`?`-`.repeat(3-e.length):p.endsWith(`
22
- `)?`---`:`
23
- ---`}if(s&&(p+=p.endsWith(`
24
- `)?`$$`:`
25
- $$`),n&&e.includes(`::`)){let e=p.lastIndexOf(`
26
- `)+1,t=p.slice(e),n=-1;for(let e=t.length-1;e>=0&&t[e]!==`}`;e--)if(t[e]===`{`){n=e;break}if(n>=0){let e=t.slice(n+1),r=0,i=0;for(let t=0;t<e.length;t++)e[t]===`"`&&r++,e[t]===`'`&&i++;let a=``;r%2==1&&(a+=`"`),i%2==1&&(a+=`'`),p+=a+`}`}if(d.length>0){let e=d[d.length-1],t=p.lastIndexOf(`
27
- `)+1,n=p.slice(t).trim();e.hasYamlProps&&(n===`-`||n===`--`)&&(p+=`-`.repeat(3-n.length),e.hasYamlProps=!1);let r=[];for(;d.length>0;){let e=d.pop();e.hasYamlProps&&r.push(e.indent+`---`),r.push(e.indent+`:`.repeat(e.depth))}p+=`
28
- `+r.join(`
29
- `)}}return p}function d_(e){return e===``||e===` `||e===` `}function f_(e,t,n){let r=e.length,i=t;for(;i+1<r&&e[i+1]===n;)i++;let a=t>0?e[t-1]:``,o=i+1<r?e[i+1]:``;return{end:i,length:i-t+1,afterCh:o,surroundedBySpace:d_(a)&&d_(o)}}function p_(e,t){let n=e.length;if(n===0)return e;let r=0,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=-1,p=n;for(;p>0&&(e[p-1]===` `||e[p-1]===` `);)p--;let m=p<n,h=[],g=[],_=0,v=0,y=0,b=0,x=!1,S=!1;for(let p=0;p<n;p++){let m=p>0?e[p-1]:``,C=e[p];if(C===`\\`){p++;continue}if(x){C==="`"&&(s++,x=!1);continue}if(S){C===`$`&&!(p+1<n&&e[p+1]===`$`)&&(c++,S=!1);continue}if(t&&C===`{`&&m!==` `){_++;continue}if(t&&C===`}`){_>0&&_--;continue}if(!(_>0)){if(C===`[`){u++,f=p,v++;continue}if(C===`]`){u--,f=p,v>0&&v--;continue}if(C===`(`){f>=0&&p>f&&(d++,m===`]`&&y++);continue}if(C===`)`){f>=0&&p>f&&(d--,y>0&&y--);continue}if(v>0){C==="`"&&b++;continue}if(!(y>0)){if(C==="`"){s++,x=!0;continue}if(C===`$`){p+1<n&&e[p+1]===`$`?(l++,c+=2,p++):(c++,S=!0);continue}if(C===`*`){let t=f_(e,p,`*`);t.surroundedBySpace||(r+=t.length,t.length===2&&h.push(p)),p=t.end}else if(C===`_`){let t=f_(e,p,`_`),n=m>=`a`&&m<=`z`||m>=`A`&&m<=`Z`||m>=`0`&&m<=`9`,r=t.afterCh>=`a`&&t.afterCh<=`z`||t.afterCh>=`A`&&t.afterCh<=`Z`||t.afterCh>=`0`&&t.afterCh<=`9`;!(n&&r)&&!t.surroundedBySpace&&(i+=t.length,t.length===2&&g.push(p)),p=t.end}else if(C===`~`){let t=f_(e,p,`~`);t.surroundedBySpace||(a+=t.length>>1,t.length&1&&o++),p=t.end}}}}if(x)return e+"`";if(S)return e.trim()===`$$`?e:e+`$`;let C=h.length>=2,w=``,T=!1;if(r>=3&&e[0]===`*`&&e[1]===`*`&&e[2]===`*`){let t=r%6;if(t===3)e[3]!==`*`&&(p>=3&&e[p-1]===`*`&&e[p-2]===`*`&&e[p-3]===`*`&&(p===3||e[p-4]===` `)||(w=`***`));else if(t>3&&t<6){let e=6-t;w=`*`.repeat(e)}}if(!w&&r>=2){let t=r%4;if(t===2){if(h.length>0&&(e[0]!==`*`||e[1]!==`*`||e[2]!==`*`)){let t=p>=2&&e[p-1]===`*`&&e[p-2]===`*`;if(!t||p!==2&&e[p-3]!==` `){let n=Math.floor(h.length/2)*4,i=r-n;if(!(C&&i%2==0)){let n=e[p-1];(!C||n>=`a`&&n<=`z`||n>=`A`&&n<=`Z`||n>=`0`&&n<=`9`)&&(w=`**`,m&&!t&&(T=!0))}}}}else if(t>2&&t<4){let e=4-t;w=`*`.repeat(e)}}if(!w&&r%2==1&&(e[0]!==`*`||e[1]!==`*`||C)){let t=!1;for(let r=0;r<n;r++)if(e[r]===`*`){let i=r+1<n?e[r+1]:``,a=r>0?e[r-1]:``;if(i!==` `||a===` `){t=!0;break}}if(t&&(!(p>=1&&e[p-1]===`*`&&(p===1||e[p-2]===` `))||r>1)){w=`*`;let t=e[p-1]===`*`;m&&!t&&(T=!0)}}if(!w&&i>=2){let t=i%4;if(t===2){if(g.length>0){let t=g.length>=2,n=p>=2&&e[p-1]===`_`&&e[p-2]===`_`;(!n||p!==2&&e[p-3]!==` `)&&!t&&(w=`__`,m&&!n&&(T=!0))}}else if(t>2&&t<4){let e=4-t;w=`_`.repeat(e)}}if(!w&&i%2==1){let t=!1;for(let r=0;r<n;r++)if(e[r]===`_`){let i=r+1<n?e[r+1]:``,a=r>0?e[r-1]:``;if(i!==` `||a===` `){t=!0;break}}if(t&&!(p>=1&&e[p-1]===`_`&&(p===1||e[p-2]===` `))){w=`_`;let t=e[p-1]===`_`;m&&!t&&(T=!0)}}if(!w&&a%2==1?(w=o===1?`~`:`~~`,m&&(T=!0)):!w&&o%2==1&&(w=`~`,m&&(T=!0)),!w&&s%2==1&&(w="`"),!w&&l%2==1&&e.trim()!==`$$`&&(w=`$$`),!w&&c%2==1&&(w=`$`),!w&&u>0&&(w=b%2==1?"`]":`]`),!w&&d>0&&(w=`)`),T&&w){let t=n;for(;t>0&&(e[t-1]===` `||e[t-1]===` `);)t--;return e.slice(0,t)+w}return e+w}function m_(e,t){let n=-1,r=t.nodes.length-1,i=!1;for(;r>=0;){let e=t.nodes[r];if(e[1]&&e[1].$?.line){if(i){n=r;break}i=!0}r--}let a=n===-1?null:t.nodes[n];if(a){let r=a[1].$?.line??0;return{remainingMarkdownStartLine:r,reusedNodes:t.nodes.slice(0,n+1),remainingMarkdown:e.split(`
30
- `).slice(r).join(`
31
- `)||``}}return{remainingMarkdownStartLine:0,remainingMarkdown:e,reusedNodes:[]}}var h_={end:()=>{}},g_={startSpan:()=>h_,startActiveSpan:(e,t,n)=>(typeof t==`function`?t:n)(h_)};function __(e,t,n,r){return e.startActiveSpan(t,r??{},e=>{try{let t=n();return t instanceof Promise?t.finally(()=>e.end()):(e.end(),t)}catch(t){throw e.end(),t}})}function v_(e={}){let{autoUnwrap:t=!0,autoClose:n=!0,tracer:r=g_}=e,i=dg(e.unwrap),a=e.plugins??[];e.html!==void 0&&console.warn("[comark] `ParserOptions.html` is deprecated and will be removed in a future major version. Use `registerDefaultPlugins: false` and register `html()` from `comark/plugins/html` only when needed.");let o=e.registerDefaultPlugins===!1?[]:[lg(),...e.html===!1?[]:[cg()],Yh(),qh(),Rh(),Hh()],s=xh([...a,...o]),c=e=>s.some(t=>t.name===e),l=new bh({linkify:e.linkify??!0}).enable([`table`,`strikethrough`]);for(let e of s)for(let t of e.markdownItPlugins||[])l.use(t);let u=null,d=null;return async(a,o={})=>await __(r,`comark:parse`,async()=>{let f={options:e,tokens:[],markdown:a,tree:null,parsedLines:0,reusableNodes:[],frontmatterText:``,frontmatter:{}},p=u,m=a.startsWith(d??``);if(o.streaming&&p&&m){let{remainingMarkdownStartLine:e,reusedNodes:t,remainingMarkdown:n}=m_(a,p);if(!n)return p;f.parsedLines=e,f.markdown=n,f.reusableNodes=t}n&&(f.markdown=__(r,`comark:autoclose`,()=>u_(f.markdown,{frontmatter:c(`frontmatter`)&&o.streaming,syntax:c(`components`)})));for(let e of s)e.pre&&await __(r,`comark:pre:${e.name}`,()=>e.pre(f));try{f.tokens=__(r,`comark:tokenize`,()=>l.parse(f.markdown,{}))}catch(e){if(o.streaming&&p)return p;throw e}let h=r.startSpan(`comark:nodes`),g=Gg(f.tokens,{startLine:f.parsedLines,preservePositions:o.streaming??!1,headingIds:e.headingIds??!0});t&&(g=g.map(e=>ug(e))),i.length>0&&(g=hg(g,i)),h.end();let _=f.frontmatter??{},v=f.frontmatterText??``;o.streaming?(f.tree={frontmatter:v?_:p?.frontmatter??_,meta:{},nodes:[...f.reusableNodes,...g]},u=f.tree,d=a):(f.tree={frontmatter:_,meta:{},nodes:g},u=null,d=null);for(let e of s)e.post&&await __(r,`comark:post:${e.name}`,()=>e.post(f));return f.tree})}function y_(e){return Array.isArray(e)&&e.length>=1?e[0]:null}function b_(e){return Array.isArray(e)&&e.length>2?e.slice(2):[]}function x_(e){return typeof e==`string`?e:Array.isArray(e)?b_(e).reduce((e,t)=>e+x_(t),``):``}var S_=Sh((e={})=>{let{titleTag:t=`h1`,descriptionTag:n=`p`,remove:r=!1}=e;return{name:`headings`,post(e){let i=e.tree.nodes,a=i.filter(e=>Array.isArray(e)&&y_(e)!==`hr`),o=-1,s=-1,c=0;if(t!==!1){let n=a[0];n&&y_(n)===t&&(o=i.indexOf(n),e.tree.meta.title=x_(n),c=1)}if(n!==!1){let t=a[c];t&&y_(t)===n&&(s=i.indexOf(t),e.tree.meta.description=x_(t))}if(r){let e=[o,s].filter(e=>e!==-1).sort((e,t)=>t-e);for(let t of e)i.splice(t,1)}}}}),C_=[`object`],w_=[`srcdoc`,`formaction`],T_=[`javascript:`,`data:text/html`,`vbscript:`,`data:text/javascript`,`data:text/vbscript`,`data:text/css`,`data:text/plain`,`data:text/xml`];function E_(e,t){try{let n=new URL(e),r=new URL(t);return n.protocol=r.protocol,n.host=r.host,n.href}catch{return t}}function D_(e,t,n){let{allowedLinkPrefixes:r=[`*`],allowedImagePrefixes:i=[`*`],allowedProtocols:a=[`*`],defaultOrigin:o,allowDataImages:s=!0}=n,c=decodeURIComponent(e).replace(/&#x([0-9a-f]+);?/gi,``).replace(/&#(\d+);?/g,``).replace(/&[a-z]+;?/gi,``),l;try{l=new URL(c)}catch{return e}if(T_.some(e=>l.href.toLowerCase().startsWith(e))||t===`image`&&!s&&l.protocol===`data:`)return!1;if(!a.includes(`*`)){let e=l.protocol.replace(`:`,``);if(!a.includes(e))return!1}let u=t===`link`?r:i;if(!u.includes(`*`)){let e=l.href.toLowerCase();if(!u.some(t=>e.startsWith(t.toLowerCase())))return o?E_(c,o):!1}return e}function O_(e,t,n={}){return e=e.toLowerCase().replace(/^(:|v-bind:)/,``).replace(/^(@|v-on:)/,`on`).replace(/:/g,``),e.startsWith(`on`)||w_.includes(e)?!1:e===`href`||e===`xlinkhref`?D_(t,`link`,n):e===`src`?D_(t,`image`,n):t}function k_(e,t,n={}){if(C_.includes(e.toLowerCase())||!t)return{};let r=Object.entries(t);return r.length===0?{}:(t=Object.fromEntries(r.flatMap(([e,t])=>{if(e===`id`&&!t)return[];let r=O_(e,t,n);return r===!1?(console.warn(`[comark/plugins/security] removing unsafe attribute: ${e}="${t}"`),[]):[[e,r]]})),t)}var A_=Sh((e={})=>{let{blockedTags:t=[],allowedTags:n=[],tagFallback:r=void 0,allowedLinkPrefixes:i,allowedImagePrefixes:a,allowedProtocols:o,defaultOrigin:s,allowDataImages:c}=e,l=new Set(t.map(e=>e.toLowerCase())),u=new Set(n.map(e=>e.toLowerCase())),d={allowedLinkPrefixes:i,allowedImagePrefixes:a,allowedProtocols:o,defaultOrigin:s,allowDataImages:c};return{name:`security`,async post(e){await ua(e.tree,e=>typeof e!=`string`&&e[0]!==null,async e=>{let t=e,n=t[0].toLowerCase(),i=l.has(n);if(u.size>0&&!u.has(n)||i)return typeof r==`function`&&await r(t);Object.keys(t[1]).length&&(t[1]=k_(t[0],t[1],d))})}}}),j_=[`h2`,`h3`,`h4`,`h5`,`h6`],M_=j_.reduce((e,t)=>(e[t]=Number(t.charAt(t.length-1)),e),{});function N_(e){return Array.isArray(e)&&e.length>=1?e[0]:null}function P_(e){return Array.isArray(e)&&e.length>=2&&typeof e[1]==`object`&&!Array.isArray(e[1])?e[1]:{}}function F_(e){return Array.isArray(e)&&e.length>2?e.slice(2):[]}function I_(e){let t=N_(e);return t&&M_[t]||0}function L_(e){return(e<1||e>5)&&(console.warn(`\`toc.depth\` is set to ${e}. It should be a number between 1 and 5. `),e=1),j_.slice(0,e)}function R_(e){return typeof e==`string`?e:Array.isArray(e)?F_(e).reduce((e,t)=>e+R_(t),``):``}function z_(e,t,n=0){if(n>=t)return e;let r=[];for(let i of e)if(r.push(i),Array.isArray(i)){let e=F_(i);e.length>0&&r.push(...z_(e,t,n+1))}return r}function B_(e){if(e.length<=1)return e;let t=[],n;return e.forEach(e=>{!n||e.depth<=n.depth?(e.children=[],n=e,t.push(e)):n.children.push(e)}),t.forEach(e=>{e.children?.length?e.children=B_(e.children):delete e.children}),t}function V_(e,t){let{searchDepth:n,depth:r,title:i=``}=t,a=L_(r);return{title:i,searchDepth:n,depth:r,links:z_(e.nodes,n).filter(e=>{let t=N_(e);return t!==null&&a.includes(t)}).map(e=>({id:P_(e).id||``,depth:I_(e),text:R_(e)}))}}var H_=Sh((e={})=>{let{title:t=``,depth:n=2,searchDepth:r=2,links:i=[]}=e;return{name:`toc`,post(e){let a=V_(e.tree,{title:t,depth:n,searchDepth:r,links:i});a.links=B_(a.links),e.tree.meta.toc=a}}}),U_=`__cmsSourceMappings`,W_=new Map([[`blockquote_open`,`blockquote`],[`bullet_list_open`,`ul`],[`list_item_open`,`li`],[`ordered_list_open`,`ol`],[`paragraph_open`,`p`],[`table_open`,`table`],[`tbody_open`,`tbody`],[`td_open`,`td`],[`th_open`,`th`],[`thead_open`,`thead`],[`tr_open`,`tr`]]),G_=zn({attrs:xr(tr(Ci(Zn([ar,ar])))),hidden:xr(dr),level:xr(Fn),map:xr(tr(Zn([Fn,Fn]))),nesting:xr(Fn),tag:xr(ar),type:xr(ar)}),K_=new Set([`blockquote`,`ol`,`pre`,`table`,`ul`]);function q_(){return{name:`cms-source-capture`,pre(e){e.__cmsOriginalMarkdown=e.markdown}}}function J_(){return{name:`cms-source-mapping`,post(e){let t=e.__cmsOriginalMarkdown??e.markdown,n=Y_(e.tokens.flatMap(e=>{let t=pr(G_)(e);return t._tag===`Some`?[t.value]:[]}),t,e.markdown,e.parsedLines??0),r=[];tv(e.tree.nodes,n,[],r),e.tree.meta[U_]=r}}}function Y_(e,t,n,r){let i=[],a=[],o=rv(t),s=rv(n),c=t.lastIndexOf(n),l=Z_(e,n);for(let u=0;u<e.length;u++){let d=e[u];if(!d)continue;let f=X_(d),p=d.map??l.get(u);if(!f||!p)continue;let m=d.level??0;for(;;){let e=a.at(-1);if(!e||e.level<m)break;a.pop()}let h={children:[],range:iv(t,o,n,s,c,p[0],p[1]+ +(d.type===`mdc_block_open`),r),tag:f};(a.at(-1)?.descriptor?.children??i).push(h),d.nesting===1&&a.push({descriptor:h,level:m})}return i.map($_).map(ev)}function X_(e){if(!e.hidden&&e.type)return e.type===`heading_open`?e.tag:e.type===`mdc_block_open`||e.type===`mdc_block_shorthand`&&e.nesting!==-1?e.tag||`component`:e.type===`mdc_block_slot`&&e.nesting===1?`template`:[`fence`,`fenced_code_block`,`code_block`].includes(e.type)?`pre`:e.type===`math_block`?`math`:e.type===`html_block`?`*`:e.type===`hr`?`hr`:W_.get(e.type)}function Z_(e,t){let n=new Map,r=Q_(t),i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t];if(!o||o.type!==`mdc_block_slot`)continue;if(o.nesting===1){let e=o.attrs?.[0]?.[0]?.replace(/^#/u,``),n=a;for(;n<r.length&&r[n]?.name!==e;)n++;let s=r[n];s&&(i.push({index:t,marker:s.line}),a=n+1);continue}if(o.nesting!==-1)continue;let s=i.pop();if(!s)continue;let c=s.marker+1;for(let r=s.index+1;r<t;r++){let t=e[r],i=t?.map??n.get(r);t&&i&&(c=Math.max(c,i[1]+ +(t.type===`mdc_block_open`)))}n.set(s.index,[s.marker,c])}return n}function Q_(e){return e.split(/\r?\n/u).flatMap((e,t)=>{let n=e.match(/^\s*#([^\s{]+)/u)?.[1];return n?[{line:t,name:n}]:[]})}function $_(e){let t=e.children.map($_);return K_.has(e.tag)&&t.length===1&&t[0]?.tag===e.tag?{...e,children:t[0].children}:{...e,children:t}}function ev(e){let t=[],n;for(let r of e.children){let e=ev(r);if(e.tag===`template`){n=e,t.push(e);continue}if(!n){t.push(e);continue}n.children.push(e),e.range.end.offset>n.range.end.offset&&(n.range={start:n.range.start,end:e.range.end})}return{...e,children:t}}function tv(e,t,n,r){let i=0;for(let a=0;a<e.length;a++){let o=e[a];if(!o||!nv(o))continue;let s=i;for(;s<t.length&&t[s]?.tag!==`*`&&t[s]?.tag!==o[0];)s++;let c=t[s];if(!c)continue;i=s+1;let l=[...n,a];r.push({nodePath:l,range:c.range});let[,,...u]=o;tv(u,c.children,l,r)}}function nv(e){return Array.isArray(e)&&Y(e[0])}function rv(e){let t=[0];for(let n=0;n<e.length;n++)e.charCodeAt(n)===10&&t.push(n+1);return t}function iv(e,t,n,r,i,a,o,s){let c=i>=0?i+(r[a]??n.length):t[a+s]??e.length,l=i>=0?i+(r[o]??n.length):t[o+s]??e.length;return{start:av(e,t,c),end:av(e,t,Math.max(c,l))}}function av(e,t,n){let r=Math.min(Math.max(n,0),e.length),i=0,a=t.length-1;for(;i<a;){let n=Math.ceil((i+a)/2);(t[n]??e.length)<=r?i=n:a=n-1}return{offset:r,line:i+1,column:r-(t[i]??0)+1}}function ov(){return v_({autoClose:!1,registerDefaultPlugins:!1,plugins:[q_(),lg(),Yh(),qh(),Rh(),Hh(),A_(),S_(),H_({depth:5,searchDepth:6}),J_()]})}ci(`AuthoringSchema.parseContent`)(function*(e){let t=yield*gr({try:()=>ov()(e),catch:e=>new ya({cause:e,message:`Invalid initial Markdown content.`})});return(yield*Un(ti)(t)).nodes});var sv=li(jn);function cv(e,t){let n=new Map(t.props.map(e=>[e.name,e])),r=new Map(t.slots.map(e=>[e.name,e]));if(n.size!==t.props.length||r.size!==t.slots.length)throw Error(`${t.label}: authoring names must be unique.`);let i={...Object.fromEntries(t.props.flatMap(e=>e.defaultValue===void 0?[]:[[e.name,e.defaultValue]])),...t.initialProps};for(let e of t.props){if(e.defaultValue===void 0)continue;let n=dv(e,e.defaultValue,`working`);if(n)throw Error(`Invalid default for ${t.label}: ${n}`)}function a(e){let n=r.get(e);if(!n)throw Error(`${t.label}: unknown content region ${e}.`);let i=n.initial?Al(n.initial):[];return{type:`cmsSlot`,attrs:{cmsNodeId:aa(),name:e,implicit:e==="default",props:{}},content:i.length?i:[{type:`paragraph`,attrs:{cmsNodeId:aa()}}]}}function o(){return{type:`cmsBlock`,attrs:{cmsNodeId:aa(),tag:e,props:structuredClone(i)},content:t.slots.filter(e=>e.required||e.initial!==void 0).map(e=>a(e.name))}}function s(e,i){let a=[],o=e.attrs?.props,s=sv(o)?o:{};for(let e of Object.keys(s))n.has(e)||a.push(`${t.label}: ${e} is not editable.`);for(let e of t.props){let t=dv(e,s[e.name]??(s[e.name]===null?null:e.defaultValue),i);t&&a.push(t)}let c=new Set;for(let n of e.content??[]){let e=String(n.attrs?.name??`default`),i=r.get(e);if(!i||n.type!==`cmsSlot`){a.push(`${t.label}: unsupported content region ${e}.`);continue}c.has(e)&&a.push(`${i.label} can only appear once.`),c.add(e),fv(i,n.content??[])||a.push(`${i.label} contains unsupported formatting or blocks.`)}for(let e of t.slots)e.required&&!c.has(e.name)&&a.push(`${e.label} is required.`);return a}let c={definition:t,createContent:o,createSlot:a,validate:s,setProperty(e,r,i){let a=n.get(r);if(!a)throw Error(`${t.label}: ${r} is not editable.`);let o=dv(a,i,`working`);if(o)throw Error(o);let s=Object.fromEntries(Object.entries(e));return i===void 0?delete s[r]:s[r]=i,s}},l=s(o(),`publish`);if(l.length)throw Error(`Invalid initial content for ${t.label}: ${l.join(` `)}`);return c}function lv(e,t){let n=e.state.selection.$from;for(let e=n.depth;e>0;e--){let r=n.node(e);if(r.type.name!==`cmsSlot`)continue;let i=n.node(e-1);return t.find(e=>e.name===i.attrs.tag)?.authoring?.slots.find(e=>e.name===r.attrs.name)}}function uv(e){let t=new Map(e.flatMap(e=>e.authoring?[[e.name,cv(e.name,e.authoring)]]:[]));function n(e){return[...e.type===`cmsBlock`?t.get(String(e.attrs?.tag))?.validate(e,`working`)??[]:[],...(e.content??[]).flatMap(n)]}return ie.create({name:`cmsAuthoringPolicy`,addProseMirrorPlugins(){return[new u({filterTransaction(e,t){if(!e.docChanged||e.getMeta(ye)?.isChangeOrigin)return!0;let r=n(t.doc.toJSON());return n(e.doc.toJSON()).every(e=>{let t=r.indexOf(e);return t<0?!1:(r.splice(t,1),!0)})}})]}})}function dv(e,t,n){if(t===void 0)return e.required&&n===`publish`?`${e.label} is required.`:void 0;if(!(t===null&&e.nullable)){if(!(e.type===`string`?Y(t):e.type===`number`?Oi(t)&&Number.isFinite(t):xi(t)))return`${e.label} must be ${e.type}.`;if(e.options.length&&!e.options.some(e=>e.value===t))return`${e.label} must use one of its available choices.`}}function fv(e,t){let n=new Set([`paragraph`,`text`,`hardBreak`]),r=new Set;if(e.input===`text`&&t.length>1)return!1;if(e.input===`rich-text`)for(let t of e.features)t===`bullet-list`?(n.add(`bulletList`),n.add(`listItem`)):r.add(t);let i=e=>n.has(e.type??``)&&(e.marks??[]).every(e=>r.has(e.type))&&(e.content??[]).every(i);return t.every(i)}function pv(e){if(!Y(e)&&e.authoring)return cv(e.name,e.authoring).createContent();let t=Y(e)?{name:e,props:[],slots:[]}:e,n=t.slots.length?[t.slots.find(e=>e.name==="default")||t.slots[0]]:[];return{type:`cmsBlock`,attrs:{props:Object.fromEntries(t.props.filter(e=>e.required).map(e=>[e.name,hv(e.type)])),tag:t.name},content:n.map(e=>mv(e.name))}}function mv(e){return{type:`cmsSlot`,attrs:{implicit:e==="default",name:e,props:{}},content:[{type:`paragraph`,attrs:{cmsSynthetic:!0}}]}}function hv(e){return e===`boolean`?!1:e===`number`?0:e===`array`?[]:e===`object`?{}:``}function gv(){return ie.create({name:`cmsStructurePolicy`,addProseMirrorPlugins(){let e=this.editor;return[new u({filterTransaction(e,t){return!e.docChanged||e.getMeta(ye)?.isChangeOrigin?!0:e.getMeta(`uiEvent`)!==`drop`||_v(t.doc.toJSON(),e.doc.toJSON())},props:{handleDOMEvents:{click(t,n){let r=t.state.doc.firstChild?.nodeSize??0,i=t.state.doc.nodeAt(r),a=t.nodeDOM(r);return!i||!(a instanceof HTMLElement)||n.clientY>=a.getBoundingClientRect().top?!1:bv(e,r,`before`)}}}})]}})}function _v(e,t){let n=Cv(e),r=Cv(t);if(n.size!==r.size)return!1;for(let[e,t]of n)if(r.get(e)!==t)return!1;return!0}function vv(e,t,n){let r=e.state.doc.nodeAt(t);if(!r||r.type.name===`cmsFrontmatter`)return!1;let i=e.state.doc.resolve(t),a=i.index();return n===`up`?a>0&&i.parent.child(a-1).type.name!==`cmsFrontmatter`:a+1<i.parent.childCount}function yv(e,t,n){if(!vv(e,t,n))return!1;let r=e.state.doc.nodeAt(t),i=e.state.doc.resolve(t),a=i.parent.child(i.index()+(n===`up`?-1:1)),o=n===`up`?t-a.nodeSize:t+a.nodeSize;return e.view.dispatch(e.state.tr.delete(t,t+r.nodeSize).insert(o,r).scrollIntoView()),e.view.focus(),!0}function bv(e,t,n){let r=e.state.doc.nodeAt(t);return!r||r.type.name===`cmsFrontmatter`?!1:wv(e,n===`before`?t:t+r.nodeSize)}function xv(e){return e.state.selection instanceof fe&&wv(e,e.state.selection.from)}function Sv(e,t=!0){let{doc:n,selection:r}=e.state,i=[];if(n.descendants((e,n)=>{if(e.type.name!==`paragraph`||!e.attrs.cmsTransient||e.content.size)return;let a=n+e.nodeSize,s=r.from>n&&r.to<a||o(r)&&r.from===n;(!t||!s)&&i.push({from:n,selected:s,to:a})}),!i.length)return!1;let a=e.state.tr,s;for(let e of i.reverse()){let t=a.doc.resolve(e.from);t.parent.canReplace(t.index(),t.index()+1)&&(a.delete(e.from,e.to),e.selected&&(s=e.from))}return a.docChanged?(s!==void 0&&a.setSelection(Tv(a.doc,a.mapping.map(s))),e.view.dispatch(a),!0):!1}function Cv(e){let t=new Map,n=(e,r)=>{let i=Ev(e.attrs?.cmsNodeId);i&&t.set(i,t.has(i)?`__duplicate__`:r),e.content?.forEach(e=>n(e,i||r))};return e.content?.forEach(e=>n(e,`__root__`)),t}function wv(e,t){let n=e.schema.nodes.paragraph,r=e.state.doc.resolve(t);if(!n||t===0&&e.state.doc.firstChild?.type.name===`cmsFrontmatter`||!r.parent.canReplaceWith(r.index(),r.index(),n))return!1;let i=e.state.tr.insert(t,n.create({cmsTransient:!0}));return i.setSelection(C.near(i.doc.resolve(t+1),1)),e.view.dispatch(i.scrollIntoView()),e.view.focus(),!0}function Tv(e,t){let n=e.resolve(Math.min(t,e.content.size));return n.nodeAfter&&j.isSelectable(n.nodeAfter)?j.create(e,n.pos):n.nodeBefore&&j.isSelectable(n.nodeBefore)?j.create(e,n.pos-n.nodeBefore.nodeSize):C.near(n,1)}function Ev(e){return li($n)(e)?e:void 0}var Dv=li(jn),Ov=_u(),kv=ci(`EditorDocument.open`)(e=>Wn({try:()=>({content:jv({type:`doc`,content:[{type:`cmsFrontmatter`,attrs:{frontmatter:structuredClone(e.frontmatter)}},...Al(e.nodes,pa(e))]}),meta:structuredClone(e.meta)}),catch:Nv})),Av=ci(`EditorDocument.encode`)(function*(e){let{content:t,nodes:n,frontmatter:r}=yield*Wn({try:()=>{let t=jv(e.content);return{content:t,nodes:wu(t),frontmatter:Mv(t)}},catch:Nv}),i=yield*Ai(ti)({frontmatter:r,meta:e.meta,nodes:n}).pipe(Er(Nv)),a=yield*ba(i);return{body:i,document:{content:t,meta:structuredClone(i.meta)},markdown:a}});function jv(e){if(e.type!==`doc`)throw Error(`Editor content must have a Tiptap document root.`);let t=Ov.nodeFromJSON(e);return t.check(),t.toJSON()}function Mv(e){let t=e.content?.[0]?.attrs?.frontmatter;if(!Dv(t))throw Error(`Editor content must start with JSON object frontmatter.`);return structuredClone(t)}function Nv(e){return new ya({cause:e,message:e instanceof Error&&e.message?e.message:`The editor document is invalid.`})}var Pv=`frontmatter`,Fv=`properties`,Iv=`props:`,Lv=`cmsProps:`,Rv=_u(),zv=_r(bi),Bv=_r(Zr),Vv=_r(jn),Hv=_r(Ci(ar));function Uv(e,t){let n=Zv(t);ry(e.getMap(Pv),ey(n.frontmatter));let r=e.getMap(Fv);r.clear();for(let[e,t]of n.properties){let n=new Oa;for(let[e,r]of Object.entries(t))n.set(e,structuredClone(r));r.set(e,n)}}function Wv(e,t){let n=e.share.has(Pv),r=e.share.has(Fv);if(n&&r)return;let i=Zv(t);e.transact(()=>{if(n||ry(e.getMap(Pv),ey(i.frontmatter)),!r){let t=e.getMap(Fv);for(let[e,n]of i.properties){let r=new Oa;for(let[e,t]of Object.entries(n))r.set(e,structuredClone(t));t.set(e,r)}}})}function Gv(e,t,n){let r=Zv(Qv(t)),i=Zv(Qv(n));e.transact(()=>Xv(e,r,i))}function Kv(e,t){let n=structuredClone(t),r=e.share.has(Pv)?ty(iy(e.getMap(Pv))):void 0,i=e.share.has(Fv)?e.getMap(Fv):void 0;return $v(n,e=>{if(e.type===`cmsFrontmatter`){r!==void 0&&(e.attrs={...e.attrs,frontmatter:r});return}if(i===void 0)return;let t=ly(e.attrs?.cmsNodeId);if(t===void 0)return;let n=i.get(t),a=n instanceof Oa?iy(n):{},o={...e.attrs};Object.hasOwn(o,`props`)&&(o.props=oy(a,Iv)),Object.hasOwn(o,`cmsProps`)&&(o.cmsProps=oy(a,Lv)),e.attrs=o}),n}function qv(e){return e.getMap(Pv)}function Jv(e){return ty(iy(qv(e)))}function Yv(e,t,n){let r=JSON.stringify(t.split(`.`).filter(Boolean));e.transact(()=>{let t=qv(e);n===void 0||n===``?t.delete(r):t.set(r,structuredClone(n))})}function Xv(e,t,n){ny(qv(e),ey(t.frontmatter),ey(n.frontmatter));let r=e.getMap(Fv),i=new Set([...t.properties.keys(),...n.properties.keys()]);for(let e of i){let i=t.properties.get(e)??{},a=n.properties.get(e);if(a===void 0){r.delete(e);continue}let o=r.get(e)??new Oa;r.has(e)||r.set(e,o),ny(o,i,a)}}function Zv(e){let t={},n=new Map;return $v(e,e=>{e.type===`cmsFrontmatter`&&(t=structuredClone(Vv(e.attrs?.frontmatter)));let r=ly(e.attrs?.cmsNodeId);if(r===void 0)return;let i=Object.assign({},ay(sy(e.attrs?.props),Iv),ay(sy(e.attrs?.cmsProps),Lv));Object.keys(i).length>0&&n.set(r,i)}),{frontmatter:t,properties:n}}function Qv(e){if(e.type!==`doc`)throw Error(`Editor content must have a Tiptap document root.`);let t=Rv.nodeFromJSON(e);return t.check(),t.toJSON()}function $v(e,t){t(e);for(let n of e.content??[])$v(n,t)}function ey(e){let t={},n=(e,r)=>{for(let[i,a]of Object.entries(e)){let e=[...r,i];cy(a)&&Object.keys(a).length>0?n(a,e):t[JSON.stringify(e)]=structuredClone(a)}};return n(e,[]),Vv(t)}function ty(e){let t={};for(let[n,r]of Object.entries(e)){let e=Hv(JSON.parse(n));if(e.length===0)continue;let i=t;for(let t of e.slice(0,-1)){let e=Object.hasOwn(i,t)?i[t]:void 0,n=cy(e)?e:{};uy(i,t,n),i=n}let a=e.at(-1);a!==void 0&&uy(i,a,structuredClone(r))}return Vv(t)}function ny(e,t,n){let r=new Set([...Object.keys(t),...Object.keys(n)]);for(let i of r)if(!Object.hasOwn(n,i))e.delete(i);else{let r=n[i];r!==void 0&&!dy(t[i],r)&&e.set(i,structuredClone(r))}}function ry(e,t){e.clear();for(let[n,r]of Object.entries(t))e.set(n,structuredClone(r))}function iy(e){return Vv(Object.fromEntries([...e.entries()].map(([e,t])=>[e,structuredClone(Bv(t))])))}function ay(e,t){return Vv(Object.fromEntries(Object.entries(e).map(([e,n])=>[`${t}${e}`,structuredClone(n)])))}function oy(e,t){return Vv(Object.fromEntries(Object.entries(e).filter(([e])=>e.startsWith(t)).map(([e,n])=>[e.slice(t.length),structuredClone(n)])))}function sy(e){return e==null?{}:structuredClone(Vv(e))}function cy(e){return li(jn)(e)}function ly(e){if(e!=null)return zv(e)}function uy(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function dy(e,t){return JSON.stringify(e)===JSON.stringify(t)}var fy=`body`,py=`cms`,my=`meta`,hy=`sourcePath`,gy=_u(),_y=_r(Zr),vy=_r(jn),yy=_r(Ti);function by(e,t,n){let r=oe(gy,t,fy);try{return r.transact(()=>{Uv(r,t);let i=r.getMap(py);i.set(my,structuredClone(n)),i.set(hy,e)}),r}catch(e){throw r.destroy(),e}}function xy(e){let t=e.getMap(py);if(!t.has(my)||!t.has(hy))throw Error(`Collaboration metadata must include meta and sourcePath.`);let n=Sy(_y(t.get(hy))),r=structuredClone(vy(t.get(my))),i=e.getXmlFragment(fy);return{content:Kv(e,Ne(i,gy).toJSON()),fragment:i,meta:r,sourcePath:n}}function Sy(e){try{return yy(e)}catch(e){throw Error(`Collaboration metadata must contain a valid source path.`,{cause:e})}}function Cy(e,t,n){Wv(e,n);let r=qv(e);return{extensions:[Ty(e),...wy(t)],frontmatter:{read:()=>Jv(e),observe(t){let n=()=>t(Jv(e));return r.observeDeep(n),n(),()=>r.unobserveDeep(n)},write:(t,n)=>Yv(e,t,n)}}}function wy(e){let t={};return[ie.create({name:`cmsCollaborationInitialization`,priority:1100,onBeforeCreate(){let{doc:n,meta:r}=Oe(e,this.editor.schema);n.check(),this.editor.options.content=n.toJSON(),t.mapping=r.mapping}}),we.configure({fragment:e,ySyncOptions:t})]}function Ty(e){return ie.create({name:`cmsGranularFields`,addProseMirrorPlugins(){return[new u({appendTransaction(t,n,r){return t.some(e=>e.docChanged&&!e.getMeta(ye)?.isChangeOrigin)&&Gv(e,n.doc.toJSON(),r.doc.toJSON()),null},view(t){let n=e.getMap(`properties`),r=Ey(t,e);return n.observeDeep(r.apply),r.apply(),{destroy(){r.destroy(),n.unobserveDeep(r.apply)}}}})]}})}function Ey(e,t){let n=!1,r=!1;return{apply:()=>{n||r||(n=!0,queueMicrotask(()=>{if(n=!1,r)return;let i=Kv(t,e.state.doc.toJSON()),a=e.state.tr;Dy(a,i),a.docChanged&&e.dispatch(a)}))},destroy:()=>r=!0}}function Dy(e,t){let n=new Map;Oy(t,e=>{let t=e.attrs?.cmsNodeId;Y(t)&&n.set(t,e.attrs)}),e.doc.descendants((t,r)=>{let i=t.attrs.cmsNodeId;if(!Y(i))return;let a=n.get(i);a!==void 0&&JSON.stringify(t.attrs)!==JSON.stringify(a)&&e.setNodeMarkup(r,void 0,a)})}function Oy(e,t){t(e);for(let n of e.content??[])Oy(n,t)}var ky=class extends Gn()(`CollaborationDocument.Invalid`,{message:$n,cause:Ln()}){};function Ay(e,t){return new ky({cause:t,message:e})}function jy(e){return e instanceof Error&&e.message?e.message:`The collaborative editor document is invalid.`}function My(e){return{state:Uint8Array.from(Ta(e)),stateVector:Uint8Array.from(Ea(e))}}function Ny(e){if(!(e.state instanceof Uint8Array)||!(e.stateVector instanceof Uint8Array))throw Error(`Collaboration snapshot state must be binary data.`);let t=Py(e.state);if(!Ly(Ea(t),e.stateVector))throw t.destroy(),Error(`Collaboration snapshot state vector does not match its state.`);return t}function Py(e){if(!(e instanceof Uint8Array))throw Error(`Collaboration state must be binary data.`);let t=new Da;try{return Aa(t,Uint8Array.from(e)),t}catch(e){throw t.destroy(),e}}function Fy(e,t){Aa(e,Uint8Array.from(t))}function Iy(e,t){return{stateVector:Uint8Array.from(Ea(e)),update:Uint8Array.from(t===void 0?Ta(e):Ta(e,t))}}function Ly(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}ci(`CollaborationDocument.create`)(function*(e){let t=yield*kv(e.body);return yield*Wn({try:()=>by(e.sourcePath,t.content,t.meta),catch:e=>Ay(`Could not create the collaborative editor document.`,e)})}),ci(`CollaborationDocument.render`)(function*(e){let t=yield*zy(e);return{...yield*Av({content:t.content,meta:t.meta}),sourcePath:t.sourcePath}});function Ry(e){try{let t=xy(e);return Cy(e,t.fragment,t.content)}catch(e){throw Ay(jy(e),e)}}ci(`CollaborationDocument.capture`)(function*(e){return yield*zy(e),yield*Wn({try:()=>My(e),catch:e=>Ay(`Could not capture the collaborative editor document.`,e)})}),ci(`CollaborationDocument.restore`)(function*(e){return yield*By(yield*Wn({try:()=>Ny(e),catch:e=>Ay(`Could not restore the collaborative editor document.`,e)}))}),ci(`CollaborationDocument.restoreState`)(function*(e){return yield*By(yield*Wn({try:()=>Py(e),catch:e=>Ay(`Could not restore the collaborative editor document.`,e)}))}),ci(`CollaborationDocument.applyUpdate`)((e,t)=>Wn({try:()=>Fy(e,t),catch:e=>Ay(`Could not apply the collaborative document update.`,e)})),ci(`CollaborationDocument.synchronizeState`)((e,t)=>Wn({try:()=>Iy(e,t),catch:e=>Ay(`Could not synchronize the collaborative document state.`,e)}));var zy=ci(`CollaborationDocument.inspect`)(e=>Wn({try:()=>xy(e),catch:e=>Ay(jy(e),e)}));function By(e){return zy(e).pipe(Jr(e),ji(()=>Qn(()=>e.destroy())))}var Vy=class extends Gn()(`Collaboration.ConnectionFailed`,{reason:Yr([`authentication`,`closed`,`invalid-url`,`room-replaced`,`timeout`])}){},Hy=class extends Gn()(`Collaboration.CommandFailed`,{command:Yr([`preview`,`publish`]),message:$n,published:dr,stale:dr,statusCode:rr.check(qn({minimum:400,maximum:599}))}){},Uy=Vn(Yn($r)),Wy=pr(Yn(vi)),Gy=ci(`CollaborationRoomClient.make`)(function*(e){let t=yield*ni(Zy(e.ticket.url,e.baseUrl)),n=yield*Bs,r=e.document??new Da,i=e.document===void 0,a=yield*_i(),o=yield*si(),s=Rn(o),c=Mn(o),l=new Set,u=new Map,d=new Map,f=e.ticket.authoredStateVector,p=`connecting`,m=!1,h=!1,g=`saving`,_=[e.ticket.user],v=!1,y=e.ticket.workingStateVector,b=()=>({connection:p,hasWorkingChanges:Xy(r)!==f,participants:_,persistence:g,stale:v}),x=()=>{let e=b();for(let t of l)t(e)},S=e=>{s(Lr(a,new Vy({reason:e})))},C=(e.providerFactory??Ky)({document:r,documentName:e.ticket.documentName,onAuthenticationFailed:()=>{p=`offline`,S(`authentication`),x()},onAwarenessChange:t=>{_=qy(t,e.ticket.user),x()},onStateless:e=>D(e),onStatus:e=>{p=e,e!==`online`&&(h=!1),x()},onSynced:()=>{h=!0,p=`online`,E({type:`checkpoint`}),T(),x()},token:()=>c(e.refreshTicket).then(t=>{if(t.documentName!==e.ticket.documentName)throw v=!0,x(),new Vy({reason:`room-replaced`});return t.token}),url:t});C.setUser(e.ticket.user);let w=()=>{g!==`error`&&(g=Xy(r)===y?`saved`:`saving`),x()};r.on(`update`,w);function T(){h&&g===`saved`&&s(ii(a,void 0))}function E(e){m||s(Uy(e).pipe(cr(e=>Qn(()=>C.sendStateless(e))),Si))}function D(e){let t=Wy(e);if(t._tag===`None`||m)return;let n=t.value;switch(n.type){case`working-saved`:y=n.workingStateVector,g=Xy(r)===y?`saved`:`saving`,T(),x();return;case`working-save-error`:g=`error`,x();return;case`preview-result`:O(n);return;case`publish-result`:k(n)}}function O(e){let t=u.get(e.requestId);t&&(u.delete(e.requestId),s(e.outcome.status===`success`?ii(t,e.outcome.result):Lr(t,Jy(`preview`,e.outcome.error,e.outcome.statusCode,!1))))}function k(e){let t=e.outcome.status===`success`?e.outcome:e.outcome.checkpoint;t&&(f=t.authoredStateVector,y=t.authoredStateVector,g=`saved`),e.outcome.status===`failure`&&e.outcome.statusCode===409&&(v=!0),x();let n=d.get(e.requestId);n&&(d.delete(e.requestId),s(e.outcome.status===`success`?ii(n,e.outcome.result):Lr(n,Jy(`publish`,e.outcome.error,e.outcome.statusCode,e.outcome.checkpoint?.result!==void 0))))}let A=(t,r)=>Gr(function*(){if(m)return yield*new Vy({reason:`closed`});let i=lr.make(yield*n.randomUUIDv4.pipe(Si)),a=yield*_i();return r.set(i,a),E({requestId:i,type:t}),yield*An(a).pipe(Nn({duration:e.commandTimeout??(t===`preview`?`15 seconds`:`20 seconds`),orElse:()=>yi(Jy(t,`${t===`preview`?`Preview`:`Publishing`} timed out.`,504,!1))}),ei(Qn(()=>r.delete(i))))}),j=yield*Uy({type:`checkpoint`}).pipe(Si),M=Qn(()=>{m||(m=!0,C.sendStateless(j),p=`offline`,r.off(`update`,w),C.destroy(),i&&r.destroy(),S(`closed`),Yy(u,s),Yy(d,s),x(),l.clear())}),N={awareness:C.awareness,close:M,document:r,open:An(a).pipe(Nn({duration:e.openTimeout??`15 seconds`,orElse:()=>yi(new Vy({reason:`timeout`}))})),preview:A(`preview`,u),publish:A(`publish`,d),state:b,subscribe:e=>(l.add(e),e(b()),()=>l.delete(e))};return yield*pi(()=>M),N});function Ky(e){let t=new ka({document:e.document,name:e.documentName,onAuthenticationFailed:({reason:t})=>e.onAuthenticationFailed(t),onAwarenessChange:({states:t})=>e.onAwarenessChange(t.map(e=>li(Zr)(e.user)?{user:e.user}:{})),onStateless:({payload:t})=>e.onStateless(t),onStatus:({status:t})=>e.onStatus(t===`disconnected`?`offline`:`connecting`),onSynced:({state:t})=>{t&&e.onSynced()},token:e.token,url:e.url});return{awareness:t.awareness,destroy:()=>t.destroy(),sendStateless:e=>t.sendStateless(e),setUser:e=>t.setAwarenessField(`user`,e)}}function qy(e,t){let n=new Map([[t.id,t]]);for(let t of e)li(Fr)(t.user)&&n.set(t.user.id,t.user);return[...n.values()].sort((e,n)=>e.id===t.id?-1:n.id===t.id?1:e.name.localeCompare(n.name))}function Jy(e,t,n,r){return new Hy({command:e,message:t,published:r,stale:n===409,statusCode:n})}function Yy(e,t){for(let n of e.values())t(Lr(n,new Vy({reason:`closed`})));e.clear()}function Xy(e){return zr.make(Or(Ea(e)))}function Zy(e,t){return Wr({try:()=>{let n=new URL(e,t);if(n.protocol!==`http:`&&n.protocol!==`https:`&&n.protocol!==`ws:`&&n.protocol!==`wss:`)throw Error(`Unsupported collaboration URL protocol.`);return n.protocol===`http:`&&(n.protocol=`ws:`),n.protocol===`https:`&&(n.protocol=`wss:`),n.toString()},catch:()=>new Vy({reason:`invalid-url`})})}var Qy=ui(Bs,Vs({digest:(e,t)=>ki(async()=>{let n=new Uint8Array(t);return new Uint8Array(await window.crypto.subtle.digest(e,n.buffer))}),randomBytes:e=>window.crypto.getRandomValues(new Uint8Array(e))}));async function $y(e,t,n={}){let r=await e.collaboration.ticket(t),i=Ws(Qy),a=await i.runPromise(wr());try{let o=await i.runPromise(Gy({baseUrl:n.baseUrl??window.location.origin,providerFactory:n.providerFactory,refreshTicket:gr(()=>e.collaboration.ticket(t)).pipe(Er(()=>new Vy({reason:`authentication`}))),ticket:r}).pipe(Di(Jn,a)));await i.runPromise(o.open);let s=!1;return{awareness:o.awareness,async close(){s||(s=!0,await i.runPromise(o.close),await i.runPromise(Sr(a,qr)),await i.dispose())},document:o.document,preview:()=>i.runPromise(o.preview),publish:()=>i.runPromise(o.publish),source:r.source,state:o.state,subscribe:o.subscribe,user:r.user}}catch(e){throw await i.runPromise(Sr(a,fi(e))),await i.dispose(),e}}function eb(e){let t=li(ar)(e.color)?e.color:``,n=li(ar)(e.name)?e.name:``,r=document.createElement(`span`),i=document.createElement(`span`);return r.className=`pointer-events-none relative -mx-px border-x break-normal`,r.style.borderColor=t,r.setAttribute(`aria-hidden`,`true`),i.className=`absolute -left-px -top-5 z-10 max-w-40 select-none overflow-hidden text-ellipsis whitespace-nowrap rounded-sm rounded-bl-none px-1.5 py-0.5 text-[10px] font-semibold leading-none text-white shadow-xs`,i.style.backgroundColor=t,i.textContent=n,r.append(i),r}var tb={base:`relative`,variants:{size:{xs:``,sm:``,md:``,lg:``,xl:``},orientation:{horizontal:`inline-flex -space-x-px`,vertical:`flex flex-col -space-y-px`}}},nb={__name:`FieldGroup`,props:{as:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:`horizontal`},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(e){let n=et(`fieldGroup`,e),r=Je(),i=F(()=>st({extend:tb,...r.ui?.fieldGroup||{}}));return Le(gt,F(()=>({orientation:n.orientation,size:n.size}))),(e,r)=>(s(),t(R(q),{as:R(n).as,"data-orientation":R(n).orientation,class:H(i.value({orientation:R(n).orientation,class:[R(n).ui?.base,R(n).class]}))},{default:k(()=>[d(e.$slots,`default`)]),_:3},8,[`as`,`data-orientation`,`class`]))}},rb={slots:{root:`relative inline-flex items-center`,base:[`w-full rounded-md border-0 placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75`,`transition-colors`],increment:`absolute flex items-center`,decrement:`absolute flex items-center`},variants:{fieldGroup:{horizontal:{root:`group has-focus-visible:z-[1]`,base:`group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none`},vertical:{root:`group has-focus-visible:z-[1]`,base:`group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none`}},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},size:{xs:`px-2 py-1 text-sm/4 gap-1`,sm:`px-2.5 py-1.5 text-sm/4 gap-1.5`,md:`px-2.5 py-1.5 text-base/5 gap-1.5`,lg:`px-3 py-2 text-base/5 gap-2`,xl:`px-3 py-2 text-base gap-2`},variant:{outline:`text-highlighted bg-default ring ring-inset ring-accented`,soft:`text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50`,subtle:`text-highlighted bg-elevated ring ring-inset ring-accented`,ghost:`text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent`,none:`text-highlighted bg-transparent focus:outline-none`},disabled:{true:{increment:`opacity-75 cursor-not-allowed`,decrement:`opacity-75 cursor-not-allowed`}},orientation:{horizontal:{base:`text-center`,increment:`inset-y-0 end-0 pe-1`,decrement:`inset-y-0 start-0 ps-1`},vertical:{increment:`top-0 end-0 pe-1 [&>button]:py-0 scale-80`,decrement:`bottom-0 end-0 pe-1 [&>button]:py-0 scale-80`}},highlight:{true:``},fixed:{false:``},increment:{false:``},decrement:{false:``}},compoundVariants:[{color:`primary`,variant:[`outline`,`subtle`],class:`outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary`},{color:`secondary`,variant:[`outline`,`subtle`],class:`outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary`},{color:`success`,variant:[`outline`,`subtle`],class:`outline-success/25 focus-visible:outline-3 focus-visible:ring-success`},{color:`info`,variant:[`outline`,`subtle`],class:`outline-info/25 focus-visible:outline-3 focus-visible:ring-info`},{color:`warning`,variant:[`outline`,`subtle`],class:`outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning`},{color:`error`,variant:[`outline`,`subtle`],class:`outline-error/25 focus-visible:outline-3 focus-visible:ring-error`},{color:`primary`,variant:[`soft`,`ghost`],class:`outline-primary/25 focus-visible:outline-3`},{color:`secondary`,variant:[`soft`,`ghost`],class:`outline-secondary/25 focus-visible:outline-3`},{color:`success`,variant:[`soft`,`ghost`],class:`outline-success/25 focus-visible:outline-3`},{color:`info`,variant:[`soft`,`ghost`],class:`outline-info/25 focus-visible:outline-3`},{color:`warning`,variant:[`soft`,`ghost`],class:`outline-warning/25 focus-visible:outline-3`},{color:`error`,variant:[`soft`,`ghost`],class:`outline-error/25 focus-visible:outline-3`},{color:`primary`,highlight:!0,class:`ring ring-inset ring-primary`},{color:`secondary`,highlight:!0,class:`ring ring-inset ring-secondary`},{color:`success`,highlight:!0,class:`ring ring-inset ring-success`},{color:`info`,highlight:!0,class:`ring ring-inset ring-info`},{color:`warning`,highlight:!0,class:`ring ring-inset ring-warning`},{color:`error`,highlight:!0,class:`ring ring-inset ring-error`},{color:`neutral`,variant:[`outline`,`subtle`],class:`outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted`},{color:`neutral`,variant:[`soft`,`ghost`],class:`outline-inverted/25 focus-visible:outline-3`},{color:`neutral`,highlight:!0,class:`ring ring-inset ring-inverted`},{orientation:`horizontal`,decrement:!1,class:`text-start`},{decrement:!0,size:`xs`,class:`ps-7`},{decrement:!0,size:`sm`,class:`ps-8`},{decrement:!0,size:`md`,class:`ps-9`},{decrement:!0,size:`lg`,class:`ps-10`},{decrement:!0,size:`xl`,class:`ps-11`},{increment:!0,size:`xs`,class:`pe-7`},{increment:!0,size:`sm`,class:`pe-8`},{increment:!0,size:`md`,class:`pe-9`},{increment:!0,size:`lg`,class:`pe-10`},{increment:!0,size:`xl`,class:`pe-11`},{fixed:!1,size:`xs`,class:`md:text-xs`},{fixed:!1,size:`sm`,class:`md:text-xs`},{fixed:!1,size:`md`,class:`md:text-sm`},{fixed:!1,size:`lg`,class:`md:text-sm`}],defaultVariants:{size:`md`,color:`primary`,variant:`outline`}},ib=Object.assign({inheritAttrs:!1},{__name:`InputNumber`,props:{as:{type:null,required:!1},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},orientation:{type:null,required:!1,default:`horizontal`},increment:{type:[Boolean,Object],required:!1,default:!0},incrementIcon:{type:null,required:!1},incrementDisabled:{type:Boolean,required:!1},decrement:{type:[Boolean,Object],required:!1,default:!0},decrementIcon:{type:null,required:!1},decrementDisabled:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},min:{type:Number,required:!1},max:{type:Number,required:!1},step:{type:Number,required:!1},stepSnapping:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},required:{type:Boolean,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},formatOptions:{type:null,required:!1},disableWheelChange:{type:Boolean,required:!1},invertWheelChange:{type:Boolean,required:!1},readonly:{type:Boolean,required:!1},focusOnChange:{type:Boolean,required:!1},locale:{type:String,required:!1}},emits:[`update:modelValue`,`blur`,`change`],setup(e,{expose:n,emit:r,attrs:i}){let a=e,o=r,c=et(`inputNumber`,a),l=Wt(c,`modelValue`,o,{defaultValue:c.defaultValue}),{t:u}=We(),f=Je(),p=Ct(lt(c,`as`,`stepSnapping`,`formatOptions`,`disableWheelChange`,`invertWheelChange`,`required`,`readonly`,`focusOnChange`,`locale`),o),{emitFormBlur:m,emitFormFocus:h,emitFormChange:g,emitFormInput:v,id:y,color:b,size:x,name:C,highlight:w,disabled:T,ariaAttrs:E}=ut(a),{orientation:D,size:O}=pt(a),A=F(()=>b.value??c.color),j=F(()=>w.value??c.highlight),M=F(()=>O.value??x.value??c.size),N=F(()=>T.value??c.disabled),ee=F(()=>st({extend:rb,...f.ui?.inputNumber||{}})({color:A.value,variant:c.variant,size:M.value,highlight:j.value,fixed:c.fixed,orientation:c.orientation,fieldGroup:D.value,increment:c.orientation===`vertical`?!!c.increment||!!c.decrement:!!c.increment,decrement:c.orientation!==`vertical`&&!!c.decrement})),te=F(()=>c.incrementIcon||(c.orientation===`horizontal`?f.ui.icons.plus:f.ui.icons.chevronUp)),P=F(()=>c.decrementIcon||(c.orientation===`horizontal`?f.ui.icons.minus:f.ui.icons.chevronDown)),I=S(`inputRef`);function ne(e){c.modelModifiers?.optional&&(l.value=e??=void 0);let t=new Event(`change`,{target:{value:e}});o(`change`,t),g(),v()}function re(e){m(),o(`blur`,e)}function ie(){c.autofocus&&I.value?.$el?.focus()}let oe;return ae(()=>{oe=setTimeout(()=>{ie()},c.autofocusDelay)}),_(()=>clearTimeout(oe)),n({inputRef:de(()=>I.value?.$el)}),(e,n)=>(s(),t(R(ko),V(R(p),{id:R(y),"default-value":R(c).defaultValue,"model-value":R(l),min:R(c).min,max:R(c).max,step:R(c).step,"data-slot":i[`data-slot`]??`root`,class:ee.value.root({class:[R(c).ui?.root,R(c).class]}),name:R(C),disabled:N.value,"onUpdate:modelValue":n[0]||=e=>ne(e)}),{default:k(()=>[z(R(Mo),V({...i,...R(E)},{ref_key:`inputRef`,ref:I,placeholder:R(c).placeholder,required:R(c).required,"data-slot":`base`,class:ee.value.base({class:R(c).ui?.base}),onBlur:re,onFocus:R(h)}),null,16,[`placeholder`,`required`,`class`,`onFocus`]),R(c).increment?(s(),K(`div`,{key:0,"data-slot":`increment`,class:H(ee.value.increment({class:R(c).ui?.increment}))},[z(R(jo),{"as-child":``,disabled:N.value||R(c).incrementDisabled},{default:k(()=>[d(e.$slots,`increment`,{},()=>[z(mt,V({icon:te.value,color:A.value,size:M.value,variant:`link`,"aria-label":R(u)(`inputNumber.increment`)},typeof R(c).increment==`object`?R(c).increment:void 0),null,16,[`icon`,`color`,`size`,`aria-label`])])]),_:3},8,[`disabled`])],2)):L(``,!0),R(c).decrement?(s(),K(`div`,{key:1,"data-slot":`decrement`,class:H(ee.value.decrement({class:R(c).ui?.decrement}))},[z(R(Ao),{"as-child":``,disabled:N.value||R(c).decrementDisabled},{default:k(()=>[d(e.$slots,`decrement`,{},()=>[z(mt,V({icon:P.value,color:A.value,size:M.value,variant:`link`,"aria-label":R(u)(`inputNumber.decrement`)},typeof R(c).decrement==`object`?R(c).decrement:void 0),null,16,[`icon`,`color`,`size`,`aria-label`])])]),_:3},8,[`disabled`])],2)):L(``,!0)]),_:3},16,[`id`,`default-value`,`model-value`,`min`,`max`,`step`,`data-slot`,`class`,`name`,`disabled`]))}}),ab={slots:{root:`relative flex items-start`,base:[`inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-3 data-[state=unchecked]:bg-accented`,`transition-[background] duration-200 ease-out`],container:`flex items-center`,thumb:`group pointer-events-none rounded-full bg-default shadow-lg ring-0 transition-transform duration-200 ease-out motion-reduce:transition-none data-[state=unchecked]:translate-x-0 data-[state=unchecked]:rtl:-translate-x-0 flex items-center justify-center`,icon:[`absolute shrink-0 group-data-[state=unchecked]:text-dimmed opacity-0 size-10/12`,`transition-[color,opacity] duration-200 ease-out`],wrapper:`ms-2`,label:`block font-medium text-default`,description:`text-muted`},variants:{color:{primary:{base:`data-[state=checked]:bg-primary outline-primary/25`,icon:`group-data-[state=checked]:text-primary`},secondary:{base:`data-[state=checked]:bg-secondary outline-secondary/25`,icon:`group-data-[state=checked]:text-secondary`},success:{base:`data-[state=checked]:bg-success outline-success/25`,icon:`group-data-[state=checked]:text-success`},info:{base:`data-[state=checked]:bg-info outline-info/25`,icon:`group-data-[state=checked]:text-info`},warning:{base:`data-[state=checked]:bg-warning outline-warning/25`,icon:`group-data-[state=checked]:text-warning`},error:{base:`data-[state=checked]:bg-error outline-error/25`,icon:`group-data-[state=checked]:text-error`},neutral:{base:`data-[state=checked]:bg-inverted outline-inverted/25`,icon:`group-data-[state=checked]:text-highlighted`}},size:{xs:{base:`w-7`,container:`h-4`,thumb:`size-3 data-[state=checked]:translate-x-3 data-[state=checked]:rtl:-translate-x-3`,wrapper:`text-xs`},sm:{base:`w-8`,container:`h-4`,thumb:`size-3.5 data-[state=checked]:translate-x-3.5 data-[state=checked]:rtl:-translate-x-3.5`,wrapper:`text-xs`},md:{base:`w-9`,container:`h-5`,thumb:`size-4 data-[state=checked]:translate-x-4 data-[state=checked]:rtl:-translate-x-4`,wrapper:`text-sm`},lg:{base:`w-10`,container:`h-5`,thumb:`size-4.5 data-[state=checked]:translate-x-4.5 data-[state=checked]:rtl:-translate-x-4.5`,wrapper:`text-sm`},xl:{base:`w-11`,container:`h-6`,thumb:`size-5 data-[state=checked]:translate-x-5 data-[state=checked]:rtl:-translate-x-5`,wrapper:`text-base`}},checked:{true:{icon:`group-data-[state=checked]:opacity-100`}},unchecked:{true:{icon:`group-data-[state=unchecked]:opacity-100`}},loading:{true:{icon:`animate-spin`}},highlight:{true:``},required:{true:{label:`after:content-['*'] after:ms-0.5 after:text-error`}},disabled:{true:{root:`opacity-75`,base:`cursor-not-allowed`,label:`cursor-not-allowed`,description:`cursor-not-allowed`}}},compoundVariants:[{color:`primary`,highlight:!0,class:{base:`ring ring-primary`}},{color:`secondary`,highlight:!0,class:{base:`ring ring-secondary`}},{color:`success`,highlight:!0,class:{base:`ring ring-success`}},{color:`info`,highlight:!0,class:{base:`ring ring-info`}},{color:`warning`,highlight:!0,class:{base:`ring ring-warning`}},{color:`error`,highlight:!0,class:{base:`ring ring-error`}},{color:`neutral`,highlight:!0,class:{base:`ring ring-inverted`}}],defaultVariants:{color:`primary`,size:`md`}},ob=Object.assign({inheritAttrs:!1},{__name:`Switch`,props:{as:{type:null,required:!1},color:{type:null,required:!1},size:{type:null,required:!1},highlight:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},checkedIcon:{type:null,required:!1},uncheckedIcon:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},value:{type:String,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},trueValue:{type:null,required:!1},falseValue:{type:null,required:!1}},emits:[`change`,`update:modelValue`],setup(e,{emit:n,attrs:r}){let a=e,o=b(),c=n,l=et(`switch`,a),u=Je(),f=Ct(lt(l,`required`,`value`,`defaultValue`,`modelValue`,`trueValue`,`falseValue`),c),{id:p,emitFormChange:m,emitFormInput:g,size:_,color:v,highlight:y,name:x,disabled:S,ariaAttrs:C}=ut(a),w=p.value??i(),T=F(()=>v.value??l.color),D=F(()=>y.value??l.highlight),O=F(()=>_.value??l.size),A=F(()=>S.value??l.disabled),j=ve(),M=F(()=>{let{"data-state":e,...t}=j;return t}),N=F(()=>st({extend:ab,...u.ui?.switch||{}})({size:O.value,color:T.value,highlight:D.value,required:l.required,loading:l.loading,disabled:A.value||l.loading}));function ee(e){let t=new Event(`change`,{target:{value:e}});c(`change`,t),m(),g()}return(e,n)=>(s(),t(R(q),{as:R(l).as,"data-slot":r[`data-slot`]??`root`,class:H(N.value.root({class:[R(l).ui?.root,R(l).class]}))},{default:k(()=>[E(`div`,{"data-slot":`container`,class:H(N.value.container({class:R(l).ui?.container}))},[z(R(Lo),V({id:R(w)},{...R(f),...M.value,...R(C)},{name:R(x),disabled:A.value||R(l).loading,"data-slot":`base`,class:N.value.base({class:R(l).ui?.base}),"onUpdate:modelValue":ee}),{default:k(()=>[z(R(Ro),{"data-slot":`thumb`,class:H(N.value.thumb({class:R(l).ui?.thumb}))},{default:k(()=>[R(l).loading?(s(),t(J,{key:0,name:R(l).loadingIcon||R(u).ui.icons.loading,"data-slot":`icon`,class:H(N.value.icon({class:R(l).ui?.icon,checked:!0,unchecked:!0}))},null,8,[`name`,`class`])):(s(),K(h,{key:1},[R(l).checkedIcon?(s(),t(J,{key:0,name:R(l).checkedIcon,"data-slot":`icon`,class:H(N.value.icon({class:R(l).ui?.icon,checked:!0}))},null,8,[`name`,`class`])):L(``,!0),R(l).uncheckedIcon?(s(),t(J,{key:1,name:R(l).uncheckedIcon,"data-slot":`icon`,class:H(N.value.icon({class:R(l).ui?.icon,unchecked:!0}))},null,8,[`name`,`class`])):L(``,!0)],64))]),_:1},8,[`class`])]),_:1},16,[`id`,`name`,`disabled`,`class`])],2),R(l).label||o.label||R(l).description||o.description?(s(),K(`div`,{key:0,"data-slot":`wrapper`,class:H(N.value.wrapper({class:R(l).ui?.wrapper}))},[R(l).label||o.label?(s(),t(R(Sn),{key:0,for:R(w),"data-slot":`label`,class:H(N.value.label({class:R(l).ui?.label}))},{default:k(()=>[d(e.$slots,`label`,{label:R(l).label},()=>[G(B(R(l).label),1)])]),_:3},8,[`for`,`class`])):L(``,!0),R(l).description||o.description?(s(),K(`p`,{key:1,"data-slot":`description`,class:H(N.value.description({class:R(l).ui?.description}))},[d(e.$slots,`description`,{description:R(l).description},()=>[G(B(R(l).description),1)])],2)):L(``,!0)],2)):L(``,!0)]),_:3},8,[`as`,`data-slot`,`class`]))}}),sb={class:`mb-4`},cb={class:`text-sm font-semibold text-highlighted`},lb={class:`grid gap-4`},ub={key:0,class:`text-xs text-muted`},db=U({__name:`ComponentProperties`,props:{component:{},disabled:{type:Boolean},modelValue:{}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,a=P(``),o=P({}),c=P({}),l=F(()=>y(r.component?.name||`component`)),u=F(()=>{let e=r.component?.props||[],t=new Set(e.map(e=>e.name)),n=Object.entries(r.modelValue).filter(([e])=>!t.has(e)).map(([e,t])=>({name:e,required:!1,type:v(t)}));return[...e,...n]});T(()=>[r.component,r.modelValue],()=>{for(let e of u.value)(e.type===`array`||e.type===`object`)&&(o.value[e.name]=JSON.stringify(r.modelValue[e.name],null,2),c.value[e.name]=``)},{deep:!0,immediate:!0});function d(e,t){i(`update:modelValue`,{...r.modelValue,[e]:t})}function f(e,t){let n=String(t??``);o.value[e.name]=n;try{let t=e.type===`array`?Ci(Zr):jn,r=pr(t)(JSON.parse(n));if(Hr(r))throw TypeError(`Enter a valid JSON ${e.type}.`);c.value[e.name]=``,d(e.name,r.value)}catch{c.value[e.name]=`Enter a valid JSON ${e.type}.`}}function m(){let e=a.value.trim();e&&!Object.hasOwn(r.modelValue,e)&&(d(e,``),a.value=``)}function _(e){let t=r.modelValue[e];return Oi(t)?t:void 0}function v(e){return Array.isArray(e)?`array`:xi(e)?`boolean`:Oi(e)?`number`:li(jn)(e)?`object`:`string`}function y(e){return e.split(`-`).map(e=>e?`${e[0]?.toUpperCase()}${e.slice(1)}`:``).join(` `)}return(n,r)=>{let i=ob,v=ib,y=ac,b=rn,x=Cn,S=mt,C=nb;return s(),K(`div`,{class:`max-h-104 w-[min(26rem,calc(100vw-2rem))] overflow-y-auto p-4`,onClick:r[1]||=g(()=>{},[`stop`])},[E(`div`,sb,[E(`p`,cb,B(l.value)+` properties`,1),r[2]||=E(`p`,{class:`text-xs text-muted`},`Changes update this block in the visual document.`,-1)]),E(`div`,lb,[(s(!0),K(h,null,M(u.value,n=>(s(),t(x,{key:n.name,label:n.name,required:n.required,error:c.value[n.name]||void 0,size:`sm`},{default:k(()=>[n.type===`boolean`?(s(),t(i,{key:0,"model-value":e.modelValue[n.name]===!0,disabled:e.disabled,"onUpdate:modelValue":e=>d(n.name,e)},null,8,[`model-value`,`disabled`,`onUpdate:modelValue`])):n.type===`number`?(s(),t(v,{key:1,"model-value":_(n.name),disabled:e.disabled,class:`w-full`,"onUpdate:modelValue":e=>d(n.name,e)},null,8,[`model-value`,`disabled`,`onUpdate:modelValue`])):n.type===`array`||n.type===`object`?(s(),t(y,{key:2,"model-value":o.value[n.name],disabled:e.disabled,rows:3,class:`w-full font-mono text-xs`,"onUpdate:modelValue":e=>f(n,e)},null,8,[`model-value`,`disabled`,`onUpdate:modelValue`])):(s(),t(b,{key:3,"model-value":String(e.modelValue[n.name]??``),disabled:e.disabled,class:`w-full`,"onUpdate:modelValue":e=>d(n.name,e)},null,8,[`model-value`,`disabled`,`onUpdate:modelValue`]))]),_:2},1032,[`label`,`required`,`error`]))),128)),u.value.length?L(``,!0):(s(),K(`p`,ub,`This component has no declared properties.`)),z(x,{label:`Add property`,size:`sm`},{default:k(()=>[z(C,{class:`w-full`},{default:k(()=>[z(b,{modelValue:a.value,"onUpdate:modelValue":r[0]||=e=>a.value=e,placeholder:`property-name`,disabled:e.disabled,class:`min-w-0 flex-1`,onKeydown:p(g(m,[`prevent`]),[`enter`])},null,8,[`modelValue`,`disabled`,`onKeydown`]),z(S,{icon:`i-lucide-plus`,color:`neutral`,variant:`soft`,disabled:e.disabled||!a.value.trim(),"aria-label":`Add property`,onClick:m},null,8,[`disabled`])]),_:1})]),_:1})])])}}}),fb={class:`text-sm font-semibold text-highlighted`},pb={key:0,class:`text-xs text-muted`},mb={key:0,role:`alert`,class:`text-sm text-error`},hb=U({__name:`BlockProperties`,props:{name:{},definition:{},modelValue:{},disabled:{type:Boolean}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,a=F(()=>cv(r.name,r.definition)),o=P(``);function c(e){return Object.hasOwn(r.modelValue,e.name)?r.modelValue[e.name]:e.defaultValue}function l(e){let t=c(e);return Oi(t)?t:void 0}function u(e,t){if(!r.disabled)try{i(`update:modelValue`,a.value.setProperty(r.modelValue,e.name,t)),o.value=``}catch(e){o.value=e instanceof Error?e.message:`This value is unavailable.`}}return(n,r)=>{let i=xn,a=ob,d=ib,f=ac,p=rn,m=mt,_=Cn;return s(),K(`div`,{class:`grid max-h-104 w-[min(26rem,calc(100vw-2rem))] gap-4 overflow-y-auto p-4`,onClick:r[0]||=g(()=>{},[`stop`])},[E(`div`,null,[E(`p`,fb,B(e.definition.label),1),e.definition.description?(s(),K(`p`,pb,B(e.definition.description),1)):L(``,!0)]),(s(!0),K(h,null,M(e.definition.props,n=>(s(),t(_,{key:n.name,label:n.label,description:n.help,required:n.required,size:`sm`},{default:k(()=>[n.input===`select`?(s(),t(i,{key:0,"model-value":String(c(n)??``),items:[...n.options],"value-key":`value`,class:`w-full`,disabled:e.disabled,"onUpdate:modelValue":e=>u(n,e)},null,8,[`model-value`,`items`,`disabled`,`onUpdate:modelValue`])):n.input===`toggle`?(s(),t(a,{key:1,"model-value":c(n)===!0,disabled:e.disabled,"onUpdate:modelValue":e=>u(n,e)},null,8,[`model-value`,`disabled`,`onUpdate:modelValue`])):n.input===`number`?(s(),t(d,{key:2,"model-value":l(n),class:`w-full`,disabled:e.disabled,"onUpdate:modelValue":e=>u(n,e)},null,8,[`model-value`,`disabled`,`onUpdate:modelValue`])):n.input===`textarea`?(s(),t(f,{key:3,"model-value":String(c(n)??``),class:`w-full`,disabled:e.disabled,"onUpdate:modelValue":e=>u(n,e)},null,8,[`model-value`,`disabled`,`onUpdate:modelValue`])):(s(),t(p,{key:4,"model-value":String(c(n)??``),class:`w-full`,disabled:e.disabled,"onUpdate:modelValue":e=>u(n,e)},null,8,[`model-value`,`disabled`,`onUpdate:modelValue`])),n.defaultValue===void 0?L(``,!0):(s(),t(m,{key:5,size:`xs`,color:`neutral`,variant:`link`,disabled:e.disabled,onClick:e=>u(n,n.defaultValue)},{default:k(()=>[G(`Reset `+B(n.label),1)]),_:2},1032,[`disabled`,`onClick`]))]),_:2},1032,[`label`,`description`,`required`]))),128)),o.value?(s(),K(`p`,mb,B(o.value),1)):L(``,!0)])}}}),gb=[`aria-expanded`],_b={class:`truncate font-mono text-xs font-medium text-muted transition-colors group-hover:text-default`},vb={class:`flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100`},yb={key:0,class:`ml-5 mt-2 border-l-2 border-dashed border-default pl-4`},bb=U({__name:`ComponentNode`,props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(e){let n=e,r=_t(),i=P(!1),a=P(!1),o=F(()=>String(n.node.attrs.tag||`component`)),c=F(()=>p.value?.authoring?.label??o.value.split(`-`).map(S).join(` `)),l=F(()=>li(jn)(n.node.attrs.props)?n.node.attrs.props:{}),u=F(()=>Object.keys(l.value).length),d=F(()=>n.node.childCount),f=F(()=>d.value>0),p=F(()=>r.bootstrap.components.find(e=>e.name===o.value)),m=F(()=>new Set([...n.node.content.content].map(e=>String(e.attrs.name||`default`)))),h=F(()=>p.value?.slots.find(e=>!m.value.has(e.name))),_=F(()=>p.value?.authoring?.slots.find(e=>e.name===h.value?.name)?.label??h.value?.name);ae(()=>n.editor.on(`transaction`,v)),Fe(()=>n.editor.off(`transaction`,v));function v({transaction:e}){let t=n.getPos();Oi(t)&&Ju(e,t,n.node.nodeSize)&&(i.value=!1)}function y(e){e.preventDefault(),e.stopPropagation(),f.value?i.value=!i.value:a.value=!0}function b(e){e.preventDefault(),e.stopPropagation();let t=n.getPos();Oi(t)&&n.editor.view.dispatch(n.editor.state.tr.setSelection(j.create(n.editor.state.doc,t)))}function x(e){e.preventDefault(),e.stopPropagation();let t=n.getPos(),r=n.editor.schema.nodes.cmsSlot;if(!n.editor.isEditable||!h.value||!Oi(t)||!r)return;let a=p.value?.authoring?cv(p.value.name,p.value.authoring).createSlot(h.value.name):mv(h.value.name),o=n.editor.schema.nodeFromJSON(a),s=t+n.node.nodeSize-1,c=n.editor.state.tr.insert(s,o);c.setSelection(C.near(c.doc.resolve(s+1),1)),i.value=!1,n.editor.view.dispatch(c.scrollIntoView()),n.editor.view.focus()}function S(e){return e?`${e[0]?.toUpperCase()}${e.slice(1)}`:``}return(n,r)=>{let o=J,m=Bi,v=mt,S=Ri,C=Wi;return s(),t(R(ne),{class:`my-3`},{default:k(()=>[E(`div`,{contenteditable:`false`,class:H([`group flex items-center justify-between rounded-md border px-2 py-1.5 transition-colors`,e.selected?`border-accented bg-elevated/70`:`border-transparent hover:border-muted hover:bg-muted/50`]),onPointerdown:r[4]||=g(()=>{},[`stop`]),onMousedown:r[5]||=g(()=>{},[`stop`])},[E(`button`,{type:`button`,class:`flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-left`,"aria-expanded":f.value?!i.value:void 0,onClick:y},[z(o,{name:f.value?i.value?`i-lucide-chevron-right`:`i-lucide-chevron-down`:`i-lucide-box`,class:`size-3.5 shrink-0 text-muted transition-colors group-hover:text-default`},null,8,[`name`]),E(`span`,_b,B(c.value),1),!p.value?.authoring&&u.value?(s(),t(m,{key:0,color:`neutral`,variant:`subtle`,size:`xs`},{default:k(()=>[G(B(u.value)+` `+B(u.value===1?`prop`:`props`),1)]),_:1})):L(``,!0),!p.value?.authoring&&d.value?(s(),t(m,{key:1,color:`neutral`,variant:`outline`,size:`xs`},{default:k(()=>[G(B(d.value)+` `+B(d.value===1?`slot`:`slots`),1)]),_:1})):L(``,!0)],8,gb),E(`div`,vb,[z(S,{text:`Locate in preview`},{default:k(()=>[z(v,{color:`neutral`,variant:`ghost`,size:`xs`,icon:`i-lucide-crosshair`,"aria-label":`Locate ${c.value} in preview`,onClick:b},null,8,[`aria-label`])]),_:1}),h.value?(s(),t(S,{key:0,text:`Add ${_.value}`},{default:k(()=>[z(v,{color:`neutral`,variant:`ghost`,size:`xs`,icon:`i-lucide-plus`,"aria-label":`Add ${_.value}`,disabled:!e.editor.isEditable,onClick:x},null,8,[`aria-label`,`disabled`])]),_:1},8,[`text`])):L(``,!0),!p.value?.authoring||p.value.authoring.props.length?(s(),t(C,{key:1,open:a.value,"onUpdate:open":r[3]||=e=>a.value=e,content:{align:`start`}},{content:k(()=>[p.value?.authoring?(s(),t(hb,{key:0,name:p.value.name,definition:p.value.authoring,"model-value":l.value,disabled:!e.editor.isEditable,"onUpdate:modelValue":r[1]||=t=>e.updateAttributes({props:t})},null,8,[`name`,`definition`,`model-value`,`disabled`])):(s(),t(db,{key:1,component:p.value,"model-value":l.value,disabled:!e.editor.isEditable,"onUpdate:modelValue":r[2]||=t=>e.updateAttributes({props:t})},null,8,[`component`,`model-value`,`disabled`]))]),default:k(()=>[z(S,{text:`Edit ${c.value}`,disabled:a.value},{default:k(()=>[z(v,{color:`neutral`,variant:`ghost`,size:`xs`,icon:`i-lucide-sliders-horizontal`,"aria-label":`Edit ${c.value}`,disabled:!e.editor.isEditable,onClick:r[0]||=g(()=>{},[`stop`])},null,8,[`aria-label`,`disabled`])]),_:1},8,[`text`,`disabled`])]),_:1},8,[`open`])):L(``,!0),z(S,{text:`Delete component`},{default:k(()=>[z(v,{color:`neutral`,variant:`ghost`,size:`xs`,icon:`i-lucide-trash-2`,disabled:!e.editor.isEditable,onClick:e.deleteNode},null,8,[`disabled`,`onClick`])]),_:1})])],34),f.value?He((s(),K(`div`,yb,[z(R(pe),{class:`min-h-6`})],512)),[[N,!i.value]]):L(``,!0)]),_:1})}}}),xb={class:`flex-1 space-y-6 overflow-y-auto px-4 py-5 sm:px-6`},Sb={class:`space-y-3`},Cb={class:`flex items-center gap-3 rounded-lg border border-default bg-muted/30 p-3`},wb={class:`min-w-0 flex-1 truncate font-mono text-xs text-highlighted`},Tb={class:`space-y-3 border-t border-default pt-5`},Eb={class:`space-y-3 border-t border-default pt-5`},Db={class:`grid grid-cols-3 gap-2`},Ob=[`aria-pressed`,`onClick`],kb={class:`text-xs font-medium`},Ab={class:`text-[11px] leading-4 text-muted`},jb={class:`flex justify-end gap-2 border-t border-default px-4 py-3 sm:px-6`},Mb=U({__name:`ImageProperties`,props:{allowReplace:{type:Boolean},modelValue:{}},emits:[`apply`,`cancel`,`replace`],setup(e,{emit:n}){let r=e,i=n,a=Ee({decorative:!1,description:``,layout:`natural`}),o=F(()=>a.decorative||!!a.description.trim());T(()=>r.modelValue,e=>{a.decorative=e.alt===``,a.description=e.alt||``,a.layout=e.layout},{immediate:!0});function c(){o.value&&i(`apply`,{alt:a.decorative?``:a.description.trim(),layout:a.layout,src:r.modelValue.src})}return(n,r)=>{let l=mt,u=ac,d=Cn,f=ob,p=J;return s(),K(`form`,{class:`flex h-full flex-col`,onSubmit:g(c,[`prevent`])},[E(`div`,xb,[E(`section`,Sb,[r[4]||=E(`div`,null,[E(`h3`,{class:`text-sm font-medium text-highlighted`},`Image`),E(`p`,{class:`mt-1 text-xs text-muted`},`Choose the asset used by this image.`)],-1),E(`div`,Cb,[E(`p`,wb,B(e.modelValue.src),1),e.allowReplace?(s(),t(l,{key:0,type:`button`,color:`neutral`,variant:`outline`,size:`sm`,icon:`i-lucide-images`,label:`Replace`,onClick:r[0]||=e=>i(`replace`)})):L(``,!0)])]),E(`section`,Tb,[r[5]||=E(`div`,null,[E(`h3`,{class:`text-sm font-medium text-highlighted`},`Accessibility`),E(`p`,{class:`mt-1 text-xs text-muted`},`Describe the image's purpose, or mark it as decorative.`)],-1),z(d,{label:`Description`,error:o.value?void 0:`Add a description or mark the image as decorative.`,size:`sm`},{default:k(()=>[z(u,{modelValue:a.description,"onUpdate:modelValue":r[1]||=e=>a.description=e,disabled:a.decorative,placeholder:a.decorative?`Not required for decorative images`:`What does this image communicate?`,rows:3,autoresize:``,class:`w-full`},null,8,[`modelValue`,`disabled`,`placeholder`])]),_:1},8,[`error`]),z(f,{modelValue:a.decorative,"onUpdate:modelValue":r[2]||=e=>a.decorative=e,label:`Decorative image`,description:`Screen readers will ignore this image.`},null,8,[`modelValue`])]),E(`section`,Eb,[r[6]||=E(`div`,null,[E(`h3`,{class:`text-sm font-medium text-highlighted`},`Layout`),E(`p`,{class:`mt-1 text-xs text-muted`},`Choose how the image occupies the content canvas.`)],-1),E(`div`,Db,[(s(!0),K(h,null,M(R(En),e=>(s(),K(`button`,{key:e.value,type:`button`,class:H([`flex min-h-24 cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border px-2 py-3 text-center transition-colors`,a.layout===e.value?`border-primary bg-primary/5 text-highlighted ring-1 ring-primary`:`border-default bg-default text-muted hover:border-muted hover:text-highlighted`]),"aria-pressed":a.layout===e.value,onClick:t=>a.layout=e.value},[z(p,{name:e.icon,class:`size-5`},null,8,[`name`]),E(`span`,kb,B(e.label),1),E(`span`,Ab,B(e.description),1)],10,Ob))),128))])])]),E(`div`,jb,[z(l,{type:`button`,color:`neutral`,variant:`ghost`,label:`Cancel`,onClick:r[3]||=e=>i(`cancel`)}),z(l,{type:`submit`,disabled:!o.value,label:`Save Changes`},null,8,[`disabled`])])],32)}}});function Nb(e,t=`natural`){return{asset:e,decorative:!1,description:e.name.replace(/\.[^.]+$/u,``).replace(/[-_]+/gu,` `),layout:t}}var Pb={class:`flex h-[min(68vh,620px)] min-h-112 flex-col`},Fb={class:`flex flex-col gap-2 border-b border-default p-4 sm:flex-row`},Ib={key:1,class:`grid flex-1 grid-cols-3 content-start gap-3 overflow-hidden p-4 sm:grid-cols-4 lg:grid-cols-5`},Lb={key:2,class:`grid flex-1 place-items-center p-8 text-center`},Rb={class:`max-w-xs`},zb={class:`mx-auto grid size-10 place-items-center rounded-full border border-default bg-muted/40`},Bb={class:`mt-3 text-sm font-medium text-highlighted`},Vb={class:`mt-1 text-xs text-muted`},Hb={key:3,class:`min-h-0 flex-1 overflow-y-auto p-4`},Ub={class:`grid grid-cols-3 gap-3 sm:grid-cols-4 lg:grid-cols-5`},Wb=[`aria-pressed`,`onClick`],Gb=[`src`,`alt`],Kb={key:0,class:`absolute right-2 top-2 grid size-5 place-items-center rounded-full bg-primary text-inverted shadow-sm`},qb={class:`mt-1.5 block truncate text-xs text-highlighted`},Jb={class:`block truncate font-mono text-[10px] text-muted`},Yb={key:0,class:`flex justify-center pt-5`},Xb={class:`flex items-center justify-between border-t border-default px-4 py-2 text-xs text-muted`},Zb={key:0},Qb={class:`w-full`},$b={key:0,class:`grid gap-4 border-b border-default p-4 sm:grid-cols-[minmax(0,1fr)_180px]`},ex={class:`flex min-w-0 gap-3`},tx=[`src`],nx={class:`min-w-0 flex-1`},rx={class:`flex items-center justify-between gap-3 px-4 py-3`},ix={class:`text-xs text-muted`},ax={class:`flex shrink-0 gap-2`},ox=U({__name:`MediaPicker`,props:{allowUpload:{type:Boolean},initialLayout:{default:`natural`},mode:{default:`insert`},open:{type:Boolean}},emits:[`cancel`,`commit`],setup(e,{emit:n}){let r=e,i=n,{gateway:a}=_t(),o=kn(a),c=S(`searchInput`),l=S(`uploader`),u=P(),d=F(()=>r.mode===`replace`?`Replace Image`:`Insert Image`),f=F(()=>!!u.value&&(u.value.decorative||!!u.value.description.trim())),p=F({get:()=>o.folder.value||`__all__`,set:e=>o.folder.value=e===`__all__`?``:e}),m=F(()=>[{label:`All folders`,value:On},...o.folders.value.map(e=>({label:e,value:e}))]),g=En.map(({label:e,value:t})=>({label:e,value:t}));T(()=>r.open,async e=>{e&&(o.search.value=``,o.folder.value=``,u.value=void 0,await he(),await o.load(),await he(),c.value?.$el.querySelector(`input`)?.focus())},{immediate:!0});function _(e){u.value=Nb(e,r.initialLayout)}function v(){f.value&&u.value&&i(`commit`,u.value)}function y(){l.value?.open({folder:o.folder.value||``})}async function b(e){await o.load();let t=e.at(-1);t&&_(t)}return(n,r)=>{let a=rn,x=xn,S=mt,C=yt,w=na,T=J,D=Cn,O=ob,A=wn;return s(),K(h,null,[z(A,{open:e.open,title:d.value,description:`Choose an asset, then confirm how it should be presented.`,ui:{content:`max-w-5xl`,body:`p-0 sm:p-0`,footer:`p-0 sm:p-0`},"onUpdate:open":r[6]||=e=>!e&&i(`cancel`)},{body:k(()=>[E(`div`,Pb,[E(`div`,Fb,[z(a,{ref_key:`searchInput`,ref:c,modelValue:R(o).search.value,"onUpdate:modelValue":r[0]||=e=>R(o).search.value=e,color:`neutral`,variant:`outline`,placeholder:`Search images`,autofocus:``,icon:`i-lucide-search`,class:`min-w-0 flex-1`},null,8,[`modelValue`]),z(x,{modelValue:p.value,"onUpdate:modelValue":r[1]||=e=>p.value=e,items:m.value,"value-key":`value`,icon:`i-lucide-folder`,class:`w-full sm:w-56`},null,8,[`modelValue`,`items`]),e.allowUpload?(s(),t(S,{key:0,icon:`i-lucide-upload`,label:`Upload`,onClick:y})):L(``,!0)]),R(o).error.value?(s(),t(C,{key:0,title:`Media could not be loaded`,description:R(ri)(R(o).error.value),icon:`i-lucide-circle-alert`,color:`error`,variant:`subtle`,class:`m-4`,actions:[{label:`Retry`,color:`error`,variant:`soft`,onClick:R(o).load}]},null,8,[`description`,`actions`])):R(o).isLoading.value&&!R(o).assets.value.length?(s(),K(`div`,Ib,[(s(),K(h,null,M(10,e=>z(w,{key:e,class:`aspect-square rounded-lg`})),64))])):R(o).assets.value.length?(s(),K(`div`,Hb,[E(`div`,Ub,[(s(!0),K(h,null,M(R(o).assets.value,e=>(s(),K(`button`,{key:e.objectKey,type:`button`,class:`group min-w-0 cursor-pointer rounded-lg text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,"aria-pressed":u.value?.asset.objectKey===e.objectKey,onClick:t=>_(e)},[E(`span`,{class:H([`relative block aspect-square overflow-hidden rounded-lg border bg-muted/30 transition-all`,u.value?.asset.objectKey===e.objectKey?`border-primary ring-2 ring-primary`:`border-default group-hover:border-muted group-hover:ring-1 group-hover:ring-muted`])},[E(`img`,{src:e.url,alt:e.name,loading:`lazy`,class:`size-full object-cover transition-transform duration-150 group-hover:scale-[1.02]`},null,8,Gb),u.value?.asset.objectKey===e.objectKey?(s(),K(`span`,Kb,[z(T,{name:`i-lucide-check`,class:`size-3.5`})])):L(``,!0)],2),E(`span`,qb,B(e.name),1),E(`span`,Jb,B(R(Tn)(e)),1)],8,Wb))),128))]),R(o).nextCursor.value?(s(),K(`div`,Yb,[z(S,{color:`neutral`,variant:`outline`,loading:R(o).isLoading.value,label:`Load More`,onClick:R(o).loadMore},null,8,[`loading`,`onClick`])])):L(``,!0)])):(s(),K(`div`,Lb,[E(`div`,Rb,[E(`span`,zb,[z(T,{name:`i-lucide-image-off`,class:`size-5 text-muted`})]),E(`p`,Bb,B(R(o).search.value?`No matching images`:`No images in this location`),1),E(`p`,Vb,B(R(o).search.value?`Try a different filename or path.`:`Choose another location to continue.`),1)])])),E(`div`,Xb,[E(`span`,null,B(R(o).total.value)+` `+B(R(o).total.value===1?`image`:`images`),1),R(o).assets.value.length<R(o).total.value?(s(),K(`span`,Zb,`Showing `+B(R(o).assets.value.length),1)):L(``,!0)])])]),footer:k(()=>[E(`div`,Qb,[u.value?(s(),K(`div`,$b,[E(`div`,ex,[E(`img`,{src:u.value.asset.url,alt:``,class:`size-14 shrink-0 rounded-md border border-default bg-muted object-cover`},null,8,tx),E(`div`,nx,[z(D,{label:`Description`,error:f.value?void 0:`Add a description or mark this image as decorative.`,size:`sm`},{default:k(()=>[z(a,{modelValue:u.value.description,"onUpdate:modelValue":r[2]||=e=>u.value.description=e,disabled:u.value.decorative,placeholder:`What does this image communicate?`,class:`w-full`},null,8,[`modelValue`,`disabled`])]),_:1},8,[`error`]),z(O,{modelValue:u.value.decorative,"onUpdate:modelValue":r[3]||=e=>u.value.decorative=e,label:`Decorative`,size:`sm`,class:`mt-2`},null,8,[`modelValue`])])]),z(D,{label:`Layout`,size:`sm`},{default:k(()=>[z(x,{modelValue:u.value.layout,"onUpdate:modelValue":r[4]||=e=>u.value.layout=e,items:R(g),"value-key":`value`,class:`w-full`},null,8,[`modelValue`,`items`])]),_:1})])):L(``,!0),E(`div`,rx,[E(`p`,ix,B(u.value?u.value.asset.objectKey:`Select an image to continue.`),1),E(`div`,ax,[z(S,{color:`neutral`,variant:`ghost`,label:`Cancel`,onClick:r[5]||=e=>i(`cancel`)}),z(S,{disabled:!f.value,label:d.value,onClick:v},null,8,[`disabled`,`label`])])])])]),_:1},8,[`open`,`title`]),z(Dn,{ref_key:`uploader`,ref:l,onUploaded:b},null,512)],64)}}}),sx=[`src`,`alt`,`title`,`width`,`height`],cx={class:`flex flex-col items-center gap-2 text-center`},lx=U({__name:`ImageNode`,props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(e){let n=e,{bootstrap:r}=_t(),i=P(!1),a=P(!1),o=F(()=>String(n.node.attrs.src||``)),c=F(()=>n.node.attrs.alt===null?null:String(n.node.attrs.alt||``)),l=F(()=>[`content`,`full`].includes(n.node.attrs.layout)?n.node.attrs.layout:`natural`),u=F(()=>({alt:c.value,layout:l.value,src:o.value})),d=F(()=>li(jn)(n.node.attrs.cmsProps)?n.node.attrs.cmsProps:{}),f=F(()=>l.value===`natural`?`inline-grid max-w-full`:l.value===`content`?`grid w-full max-w-3xl`:`grid w-full`),p=F(()=>l.value===`natural`?`max-w-full object-contain`:`w-full object-cover`),m=F(()=>n.selected||i.value||a.value),h=F(()=>[En.map(e=>S(e.value,e.label,e.icon))]),_=[[{label:`Delete Image`,icon:`i-lucide-trash-2`,color:`error`,onSelect:C}]];ae(()=>{!o.value&&r.media.enabled&&(a.value=!0)});function v(){let e=n.getPos();Oi(e)&&n.editor.chain().focus().setNodeSelection(e).run()}function y(e){n.updateAttributes(e),i.value=!1}function b(){i.value=!1,a.value=!0}function x(e){n.updateAttributes({alt:e.decorative?``:e.description.trim(),layout:e.layout,src:e.asset.url}),a.value=!1}function S(e,t,r){return{checked:l.value===e,icon:r,label:t,onSelect:()=>n.updateAttributes({layout:e}),type:`checkbox`}}function C(){let e=n.getPos();Oi(e)&&n.editor.view.dispatch(n.editor.state.tr.delete(e,e+n.node.nodeSize)),i.value=!1}function w(e){let t=d.value[e];return Y(t)||Oi(t)?String(t):void 0}return(n,d)=>{let S=J,C=mt,T=Ri,D=_n,O=Zi;return s(),t(R(ne),{as:`span`,class:`group relative my-3 block min-h-22 overflow-visible pb-11`},{default:k(()=>[E(`span`,{contenteditable:!1,class:H([`relative min-h-11 min-w-11 place-items-center overflow-hidden rounded-lg bg-muted/30 transition-shadow`,[f.value,e.selected?`ring-2 ring-primary`:`ring-1 ring-default group-hover:ring-muted`]]),onClick:v},[o.value?(s(),K(`img`,{key:0,src:o.value,alt:c.value||``,title:e.node.attrs.title||void 0,width:w(`width`),height:w(`height`),class:H([w(`class`),p.value])},null,10,sx)):(s(),K(`span`,{key:1,class:`flex min-h-32 min-w-64 cursor-pointer items-center justify-center p-10 text-muted`,onClick:d[0]||=g(e=>a.value=!0,[`stop`])},[E(`span`,cx,[z(S,{name:`i-lucide-image-off`,class:`size-7`}),d[8]||=E(`span`,{class:`text-sm font-medium text-highlighted`},`Image unavailable`,-1),d[9]||=E(`span`,{class:`text-xs`},`Choose another asset to continue.`,-1)])]))],2),E(`span`,{contenteditable:!1,class:H([`absolute bottom-0 left-0 z-10 flex h-9 items-center gap-1 rounded-lg border border-default bg-default p-1 shadow-lg ring-1 ring-black/5 transition-[opacity,transform] duration-150 dark:ring-white/10`,m.value?`pointer-events-auto translate-y-0 opacity-100`:`pointer-events-none translate-y-1 opacity-0 group-hover:pointer-events-auto group-hover:translate-y-0 group-hover:opacity-100`]),"aria-label":`Image actions`,onPointerdown:d[3]||=g(()=>{},[`stop`]),onMousedown:d[4]||=g(()=>{},[`stop`])},[R(r).media.enabled?(s(),t(T,{key:0,text:`Replace image`},{default:k(()=>[z(C,{color:`neutral`,variant:`ghost`,size:`xs`,icon:`i-lucide-images`,"aria-label":`Replace image`,onClick:d[1]||=e=>a.value=!0})]),_:1})):L(``,!0),z(T,{text:c.value===null?`Add image description`:`Edit image details`},{default:k(()=>[z(C,{color:c.value===null?`error`:`neutral`,variant:c.value===null?`soft`:`ghost`,size:`xs`,icon:c.value===null?`i-lucide-triangle-alert`:`i-lucide-accessibility`,"aria-label":`Edit image details`,onClick:d[2]||=e=>i.value=!0},null,8,[`color`,`variant`,`icon`])]),_:1},8,[`text`]),z(D,{items:h.value,content:{align:`start`}},{default:k(()=>[z(T,{text:`Image layout`},{default:k(()=>[z(C,{color:`neutral`,variant:`ghost`,size:`xs`,icon:`i-lucide-panels-top-left`,"aria-label":`Image layout`})]),_:1})]),_:1},8,[`items`]),d[10]||=E(`span`,{class:`mx-0.5 h-4 w-px bg-default`},null,-1),z(D,{items:_,content:{align:`start`}},{default:k(()=>[z(T,{text:`More image actions`},{default:k(()=>[z(C,{color:`neutral`,variant:`ghost`,size:`xs`,icon:`i-lucide-ellipsis`,"aria-label":`More image actions`})]),_:1})]),_:1})],34),z(O,{open:i.value,title:`Image Details`,description:`Describe the image and choose its layout.`,ui:{content:`max-w-md`,body:`p-0 sm:p-0`},"onUpdate:open":d[6]||=e=>i.value=e},{body:k(()=>[z(Mb,{"allow-replace":R(r).media.enabled,"model-value":u.value,onApply:y,onCancel:d[5]||=e=>i.value=!1,onReplace:b},null,8,[`allow-replace`,`model-value`])]),_:1},8,[`open`]),R(r).media.enabled?(s(),t(ox,{key:0,"allow-upload":e.editor.isEditable,open:a.value,mode:`replace`,"initial-layout":l.value,onCommit:x,onCancel:d[7]||=e=>a.value=!1},null,8,[`allow-upload`,`open`,`initial-layout`])):L(``,!0)]),_:1})}}}),ux=U({__name:`InlineOpaqueNode`,props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(e){return(n,r)=>{let i=Bi;return s(),t(R(ne),{as:`span`,class:`mx-1 inline-flex`,contenteditable:`false`},{default:k(()=>[z(i,{color:`neutral`,variant:`subtle`,icon:`i-lucide-code-xml`,class:H(e.selected?`ring-2 ring-primary`:``)},{default:k(()=>[G(B(e.node.attrs.label||`inline content`),1)]),_:1},8,[`class`])]),_:1})}}}),dx=U({__name:`OpaqueNode`,props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(e){return(n,r)=>{let i=yt;return s(),t(R(ne),{class:`my-3`,contenteditable:`false`},{default:k(()=>[z(i,{title:`${e.node.attrs.label||`Documents`} is preserved in Markdown mode`,description:`This content is read-only in the visual editor and will not be removed or rewritten.`,icon:`i-lucide-file-code-2`,color:`neutral`,variant:`subtle`,class:H(e.selected?`ring-2 ring-primary`:``)},null,8,[`title`,`class`])]),_:1})}}}),fx={slots:{base:[`relative group rounded-md inline-flex items-center disabled:cursor-not-allowed disabled:opacity-75`,`transition-colors`],leading:`absolute inset-y-0 start-0 flex items-center`,leadingIcon:`shrink-0 text-dimmed`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailing:`absolute inset-y-0 end-0 flex items-center`,trailingIcon:`shrink-0 text-dimmed`,value:`truncate pointer-events-none`,placeholder:`truncate text-dimmed`,arrow:`fill-bg stroke-default`,content:[`max-h-[min(15rem,var(--reka-select-content-available-height,15rem))] w-(--reka-select-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden origin-(--reka-select-content-transform-origin) pointer-events-auto flex flex-col`,`max-h-[min(15rem,var(--reka-combobox-content-available-height,15rem))] origin-(--reka-combobox-content-transform-origin) w-(--reka-combobox-trigger-width)`],viewport:`relative scroll-py-1 overflow-y-auto flex-1`,group:`p-1 isolate`,empty:`text-center text-muted`,label:`font-semibold text-highlighted`,separator:`-mx-1 my-1 h-px bg-border`,item:[`group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50`,`transition-colors before:transition-colors`],itemLeadingIcon:[`shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default`,`transition-colors`],itemLeadingAvatar:`shrink-0`,itemLeadingAvatarSize:``,itemLeadingChip:`shrink-0`,itemLeadingChipSize:``,itemTrailing:`ms-auto inline-flex gap-1.5 items-center`,itemTrailingIcon:`shrink-0`,itemWrapper:`flex-1 flex flex-col min-w-0`,itemLabel:`truncate`,itemDescription:`truncate text-muted`,input:`border-b border-default`,focusScope:`flex flex-col min-h-0`,trailingClear:`p-0`},variants:{fieldGroup:{horizontal:`not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]`,vertical:`not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]`},size:{xs:{base:`px-2 py-1 text-xs gap-1`,leading:`ps-2`,trailing:`pe-2`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1 text-[10px]/3 gap-1`,item:`p-1 text-xs gap-1`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,empty:`p-2 text-xs`},sm:{base:`px-2.5 py-1.5 text-xs gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1.5 text-[10px]/3 gap-1.5`,item:`p-1.5 text-xs gap-1.5`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,empty:`p-2.5 text-xs`},md:{base:`px-2.5 py-1.5 text-sm gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-1.5 text-xs gap-1.5`,item:`p-1.5 text-sm gap-1.5`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,empty:`p-2.5 text-sm`},lg:{base:`px-3 py-2 text-sm gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-2 text-xs gap-2`,item:`p-2 text-sm gap-2`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,empty:`p-3 text-sm`},xl:{base:`px-3 py-2 text-base gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-6`,leadingAvatarSize:`xs`,trailingIcon:`size-6`,label:`p-2 text-sm gap-2`,item:`p-2 text-base gap-2`,itemLeadingIcon:`size-6`,itemLeadingAvatarSize:`xs`,itemLeadingChip:`size-6`,itemLeadingChipSize:`lg`,itemTrailingIcon:`size-6`,empty:`p-3 text-base`}},variant:{outline:`text-highlighted bg-default ring ring-inset ring-accented hover:bg-elevated disabled:bg-default`,soft:`text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50`,subtle:`text-highlighted bg-elevated ring ring-inset ring-accented hover:bg-accented/75 disabled:bg-elevated`,ghost:`text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent`,none:`text-highlighted bg-transparent focus:outline-none`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},leading:{true:``},trailing:{true:``},loading:{true:``},highlight:{true:``},fixed:{false:``},type:{file:`file:me-1.5 file:font-medium file:text-muted file:outline-none`},position:{popper:{content:`data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)]`},"item-aligned":{content:``}},multiple:{true:``},virtualize:{true:{viewport:`p-1 isolate`},false:{viewport:`divide-y divide-default`}}},compoundVariants:[{color:`primary`,variant:[`outline`,`subtle`],class:`outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary`},{color:`secondary`,variant:[`outline`,`subtle`],class:`outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary`},{color:`success`,variant:[`outline`,`subtle`],class:`outline-success/25 focus-visible:outline-3 focus-visible:ring-success`},{color:`info`,variant:[`outline`,`subtle`],class:`outline-info/25 focus-visible:outline-3 focus-visible:ring-info`},{color:`warning`,variant:[`outline`,`subtle`],class:`outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning`},{color:`error`,variant:[`outline`,`subtle`],class:`outline-error/25 focus-visible:outline-3 focus-visible:ring-error`},{color:`primary`,variant:[`soft`,`ghost`],class:`outline-primary/25 focus-visible:outline-3`},{color:`secondary`,variant:[`soft`,`ghost`],class:`outline-secondary/25 focus-visible:outline-3`},{color:`success`,variant:[`soft`,`ghost`],class:`outline-success/25 focus-visible:outline-3`},{color:`info`,variant:[`soft`,`ghost`],class:`outline-info/25 focus-visible:outline-3`},{color:`warning`,variant:[`soft`,`ghost`],class:`outline-warning/25 focus-visible:outline-3`},{color:`error`,variant:[`soft`,`ghost`],class:`outline-error/25 focus-visible:outline-3`},{color:`primary`,highlight:!0,class:`ring ring-inset ring-primary`},{color:`secondary`,highlight:!0,class:`ring ring-inset ring-secondary`},{color:`success`,highlight:!0,class:`ring ring-inset ring-success`},{color:`info`,highlight:!0,class:`ring ring-inset ring-info`},{color:`warning`,highlight:!0,class:`ring ring-inset ring-warning`},{color:`error`,highlight:!0,class:`ring ring-inset ring-error`},{color:`neutral`,variant:[`outline`,`subtle`],class:`outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted`},{color:`neutral`,variant:[`soft`,`ghost`],class:`outline-inverted/25 focus-visible:outline-3`},{color:`neutral`,highlight:!0,class:`ring ring-inset ring-inverted`},{leading:!0,size:`xs`,class:`ps-7`},{leading:!0,size:`sm`,class:`ps-8`},{leading:!0,size:`md`,class:`ps-9`},{leading:!0,size:`lg`,class:`ps-10`},{leading:!0,size:`xl`,class:`ps-11`},{trailing:!0,size:`xs`,class:`pe-7`},{trailing:!0,size:`sm`,class:`pe-8`},{trailing:!0,size:`md`,class:`pe-9`},{trailing:!0,size:`lg`,class:`pe-10`},{trailing:!0,size:`xl`,class:`pe-11`},{loading:!0,leading:!0,class:{leadingIcon:`animate-spin`}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:`animate-spin`}},{fixed:!1,size:`xs`,class:`md:text-xs`},{fixed:!1,size:`sm`,class:`md:text-xs`},{fixed:!1,size:`md`,class:`md:text-sm`},{fixed:!1,size:`lg`,class:`md:text-sm`}],defaultVariants:{size:`md`,color:`primary`,variant:`outline`,position:`popper`}},px=Object.assign({inheritAttrs:!1},{__name:`SelectMenu`,props:W({id:{type:String,required:!1},placeholder:{type:String,required:!1},searchInput:{type:[Boolean,Object],required:!1,default:!0},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},clear:{type:[Boolean,Object],required:!1},clearIcon:{type:null,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},virtualize:{type:[Boolean,Object],required:!1,default:!1},valueKey:{type:null,required:!1},labelKey:{type:null,required:!1,default:`label`},descriptionKey:{type:null,required:!1,default:`description`},items:{type:null,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},multiple:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},createItem:{type:[Boolean,String,Object],required:!1},filterFields:{type:Array,required:!1},ignoreFilter:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},resetSearchTermOnBlur:{type:Boolean,required:!1,default:!0},resetSearchTermOnSelect:{type:Boolean,required:!1,default:!0},resetModelValueOnClear:{type:Boolean,required:!1,default:!0},highlightOnHover:{type:Boolean,required:!1},by:{type:[String,Function],required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:``},searchTermModifiers:{}}),emits:W([`change`,`blur`,`focus`,`create`,`clear`,`highlight`,`update:modelValue`,`update:open`],[`update:searchTerm`]),setup(e,{expose:r,emit:i,attrs:a}){let o=e,c=i,l=b(),u=et(`selectMenu`,o),f=_e(e,`searchTerm`,{type:String,default:``}),{t:p}=We(),m=Je(),{filterGroups:v}=pn(),y=Ct(lt(u,`modelValue`,`defaultValue`,`open`,`defaultOpen`,`required`,`multiple`,`resetSearchTermOnBlur`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`highlightOnHover`,`by`),c),x=en(de(()=>u.portal)),C=de(()=>Ge(u.content,{side:`bottom`,sideOffset:8,collisionPadding:8,position:`popper`})),w=de(()=>Ge(u.arrow,{rounded:!0})),D=F(()=>typeof u.clear==`object`?u.clear:{}),O=de(()=>u.virtualize?Ge(typeof u.virtualize==`boolean`?{}:u.virtualize,{estimateSize:zi(je.value,xe.value??`md`,u.descriptionKey,!!l[`item-description`])}):!1),A=de(()=>Ge(u.searchInput,{placeholder:p(`selectMenu.search`),variant:`none`})),{emitFormBlur:j,emitFormFocus:N,emitFormInput:ee,emitFormChange:te,size:I,color:ne,id:re,name:ie,highlight:oe,disabled:se,ariaAttrs:le}=ut(o),{orientation:ue,size:fe}=pt(o),{isLeading:pe,isTrailing:me,leadingIconName:ge,trailingIconName:ve}=ft(F(()=>({icon:u.icon,leading:u.leading,leadingIcon:u.leadingIcon,trailing:u.trailing,trailingIcon:u.trailingIcon??m.ui.icons.chevronDown,loading:u.loading,loadingIcon:u.loadingIcon}))),ye=F(()=>ne.value??u.color),be=F(()=>oe.value??u.highlight),xe=F(()=>fe.value??I.value??u.size),Se=F(()=>se.value??u.disabled),[Ce,we]=Pt(),[U,Te]=Pt({props:{item:{type:[Object,String,Number,Boolean],required:!0},index:{type:Number,required:!1}}}),W=F(()=>st({extend:fx,...m.ui?.selectMenu||{}})({color:ye.value,variant:u.variant,size:xe.value,loading:u.loading,highlight:be.value,leading:pe.value||!!u.avatar||!!l.leading,trailing:me.value||!!l.trailing,fieldGroup:ue.value,virtualize:!!u.virtualize,multiple:u.multiple}));function Ee(e){if(u.multiple&&Array.isArray(e)){let t=e.map(e=>$e(Oe.value,e,{labelKey:u.labelKey,valueKey:u.valueKey,by:u.by})).filter(e=>e!=null&&e!==``);return t.length>0?t.join(`, `):void 0}return $e(Oe.value,e,{labelKey:u.labelKey,valueKey:u.valueKey,by:u.by})}let De=F(()=>u.items?.length?Tt(u.items)?u.items:[u.items]:[]),Oe=F(()=>De.value.flatMap(e=>e)),Ae=F(()=>{if(u.ignoreFilter||!f.value)return De.value;let e=Array.isArray(u.filterFields)?u.filterFields:[u.labelKey];return v(De.value,f.value,{fields:e,isStructural:e=>q(e)&&!!e.type&&[`label`,`separator`].includes(e.type)})}),je=F(()=>Ae.value.flatMap(e=>e)),Me=F(()=>{if(!u.createItem||!f.value)return!1;let e=u.valueKey?{[u.valueKey]:f.value}:f.value;return typeof u.createItem==`object`&&u.createItem.when===`always`||u.createItem===`always`?!je.value.find(t=>qe(t,e,u.by??u.valueKey)):!je.value.length}),Ne=F(()=>typeof u.createItem==`object`?u.createItem.position:`bottom`),Pe=S(`triggerRef`);function Fe(){u.autofocus&&Pe.value?.$el?.focus({focusVisible:!0})}let Ie;ae(()=>{Ie=setTimeout(()=>{Fe()},u.autofocusDelay)}),_(()=>clearTimeout(Ie));function Le(e){if(n(u.modelValue)===e)return;u.modelModifiers?.trim&&(typeof e==`string`||e==null)&&(e=e?.trim()??null),u.modelModifiers?.number&&(e=Ue(e)),u.modelModifiers?.nullable&&(e??=null),u.modelModifiers?.optional&&!u.modelModifiers?.nullable&&e!==null&&(e??=void 0);let t=new Event(`change`,{target:{value:e}});c(`change`,t),te(),ee(),u.resetSearchTermOnSelect&&(f.value=``)}let Re=P(!1),ze;_(()=>clearTimeout(ze));function Be(e){if(Re.value=e,e){let e=new FocusEvent(`focus`);c(`focus`,e),N(),clearTimeout(ze)}else{let e=new FocusEvent(`blur`);c(`blur`,e),j(),u.resetSearchTermOnBlur&&(ze=setTimeout(()=>{f.value=``},100))}}function Ve(e){e.preventDefault(),e.stopPropagation(),c(`create`,f.value)}function He(e,t){if(q(t)){if(t.disabled){e.preventDefault();return}t.onSelect?.(e)}}function q(e){return typeof e==`object`&&!!e}function Ke(e){return u.multiple&&Array.isArray(e)?e.length===0:e==null||e===``}function Xe(){c(`clear`)}let Ze=S(`viewportRef`),Qe=S(`comboboxRootRef`);return T(()=>u.items,async()=>{Re.value&&u.createItem&&(await he(),Qe.value?.highlightFirstItem?.())},{flush:`post`}),r({triggerRef:de(()=>Pe.value?.$el),viewportRef:de(()=>Ze.value)}),(e,n)=>(s(),K(h,null,[z(R(Ce),null,{default:k(()=>[z(R(Ya),{"data-slot":`item`,class:H(W.value.item({class:R(u).ui?.item})),value:f.value,onSelect:Ve},{default:k(()=>[E(`span`,{"data-slot":`itemLabel`,class:H(W.value.itemLabel({class:R(u).ui?.itemLabel}))},[d(e.$slots,`create-item-label`,{item:f.value},()=>[G(B(R(p)(`selectMenu.create`,{label:f.value})),1)])],2)]),_:3},8,[`class`,`value`])]),_:3}),z(R(U),null,{default:k(({item:n,index:r})=>[q(n)&&n.type===`label`?(s(),t(R(Za),{key:0,"data-slot":`label`,class:H(W.value.label({class:[R(u).ui?.label,n.ui?.label,n.class]}))},{default:k(()=>[G(B(R(Ye)(n,R(u).labelKey)),1)]),_:2},1032,[`class`])):q(n)&&n.type===`separator`?(s(),t(R($a),{key:1,"data-slot":`separator`,class:H(W.value.separator({class:[R(u).ui?.separator,n.ui?.separator,n.class]}))},null,8,[`class`])):(s(),t(R(Ya),{key:2,"data-slot":`item`,class:H(W.value.item({class:[R(u).ui?.item,q(n)&&n.ui?.item,q(n)&&n.class]})),disabled:q(n)&&n.disabled,value:R(u).valueKey&&q(n)?R(Ye)(n,R(u).valueKey):n,onSelect:e=>He(e,n)},{default:k(()=>[d(e.$slots,`item`,{item:n,index:r,ui:W.value},()=>[d(e.$slots,`item-leading`,{item:n,index:r,ui:W.value},()=>[q(n)&&n.icon?(s(),t(J,{key:0,name:n.icon,"data-slot":`itemLeadingIcon`,class:H(W.value.itemLeadingIcon({class:[R(u).ui?.itemLeadingIcon,n.ui?.itemLeadingIcon]}))},null,8,[`name`,`class`])):q(n)&&n.avatar?(s(),t(ot,V({key:1,size:n.ui?.itemLeadingAvatarSize||R(u).ui?.itemLeadingAvatarSize||W.value.itemLeadingAvatarSize()},n.avatar,{"data-slot":`itemLeadingAvatar`,class:W.value.itemLeadingAvatar({class:[R(u).ui?.itemLeadingAvatar,n.ui?.itemLeadingAvatar]})}),null,16,[`size`,`class`])):q(n)&&n.chip?(s(),t(St,V({key:2,size:n.ui?.itemLeadingChipSize||R(u).ui?.itemLeadingChipSize||W.value.itemLeadingChipSize(),inset:``,standalone:``},n.chip,{"data-slot":`itemLeadingChip`,class:W.value.itemLeadingChip({class:[R(u).ui?.itemLeadingChip,n.ui?.itemLeadingChip]})}),null,16,[`size`,`class`])):L(``,!0)]),E(`span`,{"data-slot":`itemWrapper`,class:H(W.value.itemWrapper({class:[R(u).ui?.itemWrapper,q(n)&&n.ui?.itemWrapper]}))},[E(`span`,{"data-slot":`itemLabel`,class:H(W.value.itemLabel({class:[R(u).ui?.itemLabel,q(n)&&n.ui?.itemLabel]}))},[d(e.$slots,`item-label`,{item:n,index:r},()=>[G(B(q(n)?R(Ye)(n,R(u).labelKey):n),1)])],2),q(n)&&(R(Ye)(n,R(u).descriptionKey)||l[`item-description`])?(s(),K(`span`,{key:0,"data-slot":`itemDescription`,class:H(W.value.itemDescription({class:[R(u).ui?.itemDescription,q(n)&&n.ui?.itemDescription]}))},[d(e.$slots,`item-description`,{item:n,index:r},()=>[G(B(R(Ye)(n,R(u).descriptionKey)),1)])],2)):L(``,!0)],2),E(`span`,{"data-slot":`itemTrailing`,class:H(W.value.itemTrailing({class:[R(u).ui?.itemTrailing,q(n)&&n.ui?.itemTrailing]}))},[d(e.$slots,`item-trailing`,{item:n,index:r,ui:W.value}),z(R(Xa),{"as-child":``},{default:k(()=>[z(J,{name:R(u).selectedIcon||R(m).ui.icons.check,"data-slot":`itemTrailingIcon`,class:H(W.value.itemTrailingIcon({class:[R(u).ui?.itemTrailingIcon,q(n)&&n.ui?.itemTrailingIcon]}))},null,8,[`name`,`class`])]),_:2},1024)],2)])]),_:2},1032,[`class`,`disabled`,`value`,`onSelect`]))]),_:3}),z(R(Ia),V({ref_key:`comboboxRootRef`,ref:Qe},R(y),{"ignore-filter":``,"as-child":``,name:R(ie),disabled:Se.value,"onUpdate:modelValue":Le,"onUpdate:open":Be}),{default:k(({modelValue:r,open:i})=>[z(R(La),{"as-child":``},{default:k(()=>[z(R(eo),V({id:R(re),ref_key:`triggerRef`,ref:Pe,"data-slot":`base`,class:W.value.base({class:[R(u).ui?.base,R(u).class]}),tabindex:`0`},{...a,...R(le)}),{default:k(()=>[R(pe)||R(u).avatar||l.leading?(s(),K(`span`,{key:0,"data-slot":`leading`,class:H(W.value.leading({class:R(u).ui?.leading}))},[d(e.$slots,`leading`,{modelValue:r,open:i,ui:W.value},()=>[R(pe)&&R(ge)?(s(),t(J,{key:0,name:R(ge),"data-slot":`leadingIcon`,class:H(W.value.leadingIcon({class:R(u).ui?.leadingIcon}))},null,8,[`name`,`class`])):R(u).avatar?(s(),t(ot,V({key:1,size:R(u).ui?.itemLeadingAvatarSize||W.value.itemLeadingAvatarSize()},R(u).avatar,{"data-slot":`itemLeadingAvatar`,class:W.value.itemLeadingAvatar({class:R(u).ui?.itemLeadingAvatar})}),null,16,[`size`,`class`])):L(``,!0)])],2)):L(``,!0),d(e.$slots,`default`,{modelValue:r,open:i,ui:W.value},()=>[(s(!0),K(h,null,M([Ee(r)],e=>(s(),K(h,{key:e},[e==null?(s(),K(`span`,{key:1,"data-slot":`placeholder`,class:H(W.value.placeholder({class:R(u).ui?.placeholder}))},B(R(u).placeholder??`\xA0`),3)):(s(),K(`span`,{key:0,"data-slot":`value`,class:H(W.value.value({class:R(u).ui?.value}))},B(e),3))],64))),128))]),R(me)||l.trailing||R(u).clear?(s(),K(`span`,{key:1,"data-slot":`trailing`,class:H(W.value.trailing({class:R(u).ui?.trailing}))},[d(e.$slots,`trailing`,{modelValue:r,open:i,ui:W.value},()=>[R(u).clear&&!Ke(r)?(s(),t(R(Ha),{key:0,"as-child":``},{default:k(()=>[z(mt,V({as:`span`,icon:R(u).clearIcon||R(m).ui.icons.close,size:xe.value,variant:`link`,color:`neutral`,tabindex:`-1`},D.value,{"data-slot":`trailingClear`,class:W.value.trailingClear({class:R(u).ui?.trailingClear}),onClick:g(Xe,[`stop`])}),null,16,[`icon`,`size`,`class`])]),_:1})):R(ve)?(s(),t(J,{key:1,name:R(ve),"data-slot":`trailingIcon`,class:H(W.value.trailingIcon({class:R(u).ui?.trailingIcon}))},null,8,[`name`,`class`])):L(``,!0)])],2)):L(``,!0)]),_:2},1040,[`id`,`class`])]),_:2},1024),z(R(Qa),ke(ce(R(x))),{default:k(()=>[z(R(vt),null,{default:k(()=>[z(R(Ua),V({"data-slot":`content`,class:W.value.content({class:R(u).ui?.content})},C.value),{default:k(()=>[z(R(on),{trapped:``,"data-slot":`focusScope`,class:H(W.value.focusScope({class:R(u).ui?.focusScope}))},{default:k(()=>[d(e.$slots,`content-top`),R(u).searchInput?(s(),t(R(Ja),{key:0,modelValue:f.value,"onUpdate:modelValue":n[1]||=e=>f.value=e,"display-value":()=>f.value,"as-child":``},{default:k(()=>[z(rn,V({autofocus:``,autocomplete:`off`,size:xe.value},A.value,{"model-modifiers":{trim:R(u).modelModifiers?.trim},"data-slot":`input`,class:W.value.input({class:R(u).ui?.input}),onChange:n[0]||=g(()=>{},[`stop`])}),null,16,[`size`,`model-modifiers`,`class`])]),_:1},8,[`modelValue`,`display-value`])):L(``,!0),z(R(Wa),{"data-slot":`empty`,class:H(W.value.empty({class:R(u).ui?.empty}))},{default:k(()=>[d(e.$slots,`empty`,{searchTerm:f.value},()=>[G(B(f.value?R(p)(`selectMenu.noMatch`,{searchTerm:f.value}):R(p)(`selectMenu.noData`)),1)])]),_:3},8,[`class`]),E(`div`,{ref_key:`viewportRef`,ref:Ze,role:`presentation`,"data-slot":`viewport`,class:H(W.value.viewport({class:R(u).ui?.viewport}))},[R(u).virtualize?(s(),K(h,{key:0},[Me.value&&Ne.value===`top`?(s(),t(R(we),{key:0})):L(``,!0),z(R(to),V({options:je.value,"text-content":e=>q(e)?R(Ye)(e,R(u).labelKey):String(e)},O.value),{default:k(({option:e,virtualItem:t})=>[z(R(Te),{item:e,index:t.index},null,8,[`item`,`index`])]),_:1},16,[`options`,`text-content`]),Me.value&&Ne.value===`bottom`?(s(),t(R(we),{key:1})):L(``,!0)],64)):(s(),K(h,{key:1},[Me.value&&Ne.value===`top`?(s(),t(R(qa),{key:0,"data-slot":`group`,class:H(W.value.group({class:R(u).ui?.group}))},{default:k(()=>[z(R(we))]),_:1},8,[`class`])):L(``,!0),(s(!0),K(h,null,M(Ae.value,(e,n)=>(s(),t(R(qa),{key:`group-${n}`,"data-slot":`group`,class:H(W.value.group({class:R(u).ui?.group}))},{default:k(()=>[(s(!0),K(h,null,M(e,(e,r)=>(s(),t(R(Te),{key:`group-${n}-${r}`,item:e,index:r},null,8,[`item`,`index`]))),128))]),_:2},1032,[`class`]))),128)),Me.value&&Ne.value===`bottom`?(s(),t(R(qa),{key:1,"data-slot":`group`,class:H(W.value.group({class:R(u).ui?.group}))},{default:k(()=>[z(R(we))]),_:1},8,[`class`])):L(``,!0)],64))],2),d(e.$slots,`content-bottom`)]),_:3},8,[`class`]),R(u).arrow?(s(),t(R(Va),V({key:0},w.value,{"data-slot":`arrow`,class:W.value.arrow({class:R(u).ui?.arrow})}),null,16,[`class`])):L(``,!0)]),_:3},16,[`class`])]),_:3})]),_:3},16)]),_:3},16,[`name`,`disabled`])],64))}}),mx={key:1,class:`text-xs font-medium text-muted`},hx={class:`border-l-2 border-dashed border-default pl-4`},gx=U({__name:`SlotNode`,props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(e){let n=e,r=_t(),i=F(()=>String(n.node.attrs.name||`default`)),a=F(()=>{let e=n.getPos();return Oi(e)?n.editor.state.doc.resolve(e).parent:void 0}),o=F(()=>r.bootstrap.components.find(e=>e.name===a.value?.attrs.tag)),c=F(()=>new Set([...a.value?.content.content??[]].map(e=>String(e.attrs.name||`default`)))),l=F(()=>(o.value?.slots??[]).map(e=>e.name).filter(e=>e===i.value||!c.value.has(e))),u=F(()=>o.value?.authoring?.slots.find(e=>e.name===i.value)),d=F(()=>!o.value?.authoring&&(o.value?.slots.length??0)>1),f=F(()=>n.editor.isEditable&&(u.value?!u.value.required:(a.value?.childCount??0)>1));function p(e){e&&e!==i.value&&n.updateAttributes({implicit:e==="default",name:e})}function m(){let e=n.getPos();Oi(e)&&(n.editor.view.dispatch(n.editor.state.tr.setSelection(C.near(n.editor.state.doc.resolve(e+1),1)).scrollIntoView()),n.editor.view.focus())}return(n,r)=>{let a=px,o=mt,c=Ri;return s(),t(R(ne),{class:`my-2`},{default:k(()=>[E(`div`,{contenteditable:`false`,class:`mb-2 flex cursor-pointer items-center gap-2`,onClick:m},[d.value?(s(),t(a,{key:0,"model-value":i.value,items:l.value,disabled:!e.editor.isEditable,size:`xs`,content:{align:`start`},ui:{base:`w-auto cursor-pointer font-mono text-xs text-muted ring-0 hover:text-default`},"onUpdate:modelValue":p},{leading:k(()=>[...r[0]||=[E(`span`,{class:`text-muted`},`#`,-1)]]),_:1},8,[`model-value`,`items`,`disabled`])):(s(),K(`span`,mx,B(u.value?.label??`#${i.value}`),1)),u.value?.required?L(``,!0):(s(),t(c,{key:2,text:`Remove content region`},{default:k(()=>[z(o,{color:`neutral`,variant:`ghost`,size:`xs`,icon:`i-lucide-trash-2`,disabled:!f.value,"aria-label":`Remove ${u.value?.label??i.value}`,onClick:g(e.deleteNode,[`stop`])},null,8,[`disabled`,`aria-label`,`onClick`])]),_:1}))]),E(`div`,hx,[z(R(pe),{class:`min-h-6`})])]),_:1})}}});function _x(e){return[uv(e),...gu({nodeViews:{block:Pe(bb),image:Pe(lx),inlineOpaque:Pe(ux),opaque:Pe(dx),slot:Pe(gx)}}),ge.configure({placeholder:`Type '/' for commands or start writing…`,showOnlyCurrent:!0,showOnlyWhenEditable:!1})]}function vx(e,t){let n=D(`offline`),r=D(),i=D(),a=D(),o=D({}),s=D(!1),c=D(!1),l=D(``),u=D(`idle`),d=D(`saved`),f=D([]),p=D(),m=D(),h=D({}),g=D(),_,v=0,y=0,b=e.session.canWrite,x=F(()=>b.value&&u.value===`ready`&&n.value===`online`&&d.value===`saved`&&g.value?.valid!==!1),S=F(()=>e.bootstrap.documents.types.find(e=>e.collection===r.value?.document.collection)?.authoringFields??[]),C=async()=>{if(!_||!r.value||!b.value)return;let e=++y;try{let t=await _.connection.preview();if(e!==y)return;g.value=t,l.value=t.markdown,m.value=t.preview.body,h.value=t.preview.fallbacks,t.document&&(p.value=t.document)}catch(t){e===y&&(i.value=t)}},w=wt(C,350,{maxWait:1200}),T=async()=>{v+=1,y+=1,w.cancel(),t.protect(`document-session`);let e=_;_=void 0,a.value=void 0,r.value=void 0,o.value={},s.value=!1,l.value=``,p.value=void 0,m.value=void 0,h.value={},g.value=void 0,f.value=[],n.value=`offline`,d.value=`saved`,u.value=`idle`,e&&await yx(e)};return ct(()=>void T()),{canPublish:x,canWrite:b,close:T,connection:I(n),editor:I(a),entry:I(r),error:I(i),fields:S,frontmatter:I(o),hasWorkingChanges:I(s),isPublishing:I(c),markdown:I(l),open:async c=>{await T();let h=++v;u.value=`opening`,r.value=c,i.value=void 0,p.value=c.document,m.value=c.document.body;try{let r=await $y(e.gateway,c.document.id);if(h!==v){await r.close();return}let i=Ry(r.document),p={binding:i,connection:r};if(_=p,p.stopState=r.subscribe(e=>{n.value=e.connection,s.value=e.hasWorkingChanges,d.value=e.persistence,f.value=e.participants,t.protect(`document-session`,e.persistence===`saved`?void 0:`This document has changes that have not reached the collaboration server.`),u.value===`ready`&&b.value&&w()}),h!==v)return;l.value=r.source.markdown;let m=new xe({editable:b.value,extensions:[..._x(e.bootstrap.components),gv(),...i.extensions,...r.awareness?[re.configure({provider:{awareness:r.awareness},render:eb,user:r.user})]:[]],onBlur:({editor:e})=>Sv(e,!1),onSelectionUpdate:({editor:e})=>{xv(e)||Sv(e)}});p.editor=m,p.stopObserving=i.frontmatter.observe(e=>o.value=e),a.value=m,u.value=`ready`,await C()}catch(e){if(h!==v)return;let t=_;_=void 0,a.value=void 0,t&&await yx(t),i.value=e,u.value=ri(e).toLocaleLowerCase().includes(`replaced`)?`conflicted`:`failed`}},participants:I(f),persistence:I(d),phase:I(u),preview:I(p),previewBody:I(m),previewFallbacks:I(h),publish:async()=>{let e=_;if(e&&r.value&&!c.value&&x.value){c.value=!0,i.value=void 0;try{let t=await e.connection.publish();t.entry?r.value=t.entry:r.value={...r.value,sourcePath:t.sourcePath,version:t.version},await C()}catch(e){throw i.value=e,e}finally{c.value=!1}}},setFrontmatter:(e,t)=>{_&&b.value&&_.binding.frontmatter.write(e,t)},validation:I(g)}}async function yx(e){e.stopObserving?.(),e.stopState?.(),e.editor?.destroy(),await e.connection.close()}var bx={slots:{content:`min-w-48 max-w-60 max-h-96 bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-dropdown-menu-content-transform-origin) flex flex-col`,viewport:`relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1`,group:`p-1 isolate`,label:`w-full flex items-center font-semibold text-highlighted`,separator:`-mx-1 my-1 h-px bg-border`,item:`group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75`,itemLeadingIcon:`shrink-0 flex items-center justify-center`,itemLeadingAvatar:`shrink-0`,itemLeadingAvatarSize:``,itemWrapper:`flex-1 flex flex-col text-start min-w-0`,itemLabel:`truncate`,itemDescription:`truncate text-muted`,itemLabelExternalIcon:`inline-block size-3 align-top text-dimmed`},variants:{size:{xs:{label:`p-1 text-[10px]/3 gap-1`,item:`p-1 text-xs gap-1`,itemLeadingIcon:`size-4 text-sm`,itemLeadingAvatarSize:`3xs`},sm:{label:`p-1.5 text-[10px]/3 gap-1.5`,item:`p-1.5 text-xs gap-1.5`,itemLeadingIcon:`size-4 text-sm`,itemLeadingAvatarSize:`3xs`},md:{label:`p-1.5 text-xs gap-1.5`,item:`p-1.5 text-sm gap-1.5`,itemLeadingIcon:`size-5 text-base`,itemLeadingAvatarSize:`2xs`},lg:{label:`p-2 text-xs gap-2`,item:`p-2 text-sm gap-2`,itemLeadingIcon:`size-5 text-base`,itemLeadingAvatarSize:`2xs`},xl:{label:`p-2 text-sm gap-2`,item:`p-2 text-base gap-2`,itemLeadingIcon:`size-6 text-xl`,itemLeadingAvatarSize:`xs`}},active:{true:{item:`text-highlighted before:bg-elevated/75`,itemLeadingIcon:`text-default`},false:{item:[`text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50`,`transition-colors before:transition-colors`],itemLeadingIcon:[`text-dimmed group-data-highlighted:not-group-data-disabled:text-default`,`transition-colors`]}}},defaultVariants:{size:`md`}},xx=Object.assign({inheritAttrs:!1},{__name:`EditorSuggestionMenu`,props:{size:{type:null,required:!1},items:{type:Array,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},editor:{type:Object,required:!1},char:{type:String,required:!1,default:`/`},pluginKey:{type:String,required:!1,default:`suggestionMenu`},filterFields:{type:Array,required:!1},limit:{type:Number,required:!1},options:{type:Object,required:!1},suggestion:{type:Object,required:!1},appendTo:{type:Function,required:!1,skipCheck:!0}},setup(e){let t=e,n=Je(),r=ue(`editorHandlers`,F(()=>ws())),i=F(()=>st({extend:bx,...n.ui?.editorSuggestionMenu||{}})({size:t.size})),a=null;return ae(async()=>{await he(),t.editor&&!t.editor.isDestroyed&&(a=Es({editor:t.editor,char:t.char,pluginKey:t.pluginKey,items:de(()=>t.items),filterFields:t.filterFields,limit:t.limit,options:t.options,suggestion:t.suggestion,appendTo:t.appendTo,ui:i,onSelect:(e,t,n)=>{if(n.type===`label`||n.type===`separator`)return;e.chain().focus().deleteRange(t).run();let i=r?.value?.[n.kind];i&&i.execute(e,n).run()},renderItem:(e,t)=>e.type===`label`?[be(`span`,{},e.label)]:[e.icon?be(J,{name:e.icon,class:t.value.itemLeadingIcon()}):null,be(`span`,{class:t.value.itemWrapper()},[be(`span`,{class:t.value.itemLabel()},e.label),e.description?be(`span`,{class:t.value.itemDescription()},e.description):null])]}),t.editor.registerPlugin(a.plugin))}),Fe(()=>{a&&=(a.destroy(),null),t.editor&&!t.editor.isDestroyed&&t.editor.unregisterPlugin(t.pluginKey)}),(e,t)=>(s(),K(`div`))}}),Sx={slots:{root:`hidden sm:flex items-center justify-center transition-[top,left] duration-200 ease-out motion-reduce:transition-none`,handle:`cursor-grab px-1`}},Cx=Object.assign({inheritAttrs:!1},{__name:`EditorDragHandle`,props:{icon:{type:null,required:!1},color:{type:null,required:!1,default:`neutral`},variant:{type:null,required:!1,default:`ghost`},options:{type:Object,required:!1},editor:{type:Object,required:!0},ui:{type:Object,required:!1},pluginKey:{type:[Object,String],required:!1},nestedOptions:{type:Object,required:!1},onElementDragStart:{type:Function,required:!1},onElementDragEnd:{type:Function,required:!1},getReferencedVirtualElement:{type:Function,required:!1},dragImageProperties:{type:Array,required:!1},nested:{type:[Boolean,Object],required:!1},label:{type:String,required:!1},activeColor:{type:null,required:!1},activeVariant:{type:null,required:!1},size:{type:null,required:!1,default:`sm`},square:{type:Boolean,required:!1},block:{type:Boolean,required:!1},loadingAuto:{type:Boolean,required:!1},onClick:{type:[Function,Array],required:!1},class:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},as:{type:null,required:!1},type:{type:null,required:!1},disabled:{type:Boolean,required:!1},exactActiveClass:{type:String,required:!1},viewTransition:{type:Boolean,required:!1}},emits:[`nodeChange`,`hover`],setup(e,{emit:n,attrs:r}){let i=e,a=n,o=et(`editorDragHandle`,i),c=Ct(lt(o,`pluginKey`,`nested`,`nestedOptions`,`onElementDragEnd`,`onElementDragStart`,`getReferencedVirtualElement`)),l=Ct(xt(o,`icon`,`options`,`editor`,`pluginKey`,`nested`,`nestedOptions`,`onElementDragEnd`,`onElementDragStart`,`getReferencedVirtualElement`,`class`,`ui`)),u=Je(),f=F(()=>st({extend:Sx,...u.ui?.editorDragHandle||{}})()),p=F(()=>Ge(o.options,{strategy:`absolute`,placement:`left-start`,offset:({rects:e})=>{let t=e.reference.height,n=e.floating.height;return t>40?{alignmentAxis:0,mainAxis:8}:{alignmentAxis:(t-n)/2,mainAxis:8}},flip:{},shift:{},size:!1,autoPlacement:!1,hide:!1,inline:!1})),m=F(()=>Ts(p.value)),h=F(()=>({placement:p.value.placement,strategy:p.value.strategy,middleware:m.value})),g=P();function _({pos:e}){if(g.value=e,e==null||e<0)return;let t=o.editor.state.doc.nodeAt(e);t&&a(`hover`,{node:t.toJSON(),pos:e})}function v(){if(!o.editor)return;let e=g.value;if(e==null||e<0)return;let t=o.editor.state.doc.nodeAt(e);if(t){let n={node:t.toJSON(),pos:e};return a(`nodeChange`,n),o.editor.chain().setNodeSelection(e).run(),n}}return(e,n)=>(s(),t(R(De),V(R(c),{"compute-position-config":h.value,editor:R(o).editor,"on-node-change":_,"data-slot":r[`data-slot`]??`root`,class:f.value.root({class:[R(o).ui?.root,R(o).class]}),onClick:v}),{default:k(()=>[d(e.$slots,`default`,{ui:f.value,onClick:v},()=>[z(mt,V({...R(l),icon:R(o).icon||R(u).ui.icons.drag,...r},{"data-slot":`handle`,class:f.value.handle({class:[R(o).ui?.handle,R(o).class]}),ui:R(nt)(f.value,R(o).ui)}),null,16,[`class`,`ui`])])]),_:3},16,[`compute-position-config`,`editor`,`data-slot`,`class`]))}}),wx={slots:{root:`focus:outline-none`,base:`flex items-stretch gap-1.5`,group:`flex items-center gap-0.5`,separator:`w-px self-stretch bg-border`},variants:{layout:{bubble:{base:`bg-default border border-default rounded-lg p-1`},floating:{base:`bg-default border border-default rounded-lg p-1`},fixed:{base:``}}}},Tx=Object.assign({inheritAttrs:!1},{__name:`EditorToolbar`,props:{as:{type:null,required:!1},color:{type:null,required:!1,default:`neutral`},variant:{type:null,required:!1,default:`ghost`},activeColor:{type:null,required:!1,default:`primary`},activeVariant:{type:null,required:!1,default:`soft`},size:{type:null,required:!1,default:`sm`},items:{type:null,required:!1},editor:{type:Object,required:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},layout:{type:String,required:!1,default:`fixed`},pluginKey:{type:[Object,String],required:!1},updateDelay:{type:Number,required:!1},resizeDelay:{type:Number,required:!1},shouldShow:{type:[Function,null],required:!1},appendTo:{type:Function,required:!1,skipCheck:!0},getReferencedVirtualElement:{type:Function,required:!1},options:{type:Object,required:!1}},setup(e,{attrs:n}){let r=et(`editorToolbar`,e),i=Je(),a=ue(`editorHandlers`,F(()=>ws())),o=F(()=>({bubble:je,floating:Se,fixed:`template`})[r.layout]),c=Ct(xt(r,`as`,`color`,`variant`,`activeColor`,`activeVariant`,`size`,`items`,`layout`,`editor`,`class`,`ui`)),l=F(()=>Ge(r.options,{offset:8,shift:{padding:8}})),u=F(()=>st({extend:wx,...i.ui?.editorToolbar||{}})({layout:r.layout})),f=F(()=>r.items?.length?Tt(r.items)?r.items:[r.items]:[]);function p(e){return r.editor?.isEditable?`items`in e&&e.items?.length?e.items?.some(e=>p(e))||!1:`kind`in e?(a?.value?.[e.kind])?.isActive(r.editor,e)||!1:e.active??!1:!1}function m(e){if(!r.editor?.isEditable)return!0;if(`items`in e&&e.items?.length){let t=(Tt(e.items)?e.items.flat():e.items).filter(e=>e.type!==`separator`&&e.type!==`label`);return t.length===0||t.every(e=>m(e))}if(!(`kind`in e))return e.disabled??!1;let t=a?.value?.[e.kind];return t?t.isDisabled?.(r.editor,e)?!0:!t.canExecute(r.editor,e):!1}function g(e,t){if(!r.editor?.isEditable||m(t))return;if(`items`in t||!(`kind`in t)){if(`onClick`in t)for(let n of Array.isArray(t.onClick)?t.onClick:[t.onClick])n?.(e);return}let n=a?.value?.[t.kind];n&&n.execute(r.editor,t).run()}function _(e){if(e.items)return(Tt(e.items)?e.items.flat():e.items).find(e=>`kind`in e&&p(e))}function v(e){let t=rt(e,[`kind`,`mark`,`align`,`level`,`href`,`src`,`pos`,`items`,`slot`,`checkedIcon`,`loadingIcon`,`externalIcon`,`content`,`arrow`,`portal`,`modal`,`tooltip`,`onClick`]);if(`items`in e&&e.items?.length){let n=_(e);n?.icon&&(t.icon=n.icon),n?.label&&t.label!==void 0&&(t.label=n.label)}return Ge(t,{color:r.color,activeColor:r.activeColor,activeVariant:r.activeVariant,variant:r.variant,size:r.size})}function y(e){let t=Ke(e,[`size`,`checkedIcon`,`loadingIcon`,`externalIcon`,`content`,`arrow`,`portal`,`modal`,`ui`]);return Ge(t,{modal:!1,size:r.size})}function b(e){let t=`children`in e&&Array.isArray(e.children)?e.children.map(b):void 0;if(!(`kind`in e))return t?{...e,children:t}:e;let n=e;return{...n,...t&&{children:t},active:p(n),disabled:m(n),onSelect:e=>g(e,n)}}function x(e){return e.items?Tt(e.items)?e.items.map(e=>e.map(b)):[e.items.map(b)]:[]}return(e,i)=>(s(),t(R(q),V({as:o.value},o.value===`template`?{...n}:{editor:R(r).editor,tabindex:-1,class:u.value.root({class:R(r).ui?.root}),...R(c),options:l.value,...n}),{default:k(()=>[z(R(q),{as:R(r).as,role:`toolbar`,"data-slot":`base`,class:H(u.value.base({class:[R(r).ui?.base,R(r).class]}))},{default:k(()=>[(s(!0),K(h,null,M(f.value,(n,i)=>(s(),K(h,{key:`group-${i}`},[E(`div`,{role:`group`,"data-slot":`group`,class:H(u.value.group({class:R(r).ui?.group}))},[(s(!0),K(h,null,M(n,(n,r)=>d(e.$slots,n.slot||`item`,{item:n,index:r,isActive:p,isDisabled:m,onClick:g},()=>[`items`in n&&n.items?.length?(s(),t(_n,V({key:0,ref_for:!0},y(n),{items:x(n)}),{default:k(()=>[n.tooltip?(s(),t(Ri,V({key:0,disabled:m(n)},{ref_for:!0},{...n.tooltip||{}}),{default:k(()=>[z(mt,V({active:p(n),disabled:m(n)},{ref_for:!0},v(n),{onClick:e=>g(e,n)}),null,16,[`active`,`disabled`,`onClick`])]),_:2},1040,[`disabled`])):(s(),t(mt,V({key:1,active:p(n),disabled:m(n)},{ref_for:!0},v(n),{onClick:e=>g(e,n)}),null,16,[`active`,`disabled`,`onClick`]))]),_:2},1040,[`items`])):n.tooltip?(s(),t(Ri,V({key:1,disabled:m(n)},{ref_for:!0},{...n.tooltip||{}}),{default:k(()=>[z(mt,V({active:p(n),disabled:m(n)},{ref_for:!0},v(n),{ui:n.ui,onClick:e=>g(e,n)}),null,16,[`active`,`disabled`,`ui`,`onClick`])]),_:2},1040,[`disabled`])):(s(),t(mt,V({key:2,active:p(n),disabled:m(n)},{ref_for:!0},v(n),{ui:n.ui,onClick:e=>g(e,n)}),null,16,[`active`,`disabled`,`ui`,`onClick`]))],void 0,`group-${i}-${r}`)),128))],2),i<f.value.length-1?(s(),t(R(Po),{key:0,"data-slot":`separator`,class:H(u.value.separator({class:R(r).ui?.separator})),orientation:`vertical`},null,8,[`class`])):L(``,!0)],64))),128))]),_:3},8,[`as`,`class`])]),_:3},16,[`as`]))}}),Ex={slots:{root:[`relative inline-flex items-center`,`flex-wrap`],base:[`rounded-md`,`transition-colors`],leading:`absolute inset-y-0 start-0 flex items-center`,leadingIcon:`shrink-0 text-dimmed`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailing:`absolute inset-y-0 end-0 flex items-center`,trailingIcon:`shrink-0 text-dimmed`,item:`px-1.5 py-0.5 rounded-sm font-medium inline-flex items-center gap-0.5 ring ring-inset ring-accented bg-elevated text-default data-disabled:cursor-not-allowed data-disabled:opacity-75 wrap-anywhere data-[state="active"]:bg-accented`,itemText:``,itemDelete:[`inline-flex items-center rounded-xs text-dimmed hover:text-default hover:bg-accented/75 disabled:pointer-events-none`,`transition-colors`],itemDeleteIcon:`shrink-0`,input:`flex-1 border-0 bg-transparent placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75`},variants:{fieldGroup:{horizontal:`not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]`,vertical:`not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]`},size:{xs:{base:`px-2 py-1 text-sm/4 gap-1`,leading:`ps-2`,trailing:`pe-2`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,item:`text-[10px]/3`,itemDeleteIcon:`size-3`},sm:{base:`px-2.5 py-1.5 text-sm/4 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,item:`text-[10px]/3`,itemDeleteIcon:`size-3`},md:{base:`px-2.5 py-1.5 text-base/5 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,item:`text-xs`,itemDeleteIcon:`size-3.5`},lg:{base:`px-3 py-2 text-base/5 gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,item:`text-xs`,itemDeleteIcon:`size-3.5`},xl:{base:`px-3 py-2 text-base gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-6`,leadingAvatarSize:`xs`,trailingIcon:`size-6`,item:`text-sm`,itemDeleteIcon:`size-4`}},variant:{outline:`text-highlighted bg-default ring ring-inset ring-accented`,soft:`text-highlighted bg-elevated/50 hover:bg-elevated has-focus:bg-elevated disabled:bg-elevated/50`,subtle:`text-highlighted bg-elevated ring ring-inset ring-accented`,ghost:`text-highlighted bg-transparent hover:bg-elevated has-focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent`,none:`text-highlighted bg-transparent has-focus:outline-none`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},leading:{true:``},trailing:{true:``},loading:{true:``},highlight:{true:``},fixed:{false:``},type:{file:`file:me-1.5 file:font-medium file:text-muted file:outline-none`}},compoundVariants:[{color:`primary`,variant:[`outline`,`subtle`],class:`outline-primary/25 has-focus-visible:outline-3 has-focus-visible:ring-primary`},{color:`secondary`,variant:[`outline`,`subtle`],class:`outline-secondary/25 has-focus-visible:outline-3 has-focus-visible:ring-secondary`},{color:`success`,variant:[`outline`,`subtle`],class:`outline-success/25 has-focus-visible:outline-3 has-focus-visible:ring-success`},{color:`info`,variant:[`outline`,`subtle`],class:`outline-info/25 has-focus-visible:outline-3 has-focus-visible:ring-info`},{color:`warning`,variant:[`outline`,`subtle`],class:`outline-warning/25 has-focus-visible:outline-3 has-focus-visible:ring-warning`},{color:`error`,variant:[`outline`,`subtle`],class:`outline-error/25 has-focus-visible:outline-3 has-focus-visible:ring-error`},{color:`primary`,variant:[`soft`,`ghost`],class:`outline-primary/25 has-focus-visible:outline-3`},{color:`secondary`,variant:[`soft`,`ghost`],class:`outline-secondary/25 has-focus-visible:outline-3`},{color:`success`,variant:[`soft`,`ghost`],class:`outline-success/25 has-focus-visible:outline-3`},{color:`info`,variant:[`soft`,`ghost`],class:`outline-info/25 has-focus-visible:outline-3`},{color:`warning`,variant:[`soft`,`ghost`],class:`outline-warning/25 has-focus-visible:outline-3`},{color:`error`,variant:[`soft`,`ghost`],class:`outline-error/25 has-focus-visible:outline-3`},{color:`primary`,highlight:!0,class:`ring ring-inset ring-primary`},{color:`secondary`,highlight:!0,class:`ring ring-inset ring-secondary`},{color:`success`,highlight:!0,class:`ring ring-inset ring-success`},{color:`info`,highlight:!0,class:`ring ring-inset ring-info`},{color:`warning`,highlight:!0,class:`ring ring-inset ring-warning`},{color:`error`,highlight:!0,class:`ring ring-inset ring-error`},{color:`neutral`,variant:[`outline`,`subtle`],class:`outline-inverted/25 has-focus-visible:outline-3 has-focus-visible:ring-inverted`},{color:`neutral`,variant:[`soft`,`ghost`],class:`outline-inverted/25 has-focus-visible:outline-3`},{color:`neutral`,highlight:!0,class:`ring ring-inset ring-inverted`},{leading:!0,size:`xs`,class:`ps-7`},{leading:!0,size:`sm`,class:`ps-8`},{leading:!0,size:`md`,class:`ps-9`},{leading:!0,size:`lg`,class:`ps-10`},{leading:!0,size:`xl`,class:`ps-11`},{trailing:!0,size:`xs`,class:`pe-7`},{trailing:!0,size:`sm`,class:`pe-8`},{trailing:!0,size:`md`,class:`pe-9`},{trailing:!0,size:`lg`,class:`pe-10`},{trailing:!0,size:`xl`,class:`pe-11`},{loading:!0,leading:!0,class:{leadingIcon:`animate-spin`}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:`animate-spin`}},{fixed:!1,size:`xs`,class:`md:text-xs`},{fixed:!1,size:`sm`,class:`md:text-xs`},{fixed:!1,size:`md`,class:`md:text-sm`},{fixed:!1,size:`lg`,class:`md:text-sm`}],defaultVariants:{size:`md`,color:`primary`,variant:`outline`}},Dx=Object.assign({inheritAttrs:!1},{__name:`InputTags`,props:{as:{type:null,required:!1},placeholder:{type:String,required:!1},maxLength:{type:Number,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},deleteIcon:{type:null,required:!1},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},modelValue:{type:[Array,null],required:!1},defaultValue:{type:Array,required:!1},addOnPaste:{type:Boolean,required:!1},addOnTab:{type:Boolean,required:!1},addOnBlur:{type:Boolean,required:!1},duplicate:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},delimiter:{type:null,required:!1},max:{type:Number,required:!1},id:{type:String,required:!1},convertValue:{type:Function,required:!1},displayValue:{type:Function,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:[`change`,`blur`,`focus`,`update:modelValue`,`invalid`,`addTag`,`removeTag`],setup(e,{expose:r,emit:i,attrs:a}){let o=e,c=i,l=b(),u=et(`inputTags`,o),f=Je(),p=Ct(lt(u,`as`,`addOnPaste`,`addOnTab`,`addOnBlur`,`duplicate`,`delimiter`,`max`,`convertValue`,`displayValue`,`required`),c),{emitFormBlur:m,emitFormFocus:g,emitFormChange:v,emitFormInput:y,size:x,color:C,id:w,name:T,highlight:E,disabled:D,ariaAttrs:O}=ut(o),{orientation:A,size:j}=pt(o),{isLeading:N,isTrailing:ee,leadingIconName:te,trailingIconName:P}=ft(u),I=F(()=>C.value??u.color),ne=F(()=>E.value??u.highlight),re=F(()=>j.value??x.value??u.size),ie=F(()=>D.value??u.disabled),oe=F(()=>st({extend:Ex,...f.ui?.inputTags||{}})({color:I.value,variant:u.variant,size:re.value,loading:u.loading,highlight:ne.value,fixed:u.fixed,leading:N.value||!!u.avatar||!!l.leading,trailing:ee.value||!!l.trailing,fieldGroup:A.value})),se=S(`inputRef`);function ce(){u.autofocus&&se.value?.$el?.focus()}let le;ae(()=>{le=setTimeout(()=>{ce()},u.autofocusDelay)}),_(()=>clearTimeout(le));function ue(e){if(n(u.modelValue)===e)return;let t=new Event(`change`,{target:{value:e}});c(`change`,t),v(),y()}function fe(e){c(`blur`,e),m()}function pe(e){c(`focus`,e),g()}return r({inputRef:de(()=>se.value?.$el)}),(e,n)=>(s(),t(R(Xo),V({id:R(w),"model-value":R(u).modelValue,"default-value":R(u).defaultValue,"data-slot":a[`data-slot`]??`root`,class:oe.value.root({class:[oe.value.base({class:R(u).ui?.base}),R(u).ui?.root,R(u).class]})},R(p),{name:R(T),disabled:ie.value,"onUpdate:modelValue":ue}),{default:k(({modelValue:n})=>[(s(!0),K(h,null,M(n,(n,r)=>(s(),t(R(es),{key:r,value:n,"data-slot":`item`,class:H(oe.value.item({class:[R(u).ui?.item]}))},{default:k(()=>[z(R(ns),{"data-slot":`itemText`,class:H(oe.value.itemText({class:[R(u).ui?.itemText]}))},{default:k(()=>[l[`item-text`]?d(e.$slots,`item-text`,{item:n,index:r,ui:oe.value},void 0,void 0,0):L(``,!0)]),_:2},1032,[`class`]),z(R(ts),{"data-slot":`itemDelete`,class:H(oe.value.itemDelete({class:[R(u).ui?.itemDelete]})),disabled:ie.value},{default:k(()=>[d(e.$slots,`item-delete`,{item:n,index:r,ui:oe.value},()=>[z(J,{name:R(u).deleteIcon||R(f).ui.icons.close,"data-slot":`itemDeleteIcon`,class:H(oe.value.itemDeleteIcon({class:[R(u).ui?.itemDeleteIcon]}))},null,8,[`name`,`class`])])]),_:2},1032,[`class`,`disabled`])]),_:2},1032,[`value`,`class`]))),128)),z(R(Zo),V({ref_key:`inputRef`,ref:se},{...a,...R(O)},{placeholder:R(u).placeholder,"max-length":R(u).maxLength,"data-slot":`input`,class:oe.value.input({class:R(u).ui?.input}),onBlur:fe,onFocus:pe}),null,16,[`placeholder`,`max-length`,`class`]),d(e.$slots,`default`,{ui:oe.value}),R(N)||R(u).avatar||l.leading?(s(),K(`span`,{key:0,"data-slot":`leading`,class:H(oe.value.leading({class:R(u).ui?.leading}))},[d(e.$slots,`leading`,{ui:oe.value},()=>[R(N)&&R(te)?(s(),t(J,{key:0,name:R(te),"data-slot":`leadingIcon`,class:H(oe.value.leadingIcon({class:R(u).ui?.leadingIcon}))},null,8,[`name`,`class`])):R(u).avatar?(s(),t(ot,V({key:1,size:R(u).ui?.leadingAvatarSize||oe.value.leadingAvatarSize()},R(u).avatar,{"data-slot":`leadingAvatar`,class:oe.value.leadingAvatar({class:R(u).ui?.leadingAvatar})}),null,16,[`size`,`class`])):L(``,!0)])],2)):L(``,!0),R(ee)||l.trailing?(s(),K(`span`,{key:1,"data-slot":`trailing`,class:H(oe.value.trailing({class:R(u).ui?.trailing}))},[d(e.$slots,`trailing`,{ui:oe.value},()=>[R(P)?(s(),t(J,{key:0,name:R(P),"data-slot":`trailingIcon`,class:H(oe.value.trailingIcon({class:R(u).ui?.trailingIcon}))},null,8,[`name`,`class`])):L(``,!0)])],2)):L(``,!0)]),_:3},16,[`id`,`model-value`,`default-value`,`data-slot`,`class`,`name`,`disabled`]))}}),Ox={class:`mt-4`},kx={class:`flex items-center gap-1.5 text-xs font-medium text-muted transition-colors group-hover:text-default`},Ax={key:0,class:`mt-1 grid max-h-124 gap-4 overflow-y-auto border-l-2 border-dashed border-muted bg-muted/30 px-4 py-4`},jx=U({__name:`DocumentFrontmatter`,props:{disabled:{type:Boolean},fields:{},frontmatter:{}},emits:[`update`],setup(e,{emit:n}){let r=e,i=n,a=P(!1);function o(e){return e.path.split(`.`).reduce((e,t)=>li(jn)(e)?e[t]:void 0,r.frontmatter)}function c(e){let t=o(e);return Y(t)||Oi(t)?String(t):``}function l(e){let t=o(e);return Oi(t)&&Number.isFinite(t)?t:void 0}function u(e){let t=o(e);return Y(t)||Oi(t)?t:void 0}function d(e){let t=o(e);return Array.isArray(t)?t.filter(Y):[]}function f(e){return(e.options||[]).map(e=>({label:String(e),value:e}))}function p(e,t){i(`update`,e.path,t===``&&!e.required||t===null?void 0:t)}function m(e){return`cms-frontmatter-${e.path}`.replace(/[^\w-]/gu,`-`)}return(n,r)=>{let i=J,g=Bi,_=ob,v=xn,y=ib,b=Dx,x=ac,S=rn,C=Cn;return s(),K(`section`,Ox,[E(`button`,{type:`button`,class:`group flex w-full cursor-pointer items-center justify-between border-l-2 border-muted px-2 py-1.5 text-left transition-colors hover:border-accented`,onClick:r[0]||=e=>a.value=!a.value},[E(`span`,kx,[z(i,{name:a.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`,class:`size-3.5`},null,8,[`name`]),r[1]||=G(` Page settings `,-1),z(g,{color:`neutral`,variant:`subtle`,size:`xs`},{default:k(()=>[G(B(e.fields.length)+` fields`,1)]),_:1})]),z(i,{name:`i-lucide-settings`,class:`size-3.5 text-muted transition-colors group-hover:text-default`})]),a.value?(s(),K(`div`,Ax,[(s(!0),K(h,null,M(e.fields,n=>(s(),t(C,{key:n.path,label:n.label,description:n.description,name:n.path,required:n.required,size:`sm`},{default:k(()=>[n.type===`boolean`?(s(),t(_,{key:0,id:m(n),"model-value":o(n)===!0,disabled:e.disabled,"onUpdate:modelValue":e=>p(n,e)},null,8,[`id`,`model-value`,`disabled`,`onUpdate:modelValue`])):n.options?.length&&n.type===`string[]`?(s(),t(v,{key:1,id:m(n),"model-value":d(n),items:f(n),"value-key":`value`,multiple:``,class:`w-full`,disabled:e.disabled,"onUpdate:modelValue":e=>p(n,e)},null,8,[`id`,`model-value`,`items`,`disabled`,`onUpdate:modelValue`])):n.options?.length?(s(),t(v,{key:2,id:m(n),"model-value":u(n),items:f(n),"value-key":`value`,class:`w-full`,disabled:e.disabled,"onUpdate:modelValue":e=>p(n,e)},null,8,[`id`,`model-value`,`items`,`disabled`,`onUpdate:modelValue`])):n.type===`number`?(s(),t(y,{key:3,id:m(n),"model-value":l(n),class:`w-full`,disabled:e.disabled,"onUpdate:modelValue":e=>p(n,e)},null,8,[`id`,`model-value`,`disabled`,`onUpdate:modelValue`])):n.type===`string[]`?(s(),t(b,{key:4,id:m(n),"model-value":d(n),placeholder:`Add a value`,class:`w-full`,disabled:e.disabled,"onUpdate:modelValue":e=>p(n,e)},null,8,[`id`,`model-value`,`disabled`,`onUpdate:modelValue`])):n.path===`description`?(s(),t(x,{key:5,id:m(n),"model-value":c(n),autoresize:``,class:`w-full`,disabled:e.disabled,"onUpdate:modelValue":e=>p(n,e)},null,8,[`id`,`model-value`,`disabled`,`onUpdate:modelValue`])):(s(),t(S,{key:6,id:m(n),"model-value":c(n),type:n.type===`date`?`date`:`text`,class:`w-full`,disabled:e.disabled,"onUpdate:modelValue":e=>p(n,e)},null,8,[`id`,`model-value`,`type`,`disabled`,`onUpdate:modelValue`]))]),_:2},1032,[`label`,`description`,`name`,`required`]))),128)),r[2]||=E(`p`,{class:`text-xs text-muted`},`Fields not declared here remain preserved in Markdown mode.`,-1)])):L(``,!0)])}}});function Mx(e,t){let n=Object.fromEntries(e.map(e=>[e.name,{canExecute:t=>t.can().insertContent(pv(e)),execute:t=>t.chain().focus().insertContent(pv(e)),isActive:t=>t.isActive(`cmsBlock`,{tag:e.name})}]));return t?{...n,image:{canExecute:()=>!0,execute:e=>(t(e),e.chain()),isActive:()=>!1}}:n}function Nx(e,t=!1){return[[{type:`label`,label:`Basic blocks`},{kind:`paragraph`,label:`Text`,description:`Plain paragraph`,icon:`i-lucide-type`},{kind:`heading`,level:1,label:`Heading 1`,icon:`i-lucide-heading-1`},{kind:`heading`,level:2,label:`Heading 2`,icon:`i-lucide-heading-2`},{kind:`heading`,level:3,label:`Heading 3`,icon:`i-lucide-heading-3`},{kind:`bulletList`,label:`Bullet list`,icon:`i-lucide-list`},{kind:`orderedList`,label:`Numbered list`,icon:`i-lucide-list-ordered`},{kind:`blockquote`,label:`Quote`,icon:`i-lucide-text-quote`},{kind:`codeBlock`,label:`Code`,icon:`i-lucide-square-code`},{kind:`horizontalRule`,label:`Divider`,icon:`i-lucide-separator-horizontal`}],...t?[[{type:`label`,label:`Insert`},{kind:`image`,label:`Image`,description:`Choose from the media library`,icon:`i-lucide-image`}]]:[],...[...Map.groupBy(e,e=>e.authoring?.group??`Application components`)].map(([e,t])=>[{type:`label`,label:e},...t.map(e=>({kind:e.name,label:e.authoring?.label??Px(e.name),description:e.authoring?.description??`<${e.name}>`,icon:e.authoring?.icon??`i-lucide-box`}))])]}function Px(e){return e.split(`-`).filter(Boolean).map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(` `)}var Fx={key:0,class:`h-full min-h-0 overflow-auto bg-default`},Ix={class:`mx-auto min-h-full cursor-text py-6 text-highlighted sm:pl-10 sm:pr-4`},Lx=U({__name:`VisualEditor`,props:{session:{}},setup(e){let n=e,{bootstrap:r}=_t(),i=D(),a=D(),o=D(!1),c=D(0);T(()=>n.session.editor.value,(e,t,n)=>{if(!e)return;let r=()=>{c.value++};e.on(`transaction`,r),n(()=>e.off(`transaction`,r))},{immediate:!0});let l=F(()=>{c.value;let e=n.session.editor.value;return e?lv(e,r.components):void 0}),u=F(()=>{let e=l.value;return e?[[{kind:`paragraph`,label:`Text`,icon:`i-lucide-type`},...e.input===`rich-text`&&e.features.includes(`bullet-list`)?[{kind:`bulletList`,label:`Bullet list`,icon:`i-lucide-list`}]:[]]]:Nx(r.components,r.media.enabled)}),d={edgeDetection:`none`,rules:[{id:`protectStructuralNodes`,evaluate:({node:e})=>[`cmsFrontmatter`,`cmsSlot`].includes(e.type.name)?1e3:0},{id:`preferSlotContent`,evaluate:({$pos:e,depth:t,node:n})=>n.type.name===`cmsBlock`&&e.depth>t&&e.node(t+1)?.type.name===`cmsSlot`?1e3:0}]},f=[[{kind:`undo`,icon:`i-lucide-undo-2`,tooltip:{text:`Undo`}},{kind:`redo`,icon:`i-lucide-redo-2`,tooltip:{text:`Redo`}}],[{kind:`paragraph`,icon:`i-lucide-pilcrow`,tooltip:{text:`Paragraph`}},{kind:`heading`,level:2,icon:`i-lucide-heading-2`,tooltip:{text:`Heading 2`}},{kind:`heading`,level:3,icon:`i-lucide-heading-3`,tooltip:{text:`Heading 3`}}],[{kind:`mark`,mark:`bold`,icon:`i-lucide-bold`,tooltip:{text:`Bold`}},{kind:`mark`,mark:`italic`,icon:`i-lucide-italic`,tooltip:{text:`Italic`}},{kind:`mark`,mark:`strike`,icon:`i-lucide-strikethrough`,tooltip:{text:`Strike`}},{kind:`mark`,mark:`code`,icon:`i-lucide-code`,tooltip:{text:`Inline code`}},{kind:`link`,icon:`i-lucide-link`,tooltip:{text:`Link`}}],[{kind:`bulletList`,icon:`i-lucide-list`,tooltip:{text:`Bullet list`}},{kind:`orderedList`,icon:`i-lucide-list-ordered`,tooltip:{text:`Ordered list`}},{kind:`blockquote`,icon:`i-lucide-text-quote`,tooltip:{text:`Quote`}},{kind:`codeBlock`,icon:`i-lucide-square-code`,tooltip:{text:`Code block`}}]],p=F(()=>{let e=l.value;return e?f.map(t=>t.filter(t=>t.kind===`undo`||t.kind===`redo`?!0:e.input===`text`?!1:t.kind===`paragraph`?!0:t.kind===`bulletList`?e.features.includes(`bullet-list`):t.kind===`link`?e.features.includes(`link`):t.kind===`mark`&&e.features.some(e=>e===t.mark))).filter(e=>e.length):f});Le(`editorHandlers`,F(()=>({...ws(),...Mx(r.components,m)})));function m(e){a.value=e.state.selection.from,o.value=!0}function h(e){let t=n.session.editor.value;if(!t)return;let r=Math.min(a.value??t.state.selection.from,t.state.doc.content.size);t.chain().focus().insertContentAt(r,{type:`image`,attrs:{alt:e.decorative?``:e.description.trim(),layout:e.layout,src:e.asset.url}}).run(),o.value=!1,a.value=void 0}function g(){o.value=!1,a.value=void 0,n.session.editor.value?.chain().focus().run()}function _(e){let t=i.value;return t?[[{type:`label`,label:v(t.node)}],[{label:`Write above`,icon:`i-lucide-corner-up-left`,onSelect:()=>bv(e,t.pos,`before`)},{label:`Write below`,icon:`i-lucide-corner-down-right`,onSelect:()=>bv(e,t.pos,`after`)}],[{label:`Move up`,icon:`i-lucide-arrow-up`,disabled:!vv(e,t.pos,`up`),onSelect:()=>yv(e,t.pos,`up`)},{label:`Move down`,icon:`i-lucide-arrow-down`,disabled:!vv(e,t.pos,`down`),onSelect:()=>yv(e,t.pos,`down`)}]]:[]}function v(e){return e.type===`cmsBlock`?r.components.find(t=>t.name===e.attrs?.tag)?.authoring?.label??`<${e.attrs?.tag||`component`}>`:e.type===`heading`?`Heading ${e.attrs?.level||``}`.trim():(e.type||`Block`).replace(/([a-z])([A-Z])/gu,`$1 $2`).replace(/^./u,e=>e.toUpperCase())}return(n,a)=>{let c=Tx,l=mt,f=_n,m=Cx,v=xx;return e.session.editor.value?(s(),K(`div`,Fx,[E(`div`,Ix,[z(jx,{disabled:!e.session.canWrite.value,fields:e.session.fields.value,frontmatter:e.session.frontmatter.value,onUpdate:e.session.setFrontmatter},null,8,[`disabled`,`fields`,`frontmatter`,`onUpdate`]),z(c,{editor:e.session.editor.value,items:p.value,layout:`bubble`},null,8,[`editor`,`items`]),z(m,{editor:e.session.editor.value,nested:d,options:{offset:0,placement:`left`},onNodeChange:a[1]||=e=>i.value=e},{default:k(({ui:t})=>[z(f,{items:_(e.session.editor.value),modal:!1,content:{side:`left`},ui:{content:`w-44`,label:`text-xs`},"onUpdate:open":a[0]||=t=>e.session.editor.value.chain().setMeta(`lockDragHandle`,t).run()},{default:k(({open:e})=>[z(l,{color:`neutral`,variant:`ghost`,"active-variant":`soft`,size:`sm`,icon:`i-lucide-grip-vertical`,"aria-label":`Block actions`,active:e,class:H(t.handle())},null,8,[`active`,`class`])]),_:2},1032,[`items`])]),_:1},8,[`editor`]),z(v,{editor:e.session.editor.value,items:u.value},null,8,[`editor`,`items`]),z(R(me),{editor:e.session.editor.value,class:`relative size-full min-h-40 flex-1 [&_.ProseMirror]:min-h-40 [&_.ProseMirror]:w-full [&_.ProseMirror]:pt-5 [&_.ProseMirror]:outline-none [&_.ProseMirror>*]:my-5 [&_.ProseMirror>*:first-child]:mt-0 [&_.ProseMirror>[data-cms-frontmatter]+*]:mt-0 [&_.ProseMirror>*:last-child]:mb-0 [&_.ProseMirror_p]:leading-7 [&_.ProseMirror_.is-editor-empty:first-child:before]:pointer-events-none [&_.ProseMirror_.is-editor-empty:first-child:before]:float-left [&_.ProseMirror_.is-editor-empty:first-child:before]:h-0 [&_.ProseMirror_.is-editor-empty:first-child:before]:text-muted [&_.ProseMirror_.is-editor-empty:first-child:before]:content-[attr(data-placeholder)] [&_.ProseMirror_:is(h1,h2,h3,h4,h5,h6)]:font-bold [&_.ProseMirror_:is(h1,h2,h3,h4,h5,h6)]:text-highlighted [&_.ProseMirror_h1]:text-3xl [&_.ProseMirror_h2]:text-2xl [&_.ProseMirror_h3]:text-xl [&_.ProseMirror_h4]:text-lg [&_.ProseMirror_blockquote]:border-s-4 [&_.ProseMirror_blockquote]:border-accented [&_.ProseMirror_blockquote]:ps-4 [&_.ProseMirror_blockquote]:italic [&_.ProseMirror_pre]:rounded-md [&_.ProseMirror_pre]:border [&_.ProseMirror_pre]:border-muted [&_.ProseMirror_pre]:bg-muted [&_.ProseMirror_pre]:px-4 [&_.ProseMirror_pre]:py-3 [&_.ProseMirror_:is(ul,ol)]:ps-6 [&_.ProseMirror_ul]:list-disc [&_.ProseMirror_ol]:list-decimal [&_.ProseMirror_li]:my-1.5`},null,8,[`editor`])]),R(r).media.enabled?(s(),t(ox,{key:0,"allow-upload":e.session.canWrite.value,open:o.value,mode:`insert`,onCommit:h,onCancel:g},null,8,[`allow-upload`,`open`])):L(``,!0)])):L(``,!0)}}}),Rx=new Set(`a.abbr.address.article.aside.b.blockquote.br.button.caption.code.col.colgroup.dd.del.details.div.dl.dt.em.figcaption.figure.footer.h1.h2.h3.h4.h5.h6.header.hr.i.img.kbd.li.main.mark.nav.ol.p.pre.q.s.section.small.span.strong.sub.summary.sup.table.tbody.td.template.tfoot.th.thead.tr.u.ul`.split(`.`)),zx=class extends Gn()(`RevisionPresentation.Invalid`,{cause:Ln(),message:$n}){},Bx=ov(),Vx=ci(`RevisionPresentation.present`)(function*(e){let t=yield*gr({try:()=>Bx(e),catch:e=>Yx(e)});return Hx(yield*Un(ti)(t).pipe(Er(Yx)))});function Hx(e){let t=[],n=Ux(e.frontmatter);n.length&&t.push({fields:n,key:`frontmatter`,kind:`frontmatter`,occurrence:1});let r=new Map,i=[],a=()=>{let e=qx(i);if(i=[],!e)return;let n=(r.get(`content`)??0)+1;r.set(`content`,n),t.push({fields:[{key:`content:1`,kind:`content`,name:`content`,value:e}],key:`body:content:${n}`,kind:`body`,occurrence:n})};for(let n of e.nodes)if(Gx(n)){a();let e=n[0],i=(r.get(e)??0)+1;r.set(e,i);let o=Wx(n);o.length&&t.push({component:e,fields:o,key:`body:${e}:${i}`,kind:`body`,occurrence:i})}else i.push(n);return a(),t}function Ux(e){let t=[],n=(e,r)=>{if(li(jn)(e)&&Object.keys(e).length){for(let[t,i]of Object.entries(e))n(i,[...r,t]);return}let i=r.join(`.`);t.push({key:i,kind:`frontmatter`,name:i,value:Jx(e)})};for(let[t,r]of Object.entries(e))n(r,[t]);return t}function Wx(e){let[,t,...n]=e,r=[];for(let[e,n]of Object.entries(t)){if(e===`$`||e===`index`)continue;let t=e.startsWith(`:`)?e.slice(1):e;r.push({kind:`attribute`,name:t,value:Jx(n)})}let i=[];for(let e of n){let t=Kx(e);if(!t)i.push(e);else{let n=Y(e)?e:qx(e.slice(2));n&&r.push({kind:`slot`,name:t,value:n})}}let a=qx(i);a&&r.push({kind:`content`,name:`content`,value:a});let o=new Map;return r.map(e=>{let t=`${e.kind}:${e.name}`,n=(o.get(t)??0)+1;return o.set(t,n),{...e,key:`${t}:${n}`}})}function Gx(e){return!Y(e)&&e[0]!==null&&!Rx.has(e[0].toLocaleLowerCase())}function Kx(e){if(!(Y(e)||e[0]!==`template`))return Y(e[1].name)&&e[1].name?e[1].name:Object.keys(e[1]).find(e=>e.startsWith(`#`))?.slice(1)}function qx(e){return e.map(sa).join(`
32
- `).replace(/\n{3,}/gu,`
33
-
34
- `).trim()}function Jx(e){return Y(e)?e:e===null?`null`:xi(e)||Oi(e)?String(e):JSON.stringify(e,void 0,2)}function Yx(e){return new zx({cause:e,message:e instanceof Error&&e.message?e.message:`The revision could not be parsed.`})}async function Xx(e){return(await In(Vx(e))).map(e=>({fields:e.fields.map(e=>({key:e.key,label:eS(e),value:e.value})),key:e.key,label:$x(e)}))}function Zx(e,t){let n=new Map(e.map(e=>[e.key,e])),r=new Map(t.map(e=>[e.key,e]));return iS([...t.map(e=>e.key),...e.map(e=>e.key)]).flatMap(e=>{let t=n.get(e),i=r.get(e),a=new Map(t?.fields.map(e=>[e.key,e])||[]),o=new Map(i?.fields.map(e=>[e.key,e])||[]),s=iS([...i?.fields.map(e=>e.key)||[],...t?.fields.map(e=>e.key)||[]]).flatMap(e=>{let t=a.get(e),n=o.get(e);return t?.value===n?.value?[]:[{after:n?.value,before:t?.value,diff:Qx(t?.value||``,n?.value||``),key:e,label:n?.label||t?.label||`Content`}]});return s.length?[{changes:s,key:e,label:i?.label||t?.label||`Page content`}]:[]})}function Qx(e,t){if(e===t)return e?[{text:e,type:`unchanged`}]:[];let n=nS(e),r=nS(t);if(n.length>250||r.length>250)return[...e?[{text:e,type:`removed`}]:[],...t?[{text:t,type:`added`}]:[]];let i=Array.from({length:n.length+1},()=>new Uint16Array(r.length+1));for(let e=n.length-1;e>=0;e--)for(let t=r.length-1;t>=0;t--)i[e][t]=n[e]===r[t]?(i[e+1][t+1]||0)+1:Math.max(i[e+1][t]||0,i[e][t+1]||0);let a=[],o=0,s=0;for(;o<n.length||s<r.length;)n[o]===r[s]?(rS(a,`unchanged`,n[o]||``),o++,s++):s>=r.length||o<n.length&&(i[o+1][s]||0)>=(i[o][s+1]||0)?(rS(a,`removed`,n[o]||``),o++):(rS(a,`added`,r[s]||``),s++);return a}function $x(e){if(e.kind===`frontmatter`)return`Page settings`;let t=e.fields.find(e=>e.kind===`slot`&&e.name===`eyebrow`)?.value;if(t&&t.length<=80)return t;let n=e.component?tS(e.component.replace(/^studio-/u,``)):`Page content`;return e.occurrence>1?`${n} ${e.occurrence}`:n}function eS(e){return new Map([[`body`,`Body`],[`detail`,`Supporting text`],[`content`,`Page content`],[`description`,e.kind===`frontmatter`?`Page description`:`Description`],[`eyebrow`,`Section label`],[`label`,`Label`],[`navigation.order`,`Navigation order`],[`navigation.title`,`Navigation title`],[`sector`,`Category`],[`title`,e.kind===`frontmatter`?`Page title`:`Title`]]).get(e.name)||tS(e.name)}function tS(e){let t=e.replace(/[-_.]+/gu,` `);return t.charAt(0).toLocaleUpperCase()+t.slice(1)}function nS(e){return e.match(/\s+|[\p{L}\p{N}_]+|[^\s\p{L}\p{N}_]+/gu)||[]}function rS(e,t,n){let r=e.at(-1);r?.type===t?r.text+=n:n&&e.push({text:n,type:t})}function iS(e){return[...new Set(e)]}var aS={key:1,class:`space-y-3 p-5`},oS={key:2,class:`flex h-[min(70vh,660px)] min-h-100 flex-col`},sS={class:`flex max-h-36 gap-1 overflow-auto border-b border-default bg-muted/20 p-2 sm:hidden`},cS=[`aria-pressed`,`onClick`],lS={class:`flex items-center justify-between gap-2`},uS={class:`line-clamp-2 min-w-0 flex-1 text-xs font-medium text-highlighted`},dS={class:`mt-1 block text-[11px] text-muted`},fS={key:0,class:`p-4 text-center text-xs text-muted`},pS={class:`flex min-h-0 min-w-0 flex-1`},mS={class:`hidden w-64 shrink-0 flex-col gap-1 overflow-y-auto border-r border-default bg-muted/20 p-2 sm:flex`},hS=[`aria-pressed`,`onClick`],gS={class:`flex items-center justify-between gap-2`},_S={class:`line-clamp-2 min-w-0 flex-1 text-xs font-medium text-highlighted`},vS={class:`mt-1 block text-[11px] text-muted`},yS={key:0,class:`p-4 text-center text-xs text-muted`},bS={class:`flex min-h-0 min-w-0 flex-1 flex-col bg-default`},xS={key:0,class:`shrink-0 border-b border-default px-4 pt-3`},SS={class:`flex flex-wrap items-start justify-between gap-3 pb-3`},CS={class:`min-w-0`},wS={class:`truncate text-sm font-medium text-highlighted`},TS={class:`mt-0.5 text-[11px] text-muted`},ES={class:`flex items-center gap-1`},DS={key:1,class:`min-h-0 flex-1 overflow-auto`},OS={key:0,class:`space-y-3 p-5`},kS={key:1,class:`mx-auto max-w-3xl space-y-6 p-5 sm:p-6`},AS={class:`mb-2 text-sm font-semibold text-highlighted`},jS={class:`divide-y divide-default overflow-hidden rounded-lg border border-default`},MS={class:`text-xs font-medium text-muted`},NS={class:`whitespace-pre-wrap text-sm leading-6 text-highlighted`},PS={key:0,class:`grid min-h-60 place-items-center text-center`},FS={key:2,class:`mx-auto max-w-4xl p-5 sm:p-6`},IS={class:`mb-5`},LS={class:`text-sm font-medium text-highlighted`},RS={class:`mt-1 text-xs text-muted`},zS={key:0,class:`space-y-6`},BS={class:`mb-2 text-sm font-semibold text-highlighted`},VS={class:`space-y-3`},HS={class:`border-b border-default bg-muted/30 px-4 py-2 text-xs font-medium text-muted`},US={class:`grid sm:grid-cols-2 sm:divide-x sm:divide-default`},WS={class:`border-b border-default p-4 sm:border-b-0`},GS={class:`mb-2 text-[11px] font-medium tracking-wide text-dimmed uppercase`},KS={key:0,class:`text-sm italic text-dimmed`},qS={key:1,class:`whitespace-pre-wrap text-sm leading-6 text-highlighted`},JS={class:`p-4`},YS={class:`mb-2 text-[11px] font-medium tracking-wide text-dimmed uppercase`},XS={key:0,class:`text-sm italic text-dimmed`},ZS={key:1,class:`whitespace-pre-wrap text-sm leading-6 text-highlighted`},QS={key:1,class:`grid min-h-72 place-items-center text-center`},$S={key:2,class:`grid min-h-72 place-items-center text-center`},eC={class:`mt-3 text-sm font-medium text-highlighted`},tC={class:`mt-1 text-xs text-muted`},nC={key:3,class:`min-h-full bg-muted/15`},rC={class:`border-b border-default px-5 py-3`},iC={class:`mt-0.5 text-[11px] text-muted`},aC={class:`overflow-auto whitespace-pre-wrap p-5 font-mono text-xs leading-6 text-highlighted`},oC={key:2,class:`grid h-full place-items-center text-sm text-muted`},sC={class:`flex w-full flex-col items-stretch gap-3 sm:flex-row sm:items-center sm:justify-between`},cC={class:`flex justify-end gap-2`},lC=U({__name:`RevisionHistory`,props:{canWrite:{type:Boolean},entry:{},open:{type:Boolean}},emits:[`restored`,`update:open`],setup(e,{emit:n}){let r=e,i=n,{gateway:a}=_t(),o=D([]),c=D(new Map),l=D(new Map),u=D(),d=D(),f=D(`changes`),p=D(`previous`),m=D(!1),g=D(!1),_=D(!1),v=D(!1),y=D(``),b=0,x=0,S=F(()=>o.value.find(e=>e.revisionId===u.value)),C=F(()=>o.value.find(e=>e.version===r.entry?.version)||o.value[0]),w=F(()=>o.value.findIndex(e=>e.revisionId===u.value)),O=F(()=>o.value[w.value+1]),A=F(()=>S.value&&c.value.get(S.value.revisionId)),j=F(()=>S.value&&l.value.get(S.value.revisionId)||[]),N=F(()=>p.value===`current`?C.value:O.value),ee=F(()=>N.value&&c.value.get(N.value.revisionId)),te=F(()=>{if(!S.value||!N.value)return[];let e=l.value.get(N.value.revisionId)||[];return p.value===`current`?Zx(j.value,e):Zx(e,j.value)}),P=F(()=>te.value.reduce((e,t)=>e+t.changes.length,0)),I=F(()=>S.value?.version===C.value?.version),ne=F(()=>!!N.value&&A.value?.markdown!==ee.value?.markdown&&P.value===0),re=F(()=>p.value===`current`),ie=F(()=>re.value?`Changes since this version`:`Changes in this version`),ae=F(()=>re.value?`Compared with the current version`:O.value?`Compared with ${ge(O.value.createdAt)}`:`This is the first saved version of the page`),oe=F(()=>[{label:P.value?`Changes (${P.value})`:`Changes`,value:`changes`,icon:`i-lucide-git-compare-arrows`},{label:`Full page`,value:`content`,icon:`i-lucide-file-text`}]),se=F(()=>{let e=p.value===`previous`&&!I.value?{label:`Compare with current version`,icon:`i-lucide-git-compare-arrows`,onSelect:()=>{p.value=`current`,f.value=`changes`,me()}}:p.value===`current`&&O.value?{label:`Compare with previous version`,icon:`i-lucide-git-compare-arrows`,onSelect:()=>{p.value=`previous`,f.value=`changes`,me()}}:void 0;return[[{label:f.value===`source`?`Back to changes`:`View source`,icon:f.value===`source`?`i-lucide-arrow-left`:`i-lucide-code-2`,onSelect:()=>f.value=f.value===`source`?`changes`:`source`}],...e?[[e]]:[]]}),ce=F(()=>new Map(o.value.map(e=>[e.revisionId,he(e)])));T(()=>[r.open,r.entry?.document.id],([e])=>{e&&le()},{immediate:!0});async function le(){if(!r.entry)return;let e=++b;m.value=!0,_.value=!1,y.value=``,f.value=`changes`,p.value=`previous`;try{let t=await a.history.list(r.entry.document.id);if(e!==b)return;o.value=t.revisions,c.value=new Map,l.value=new Map,d.value=t.nextCursor,u.value=t.revisions[0]?.revisionId,await me()}catch(t){e===b&&(y.value=ri(t))}finally{e===b&&(m.value=!1)}}async function ue(){let e=r.entry,t=d.value;if(!e||!t||_.value)return;let n=b;_.value=!0,y.value=``;try{let r=await a.history.list(e.document.id,t);if(n!==b)return;let i=new Set(o.value.map(e=>e.revisionId)),s=r.revisions.filter(e=>!i.has(e.revisionId));o.value=[...o.value,...s],d.value=r.nextCursor}catch(e){n===b&&(y.value=ri(e))}finally{n===b&&(_.value=!1)}}async function de(){if(S.value&&r.entry&&!I.value){v.value=!0,y.value=``;try{await a.documents.restore(r.entry.document.id,S.value.revisionId,r.entry.version),i(`restored`),i(`update:open`,!1)}catch(e){y.value=ri(e)}finally{v.value=!1}}}function fe(e){u.value=e,f.value=`changes`,p.value=`previous`,me()}function pe(e){(e===`changes`||e===`content`)&&(f.value=e)}async function me(){let e=r.entry,t=S.value,n=N.value;if(!e||!t)return;let i=++x;g.value=!0,y.value=``;try{let r=[...new Set([t.revisionId,n?.revisionId].filter(e=>e!==void 0))],o=await Promise.all(r.map(async t=>c.value.get(t)||a.history.read(e.document.id,t))),s=await Promise.all(o.map(async e=>[e.revisionId,await Xx(e.markdown)]));if(i!==x)return;c.value=new Map([...c.value,...o.map(e=>[e.revisionId,e])]),l.value=new Map([...l.value,...s])}catch(e){i===x&&(y.value=ri(e))}finally{i===x&&(g.value=!1)}}function he(e){let t=e.activity.actor.name;return e.action===`document.create`?`${t} created this page`:e.action===`document.restore`?`${t} restored an earlier version`:e.action===`document.move`?`${t} moved this page`:e.action===`document.remove`?`${t} moved this page to trash`:e.action===`document.undelete`?`${t} restored this page from trash`:`${t} updated this page`}function ge(e){let t=Rr(e),n=new Date,r=new Date;r.setDate(n.getDate()-1);let i=new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t);return R(t,n)?`Today, ${i}`:R(t,r)?`Yesterday, ${i}`:new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(t)}function R(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}return(n,r)=>{let a=yt,c=na,l=Bi,p=mt,b=_n,x=sc,w=J,T=wn;return s(),t(T,{open:e.open,title:`Page history`,description:`See what changed, or restore an earlier version.`,ui:{content:`max-w-6xl`,body:`p-0 sm:p-0`},"onUpdate:open":r[2]||=e=>i(`update:open`,e)},{body:k(()=>[y.value?(s(),t(a,{key:0,description:y.value,color:`error`,variant:`subtle`,class:`m-4`},null,8,[`description`])):L(``,!0),m.value?(s(),K(`div`,aS,[(s(),K(h,null,M(6,e=>z(c,{key:e,class:`h-12`})),64))])):(s(),K(`div`,oS,[E(`div`,sS,[(s(!0),K(h,null,M(o.value,e=>(s(),K(`button`,{key:e.revisionId,type:`button`,class:H([`min-w-48 rounded-md px-3 py-2.5 text-left transition-colors`,u.value===e.revisionId?`bg-elevated shadow-xs ring ring-default`:`hover:bg-muted`]),"aria-pressed":u.value===e.revisionId,onClick:t=>fe(e.revisionId)},[E(`span`,lS,[E(`span`,uS,B(ce.value.get(e.revisionId)),1),e.version===C.value?.version?(s(),t(l,{key:0,color:`primary`,variant:`subtle`,size:`sm`},{default:k(()=>[...r[3]||=[G(`Current`,-1)]]),_:1})):L(``,!0)]),E(`span`,dS,B(ge(e.createdAt)),1)],10,cS))),128)),o.value.length?L(``,!0):(s(),K(`p`,fS,`No saved versions yet.`)),d.value?(s(),t(p,{key:1,color:`neutral`,variant:`soft`,size:`xs`,label:`Older versions`,loading:_.value,class:`min-w-32 shrink-0 self-center`,onClick:ue},null,8,[`loading`])):L(``,!0)]),E(`div`,pS,[E(`div`,mS,[(s(!0),K(h,null,M(o.value,e=>(s(),K(`button`,{key:e.revisionId,type:`button`,class:H([`w-full rounded-md px-3 py-2.5 text-left transition-colors`,u.value===e.revisionId?`bg-elevated shadow-xs ring ring-default`:`hover:bg-muted`]),"aria-pressed":u.value===e.revisionId,onClick:t=>fe(e.revisionId)},[E(`span`,gS,[E(`span`,_S,B(ce.value.get(e.revisionId)),1),e.version===C.value?.version?(s(),t(l,{key:0,color:`primary`,variant:`subtle`,size:`sm`},{default:k(()=>[...r[4]||=[G(`Current`,-1)]]),_:1})):L(``,!0)]),E(`span`,vS,B(ge(e.createdAt)),1)],10,hS))),128)),o.value.length?L(``,!0):(s(),K(`p`,yS,`No saved versions yet.`)),d.value?(s(),t(p,{key:1,color:`neutral`,variant:`soft`,size:`xs`,label:`Load older versions`,loading:_.value,class:`mx-2 my-1`,onClick:ue},null,8,[`loading`])):L(``,!0)]),E(`div`,bS,[S.value?(s(),K(`div`,xS,[E(`div`,SS,[E(`div`,CS,[E(`p`,wS,B(ce.value.get(S.value.revisionId)),1),E(`p`,TS,B(ge(S.value.createdAt)),1)]),E(`div`,ES,[I.value?(s(),t(l,{key:0,color:`primary`,variant:`subtle`},{default:k(()=>[...r[5]||=[G(` Current version `,-1)]]),_:1})):L(``,!0),z(b,{items:se.value,content:{align:`end`}},{default:k(()=>[z(p,{color:`neutral`,variant:`ghost`,size:`xs`,square:``,icon:`i-lucide-ellipsis`,"aria-label":`Version options`})]),_:1},8,[`items`])])]),f.value===`source`?(s(),t(p,{key:1,color:`neutral`,variant:`link`,size:`sm`,icon:`i-lucide-arrow-left`,label:`Back to changes`,class:`-ml-2`,onClick:r[0]||=e=>f.value=`changes`})):(s(),t(x,{key:0,items:oe.value,"model-value":f.value,content:!1,color:`neutral`,variant:`link`,size:`sm`,ui:{root:`w-fit`,list:`w-fit`},"onUpdate:modelValue":pe},null,8,[`items`,`model-value`]))])):L(``,!0),S.value?(s(),K(`div`,DS,[g.value?(s(),K(`div`,OS,[(s(),K(h,null,M(5,e=>z(c,{key:e,class:`h-16`})),64))])):f.value===`content`?(s(),K(`div`,kS,[(s(!0),K(h,null,M(j.value,e=>(s(),K(`section`,{key:e.key},[E(`h3`,AS,B(e.label),1),E(`dl`,jS,[(s(!0),K(h,null,M(e.fields,e=>(s(),K(`div`,{key:e.key,class:`grid gap-1 px-4 py-3 sm:grid-cols-[9rem_minmax(0,1fr)] sm:gap-4`},[E(`dt`,MS,B(e.label),1),E(`dd`,NS,B(e.value),1)]))),128))])]))),128)),j.value.length?L(``,!0):(s(),K(`div`,PS,[E(`div`,null,[z(w,{name:`i-lucide-file-clock`,class:`mx-auto size-5 text-muted`}),r[6]||=E(`p`,{class:`mt-2 text-sm text-muted`},`This version has no readable content.`,-1)])]))])):f.value===`changes`?(s(),K(`div`,FS,[E(`div`,IS,[E(`p`,LS,B(ie.value),1),E(`p`,RS,B(ae.value),1)]),te.value.length?(s(),K(`div`,zS,[(s(!0),K(h,null,M(te.value,e=>(s(),K(`section`,{key:e.key},[E(`h3`,BS,B(e.label),1),E(`div`,VS,[(s(!0),K(h,null,M(e.changes,e=>(s(),K(`article`,{key:e.key,class:`overflow-hidden rounded-lg border border-default`},[E(`h4`,HS,B(e.label),1),E(`div`,US,[E(`div`,WS,[E(`p`,GS,B(re.value?`Selected version`:`Before`),1),e.before===void 0?(s(),K(`p`,KS,`Not present`)):(s(),K(`p`,qS,[(s(!0),K(h,null,M(e.diff,(e,t)=>(s(),K(h,{key:t},[e.type===`added`?L(``,!0):(s(),K(`span`,{key:0,class:H(e.type===`removed`?`rounded-sm bg-error/15 text-error line-through decoration-error/60`:``)},B(e.text),3))],64))),128))]))]),E(`div`,JS,[E(`p`,YS,B(re.value?`Current version`:`After`),1),e.after===void 0?(s(),K(`p`,XS,`Removed`)):(s(),K(`p`,ZS,[(s(!0),K(h,null,M(e.diff,(e,t)=>(s(),K(h,{key:t},[e.type===`removed`?L(``,!0):(s(),K(`span`,{key:0,class:H(e.type===`added`?`rounded-sm bg-success/15 text-success`:``)},B(e.text),3))],64))),128))]))])])]))),128))])]))),128))])):N.value?(s(),K(`div`,$S,[E(`div`,null,[z(w,{name:`i-lucide-equal`,class:`mx-auto size-6 text-muted`}),E(`p`,eC,B(ne.value?`No visible content changes`:`No changes found`),1),E(`p`,tC,B(ne.value?`Only formatting or technical details changed.`:`The readable page content is the same.`),1)])])):(s(),K(`div`,QS,[E(`div`,null,[z(w,{name:`i-lucide-file-plus`,class:`mx-auto size-6 text-success`}),r[7]||=E(`p`,{class:`mt-3 text-sm font-medium text-highlighted`},`Page created`,-1),r[8]||=E(`p`,{class:`mt-1 text-xs text-muted`},` This is the first saved version. Open Full page to see its content. `,-1)])]))])):(s(),K(`div`,nC,[E(`div`,rC,[r[9]||=E(`p`,{class:`text-xs font-medium text-highlighted`},`Source content`,-1),E(`p`,iC,`Advanced view · `+B(S.value.sourcePath),1)]),E(`pre`,aC,B(A.value?.markdown),1)]))])):(s(),K(`div`,oC,`Select a version.`))])])]))]),footer:k(()=>[E(`div`,sC,[r[10]||=E(`p`,{class:`text-xs text-muted`},`This creates a new draft. Your current version stays in history.`,-1),E(`div`,cC,[z(p,{color:`neutral`,variant:`ghost`,label:`Close`,onClick:r[1]||=e=>i(`update:open`,!1)}),e.canWrite?(s(),t(p,{key:0,icon:I.value?`i-lucide-check`:`i-lucide-history`,label:I.value?`Current version`:`Restore this version`,loading:v.value,disabled:!S.value||I.value,onClick:de},null,8,[`icon`,`label`,`loading`,`disabled`])):L(``,!0)])])]),_:1},8,[`open`])}}});function uC(){let e=D(void 0),t=P(`desktop`),n=P(`fit`),r=Et(e),i=F(()=>Ii(t.value)),a=F(()=>Xi(i.value,{height:Math.max(0,r.height.value-32),width:Math.max(0,r.width.value-32)},n.value)),o=F(()=>Ki(i.value,a.value));return{canvas:e,containerStyle:F(()=>o.value.container),frameStyle:F(()=>o.value.frame),viewport:t,zoom:n}}var dC={class:`flex shrink-0 items-center gap-1.5`},fC=U({__name:`PreviewToolbar`,props:{mode:{},preset:{},zoom:{}},emits:[`selectMode`,`selectPreset`,`selectZoom`],setup(e,{emit:t}){let n=t;return(t,r)=>{let i=sc,a=xn;return s(),K(`div`,dC,[z(i,{items:[{label:`Edit`,value:`edit`,icon:`i-lucide-mouse-pointer-2`},{label:`Browse`,value:`browse`,icon:`i-lucide-globe-2`}],"model-value":e.mode,content:!1,color:`neutral`,variant:`pill`,size:`xs`,ui:{list:`w-auto`,root:`w-auto gap-0`,trigger:`px-2`},"onUpdate:modelValue":r[0]||=e=>n(`selectMode`,e)},null,8,[`model-value`]),z(i,{items:R(Ji),"model-value":e.preset,content:!1,color:`neutral`,variant:`pill`,size:`xs`,ui:{list:`w-auto`,root:`w-auto gap-0`,trigger:`px-2`},"onUpdate:modelValue":r[1]||=e=>n(`selectPreset`,e)},null,8,[`items`,`model-value`]),z(a,{items:R(Ui),"model-value":e.zoom,"value-key":`value`,color:`neutral`,variant:`soft`,size:`xs`,icon:`i-lucide-zoom-in`,"aria-label":`Preview zoom`,title:`Preview zoom`,class:`w-24`,"onUpdate:modelValue":r[2]||=e=>n(`selectZoom`,e)},null,8,[`items`,`model-value`])])}}});function pC(e){let t=!1,n=!1,r=Ar.make(0),i,a,o={kind:`idle`},s=new Set,c=new Set,l=e=>{o=e;for(let e of s)e(o)},u=()=>{n&&i&&(a=a?{...a,revision:r}:void 0,a?e.preview.patch({...i,focus:a,revision:r}):e.preview.patch({...i,revision:r}),l({...o,kind:`rendering`}))},d=()=>Dr.make(crypto.randomUUID()),f=e.editor.subscribe(o=>{if(t||o.requestId&&c.delete(o.requestId))return;let s=o.target?.nodeId,u=i?.document.id;if(!u||!o.explicit&&s===a?.nodeId)return;let f={documentId:u,id:d(),origin:`editor`,reveal:!0,revision:r};a=s?{...f,nodeId:s}:f,l({kind:n?`locating`:`connecting`,label:o.target?.label,nodeId:s}),n&&e.preview.focus(a)}),p=e.preview.subscribe(s=>{if(t)return;if(s.type===`connecting`){n=!1,l({...o,kind:i?`connecting`:`idle`});return}if(s.type===`ready`){n=!0,u();return}if(s.type===`manifest`){e.onManifest?.(s.manifest);return}if(s.revision!==r)return;if(s.type===`rendered`){l({...o,kind:a?.nodeId?`locating`:`editing`});return}if(s.type===`applied`){if(s.intentId!==a?.id)return;l({...o,kind:s.result===`missing`?`not-rendered`:`editing`,nodeId:s.nodeId});return}if(e.onPreviewDocument?.(s.documentId,s.field),s.documentId!==i?.document.id||!s.nodeId){l({kind:`editing`,nodeId:s.nodeId});return}c.add(s.requestId);let f=e.editor.apply(s.nodeId,s.requestId);if(c.delete(s.requestId),!f){l({kind:`unavailable`,nodeId:s.nodeId});return}a={documentId:s.documentId,id:d(),nodeId:f.nodeId,origin:`preview`,reveal:!1,revision:r},l({kind:`editing`,label:f.label,nodeId:f.nodeId}),e.preview.focus(a),e.onPreviewFocus?.(f)});return{dispose(){t||(t=!0,f(),p(),s.clear())},replace(e){if(!t){if(i=e,r=Ar.make(r+1),!i){a=void 0,l({kind:`idle`});return}u(),n||l({...o,kind:`connecting`})}},subscribe(e){return t?()=>void 0:(s.add(e),e(o),()=>s.delete(e))}}}function mC(e){return{apply(t,n){let r=Ce(e);if(r&&Ku(r,t,n))return Yu(r)},subscribe(t){return T(()=>Ce(e),(e,n,r)=>{if(!e){t({explicit:!1});return}let i=!1,a=({transaction:n})=>{i||t({explicit:!1,requestId:qu(n),target:Yu(e)})},o=()=>{i||(i=!0,queueMicrotask(()=>{i=!1,t({explicit:!0,target:Yu(e)})}))},s=e.view.dom;e.on(`selectionUpdate`,a),s.addEventListener(`pointerdown`,o),t({explicit:!1,target:Yu(e)}),r(()=>{e.off(`selectionUpdate`,a),s.removeEventListener(`pointerdown`,o)})},{immediate:!0})}}}function hC(){let e=new Set,t,n=!1,r=`edit`,i,a,o=t=>{for(let n of e)n(t)},s=()=>{n&&t?.send({mode:r,type:`studio:mode`})},c=()=>{s(),i&&=(t?.send({path:i,type:`studio:navigate`}),void 0),a&&t?.send({...a,type:`studio:patch`})};return{connect(e){return t=e,n=!1,o({type:`connecting`}),e.subscribe(e=>{e.type===`preview:ready`?(n=!0,o({path:e.path,type:`ready`}),c()):e.type===`preview:activate`?o({...e,type:`activate`}):e.type===`preview:applied`?o({...e,type:`applied`}):e.type===`preview:rendered`?o({...e,type:`rendered`}):e.type===`preview:manifest`&&o({...e,type:`manifest`})})},focus(e){n&&t?.send({focus:e,type:`studio:focus`})},mode(e){r=e,s()},navigate(e){n?t?.send({path:e,type:`studio:navigate`}):i=e},patch(e){a=e,n&&t?.send({...e,type:`studio:patch`})},reconnect(){t&&(n=!1,o({type:`connecting`}),t.reconnect())},subscribe(t){return e.add(t),()=>e.delete(t)}}}async function gC(e,t,n){let r=await e.preview.issue(n),i=await In(wr());try{let e=await In(Ks({sessionId:r.sessionId,target:()=>t()??void 0,targetOrigin:r.previewOrigin,view:window}).pipe(Di(Jn,i))),n=!1;return{async close(){n||(n=!0,await In(Sr(i,qr)))},reconnect:e.reconnect,send:e.send,session:r,state:e.state,subscribe:e.subscribe}}catch(e){throw await In(Sr(i,fi(e))),e}}function _C(e){let t=D(void 0),n=D(`edit`),r=D(``),i=D(),a=D({kind:`idle`}),o=D(),s=hC(),c=``,l=``,u,d=!1,f=pC({editor:mC(e.editor),onManifest:t=>{r.value=t.route,e.onManifest?.(t)},onPreviewDocument:e.onPreviewDocument,onPreviewFocus:()=>e.onPreviewFocus?.(),preview:s}),p=f.subscribe(e=>a.value=e),m=T(()=>[Ce(e.document),Ce(e.body),Ce(e.fallbacks)],([e,t,n])=>{e?.id===c&&e.path!==l&&s.navigate(e.path),c=e?.id??``,l=e?.path??``,f.replace(e?{document:{...e,body:t??e.body},fallbacks:n??{}}:void 0)},{immediate:!0}),h=F(()=>{let t=Ce(e.document),n=i.value;if(!n||!t&&!r.value)return`about:blank`;let a=ec(new URL(r.value||t?.path||`/`,n.session.previewOrigin),n.session);return`${a.pathname}${a.search}${a.hash}`});return T(()=>Ce(e.document),e=>{e&&!r.value&&(r.value=e.path)},{immediate:!0}),T(n,e=>s.mode(e),{immediate:!0}),Kt(t,`load`,()=>s.reconnect()),gC(e.environment.gateway,()=>t.value?.contentWindow,location.origin).then(e=>{if(d)return e.close();i.value=e,u=s.connect(e)}).catch(e=>o.value=e),ct(()=>{d=!0,m(),p(),u?.(),f.dispose(),i.value?.close()}),{error:o,frame:t,mode:n,navigate(e){r.value=e,s.navigate(e)},source:h,state:a}}var vC={class:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-default`},yC={key:1,class:`grid min-h-0 flex-1 place-items-center bg-muted/30`},bC={key:2,class:`grid min-h-0 flex-1 place-items-center bg-muted/30 p-8`},xC={class:`w-full max-w-md text-center`},SC={class:`mx-auto grid size-10 place-items-center rounded-full bg-muted`},CC={class:`mt-1 text-xs text-muted`},wC={key:3,class:`grid min-h-0 flex-1 place-items-center bg-muted/30 p-8`},TC={class:`w-full max-w-sm text-center`},EC={class:`mx-auto grid size-10 place-items-center rounded-full bg-muted`},DC={class:`flex min-w-0 items-center justify-between gap-3 border-b border-default px-3`},OC={class:`flex min-w-0 items-center gap-2`},kC={"aria-live":`polite`,class:`hidden truncate text-[11px] text-muted xl:inline`},AC=[`src`],jC={class:`flex items-center justify-between gap-3 border-b border-default px-3`},MC={class:`flex min-w-0 items-center gap-2`},NC={class:`truncate text-xs font-medium text-highlighted`},PC={key:0,class:`hidden max-w-64 truncate text-[11px] text-muted xl:inline`},FC={class:`flex items-center gap-0.5`},IC={class:`min-h-0 min-w-0 overflow-hidden`},LC={key:0,class:`max-h-40 overflow-y-auto border-t border-default`},RC=U({__name:`DocumentsView`,setup(e){let n=_t(),{catalog:r,createDocument:i,navigation:a}=Yi(),o=Xe(),c=Ze(),l=vx(n,a),u=_C({body:l.previewBody,document:l.preview,editor:l.editor,environment:n,fallbacks:l.previewFallbacks,onManifest:ee,onPreviewDocument:N,onPreviewFocus:I}),d=uC(),f=u.frame,p=d.canvas,m=P(!1),g=P(!1),_=P(!1),v=P(`edit`),y=P(!1),b=P(`visual`),x=new Set(n.bootstrap.documents.types.map(e=>e.collection)),S=F(()=>r.entries.value.some(e=>x.has(e.document.collection))),C=F(()=>l.validation.value?.issues??l.entry.value?.document.issues??[]),w=F(()=>C.value.some(e=>e.severity===`error`)),D=F(()=>{if(u.error.value)return`Preview is unavailable.`;if(u.mode.value===`browse`)return`Links and controls behave like the live website.`;let e=u.state.value;return e.kind===`not-rendered`?`This document is not visible in this preview.`:e.kind===`connecting`||e.kind===`rendering`?`Updating preview…`:e.label?`Selected: ${e.label}`:`Click the document to select it in the editor.`}),O=F(()=>[[{label:`Visual editor`,icon:`i-lucide-panels-top-left`,trailingIcon:b.value===`visual`?`i-lucide-check`:void 0,onSelect:()=>b.value=`visual`},{label:`View source`,icon:`i-lucide-file-code-2`,trailingIcon:b.value===`markdown`?`i-lucide-check`:void 0,onSelect:()=>b.value=`markdown`}]]);T(()=>[o.query.document,o.query.path],()=>void A()),T(d.viewport,pe),T(d.zoom,pe),ae(async()=>{r.entries.value.length||await r.refresh().catch(()=>[]),fe(),x.size&&!S.value&&l.canWrite.value&&await i(),await A()});async function A(){let e=Y(o.query.document)?o.query.document:void 0,t=Y(o.query.path)?o.query.path:void 0,n=e&&r.byId(e)||t&&r.entries.value.find(e=>e.document.path===t)||me(r.entries.value);if(n){if(!e||t){await c.replace({name:`documents`,query:{...o.query,document:n.document.id,path:void 0}});return}l.entry.value?.document.id!==n.document.id&&await l.open(n)}}function j(e){let t=r.byId(e);t?.document.path&&u.navigate(t.document.path),c.push({name:`documents`,query:{...o.query,document:e}})}function N(e){I(),l.entry.value?.document.id!==e&&c.push({name:`documents`,query:{...o.query,document:e}})}function ee(e){let t=e.documents.find(e=>e.role===`primary`);t&&t.documentId!==l.entry.value?.document.id&&N(t.documentId)}function te(){y.value=!0,v.value=`preview`}function I(){y.value=!1,v.value=`edit`}function ne(e){v.value=e,e===`edit`&&(y.value=!1)}function re(){let e=tc(new URL(u.source.value===`about:blank`?`/`:u.source.value,location.origin));a.request(()=>location.assign(`${e.pathname}${e.search}${e.hash}`))}async function ie(){let e=l.entry.value?.document.id;await l.close();let t=await r.refresh(!0),n=e&&t.find(t=>t.document.id===e);n&&await l.open(n)}async function oe(e){l.entry.value?.document.id===e&&await l.close();let t=me(await r.refresh(!0));await c.replace({name:`documents`,query:{...o.query,document:t?.document.id,path:void 0}})}function ce(e){g.value=!1,j(e)}function le(e){let t=Ji.find(t=>t.value===e);t&&(d.viewport.value=t.value)}function ue(e){let t=Ui.find(t=>t.value===e);t&&(d.zoom.value=t.value)}function de(e){(e===`edit`||e===`browse`)&&(u.mode.value=e)}function fe(){d.viewport.value=Ii(o.query.viewport).value,d.zoom.value=qi(o.query.zoom)}function pe(){if(o.name!==`documents`)return;let e=d.viewport.value,t=d.zoom.value;(o.query.viewport!==e||o.query.zoom!==String(t))&&c.replace({name:`documents`,query:{...o.query,viewport:e,zoom:String(t)}})}function me(e){return e.find(e=>e.document.path===`/`)??e.find(e=>/(?:^|\/)index\.(?:md|mdc)$/iu.test(e.sourcePath))??e[0]}return(e,n)=>{let a=J,o=mt,c=Bi,x=_n,S=ac,T=yt;return s(),K(`div`,vC,[R(l).entry.value?(s(),t(Pc,{key:0,"can-publish":R(l).canPublish.value,"can-write":R(l).canWrite.value,connection:R(l).connection.value,"document-id":R(l).entry.value.document.id,"document-key":R(l).entry.value.document.key,draft:R(l).entry.value.document.draft,entries:R(r).entries.value,"has-working-changes":R(l).hasWorkingChanges.value,"history-disabled":!1,"mobile-mode":v.value,participants:R(l).participants.value,persistence:R(l).persistence.value,publishing:R(l).isPublishing.value,onCreateDocument:R(i),onHistory:n[0]||=e=>m.value=!0,onOpenDocument:j,onPrimary:R(l).publish,onRemove:n[1]||=e=>_.value=!0,onTrash:n[2]||=e=>g.value=!0,"onUpdate:mobileMode":ne,onViewSite:re},null,8,[`can-publish`,`can-write`,`connection`,`document-id`,`document-key`,`draft`,`entries`,`has-working-changes`,`mobile-mode`,`participants`,`persistence`,`publishing`,`onCreateDocument`,`onPrimary`])):L(``,!0),R(l).phase.value===`opening`?(s(),K(`main`,yC,[z(a,{name:`i-lucide-loader-circle`,class:`size-5 animate-spin text-muted`})])):R(l).phase.value===`failed`||R(l).phase.value===`conflicted`?(s(),K(`main`,bC,[E(`div`,xC,[E(`span`,SC,[z(a,{name:`i-lucide-file-question`,class:`size-5 text-muted`})]),n[7]||=E(`h2`,{class:`mt-3 text-sm font-medium text-highlighted`},`Documents could not be opened`,-1),E(`p`,CC,B(R(l).error.value?R(ri)(R(l).error.value):`This document is unavailable.`),1),z(o,{class:`mt-4`,color:`neutral`,variant:`outline`,label:`Retry`,onClick:n[3]||=e=>R(l).entry.value&&R(l).open(R(l).entry.value)})])])):R(l).entry.value?(s(),K(`main`,{key:4,class:H([`relative grid min-h-0 min-w-0 flex-1 gap-px overflow-hidden bg-border max-[900px]:grid-cols-1 max-[900px]:grid-rows-1`,y.value?`grid-cols-1`:`grid-cols-[minmax(360px,42%)_minmax(0,1fr)]`])},[E(`section`,{class:H([`order-2 grid min-h-0 min-w-0 grid-rows-[2.875rem_minmax(0,1fr)] bg-default`,v.value===`preview`||y.value?``:`max-[900px]:hidden`])},[E(`header`,DC,[E(`div`,OC,[y.value?(s(),t(o,{key:0,color:`neutral`,variant:`ghost`,size:`xs`,square:``,icon:`i-lucide-panel-left-open`,"aria-label":`Show document editor`,title:`Show document editor`,class:`max-[900px]:hidden`,onClick:I})):L(``,!0),n[10]||=E(`span`,{class:`text-xs font-medium text-highlighted`},`Website preview`,-1),E(`span`,kC,B(D.value),1)]),z(fC,{mode:R(u).mode.value,preset:R(d).viewport.value,zoom:R(d).zoom.value,onSelectMode:de,onSelectPreset:le,onSelectZoom:ue},null,8,[`mode`,`preset`,`zoom`])]),E(`div`,{ref_key:`previewCanvas`,ref:p,class:`h-full min-h-0 min-w-0 overflow-auto bg-muted/30 p-4`},[E(`div`,{class:`relative mx-auto shrink-0 transition-[width,height] duration-200`,style:se(R(d).containerStyle.value)},[E(`iframe`,{ref_key:`previewFrame`,ref:f,class:`absolute left-0 top-0 rounded-md border-0 bg-default shadow-sm ring ring-default transition-transform duration-200`,title:`Website preview`,src:R(u).source.value,style:se(R(d).frameStyle.value)},null,12,AC)],4)],512)],2),y.value?L(``,!0):(s(),K(`aside`,{key:0,class:H([`order-1 grid min-h-0 min-w-0 grid-rows-[2.875rem_minmax(0,1fr)_auto] bg-default`,v.value===`edit`?``:`max-[900px]:hidden`])},[E(`header`,jC,[E(`div`,MC,[z(a,{name:`i-lucide-pencil-line`,class:`size-3.5 text-muted`}),E(`span`,NC,B(b.value===`visual`?`Edit document`:`View source`),1),R(u).state.value.label?(s(),K(`span`,PC,B(R(u).state.value.label),1)):L(``,!0),w.value?(s(),t(c,{key:1,color:`error`,variant:`subtle`,size:`sm`},{default:k(()=>[...n[11]||=[G(` Needs attention `,-1)]]),_:1})):L(``,!0)]),E(`div`,FC,[z(x,{items:O.value,content:{align:`end`}},{default:k(()=>[z(o,{color:`neutral`,variant:`ghost`,size:`xs`,square:``,icon:`i-lucide-ellipsis`,"aria-label":`Editor options`})]),_:1},8,[`items`]),z(o,{color:`neutral`,variant:`ghost`,size:`xs`,square:``,icon:`i-lucide-panel-left-close`,"aria-label":`Hide document editor`,title:`Hide document editor`,class:`max-[900px]:hidden`,onClick:te})])]),E(`div`,IC,[b.value===`visual`?(s(),t(Lx,{key:0,session:R(l)},null,8,[`session`])):(s(),t(S,{key:1,"model-value":R(l).markdown.value,"aria-label":`Document source`,autocomplete:`off`,autocapitalize:`off`,spellcheck:`false`,wrap:`soft`,readonly:``,variant:`none`,class:`h-full min-h-0 w-full`,ui:{root:`h-full min-h-0 w-full items-stretch`,base:`h-full min-h-0 resize-none rounded-none bg-muted/30 p-5 font-mono text-[13px] leading-[1.65] text-highlighted shadow-none outline-none whitespace-pre-wrap wrap-anywhere tab-2`}},null,8,[`model-value`]))]),C.value.length||R(l).persistence.value===`error`?(s(),K(`div`,LC,[R(l).persistence.value===`error`?(s(),t(T,{key:0,title:`Save conflict`,description:R(l).error.value?R(ri)(R(l).error.value):`The shared draft could not be saved.`,icon:`i-lucide-triangle-alert`,color:`error`,variant:`subtle`,class:`rounded-none`},null,8,[`description`])):L(``,!0),(s(!0),K(h,null,M(C.value,e=>(s(),t(T,{key:`${e.code}:${e.field||``}:${e.message}`,title:e.message,description:e.code,icon:e.severity===`error`?`i-lucide-circle-alert`:`i-lucide-triangle-alert`,color:e.severity===`error`?`error`:`warning`,variant:`subtle`,class:`rounded-none border-t border-default first:border-t-0`},null,8,[`title`,`description`,`icon`,`color`]))),128))])):L(``,!0)],2))],2)):(s(),K(`main`,wC,[E(`div`,TC,[E(`span`,EC,[z(a,{name:`i-lucide-files`,class:`size-4 text-muted`})]),n[8]||=E(`p`,{class:`mt-3 text-sm font-medium text-highlighted`},`No documents yet`,-1),n[9]||=E(`p`,{class:`mt-1 text-xs text-muted`},`Create the first record for this website.`,-1),R(l).canWrite.value?(s(),t(o,{key:0,class:`mt-4`,size:`sm`,icon:`i-lucide-plus`,label:`New document`,onClick:R(i)},null,8,[`onClick`])):L(``,!0)])])),z(Xc,{open:_.value,"onUpdate:open":n[4]||=e=>_.value=e,entry:R(l).entry.value,onRemoved:oe},null,8,[`open`,`entry`]),z(Wc,{open:g.value,"onUpdate:open":n[5]||=e=>g.value=e,onRestored:ce},null,8,[`open`]),m.value?(s(),t(lC,{key:5,open:m.value,"onUpdate:open":n[6]||=e=>m.value=e,"can-write":R(l).canWrite.value,entry:R(l).entry.value,onRestored:ie},null,8,[`open`,`can-write`,`entry`])):L(``,!0)])}}});export{RC as default};