adminizer 5.2.0-build.33 → 5.2.0-build.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{abnfDiagram-VCTEODGH-BnsIqosm.js → abnfDiagram-VCTEODGH-VlwaoUTb.js} +1 -1
- package/assets/{add-LtDQwU4b.js → add-CqSZIEWV.js} +1 -1
- package/assets/{add-group-B7P_c4C8.js → add-group-BOsQ0Q3j.js} +1 -1
- package/assets/{add-user-BsX7SMOH.js → add-user-L2wD_b_T.js} +1 -1
- package/assets/ai-assistant/agent.es.js +20488 -19277
- package/assets/app-Bon67K9l.css +1 -0
- package/assets/app-CWlMJiPe.js +138 -0
- package/assets/{architectureDiagram-5GKGNRK7-CHxPdttY.js → architectureDiagram-5GKGNRK7-u57qIB-M.js} +2 -2
- package/assets/{blockDiagram-I7D4REHJ-BYTzbRFE.js → blockDiagram-I7D4REHJ-DV90TjcV.js} +4 -4
- package/assets/{c4Diagram-7LVT6UL2-CI7dW3xq.js → c4Diagram-7LVT6UL2-t5nM_yE6.js} +1 -1
- package/assets/{catalog-BiMamMLN.js → catalog-D6aEgpu7.js} +1 -1
- package/assets/channel-BObXBllO.js +1 -0
- package/assets/{chunk-2Q5K7J3B-Hi-aK_Ha.js → chunk-2Q5K7J3B-Bvean9Oy.js} +1 -1
- package/assets/{chunk-5VM5RSS4-DgcY5Qji.js → chunk-5VM5RSS4-C4yczpcm.js} +1 -1
- package/assets/{chunk-F27PBJKO-DKXOt00w.js → chunk-F27PBJKO-CZQTtsTa.js} +1 -1
- package/assets/{chunk-IMKFNOWR-D4WeUgcs.js → chunk-IMKFNOWR-CvCLehQX.js} +1 -1
- package/assets/{chunk-JWPE2WC7-Ce6Rxa30.js → chunk-JWPE2WC7-BEsqzX-T.js} +1 -1
- package/assets/{chunk-POPQ4Y6H-D0kDsnoE.js → chunk-POPQ4Y6H-BPKiJml-.js} +1 -1
- package/assets/{chunk-SVP7TREG-CYirWYWz.js → chunk-SVP7TREG-BVkc4_Yf.js} +4 -4
- package/assets/{chunk-TICWLB2K-HEf09VbM.js → chunk-TICWLB2K-nbzNG2Lg.js} +1 -1
- package/assets/{chunk-XXDRQBXY-_0ZRO4MZ.js → chunk-XXDRQBXY-BAn4BRVo.js} +1 -1
- package/assets/classDiagram-ZZMXUADV-Dyvh9xeB.js +1 -0
- package/assets/classDiagram-v2-VYDZK3BY-Dyvh9xeB.js +1 -0
- package/assets/controls/ckeditor.es.js +9602 -9418
- package/assets/controls/jsoneditor.es.js +672 -674
- package/assets/controls/toast-ui.es.js +14597 -14596
- package/assets/{cose-bilkent-JH36ORCC-Btol7060.js → cose-bilkent-JH36ORCC-DjIWkId6.js} +1 -1
- package/assets/{cynefin-OW5HDTMX-Olv1bWeO.js → cynefin-OW5HDTMX-DA3WSPz5.js} +1 -1
- package/assets/{cynefinDiagram-5FMLGOSQ-CK0ep8mN.js → cynefinDiagram-5FMLGOSQ-CctOa4fE.js} +2 -2
- package/assets/cytoscape.esm-BHa1VTXv.js +321 -0
- package/assets/d3-scale-4DPf7zan.js +1 -0
- package/assets/{dagre-GXQ25YYZ-D_Tgq3Xg.js → dagre-GXQ25YYZ-BeP3E0b5.js} +2 -2
- package/assets/{dashboard-D7Vrpy3X.js → dashboard-C0pXUDqP.js} +1 -1
- package/assets/{diagram-S7CK7UJ4-Cylxlvfi.js → diagram-S7CK7UJ4-B85fwkaf.js} +3 -3
- package/assets/diagram-UQ7AKVKN-CqkEko9N.js +41 -0
- package/assets/{diagram-VSXAHHWV-DBLNVtPt.js → diagram-VSXAHHWV-x-PrtWHy.js} +1 -1
- package/assets/diagram-VX7I27RA-BYJBRYa8.js +24 -0
- package/assets/{diagram-Z3DM3KII-B6K8hUqN.js → diagram-Z3DM3KII-DCiL-xro.js} +1 -1
- package/assets/{docs-Ce8UYCsn.js → docs-Db-NexCf.js} +1 -1
- package/assets/{ebnfDiagram-PWID7BFC-D5fzOhJr.js → ebnfDiagram-PWID7BFC-CwM3RllY.js} +1 -1
- package/assets/{erDiagram-RLTQ6QDP-B1b5aX0r.js → erDiagram-RLTQ6QDP-D_h8KziD.js} +1 -1
- package/assets/{flowDiagram-HODETNUW-DUt4TmGE.js → flowDiagram-HODETNUW-DGimFqFm.js} +4 -4
- package/assets/ganttDiagram-EL5Y4UJY-CJpR4o0I.js +292 -0
- package/assets/{gitGraphDiagram-WWUBYQGX-BCagtg-j.js → gitGraphDiagram-WWUBYQGX-Dg_f7BHs.js} +1 -1
- package/assets/{history-Bq0XZ13j.js → history-DXiUYmwU.js} +1 -1
- package/assets/{infoDiagram-27XIBGKW-CtqP-RaE.js → infoDiagram-27XIBGKW-wV9lWzkf.js} +1 -1
- package/assets/{init-user-BCb4NPxa.js → init-user-pCW_Q05s.js} +1 -1
- package/assets/{ishikawaDiagram-5VMMS53U-CU7tu3i5.js → ishikawaDiagram-5VMMS53U-BsTDr38x.js} +3 -3
- package/assets/{journeyDiagram-3NMN7TZE-DcGtNnor.js → journeyDiagram-3NMN7TZE-CNHbwqwc.js} +2 -2
- package/assets/{kanban-definition-UXKFOSKX-Da1vwxDK.js → kanban-definition-UXKFOSKX-CVhJsHlN.js} +6 -6
- package/assets/layout-BfAIponG.js +1 -0
- package/assets/{list-Co2Yh_RS.js → list-DUvMtSpV.js} +1 -1
- package/assets/login-E_Y7wut5.js +1 -0
- package/assets/manifest.json +285 -326
- package/assets/{media-manager-BhrlfUDZ.js → media-manager-SrUV61oz.js} +1 -1
- package/assets/mermaid.core-dItKH28w.js +310 -0
- package/assets/{mindmap-definition-YA3MSWOX-DwC--3ep.js → mindmap-definition-YA3MSWOX-CeNd0CHT.js} +1 -1
- package/assets/{module-CBCiLH2M.js → module-BLZcWhbK.js} +1 -1
- package/assets/{notification-Dv_yjwYp.js → notification-Dud_cS95.js} +1 -1
- package/assets/{pegDiagram-XKGWAZYB-Bfjta7he.js → pegDiagram-XKGWAZYB-XkpCeLx7.js} +1 -1
- package/assets/pieDiagram-E7YTZNPT-IfctYNg6.js +39 -0
- package/assets/{quadrantDiagram-AXDQQJYC-DMsQ6bx3.js → quadrantDiagram-AXDQQJYC-Dl71kVWH.js} +4 -4
- package/assets/{railroadDiagram-O6MQD6OU-OMQR6DgW.js → railroadDiagram-O6MQD6OU-DFZCwxEi.js} +1 -1
- package/assets/{register-bvLgzRnh.js → register-CLXNA3RH.js} +1 -1
- package/assets/{requirementDiagram-BXWQKSXE-4eXUH2nw.js → requirementDiagram-BXWQKSXE-gwMr2hhN.js} +1 -1
- package/assets/{ru-GghByIKs.js → ru-BuRkfrV3.js} +1 -1
- package/assets/sankeyDiagram-P5KCCOFB-D4m9TUBM.js +40 -0
- package/assets/{sequenceDiagram-WJ2MYXX4-Cb-fxQnC.js → sequenceDiagram-WJ2MYXX4-JrZmoS_N.js} +1 -1
- package/assets/{sizeCapture-INFHLROL-DgQ7-zHE.js → sizeCapture-INFHLROL-Bi7VDSTt.js} +1 -1
- package/assets/stateDiagram-D77RDMKH-CoOTX1h8.js +1 -0
- package/assets/stateDiagram-v2-MP3YSRHH-DSV0uD3M.js +1 -0
- package/assets/{swimlanes-42K2YHIH-yCzVS5Kf.js → swimlanes-42K2YHIH-CgtKaw_1.js} +1 -1
- package/assets/swimlanesDiagram-VR7AAH4N-tGoQkrWA.js +8 -0
- package/assets/{timeline-definition-24CTP7MA-DZ-J8WVk.js → timeline-definition-24CTP7MA-DrSuUziH.js} +2 -2
- package/assets/{use-appearance-CNzjRFkO.js → use-appearance-CSP6Ml4F.js} +1 -1
- package/assets/{user-filters-list-XZQeWIcY.js → user-filters-list-Cv2Z3Fwm.js} +1 -1
- package/assets/{vennDiagram-4TSXK5OY-DmJwiSA5.js → vennDiagram-4TSXK5OY-BIeLKAIy.js} +5 -5
- package/assets/{wardleyDiagram-VM6X3IG4-CBtPOf2I.js → wardleyDiagram-VM6X3IG4-CwmxxXr9.js} +2 -2
- package/assets/{welcome-hJX9AsIB.js → welcome-CXTRhMo9.js} +1 -1
- package/assets/with-app-layout-DVk7VpSG.js +37 -0
- package/assets/xychartDiagram-S5SC5T6Z-DCx2Vin2.js +7 -0
- package/controllers/login.d.ts +1 -1
- package/controllers/login.js +18 -17
- package/interfaces/adminpanelConfig.d.ts +7 -0
- package/interfaces/global.d.ts +0 -1
- package/lib/app-manager/ContextHandler.d.ts +12 -1
- package/lib/app-manager/ContextHandler.js +9 -0
- package/lib/helper/pretend.d.ts +4 -0
- package/lib/helper/pretend.js +27 -0
- package/package.json +1 -1
- package/system/bindInertia.js +6 -1
- package/system/bindReqFunctions.js +13 -4
- package/translations/ru.json +1 -0
- package/assets/app-DM8KzeFz.css +0 -1
- package/assets/app-D_WEQ9Ix.js +0 -138
- package/assets/arc-CqLlrEwa.js +0 -1
- package/assets/channel-TXm2e8eJ.js +0 -1
- package/assets/classDiagram-ZZMXUADV-DhaqWTWz.js +0 -1
- package/assets/classDiagram-v2-VYDZK3BY-DhaqWTWz.js +0 -1
- package/assets/cytoscape.esm-BDkkwuE4.js +0 -321
- package/assets/defaultLocale-DX6XiGOO.js +0 -1
- package/assets/diagram-UQ7AKVKN-DTi2F_20.js +0 -41
- package/assets/diagram-VX7I27RA-CahscuCU.js +0 -24
- package/assets/ganttDiagram-EL5Y4UJY-CK-rD_6X.js +0 -292
- package/assets/init-Gi6I4Gst.js +0 -1
- package/assets/layout-wE9NXraK.js +0 -1
- package/assets/linear-Cl40xh64.js +0 -1
- package/assets/login-Cl1b-jvN.js +0 -1
- package/assets/mermaid.core-DFiCyHcW.js +0 -310
- package/assets/ordinal-Cboi1Yqb.js +0 -1
- package/assets/pieDiagram-E7YTZNPT-DR6xKA3p.js +0 -39
- package/assets/sankeyDiagram-P5KCCOFB-Cl9Yn7o4.js +0 -40
- package/assets/stateDiagram-D77RDMKH-BIK_kLM3.js +0 -1
- package/assets/stateDiagram-v2-MP3YSRHH-B6Bu0mpm.js +0 -1
- package/assets/swimlanesDiagram-VR7AAH4N-DFHYvxlZ.js +0 -8
- package/assets/with-app-layout-ORRLIlc0.js +0 -34
- package/assets/xychartDiagram-S5SC5T6Z-Drb6_i6k.js +0 -7
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid.core-dItKH28w.js","./app-CWlMJiPe.js","./app-Bon67K9l.css","./isObject-DL-BuaBl.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as A,u as ie,a as Ke,bo as cs,j as f,q as Z,i as fs,k as hs,l as ps,m as ds,n as ms,o as Ge,c0 as mi,d as re,X as gi,c1 as gs,T as xs,c2 as ys,c as G,c3 as xi,c4 as mn,c5 as bs,f as jt,c6 as ks,c7 as We,c8 as Ne,aB as Pt,aC as Lt,c9 as Ae,aE as Mt,aF as On,aG as ct,ca as ws,cb as Ss,cc as Cs,bl as Fe,cd as js,ce as gn,cf as vs,cg as xn,ch as yn,ci as bn,cj as Es,p as fe,b2 as Ns,bX as As,ck as Is,bp as Ts,b3 as zs,b4 as Ps,b5 as Ls,cl as Ms,b6 as Ds,b7 as Fs,L as Xt,I as _s,bf as Os,cm as Rs,be as Bs,cn as yi,co as Rn,cp as bi,cq as $s,cr as Hs,cs as Us,ct as qs,cu as Vs,cv as Ws,cw as Js,cx as Ks,cy as Gs,cz as Xs,cA as Ys,cB as dr,cC as mr,cD as gr,cE as Qs,cF as Zs,cG as eo,cH as to,cI as no,cJ as ro,cK as io,cL as lo,cM as so,bk as ki,cN as oo,H as ao,cO as uo,cP as co,cQ as fo,cR as ho,N as Dt,O as Ft,av as po,Q as _t,b as ht,e as wi,S as mo,cS as go,aZ as xo,a_ as yo,a$ as bo,b0 as ko,b1 as wo,aA as So,bM as Co,Z as jo,P as vo,cT as Eo,cU as No,cV as Ao,bB as Io,cW as To,cX as zo,aw as Po,ax as Lo,ay as xr,az as yr,F as Mo,B as Do,cY as Fo,cZ as _o,c_ as Si,c$ as Oo}from"./app-CWlMJiPe.js";import{i as Ro,u as Bo}from"./use-appearance-CSP6Ml4F.js";const Ci=A.createContext(void 0),$o=({children:e})=>{const[n,t]=A.useState([]),[r,i]=A.useState([]),[s,l]=A.useState([]),[o,a]=A.useState(!1),[u,c]=A.useState(null),[h,d]=A.useState(""),p=ie(),{t:m}=Ke(),y=cs.useMemo(()=>({"Make read":m("Make read"),"View All":m("View All"),Search:m("Search"),"Make all read":m("Make all read"),Title:m("Title"),Message:m("Message"),Date:m("Date"),Diff:m("Diff"),"No notifications":m("No notifications"),"No notifications found":m("No notifications found"),"The end of the list has been reached":m("The end of the list has been reached")}),[m]),j=[...r,...s],b=async()=>{try{const k=await Z.getJson(`${window.routePrefix}/notifications/api`,{params:{unreadOnly:!0,limit:4}});t(k.data)}catch(k){console.error("Error fetching bell notifications:",k)}},E=async()=>{await b()},S=async()=>{try{const k=await Z.getJson(`${window.routePrefix}/notifications/api/get-classes`);k.data&&(c(k.data.activeServices),d(k.data.initTab))}catch(k){console.error("Error fetching tabs:",k)}},v=async(k,I)=>{try{if(!k){await N(I);return}const L=await Z.postJson(`${window.routePrefix}/notifications/api/search`,{s:k,notificationClass:I});l(L.data)}catch(L){console.error("Error searching notifications:",L)}},N=async k=>{a(!0);try{const I=`${window.routePrefix}/notifications/api/${k}`,L=await Z.getJson(I,{params:{limit:20,skip:0,unreadOnly:!1}});return i([]),l(L.data),L.data}catch(I){return console.error("Error fetching all notifications:",I),[]}finally{a(!1)}},w=async(k,I)=>{try{const L=`${window.routePrefix}/notifications/api/${k}`,R=await Z.getJson(L,{params:{limit:20,skip:I,unreadOnly:!1}});return l(J=>[...J,...R.data]),R.data}catch(L){return console.error("Error paginating notifications:",L),[]}};A.useEffect(()=>{if(!p.props.notifications)return;b();const k=new EventSource(`${window.routePrefix}/notifications/api/stream`);return k.addEventListener("connected",I=>{S()}),k.addEventListener("notification",I=>{const L=JSON.parse(I.data);i(R=>[L,...R]),t(R=>[L,...R].slice(0,4))}),k.onerror=()=>{console.error("SSE connection error")},()=>k.close()},[]);const P=async(k,I)=>{try{await Z.putJson(`${window.routePrefix}/notifications/api/${k}/${I}/read`,{}),i(L=>L.map(R=>R.id===I?{...R,read:!0}:R)),l(L=>L.map(R=>R.id===I?{...R,read:!0}:R)),t([])}catch(L){console.error("Error marking as read:",L)}},M=async()=>{try{await Z.putJson(`${window.routePrefix}/notifications/api/read-all`,{}),i(k=>k.map(I=>({...I,read:!0}))),l(k=>k.map(I=>({...I,read:!0}))),await b()}catch(k){console.error("Error marking all as read:",k)}},F=n.filter(k=>!k.read).length;return f.jsx(Ci.Provider,{value:{bellNotifications:n,allNotifications:j,unreadCount:F,getTabs:S,tabs:u,initTab:h,search:v,markAsRead:P,markAllAsRead:M,messages:y,fetchAllNotifications:N,paginateNotifications:w,loading:o,refreshBellNotifications:E},children:e})},ji=()=>{const e=A.useContext(Ci);if(e===void 0)throw new Error("useNotifications must be used within a NotificationProvider");return e},vi="adminizer.aiAssistant.state",Ho=()=>{if(!(typeof window>"u")){try{const e=window.localStorage.getItem(vi);if(e){const n=JSON.parse(e);if(typeof n.isOpen=="boolean")return{isOpen:n.isOpen,activeModel:typeof n.activeModel=="string"?n.activeModel:void 0}}}catch{}return window.__adminizerAiAssistantState__??void 0}},Uo=e=>{if(!(typeof window>"u")){window.__adminizerAiAssistantState__=e;try{window.localStorage.setItem(vi,JSON.stringify(e))}catch{}}},Ei=A.createContext(void 0),qo=({children:e})=>{const t=ie().props.aiAssistant,r=A.useMemo(()=>Ho(),[]),[i,s]=A.useState(()=>r?.isOpen??!1),[l,o]=A.useState([]),[a,u]=A.useState(()=>r?.activeModel??t?.defaultModel??void 0),[c,h]=A.useState(!1),[d,p]=A.useState(null),m=t?.enabled??!1,y=A.useCallback(async()=>{if(m)try{h(!0);const{data:N}=await Z.getJson(`${window.routePrefix}/api/ai-assistant/models`);o(N),u(w=>w&&N.some(M=>M.id===w)?w:t?.defaultModel&&N.some(M=>M.id===t.defaultModel)?t.defaultModel:N[0]?.id)}catch(N){console.error("Failed to load AI assistant models",N),p("Unable to load AI assistant models")}finally{h(!1)}},[t?.defaultModel,m]);A.useEffect(()=>{m&&y()},[y,m]);const j=A.useCallback(N=>{u(N)},[]),b=A.useCallback(()=>s(!0),[]),E=A.useCallback(()=>s(!1),[]),S=A.useCallback(()=>s(N=>!N),[]);A.useEffect(()=>{m||s(!1)},[m]),A.useEffect(()=>{Uo({isOpen:i,activeModel:a})},[a,i]);const v=A.useMemo(()=>({isEnabled:m,isOpen:i,openChat:b,closeChat:E,toggleChat:S,models:l,activeModel:a,setActiveModel:j,loading:c,error:d}),[a,E,d,m,i,c,l,b,j,S]);return f.jsx(Ei.Provider,{value:v,children:e})},Ot=()=>{const e=A.useContext(Ei);if(!e)throw new Error("useAiAssistant must be used within an AiAssistantProvider");return e},Vo=()=>`${window.routePrefix??""}/assets/ai-assistant/agent.es.js?v=${window.adminizerVersion??""}`;function Wo({width:e="min(25vw, 420px)",isResizing:n=!1,onResizeStart:t}){const{isEnabled:r,isOpen:i,closeChat:s,models:l,activeModel:o,setActiveModel:a,loading:u,error:c}=Ot(),[h,d]=A.useState(null),[p,m]=A.useState(null);if(A.useEffect(()=>{if(!i||h||p)return;let E=!1;return import(Vo()).then(S=>{E||d(()=>S.default)}).catch(S=>{console.error("Failed to load the AI assistant UI",S),E||m("Unable to load the AI assistant UI")}),()=>{E=!0}},[h,i,p]),!r)return null;const y=l.find(E=>E.id===o),j=f.jsx(re,{variant:"ghost",size:"icon",onClick:s,"aria-label":"Close AI assistant",children:f.jsx(gi,{className:"size-4"})}),b=f.jsxs(f.Fragment,{children:[l.length>1&&f.jsxs(fs,{value:o,onValueChange:a,children:[f.jsx(hs,{className:"h-8 w-36 text-xs","aria-label":"Select assistant",children:f.jsx(ps,{placeholder:"Assistant"})}),f.jsx(ds,{className:"z-[70]",children:l.map(E=>f.jsx(ms,{value:E.id,children:E.name},E.id))})]}),j]});return f.jsxs("aside",{id:"ai-assistant-panel","aria-label":"AI assistant chat","aria-hidden":!i,className:mi("bg-card text-card-foreground fixed bottom-0 right-0 top-0 z-[60] flex h-full flex-col border-l shadow-xl transition-all duration-300 ease-in-out","md:w-auto w-full",i?"translate-x-0 opacity-100":"translate-x-full opacity-0 pointer-events-none",n&&"transition-none"),style:{width:"var(--ai-assistant-panel-actual-width, "+e+")"},children:[f.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize AI assistant panel",className:"absolute -left-2 top-0 z-10 hidden h-full w-4 cursor-col-resize touch-none md:block",onPointerDown:t}),o&&h&&!p?f.jsx(h,{routePrefix:window.routePrefix??"",modelId:o,title:y?.name,layout:"panel",headerActions:b},o):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[f.jsx("span",{className:"font-semibold leading-tight",children:"AI assistant"}),j]}),f.jsx("div",{className:"flex flex-1 items-center justify-center p-6 text-center text-sm text-muted-foreground",children:p||c?f.jsx("span",{className:"text-destructive",children:p??c}):!u&&l.length===0?f.jsx("span",{children:"No AI models are available for your account."}):f.jsx(Ge,{className:"size-8 animate-spin"})})]})]})}const Jo="25vw",br="margin-right 300ms ease-in-out",Ni=.25,Ko=.55,Ai="adminizer.aiAssistant.panelWidth",kn=()=>({min:Math.round(window.innerWidth*Ni),max:Math.round(window.innerWidth*Ko)}),Go=()=>window.innerWidth*Ni,Xo=()=>{try{const e=Number(window.localStorage.getItem(Ai));if(!Number.isFinite(e))return null;const{min:n,max:t}=kn();return Math.min(t,Math.max(n,e))}catch{return null}};function Yo({children:e,panelWidth:n=Jo}){const{isEnabled:t,isOpen:r}=Ot(),[i,s]=A.useState(Xo),[l,o]=A.useState(!1),a=i===null?n:`${i}px`,u=A.useCallback(c=>{if(window.innerWidth<768)return;c.preventDefault();const h=c.clientX,d=i??Go(),p=document.body.style.userSelect;document.body.style.userSelect="none",o(!0);const m=j=>{const{min:b,max:E}=kn(),S=Math.min(E,Math.max(b,d+h-j.clientX));s(Math.round(S))},y=()=>{document.body.style.userSelect=p,o(!1),document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",y),document.removeEventListener("pointercancel",y)};document.addEventListener("pointermove",m),document.addEventListener("pointerup",y),document.addEventListener("pointercancel",y)},[i]);return A.useEffect(()=>{if(i!==null)try{window.localStorage.setItem(Ai,String(i))}catch{}},[i]),A.useEffect(()=>{const c=document.getElementById("app");if(!c)return;const h=c.style.transition,d=h?.includes("margin-right");return d||(c.style.transition=h?`${h}, ${br}`:br),c.classList.add("ai-assistant-host"),c.style.setProperty("--ai-assistant-panel-width",a),()=>{c.classList.remove("ai-assistant-host"),c.style.removeProperty("--ai-assistant-panel-width"),c.style.removeProperty("--ai-assistant-panel-actual-width"),c.style.removeProperty("margin-right"),delete c.dataset.aiAssistantOpen,d||(c.style.transition=h)}},[a]),A.useEffect(()=>{const c=document.getElementById("app");if(!c)return;const h=window.innerWidth<768,d=h?"100vw":a;c.style.setProperty("--ai-assistant-panel-actual-width",d),t&&r?(c.style.marginRight=h?"0":a,c.dataset.aiAssistantOpen="true"):(c.style.removeProperty("margin-right"),c.dataset.aiAssistantOpen="false");const p=()=>{const m=window.innerWidth<768,y=m?"100vw":a;if(c.style.setProperty("--ai-assistant-panel-actual-width",y),i!==null&&!m){const{min:j,max:b}=kn();s(E=>E===null?E:Math.min(b,Math.max(j,E)))}t&&r&&(c.style.marginRight=m?"0":a)};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[a,i,t,r]),f.jsxs(f.Fragment,{children:[e,f.jsx(Wo,{width:a,isResizing:l,onResizeStart:u})]})}function Qo({children:e}){return A.useEffect(()=>{Ro()},[]),f.jsx($o,{children:f.jsx(qo,{children:f.jsxs(gs,{children:[e,f.jsx(Yo,{}),f.jsx(xs,{position:"top-center",richColors:!0,closeButton:!0})]})})})}const Ii=A.memo(({children:e,variant:n="header"})=>{const[t,r]=A.useState(()=>typeof window<"u"?localStorage.getItem("sidebar")!=="false":!0),i=s=>{r(s),typeof window<"u"&&localStorage.setItem("sidebar",String(s))};return n==="header"?f.jsx("div",{className:"flex min-h-screen w-full flex-col",children:e}):f.jsx(ys,{className:"h-svh overflow-hidden",defaultOpen:t,open:t,onOpenChange:i,children:e})});function W({name:e,className:n,style:t}){return f.jsx("span",{className:G("material-icons-outlined",n),style:t,children:e})}function vt(e){return e.split(/[?#]/)[0].replace(/\/+$/,"")}function Ti(e,n){const t=vt(n);let r=null;for(const i of e){if(!i)continue;const s=vt(i);(t===s||t.startsWith(`${s}/`))&&(r===null||s.length>r.length)&&(r=s)}return r}function zi(e){return e.flatMap(n=>[n.link,...(n.actions??[]).map(t=>t.link)])}const Zo="folder",ea="radio_button_checked",Ue=A.forwardRef(({entry:e,...n},t)=>{const r=f.jsxs(f.Fragment,{children:[e.icon&&f.jsx(W,{name:e.icon,className:"!text-[18px]"}),f.jsx("span",{children:e.title})]});return e.type==="blank"?f.jsx("a",{...n,ref:t,href:e.link,target:"_blank",rel:"noopener noreferrer",children:r}):f.jsx(fe,{...n,ref:t,href:e.link,children:r})});Ue.displayName="EntryLink";function Pi({items:e=[]}){const n=ie(),{state:t,isMobile:r}=xi(),i=t==="collapsed"&&!r,s=n.props.menuSections??{},l=(v,N)=>s[v]?.icon||N.find(w=>w.icon)?.icon||Zo,o=e.reduce((v,N)=>{const w=N.section||"Platform";return v[w]||(v[w]=[]),v[w].push(N),v},{}),a=Object.keys(o).sort((v,N)=>{const w=s[v]?.order,P=s[N]?.order;return w!==void 0&&P!==void 0?w-P:w!==void 0?-1:P!==void 0?1:v==="Platform"?-1:N==="Platform"||v==="System"?1:N==="System"?-1:v.localeCompare(N)}),[u,c]=A.useState(()=>{const v={};return e.forEach(N=>{const w=N.section||"Platform";v[w]=!1}),v}),[h,d]=A.useState(()=>{const v={};return e.forEach(N=>{const w=N.section||"Platform";v[w]=!1}),v}),p=Ti(zi(e),n.url),m=v=>p!==null&&vt(v)===p,y=A.useRef(u),j=A.useRef(h);y.current=u,j.current=h;const b=v=>{for(const N of v){const w=N.actions?.find(P=>m(P.link));if(w)return w}return v.find(N=>m(N.link))??null},E=({item:v})=>v.actions?.length>0?f.jsx(js,{asChild:!0,defaultOpen:m(v.link)||v.actions.some(N=>m(N.link)),className:"group/collapsible",children:f.jsxs(Ne,{children:[f.jsx(gn,{asChild:!0,children:f.jsxs(Ae,{tooltip:v.title,children:[f.jsx(W,{name:v.icon,className:"!text-[18px]"}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:v.title}),f.jsx(jt,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),f.jsx(vs,{children:f.jsx(xn,{children:v.actions?.map(N=>f.jsx(yn,{children:f.jsx(bn,{asChild:!0,isActive:m(N.link),children:f.jsx(Ue,{entry:N})})},N.id))})})]})},v.title):f.jsxs(Ne,{children:[f.jsx(Ae,{asChild:!0,isActive:m(v.link),tooltip:{children:v.title},children:f.jsx(Ue,{entry:v})}),v.badge?f.jsx(Es,{children:v.badge}):null]},v.title),S=({section:v,itemsInSection:N})=>{const w=b(N);return f.jsx(mn,{className:"px-2 py-0",children:f.jsxs(We,{children:[f.jsx(Ne,{children:f.jsxs(Pt,{children:[f.jsx(Lt,{asChild:!0,children:f.jsxs(Ae,{isActive:!!w,"aria-label":v,children:[f.jsx(W,{name:l(v,N),className:"!text-[18px]"}),f.jsx("span",{children:v})]})}),f.jsxs(Mt,{side:"right",align:"start",className:"min-w-56 z-[1003]",children:[f.jsxs(On,{className:"flex items-center gap-2",children:[f.jsx(W,{name:l(v,N),className:"!text-[18px]"}),f.jsx("span",{children:v})]}),f.jsx(ct,{}),N.map(P=>P.actions?.length>0?f.jsxs(ws,{children:[f.jsxs(Ss,{children:[P.icon&&f.jsx(W,{name:P.icon,className:"!text-[18px]"}),f.jsx("span",{children:P.title})]}),f.jsx(Cs,{className:"z-[1003]",children:P.actions?.map(M=>f.jsx(Fe,{asChild:!0,children:f.jsx(Ue,{entry:M})},M.id||M.title))})]},P.id||P.title):f.jsx(Fe,{asChild:!0,children:f.jsx(Ue,{entry:P})},P.id||P.title))]})]})}),w&&f.jsx(Ne,{children:f.jsx(Ae,{asChild:!0,isActive:!0,tooltip:w.title,children:f.jsx(Ue,{entry:{...w,icon:w.icon||ea}})})})]})})};return f.jsx(f.Fragment,{children:a.map(v=>{const N=o[v];if(i)return f.jsx(S,{section:v,itemsInSection:N},v);const w=N.some(M=>M.actions?.length>0?M.actions.some(F=>m(F.link)):m(M.link)),P=h[v]?u[v]:w;return f.jsxs(mn,{className:"px-2 py-0",children:[f.jsx(bs,{asChild:!0,className:"cursor-pointer",onClick:()=>{const k=!(j.current[v]?y.current[v]:w);d(I=>({...I,[v]:!0})),c(I=>({...I,[v]:k}))},children:f.jsxs("div",{className:"flex w-full items-center gap-2",children:[f.jsx(W,{name:l(v,N),className:"!text-[16px]"}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:v}),f.jsx(jt,{className:`ml-auto shrink-0 transform transition-transform duration-200 ${P?"rotate-90":""}`})]})}),P&&f.jsx(ks,{children:f.jsx(We,{children:N.map(M=>f.jsx(E,{item:M},M.id||M.title))})})]},v)})})}const ta=5*1024*1024,na=(e,n)=>{const t=e?.response?.data;if(!t)return n;if(typeof t=="string")try{const r=JSON.parse(t);return r.error??r.message??n}catch{return t||n}if(typeof t=="object"){const r=t;return r.error??r.message??n}return n},Li=A.memo(({routePrefix:e,triggerLabel:n,placeholder:t,t:r,onClose:i})=>{const[s,l]=A.useState(""),[o,a]=A.useState(""),[u,c]=A.useState([]),[h,d]=A.useState({}),[p,m]=A.useState(!1),[y,j]=A.useState(!1),b=A.useRef(null),E=N=>{if(!N)return;const w={},P=[];Array.from(N).forEach(M=>{M.size>ta?w[M.name]=r("File size exceeds the 5 MB limit"):P.push(M)}),c(M=>[...M,...P]),Object.keys(w).length&&d(M=>({...M,...w}))},S=N=>c(w=>w.filter((P,M)=>M!==N)),v=async N=>{if(N.preventDefault(),!s.trim()){d({title:r("Title is required")});return}m(!0),d({});const w=new FormData;w.append("title",s.trim()),w.append("description",o.trim()),u.forEach(P=>w.append("files",P));try{await Z.post(`${e}/api/feedback`,w),j(!0)}catch(P){const M=na(P,r("Internal server error"));d({_global:M}),m(!1)}};return A.useEffect(()=>{if(!y)return;const N=setTimeout(i,2e3);return()=>clearTimeout(N)},[y,i]),y?f.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-24 text-center",children:[f.jsx(Ms,{size:48,className:"text-green-500 dark:text-green-400"}),f.jsx("p",{className:"text-base font-medium",children:r("Feedback sent successfully")})]}):f.jsxs(f.Fragment,{children:[f.jsxs(Ds,{className:"mb-4",children:[f.jsx(Fs,{children:n??r("Feedback")}),t&&f.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t})]}),f.jsxs("form",{onSubmit:v,className:"space-y-5",noValidate:!0,children:[f.jsxs("div",{className:"space-y-1.5",children:[f.jsx(Xt,{htmlFor:"fb-title",children:r("Title")}),f.jsx(_s,{id:"fb-title",value:s,onChange:N=>l(N.target.value),disabled:p,placeholder:r("Title"),className:h.title?"border-destructive":""}),h.title&&f.jsx("p",{className:"text-xs text-destructive",children:h.title})]}),f.jsxs("div",{className:"space-y-1.5",children:[f.jsx(Xt,{htmlFor:"fb-desc",children:r("Description")}),f.jsx(Os,{id:"fb-desc",value:o,onChange:N=>a(N.target.value),disabled:p,placeholder:r("Description"),rows:5,className:"resize-none"})]}),f.jsxs("div",{className:"space-y-1.5",children:[f.jsx(Xt,{children:r("Attach files")}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:()=>b.current?.click(),disabled:p,children:[f.jsx(Rs,{size:14,className:"mr-1"}),r("Attach files")]}),f.jsx("span",{className:"text-xs text-muted-foreground",children:r("Max 5 MB per file")})]}),f.jsx("input",{ref:b,type:"file",multiple:!0,className:"hidden",onChange:N=>E(N.target.files),disabled:p}),u.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:u.map((N,w)=>f.jsxs("li",{className:"flex items-center justify-between rounded-md border bg-muted/40 px-3 py-1.5 text-xs",children:[f.jsx("span",{className:"truncate max-w-[340px]",children:N.name}),f.jsx("button",{type:"button",onClick:()=>S(w),className:"ml-2 text-muted-foreground hover:text-destructive transition-colors","aria-label":r("Remove file"),disabled:p,children:f.jsx(gi,{size:13})})]},w))}),Object.entries(h).filter(([N])=>N!=="title"&&N!=="_global").map(([N,w])=>f.jsx("p",{className:"text-xs text-destructive",children:w},N))]}),h._global&&f.jsx("p",{className:"text-xs text-destructive",children:h._global}),f.jsx(Bs,{children:f.jsx(re,{type:"submit",disabled:p,children:p?f.jsxs(f.Fragment,{children:[f.jsx(Ge,{size:14,className:"mr-1.5 animate-spin"}),r("Sending...")]}):r("Send")})})]})]})});Li.displayName="FeedbackForm";function ra(){const e=ie(),{t:n}=Ke(),t=e.props.routePrefix??window.routePrefix??"",r=e.props.feedbackTriggerLabel??null,i=e.props.feedbackPlaceholder??null,[s,l]=A.useState(!1),[o,a]=A.useState(0),u=A.useCallback(()=>l(!1),[]),c=A.useCallback(h=>{l(h),h||a(d=>d+1)},[]);return f.jsxs(Ns,{open:s,onOpenChange:c,children:[f.jsx(As,{asChild:!0,children:f.jsxs("button",{className:"flex items-center gap-1.5 text-xs opacity-60 hover:opacity-100 transition-opacity cursor-pointer mt-1 mx-auto","aria-label":r??n("Send feedback"),children:[f.jsx(Is,{size:13}),r??n("Send feedback")]})}),Ts.createPortal(f.jsx(zs,{}),document.body),f.jsx(Ps,{children:f.jsx(Ls,{children:f.jsx(Li,{routePrefix:t,triggerLabel:r,placeholder:i,t:n,onClose:u},o)})})]})}const kr="rocket_launch";function Mi({className:e,side:n="bottom"}){const t=ie(),{adminContext:r,adminContexts:i=[],brand:s}=t.props,l=yi(),o=(t.props.section??[]).slice(1).flatMap(a=>a.subItems?.length?a.subItems:[a]);return f.jsxs(Pt,{children:[f.jsx(Lt,{asChild:!0,children:f.jsxs(re,{variant:"ghost",className:G("w-full justify-start px-2! cursor-pointer",e),children:[f.jsx(W,{name:r?.icon??kr,className:"!text-[18px]"}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap group-data-[state=collapsed]:hidden",children:r?.title??s}),f.jsx(Rn,{className:"ml-auto group-data-[state=collapsed]:hidden"})]})}),f.jsxs(Mt,{side:l?"bottom":n,align:"start",className:"min-w-56 z-[1003]",children:[f.jsx(On,{className:"text-xs text-muted-foreground",children:s}),i.map(a=>f.jsx(Fe,{asChild:!0,children:f.jsxs(fe,{href:a.link,className:"flex gap-2 items-center cursor-pointer",children:[f.jsx(W,{name:a.icon??kr,className:"!text-[18px]"}),f.jsx("span",{children:a.title}),a.id===r?.id&&f.jsx(bi,{className:"ml-auto size-4"})]})},a.id)),o.length>0&&f.jsx(ct,{}),o.map(a=>f.jsx(Fe,{asChild:!0,children:a.type==="blank"?f.jsxs("a",{href:a.link,target:"_blank",rel:"noreferrer",className:"flex gap-2 items-center",children:[a.icon&&f.jsx(W,{name:a.icon,className:"!text-[18px]"}),f.jsx("span",{children:a.title})]}):f.jsxs(fe,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&f.jsx(W,{name:a.icon,className:"!text-[18px]"}),f.jsx("span",{children:a.title})]})},a.id))]})]})}const Di=["Layout","Sidebar","SidebarHeader","SidebarContent","SidebarFooter","Header","HeaderStart","HeaderActions"],Fi=A.createContext({});function ia({layers:e,children:n}){const t=A.useMemo(()=>{const r={};for(const i of e)for(const s of Di){const l=i[s];(typeof l=="function"||typeof l=="object"&&l!==null)&&(r[s]??=[]).push(l)}return r},[e]);return f.jsx(Fi.Provider,{value:t,children:n})}class la extends A.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(n,t){console.error(`[Adminizer] The "${this.props.name}" layout override failed; the inherited part is shown instead`,n,t.componentStack)}render(){return this.state.failed?this.props.fallback():this.props.children}}function Ie({name:e,Default:n,...t}){const r=A.useContext(Fi)[e],i=A.useMemo(()=>{let s=n;for(const l of r??[]){const o=s,a=u=>f.jsx(la,{name:e,fallback:()=>f.jsx(o,{...u}),children:f.jsx(l,{...u,Default:o})});a.displayName=`ShellSlot(${e})`,s=a}return s},[r,n,e]);return f.jsx(i,{...t})}function _i(){return f.jsxs($s,{collapsible:"icon",variant:"inset",children:[f.jsx(Hs,{children:f.jsx(Ie,{name:"SidebarHeader",Default:sa})}),f.jsx(Us,{children:f.jsx(Ie,{name:"SidebarContent",Default:oa})}),f.jsx(qs,{children:f.jsx(Ie,{name:"SidebarFooter",Default:aa})})]})}function sa(){const e=ie(),n=(e.props.adminContexts?.length??0)>1;return f.jsx(We,{children:f.jsx(Ne,{children:n?f.jsx(Mi,{side:"right"}):f.jsxs(f.Fragment,{children:[f.jsx(Vs,{className:"p-0 shadow-none border-none bg-transparent hidden md:block",children:f.jsxs(Ws,{children:[f.jsx(Js,{asChild:!0,className:"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground rounded-md",children:f.jsx(Ae,{asChild:!0,children:f.jsx(re,{variant:"ghost",asChild:!0,className:`w-full px-2! ${e.props.section?"":"pointer-events-none"}`,children:f.jsxs("div",{children:[f.jsx(W,{name:"rocket_launch",className:"!text-[18px]"}),f.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:e.props.brand}),e.props.section&&f.jsx(Rn,{className:"ml-auto group-data-[state=collapsed]:hidden"})]})})})}),e.props.section&&f.jsx(Ks,{side:"right",className:"z-[1003]",children:e.props.section.map(t=>f.jsx("div",{children:t.subItems?f.jsxs(Gs,{children:[f.jsxs(Xs,{className:"flex gap-2 items-center cursor-pointer",children:[f.jsx(W,{name:t.icon,className:"!text-[18px]"}),f.jsx("span",{className:"hover:underline",children:t.title})]}),f.jsx(Ys,{children:t.subItems.map(r=>f.jsx(dr,{children:r.type==="blank"?f.jsxs("a",{href:r.link,target:"_blank",className:"flex gap-2 items-center",children:[r.icon&&f.jsx(W,{name:r.icon,className:"!text-[18px]"}),f.jsx("span",{className:"hover:underline",children:r.title})]},r.id):f.jsxs(fe,{href:r.link,className:"flex gap-2 items-center",children:[r.icon&&f.jsx(W,{name:r.icon,className:"!text-[18px]"}),f.jsx("span",{className:"hover:underline",children:r.title})]},r.id)},r.id))})]}):f.jsx(dr,{children:t.type==="blank"?f.jsxs("a",{href:t.link,target:"_blank",className:"flex gap-2 items-center",children:[t.icon&&f.jsx(W,{name:t.icon,className:"!text-[18px]"}),f.jsx("span",{className:"hover:underline",children:t.title})]}):f.jsxs(fe,{href:t.link,className:"flex gap-2 items-center",children:[t.icon&&f.jsx(W,{name:t.icon,className:"!text-[18px]"}),f.jsx("span",{className:"hover:underline",children:t.title})]})})},t.id))})]})}),f.jsx(mn,{className:"px-2 py-0 block md:hidden",children:f.jsx(We,{children:f.jsx(mr,{asChild:!0,className:"group/collapsible",children:f.jsxs(Ne,{children:[f.jsx(gn,{asChild:!0,children:f.jsxs(Ae,{children:[f.jsx(W,{name:"rocket_launch",className:"!text-[18px]"}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:e.props.brand}),e.props.section&&f.jsx(jt,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),e.props.section&&f.jsx(gr,{children:f.jsx(xn,{children:e.props.section&&e.props.section.map(t=>t.subItems?f.jsx(We,{children:f.jsx(mr,{asChild:!0,className:"group/collapsible-sub",children:f.jsxs(Ne,{children:[f.jsx(gn,{asChild:!0,children:f.jsxs(Ae,{children:[f.jsx(W,{name:t.icon,className:"!text-[18px]"}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:t.title}),f.jsx(jt,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible-sub:rotate-90"})]})}),f.jsx(gr,{children:f.jsx(xn,{children:t.subItems.map(r=>f.jsx(yn,{children:f.jsx(bn,{asChild:!0,children:r.type==="blank"?f.jsxs("a",{href:r.link,target:"_blank",className:"flex gap-2 items-center",children:[r.icon&&f.jsx(W,{name:r.icon,className:"!text-[18px]"}),f.jsx("span",{className:"hover:underline",children:r.title})]}):f.jsxs(fe,{href:r.link,className:"flex gap-2 items-center",children:[r.icon&&f.jsx(W,{name:r.icon,className:"!text-[18px]"}),f.jsx("span",{className:"hover:underline",children:r.title})]})})},r.id))})})]})})},t.id):f.jsx(yn,{children:f.jsx(bn,{asChild:!0,children:t.type==="blank"?f.jsxs("a",{href:t.link,target:"_blank",className:"flex gap-2 items-center",children:[t.icon&&f.jsx(W,{name:t.icon,className:"!text-[18px]"}),f.jsx("span",{className:"hover:underline",children:t.title})]}):f.jsxs(fe,{href:t.link,className:"flex gap-2 items-center",children:[t.icon&&f.jsx(W,{name:t.icon,className:"!text-[18px]"}),f.jsx("span",{className:"hover:underline",children:t.title})]})})},t.id))})})]})})})})]})},e.props.brand)})}function oa(){const e=ie();return f.jsx(Pi,{items:e.props.menu})}function aa(){const e=ie();return f.jsxs("div",{className:"flex flex-col items-center",children:[e.props.version&&(()=>{const n=e.props.version,t=n.text||"5.2.0",r=new Date("2026-11-13T15:34:14.431Z").toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),i=n.text?`v.${t}`:`v.${t} · ${r}`,s="text-center opacity-70 hover:opacity-100 transition-opacity text-xs";return n.link?f.jsx("a",{href:n.link,target:"_blank",rel:"noreferrer",title:n.hint??void 0,className:s,children:i}):f.jsx("span",{title:n.hint??void 0,className:s,children:i})})(),e.props.showFeedback&&f.jsx(ra,{})]})}function Oi({breadcrumbs:e}){return f.jsx(f.Fragment,{children:e.length>0&&f.jsx(Qs,{children:f.jsx(Zs,{children:e.map((n,t)=>{const r=t===e.length-1;return f.jsxs(A.Fragment,{children:[f.jsx(eo,{children:r||!n.href?f.jsx(to,{children:n.title}):f.jsx(no,{asChild:!0,children:f.jsx(fe,{href:n.href,children:n.title})})}),!r&&f.jsx(ro,{})]},t)})})})})}function ua(){return A.useCallback(n=>{const t=n.trim().split(" ");if(t.length===0)return"";if(t.length===1)return t[0].charAt(0).toUpperCase();const r=t[0].charAt(0),i=t[t.length-1].charAt(0);return`${r}${i}`.toUpperCase()},[])}function Bn({user:e,showEmail:n=!1}){const t=ua();return f.jsxs(f.Fragment,{children:[f.jsxs(io,{className:"h-8 w-8 overflow-hidden rounded-full",children:[f.jsx(lo,{src:e.avatar,alt:e.login}),f.jsx(so,{className:"rounded-lg bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white",children:t(e.login)})]}),f.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[f.jsx("span",{className:"truncate font-medium",children:e.login}),n&&f.jsx("span",{className:"text-muted-foreground truncate text-xs",children:e.email})]})]})}function ca(){return A.useCallback(()=>{document.body.style.removeProperty("pointer-events")},[])}function Ri({user:e,logout:n,logoutBtn:t,items:r=[]}){const i=ca();return f.jsxs(f.Fragment,{children:[f.jsx(On,{className:"p-0 font-normal",children:f.jsx("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:f.jsx(Bn,{user:e,showEmail:!0})})}),f.jsx(ct,{}),r.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(ki,{children:r.map(s=>f.jsx(Fe,{asChild:!0,children:s.type==="blank"?f.jsxs("a",{className:"flex w-full cursor-pointer items-center",href:s.link,target:"_blank",rel:"noopener noreferrer",onClick:i,children:[s.icon&&f.jsx(W,{name:s.icon,className:"mr-2 !text-[16px]"}),s.title]}):f.jsxs(fe,{className:"flex w-full cursor-pointer items-center",href:s.link,onClick:i,children:[s.icon&&f.jsx(W,{name:s.icon,className:"mr-2 !text-[16px]"}),s.title]})},s.id))}),f.jsx(ct,{})]}),f.jsx(Fe,{asChild:!0,children:f.jsxs(fe,{className:"block w-full cursor-pointer",method:"get",href:n,as:"button",onClick:i,children:[f.jsx(oo,{className:"mr-2"}),t]})})]})}function Bi(){const{auth:e,logout:n,logoutBtn:t,userMenu:r}=ie().props,{state:i}=xi(),s=yi();return f.jsx(We,{children:f.jsx(Ne,{children:f.jsxs(Pt,{children:[f.jsx(Lt,{asChild:!0,children:f.jsxs(Ae,{size:"lg",className:"text-sidebar-accent-foreground data-[state=open]:bg-sidebar-accent group focus-visible:ring-0 cursor-pointer",children:[f.jsx(Bn,{user:e.user}),f.jsx(Rn,{className:"ml-auto size-4"})]})}),f.jsx(Mt,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg z-[1002]",align:"end",side:s?"bottom":i==="collapsed"?"left":"bottom",children:f.jsx(Ri,{user:e.user,logout:n,logoutBtn:t,items:r??[]})})]})})})}function $i(){const{appearance:e,updateAppearance:n}=Bo(),t={light:"dark",dark:"system",system:"light"},r={light:fo,dark:co,system:uo},i=()=>n(t[e]),s=r[e];return f.jsx(re,{variant:"ghost",size:"icon",onClick:i,className:"shrink-0",children:f.jsx(ao,{iconNode:s})})}function fa(){const{bellNotifications:e,markAsRead:n,unreadCount:t,refreshBellNotifications:r,messages:i}=ji(),[s,l]=A.useState(!1),o=async(u,c)=>{l(!0);try{await n(u,c),await r()}catch(h){console.error("Error marking as read:",h)}finally{l(!1)}},a=u=>{const c=new Date,h=new Date(u),d=c.getTime()-h.getTime(),p=Math.floor(d/1e3),m=new Intl.RelativeTimeFormat("en",{numeric:"auto"});if(p<60)return m.format(-p,"second");const y=Math.floor(p/60);if(y<60)return m.format(-y,"minute");const j=Math.floor(y/60);if(j<24)return m.format(-j,"hour");const b=Math.floor(j/24);if(b<30)return m.format(-b,"day");const E=Math.floor(b/30);if(E<12)return m.format(-E,"month");const S=Math.floor(E/12);return m.format(-S,"year")};return f.jsxs(Pt,{children:[f.jsx(Lt,{asChild:!0,className:"cursor-pointer data-[state=open]:bg-sidebar-accent",children:f.jsxs(re,{variant:"ghost",className:"relative",children:[f.jsx(ho,{}),t>0&&f.jsx("div",{className:"absolute top-1.5 right-1.5 size-1.5 rounded-full bg-destructive"})]})}),f.jsxs(Mt,{className:"z-[1002] p-2",align:"end",onCloseAutoFocus:u=>u.preventDefault(),children:[f.jsx(ki,{className:`${s?"opacity-50 pointer-events-none":""}`,children:e.length===0?f.jsx("div",{className:"p-4 text-center text-muted-foreground",children:i["No notifications"]}):e.map(u=>f.jsxs("div",{children:[f.jsx(Fe,{asChild:!0,className:"cursor-pointer",onSelect:c=>{c.preventDefault(),ht.visit(`${window.routePrefix}/notifications?type=${u.notificationClass}`)},children:f.jsxs("div",{className:"grid grid-cols-[32px_250px] grid-rows-[auto_1fr] items-start gap-x-4 gap-y-2",children:[u.icon?f.jsx(W,{name:u.icon.icon,style:{color:u.icon.iconColor},className:"!text-[32px]"}):f.jsx("div",{}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:"font-medium",children:u.title}),f.jsx("span",{className:"truncate",children:u.message})]}),f.jsxs("div",{className:"col-start-2 flex justify-between flex-nowrap items-center",children:[f.jsx("div",{className:"flex flex-nowrap gap-2 items-center",children:f.jsx("div",{children:a(u.createdAt)})}),f.jsxs(Dt,{children:[f.jsx(Ft,{asChild:!0,children:f.jsx(re,{variant:"ghost",size:"icon",className:"size-4",onClick:c=>{c.stopPropagation(),o(u.notificationClass,u.id)},children:f.jsx(po,{className:"text-primary"})})}),f.jsx(_t,{side:"left",className:"z-[1003]",children:f.jsx("p",{children:i["Make read"]})})]})]})]})}),f.jsx(ct,{})]},u.id))}),f.jsx(re,{variant:"secondary",asChild:!0,children:f.jsxs(fe,{href:`${window.routePrefix}/notifications`,className:`w-full ${s?"opacity-50 pointer-events-none":""}`,children:[i["View All"],s&&f.jsx(Ge,{className:"h-4 w-4 animate-spin"})]})})]})]})}function ha(){const{isEnabled:e,isOpen:n,toggleChat:t,models:r,loading:i}=Ot();if(!e)return null;const s=r.length>0;return f.jsx(f.Fragment,{children:f.jsxs(Dt,{children:[f.jsx(Ft,{asChild:!0,children:f.jsx(re,{variant:"ghost",className:mi("relative",{"text-primary":n}),onClick:t,"aria-expanded":n,"aria-haspopup":"true","aria-controls":"ai-assistant-panel",disabled:!s&&i,children:i&&!s?f.jsx(Ge,{className:"size-4 animate-spin"}):f.jsx(wi,{className:"size-4"})})}),f.jsx(_t,{side:"bottom",className:"z-[1002]",children:f.jsx("span",{children:"AI assistant"})})]})})}const pa=200,wr="adminizer:ai-search-admin-links";function Hi(){const e=ie(),{t:n}=Ke(),[t,r]=A.useState(!1),[i,s]=A.useState(""),[l,o]=A.useState([]),[a,u]=A.useState(!1);A.useEffect(()=>{const d=m=>{m.defaultPrevented||!(m.metaKey||m.ctrlKey)||m.key.toLowerCase()!=="k"||(m.preventDefault(),r(y=>!y))},p=m=>{const y=m.detail;s(typeof y?.query=="string"?y.query:""),r(!0)};return window.addEventListener("keydown",d),window.addEventListener(wr,p),()=>{window.removeEventListener("keydown",d),window.removeEventListener(wr,p)}},[]),A.useEffect(()=>{if(!t)return;let d=!1;u(!0);const p=window.setTimeout(async()=>{try{const{data:m}=await Z.getJson(`${window.routePrefix}/api/links/search?q=${encodeURIComponent(i)}`);d||o(m.results.filter(y=>y.link))}catch{d||o([])}finally{d||u(!1)}},pa);return()=>{d=!0,window.clearTimeout(p)}},[t,i]);const c=A.useMemo(()=>{const d=new Map;for(const p of l){const m=p.section||"Platform";d.has(m)||d.set(m,[]),d.get(m).push(p)}return[...d]},[l]),h=A.useCallback(d=>{r(!1),ht.visit(d)},[]);return e.props.auth?.user?f.jsxs(f.Fragment,{children:[f.jsxs(Dt,{children:[f.jsx(Ft,{asChild:!0,children:f.jsx(re,{variant:"ghost",size:"icon",className:"shrink-0",onClick:()=>r(!0),"aria-label":n("Search"),children:f.jsx(mo,{className:"size-4"})})}),f.jsx(_t,{side:"bottom",className:"z-[1002]",children:f.jsxs("span",{children:[n("Search")," · Ctrl K"]})})]}),f.jsxs(go,{open:t,onOpenChange:r,shouldFilter:!1,title:n("Search"),description:n("Search"),children:[f.jsx(xo,{value:i,onValueChange:s,placeholder:`${n("Search")}…`}),f.jsxs(yo,{children:[f.jsx(bo,{children:a?"…":n("Nothing found","Nothing found")}),c.map(([d,p])=>f.jsx(ko,{heading:d,children:p.map(m=>f.jsxs(wo,{value:m.id,onSelect:()=>h(m.link),children:[f.jsx("span",{className:"truncate",children:m.title}),m.description&&f.jsx("span",{className:"text-muted-foreground ml-2 truncate text-xs",children:m.description})]},m.id))},d))]})]})]}):null}function Ui({fields:e,title:n,loading:t=!1,className:r}){const{t:i}=Ke();return f.jsxs("div",{className:G("overflow-hidden rounded-xl border",r),children:[n&&f.jsx("div",{className:"bg-muted/50 border-b px-3 py-1.5 text-sm font-medium",children:n}),t||!e?f.jsx("div",{className:"text-muted-foreground p-3 text-sm",children:i("Loading...")}):e.length===0?f.jsx("div",{className:"text-muted-foreground p-3 text-sm",children:i("No fields to display")}):f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{children:f.jsxs("tr",{className:"bg-muted/30 text-muted-foreground",children:[f.jsx("th",{className:"px-3 py-1.5 text-start font-medium",children:i("Field")}),f.jsx("th",{className:"px-3 py-1.5 text-start font-medium",children:i("Type")}),f.jsx("th",{className:"px-3 py-1.5 text-start font-medium",children:i("Required")})]})}),f.jsx("tbody",{children:e.map(s=>f.jsxs("tr",{className:"border-t",children:[f.jsxs("td",{className:"px-3 py-1.5",children:[f.jsx("span",{className:"font-medium",children:s.title||s.name}),s.title&&s.title!==s.name&&f.jsx("span",{className:"text-muted-foreground ms-2 font-mono text-xs",children:s.name})]}),f.jsx("td",{className:"px-3 py-1.5 font-mono text-xs",children:s.type}),f.jsx("td",{className:"px-3 py-1.5",children:s.required?i("Yes"):i("No")})]},s.name))})]})]})}function da(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const ma=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ga=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xa={};function Sr(e,n){return(xa.jsx?ga:ma).test(e)}const ya=/[ \t\n\f\r]/g;function ba(e){return typeof e=="object"?e.type==="text"?Cr(e.value):!1:Cr(e)}function Cr(e){return e.replace(ya,"")===""}class pt{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}pt.prototype.normal={};pt.prototype.property={};pt.prototype.space=void 0;function qi(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new pt(t,r,n)}function wn(e){return e.toLowerCase()}class ae{constructor(n,t){this.attribute=t,this.property=n}}ae.prototype.attribute="";ae.prototype.booleanish=!1;ae.prototype.boolean=!1;ae.prototype.commaOrSpaceSeparated=!1;ae.prototype.commaSeparated=!1;ae.prototype.defined=!1;ae.prototype.mustUseProperty=!1;ae.prototype.number=!1;ae.prototype.overloadedBoolean=!1;ae.prototype.property="";ae.prototype.spaceSeparated=!1;ae.prototype.space=void 0;let ka=0;const _=Oe(),X=Oe(),Sn=Oe(),T=Oe(),q=Oe(),De=Oe(),ce=Oe();function Oe(){return 2**++ka}const Cn=Object.freeze(Object.defineProperty({__proto__:null,boolean:_,booleanish:X,commaOrSpaceSeparated:ce,commaSeparated:De,number:T,overloadedBoolean:Sn,spaceSeparated:q},Symbol.toStringTag,{value:"Module"})),Yt=Object.keys(Cn);class $n extends ae{constructor(n,t,r,i){let s=-1;if(super(n,t),jr(this,"space",i),typeof r=="number")for(;++s<Yt.length;){const l=Yt[s];jr(this,Yt[s],(r&Cn[l])===Cn[l])}}}$n.prototype.defined=!0;function jr(e,n,t){t&&(e[n]=t)}function Xe(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const s=new $n(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),n[r]=s,t[wn(r)]=r,t[wn(s.attribute)]=r}return new pt(n,t,e.space)}const Vi=Xe({properties:{ariaActiveDescendant:null,ariaAtomic:X,ariaAutoComplete:null,ariaBusy:X,ariaChecked:X,ariaColCount:T,ariaColIndex:T,ariaColSpan:T,ariaControls:q,ariaCurrent:null,ariaDescribedBy:q,ariaDetails:null,ariaDisabled:X,ariaDropEffect:q,ariaErrorMessage:null,ariaExpanded:X,ariaFlowTo:q,ariaGrabbed:X,ariaHasPopup:null,ariaHidden:X,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:q,ariaLevel:T,ariaLive:null,ariaModal:X,ariaMultiLine:X,ariaMultiSelectable:X,ariaOrientation:null,ariaOwns:q,ariaPlaceholder:null,ariaPosInSet:T,ariaPressed:X,ariaReadOnly:X,ariaRelevant:null,ariaRequired:X,ariaRoleDescription:q,ariaRowCount:T,ariaRowIndex:T,ariaRowSpan:T,ariaSelected:X,ariaSetSize:T,ariaSort:null,ariaValueMax:T,ariaValueMin:T,ariaValueNow:T,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Wi(e,n){return n in e?e[n]:n}function Ji(e,n){return Wi(e,n.toLowerCase())}const wa=Xe({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:De,acceptCharset:q,accessKey:q,action:null,allow:null,allowFullScreen:_,allowPaymentRequest:_,allowUserMedia:_,alpha:_,alt:null,as:null,async:_,autoCapitalize:null,autoComplete:q,autoFocus:_,autoPlay:_,blocking:q,capture:null,charSet:null,checked:_,cite:null,className:q,closedBy:null,colorSpace:null,cols:T,colSpan:T,command:null,commandFor:null,content:null,contentEditable:X,controls:_,controlsList:q,coords:T|De,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_,defer:_,dir:null,dirName:null,disabled:_,download:Sn,draggable:X,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_,formTarget:null,headers:q,height:T,hidden:Sn,high:T,href:null,hrefLang:null,htmlFor:q,httpEquiv:q,id:null,imageSizes:null,imageSrcSet:null,inert:_,inputMode:null,integrity:null,is:null,isMap:_,itemId:null,itemProp:q,itemRef:q,itemScope:_,itemType:q,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_,low:T,manifest:null,max:null,maxLength:T,media:null,method:null,min:null,minLength:T,multiple:_,muted:_,name:null,nonce:null,noModule:_,noValidate:_,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:_,optimum:T,pattern:null,ping:q,placeholder:null,playsInline:_,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_,referrerPolicy:null,rel:q,required:_,reversed:_,rows:T,rowSpan:T,sandbox:q,scope:null,scoped:_,seamless:_,selected:_,shadowRootClonable:_,shadowRootCustomElementRegistry:_,shadowRootDelegatesFocus:_,shadowRootMode:null,shadowRootSerializable:_,shape:null,size:T,sizes:null,slot:null,span:T,spellCheck:X,src:null,srcDoc:null,srcLang:null,srcSet:null,start:T,step:null,style:null,tabIndex:T,target:null,title:null,translate:null,type:null,typeMustMatch:_,useMap:null,value:X,width:T,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:q,axis:null,background:null,bgColor:null,border:T,borderColor:null,bottomMargin:T,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_,declare:_,event:null,face:null,frame:null,frameBorder:null,hSpace:T,leftMargin:T,link:null,longDesc:null,lowSrc:null,marginHeight:T,marginWidth:T,noResize:_,noHref:_,noShade:_,noWrap:_,object:null,profile:null,prompt:null,rev:null,rightMargin:T,rules:null,scheme:null,scrolling:X,standby:null,summary:null,text:null,topMargin:T,valueType:null,version:null,vAlign:null,vLink:null,vSpace:T,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:_,disablePictureInPicture:_,disableRemotePlayback:_,exportParts:De,part:q,prefix:null,property:null,results:T,security:null,unselectable:null},space:"html",transform:Ji}),Sa=Xe({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ce,accentHeight:T,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:T,amplitude:T,arabicForm:null,ascent:T,attributeName:null,attributeType:null,azimuth:T,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:T,by:null,calcMode:null,capHeight:T,className:q,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:T,diffuseConstant:T,direction:null,display:null,dur:null,divisor:T,dominantBaseline:null,download:_,dx:null,dy:null,edgeMode:null,editable:null,elevation:T,enableBackground:null,end:null,event:null,exponent:T,externalResourcesRequired:null,fill:null,fillOpacity:T,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:De,g2:De,glyphName:De,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:T,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:T,horizOriginX:T,horizOriginY:T,id:null,ideographic:T,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:T,k:T,k1:T,k2:T,k3:T,k4:T,kernelMatrix:ce,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:T,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:T,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:T,overlineThickness:T,paintOrder:null,panose1:null,path:null,pathLength:T,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:q,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:T,pointsAtY:T,pointsAtZ:T,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ce,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ce,rev:ce,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ce,requiredFeatures:ce,requiredFonts:ce,requiredFormats:ce,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:T,specularExponent:T,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:T,strikethroughThickness:T,string:null,stroke:null,strokeDashArray:ce,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:T,strokeOpacity:T,strokeWidth:null,style:null,surfaceScale:T,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ce,tabIndex:T,tableValues:null,target:null,targetX:T,targetY:T,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ce,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:T,underlineThickness:T,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:T,values:null,vAlphabetic:T,vMathematical:T,vectorEffect:null,vHanging:T,vIdeographic:T,version:null,vertAdvY:T,vertOriginX:T,vertOriginY:T,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:T,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Wi}),Ki=Xe({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),Gi=Xe({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ji}),Xi=Xe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),Ca={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ja=/[A-Z]/g,vr=/-[a-z]/g,va=/^data[-\w.:]+$/i;function Ea(e,n){const t=wn(n);let r=n,i=ae;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&va.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(vr,Aa);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!vr.test(s)){let l=s.replace(ja,Na);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=$n}return new i(r,n)}function Na(e){return"-"+e.toLowerCase()}function Aa(e){return e.charAt(1).toUpperCase()}const Ia=qi([Vi,wa,Ki,Gi,Xi],"html"),Hn=qi([Vi,Sa,Ki,Gi,Xi],"svg");function Ta(e){return e.join(" ").trim()}var Er=/\/\*(?:[^*]|\*(?!\/))*\*\//g,za=/\n/g,Pa=/^\s*/,La=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ma=/^:\s*/,Da=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,Fa=/^[;\s]*/,_a=`
|
|
3
|
+
`,Nr="/",Ar="*",nt="",Oa="comment",Ra="declaration";function Ba(e,n){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];n=n||{};var t=1,r=1;function i(m){var y=m.match(za);y&&(t+=y.length);var j=m.lastIndexOf(_a);r=~j?m.length-j:r+m.length}function s(){var m={line:t,column:r};return function(y){return y.position=new l(m),u(),y}}function l(m){this.start=m,this.end={line:t,column:r},this.source=n.source}l.prototype.content=e;function o(m){var y=new Error(n.source+":"+t+":"+r+": "+m);if(y.reason=m,y.filename=n.source,y.line=t,y.column=r,y.source=e,!n.silent)throw y}function a(m){var y=m.exec(e);if(y){var j=y[0];return i(j),e=e.slice(j.length),y}}function u(){a(Pa)}function c(m){for(var y;y=h();)m.push(y);return m}function h(){var m=s();if(!(Nr!=e.charAt(0)||Ar!=e.charAt(1))){for(var y=2;nt!=e.charAt(y)&&(Ar!=e.charAt(y)||Nr!=e.charAt(y+1));)++y;if(y+=2,nt===e.charAt(y-1))return o("End of comment missing");var j=e.slice(2,y-2);return r+=2,i(j),e=e.slice(y),r+=2,m({type:Oa,comment:j})}}function d(){var m=s(),y=a(La);if(y){if(h(),!a(Ma))return o("property missing ':'");var j=a(Da),b=m({type:Ra,property:y[0].replace(Er,nt).trim(),value:j?j[0].replace(Er,nt).trim():nt});return a(Fa),b}}function p(){var m=[];c(m);for(var y;y=d();)m.push(y),c(m);return m}return u(),p()}function $a(e,n){let t=null;if(!e||typeof e!="string")return t;const r=Ba(e),i=typeof n=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:l,value:o}=s;i?n(l,o,s):o&&(t=t??{},t[l]=o)}),t}const Yi=Qi("end"),Un=Qi("start");function Qi(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Ha(e){const n=Un(e),t=Yi(e);if(n&&t)return{start:n,end:t}}function lt(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ir(e.position):"start"in e||"end"in e?Ir(e):"line"in e||"column"in e?jn(e):""}function jn(e){return Tr(e&&e.line)+":"+Tr(e&&e.column)}function Ir(e){return jn(e&&e.start)+"-"+jn(e&&e.end)}function Tr(e){return e&&typeof e=="number"?e:1}class Rt extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",s={},l=!1;if(t&&("line"in t&&"column"in t?s={place:t}:"start"in t&&"end"in t?s={place:t}:"type"in t?s={ancestors:[t],place:t.position}:s={...t}),typeof n=="string"?i=n:!s.cause&&n&&(l=!0,i=n.message,s.cause=n),!s.ruleId&&!s.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?s.ruleId=r:(s.source=r.slice(0,a),s.ruleId=r.slice(a+1))}if(!s.place&&s.ancestors){const a=s.ancestors[s.ancestors.length-1];a&&(s.place=a.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=lt(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Object.defineProperties(Rt.prototype,{file:{configurable:!0,enumerable:!0,value:"",writable:!0},name:{configurable:!0,enumerable:!0,value:"",writable:!0},reason:{configurable:!0,enumerable:!0,value:"",writable:!0},message:{configurable:!0,enumerable:!0,value:"",writable:!0},stack:{configurable:!0,enumerable:!0,value:"",writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});const qn={}.hasOwnProperty,Ua=new Map,qa=/[A-Z]/g,Va=/-([a-z])/g,Wa=new Set(["table","tbody","thead","tfoot","tr"]),Ja=new Set(["td","th"]),Zi="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ka(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=nu(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=tu(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Hn:Ia,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},s=el(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function el(e,n,t){if(n.type==="element")return Ga(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Xa(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Qa(e,n,t);if(n.type==="mdxjsEsm")return Ya(e,n);if(n.type==="root")return Za(e,n,t);if(n.type==="text")return eu(e,n)}function Ga(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Hn,e.schema=i),e.ancestors.push(n);const s=nl(e,n.tagName,!1),l=ru(e,n);let o=Wn(e,n);return Wa.has(n.tagName)&&(o=o.filter(function(a){return typeof a=="string"?!ba(a):!0})),tl(e,l,s,n),Vn(l,o),e.ancestors.pop(),e.schema=r,e.create(n,s,l,t)}function Xa(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ft(e,n.position)}function Ya(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);ft(e,n.position)}function Qa(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Hn,e.schema=i),e.ancestors.push(n);const s=n.name===null?e.Fragment:nl(e,n.name,!0),l=iu(e,n),o=Wn(e,n);return tl(e,l,s,n),Vn(l,o),e.ancestors.pop(),e.schema=r,e.create(n,s,l,t)}function Za(e,n,t){const r={};return Vn(r,Wn(e,n)),e.create(n,e.Fragment,r,t)}function eu(e,n){return n.value}function tl(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function Vn(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function tu(e,n,t){return r;function r(i,s,l,o){const u=Array.isArray(l.children)?t:n;return o?u(s,l,o):u(s,l)}}function nu(e,n){return t;function t(r,i,s,l){const o=Array.isArray(s.children),a=Un(r);return n(i,s,l,o,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function ru(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&qn.call(n.properties,i)){const s=lu(e,i,n.properties[i]);if(s){const[l,o]=s;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&Ja.has(n.tagName)?r=o:t[l]=o}}if(r){const s=t.style||(t.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function iu(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const l=s.expression;l.type;const o=l.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else ft(e,n.position);else{const{name:i}=r;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else ft(e,n.position);else s=r.value===null?!0:r.value;t[i]=s}return t}function Wn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Ua;for(;++r<n.children.length;){const s=n.children[r];let l;if(e.passKeys){const a=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(a){const u=i.get(a)||0;l=a+"-"+u,i.set(a,u+1)}}const o=el(e,s,l);o!==void 0&&t.push(o)}return t}function lu(e,n,t){if(t==null||typeof t=="number"&&Number.isNaN(t))return;const r=Ea(e.schema,n);return Array.isArray(t)&&(t=r.commaSeparated?da(t):Ta(t)),r.property==="style"?["style",typeof t=="object"?e.stylePropertyNameCase==="dom"?t:ou(t):su(e,String(t))]:[e.elementAttributeNameCase==="react"&&r.space?Ca[r.property]||r.property:r.attribute,t]}function su(e,n){const t={};try{$a(n,function(r,i){if(r&&i){let s=r;s.slice(0,2)!=="--"&&(s=s.toLowerCase(),e.stylePropertyNameCase==="dom"&&(s.slice(0,4)==="-ms-"&&(s=s.slice(1)),s=s.replace(Va,cu))),t[s]=i}})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,s=new Rt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Zi+"#cannot-parse-style-attribute",s}return t}function nl(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let s=-1,l;for(;++s<i.length;){const o=Sr(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=l}else r=Sr(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return qn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ft(e)}function ft(e,n){const t=new Rt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=Zi+"#cannot-handle-mdx-estrees-without-createevaluater",t}function ou(e){const n={};let t;for(t in e)qn.call(e,t)&&(n[au(t)]=e[t]);return n}function au(e){if(e.slice(0,2)==="--")return e;let n=e.replace(qa,uu);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function uu(e){return"-"+e.toLowerCase()}function cu(e,n){return n.toUpperCase()}const Qt={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},fu={};function Bt(e,n){const t=fu,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return rl(e,r,i)}function rl(e,n,t){if(hu(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return zr(e.children,n,t)}return Array.isArray(e)?zr(e,n,t):""}function zr(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=rl(e[i],n,t);return r.join("")}function hu(e){return!!(e&&typeof e=="object")}const Pr=document.createElement("i");function Jn(e){const n="&"+e+";";Pr.innerHTML=n;const t=Pr.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function ge(e,n,t,r){const i=e.length;let s=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);s<r.length;)l=r.slice(s,s+1e4),l.unshift(n,0),e.splice(...l),s+=1e4,n+=1e4}function he(e,n){return e.length>0?(ge(e,e.length,0,n),e):n}const Lr={}.hasOwnProperty;function il(e){const n={};let t=-1;for(;++t<e.length;)pu(n,e[t]);return n}function pu(e,n){let t;for(t in n){const i=(Lr.call(e,t)?e[t]:void 0)||(e[t]={}),s=n[t];let l;if(s)for(l in s){Lr.call(i,l)||(i[l]=[]);const o=s[l];du(i[l],Array.isArray(o)?o:o?[o]:[])}}}function du(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);ge(e,0,0,r)}function ll(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function xe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ee=ze(/[A-Za-z]/),te=ze(/[\dA-Za-z]/),mu=ze(/[#-'*+\--9=?A-Z^-~]/);function Et(e){return e!==null&&(e<32||e===127)}const vn=ze(/\d/),gu=ze(/[\dA-Fa-f]/),sl=ze(/[!-/:-@[-`{-~]/);function D(e){return e!==null&&e<-2}function V(e){return e!==null&&(e<0||e===32)}function $(e){return e===-2||e===-1||e===32}const dt=ze(new RegExp("\\p{P}|\\p{S}","u")),_e=ze(/\s/);function ze(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ye(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const s=e.charCodeAt(t);let l="";if(s===37&&te(e.charCodeAt(t+1))&&te(e.charCodeAt(t+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(t+1);s<56320&&o>56319&&o<57344?(l=String.fromCharCode(s,o),i=1):l="�"}else l=String.fromCharCode(s);l&&(n.push(e.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function U(e,n,t,r){const i=r?r-1:1/0;let s=0;return l;function l(a){return $(a)?(e.enter(t),o(a)):n(a)}function o(a){return $(a)&&s++<i?(e.consume(a),o):(e.exit(t),n(a))}}function ol(e,n,t,r,i,s){let l=0;return o;function o(c){return $(c)?(e.enter(r),a(c)):u(c)}function a(c){return $(c)&&l<s?(e.consume(c),l++,a):(e.exit(r),u(c))}function u(c){return l>=i?n(c):t(c)}}const xu={tokenize:yu};function yu(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),U(e,n,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const a=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=a),t=a,l(o)}function l(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return D(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),l)}}let Nt=class{constructor(){this.index=new Map,this.map=[]}add(n,t,r){Mr(this,n,t,r,!1)}addBefore(n,t,r){Mr(this,n,t,r,!0)}consume(n){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let i=r.pop();for(;i;){for(const s of i)n.push(s);i=r.pop()}this.map.length=0,this.index.clear()}};function Mr(e,n,t,r,i){if(t===0&&r.length===0)return;const s=e.index.get(n);if(s){s[1]+=t,i?(r.push(...s[2]),s[2]=r):s[2].push(...r);return}const l=[n,t,r];e.map.push(l),e.index.set(n,l)}const bu={tokenize:ku},Dr={tokenize:wu};function ku(e){const n=this,t=[];let r=0,i,s,l;return o;function o(S){if(r<t.length){const v=t[r];return n.containerState=v[1],e.attempt(v[0].continuation,a,u)(S)}return u(S)}function a(S){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&E();const v=n.events.length;let N=v,w;for(;N--;)if(n.events[N][0]==="exit"&&n.events[N][1].type==="chunkFlow"){w=n.events[N][1].end;break}b(r);let P=v;for(;P<n.events.length;)n.events[P][1].end={...w},P++;const M=new Nt;return M.add(N+1,0,n.events.slice(v)),M.add(v,P-v,[]),M.consume(n.events),u(S)}return o(S)}function u(S){if(r===t.length){if(!i)return d(S);if(i.currentConstruct&&i.currentConstruct.concrete)return m(S);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Dr,c,h)(S)}function c(S){return i&&E(),b(r),d(S)}function h(S){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,m(S)}function d(S){return n.containerState={},e.attempt(Dr,p,m)(S)}function p(S){return r++,t.push([n.currentConstruct,n.containerState]),d(S)}function m(S){if(S===null){i&&E(),b(0),e.consume(S);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),y(S)}function y(S){if(S===null){j(e.exit("chunkFlow"),!0),b(0),e.consume(S);return}return D(S)?(e.consume(S),j(e.exit("chunkFlow")),r=0,n.interrupt=void 0,o):(e.consume(S),y)}function j(S,v){const N=n.sliceStream(S);if(v&&N.push(null),S.previous=s,s&&(s.next=S),s=S,i.defineSkip(S.start),i.write(N),n.parser.lazy[S.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<l&&(!i.events[w][1].end||i.events[w][1].end.offset>l))return;const P=n.events.length;let M=P,F,k;for(;M--;)if(n.events[M][0]==="exit"&&n.events[M][1].type==="chunkFlow"){if(F){k=n.events[M][1].end;break}F=!0}for(b(r),w=P;w<n.events.length;)n.events[w][1].end={...k},w++;const I=new Nt;I.add(M+1,0,n.events.slice(P)),I.add(P,w-P,[]),I.consume(n.events)}}function b(S){let v=t.length;for(;v-- >S;){const N=t[v];n.containerState=N[1],N[0].exit.call(n,e)}t.length=S}function E(){i.write([null]),s=void 0,i=void 0,n.containerState._closeFlow=void 0}}function wu(e,n,t){return U(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Te(e){if(e===null||V(e)||_e(e))return 1;if(dt(e))return 2}function $t(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(n=s(n,t),r.push(s))}return n}const En={name:"attention",resolveAll:Su,tokenize:Cu};function Su(e,n){let t=-1,r;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){let i=t;for(;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&n.sliceSerialize(e[i][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[i][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;const s=e[i][1].end.offset-e[i][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1,l={...e[i][1].end},o={...e[t][1].start};Fr(l,-s),Fr(o,s);const a={type:s>1?"strongSequence":"emphasisSequence",start:l,end:{...e[i][1].end}},u={type:s>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:o},c={type:s>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[t][1].start}},h={type:s>1?"strong":"emphasis",start:{...a.start},end:{...u.end}};e[i][1].end={...a.start},e[t][1].start={...u.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=he(r,[["enter",e[i][1],n],["exit",e[i][1],n]])),r=he(r,[["enter",h,n],["enter",a,n],["exit",a,n],["enter",c,n]]),r=he(r,$t(n.parser.constructs.insideSpan.null,e.slice(i+1,t),n)),r=he(r,[["exit",c,n],["enter",u,n],["exit",u,n],["exit",h,n]]);let d=0;e[t][1].end.offset-e[t][1].start.offset&&(d=2,r=he(r,[["enter",e[t][1],n],["exit",e[t][1],n]])),ge(e,i-1,t-i+3,r),t=i+r.length-d-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function Cu(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Te(r);let s;return l;function l(a){return s=a,e.enter("attentionSequence"),o(a)}function o(a){if(a===s)return e.consume(a),o;const u=e.exit("attentionSequence"),c=Te(a),h=!c||c===2&&i||t.includes(a)&&a!==42&&a!==95,d=!i||i===2&&c||t.includes(r)&&r!==42&&r!==95;return u._open=!!(s===42?h:h&&(i||!d)),u._close=!!(s===42?d:d&&(c||!h)),n(a)}}function Fr(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const ju={name:"autolink",tokenize:vu};function vu(e,n,t){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return ee(p)?(e.consume(p),l):p===64?t(p):u(p)}function l(p){return p===43||p===45||p===46||te(p)?(r=1,o(p)):u(p)}function o(p){return p===58?(e.consume(p),r=0,a):(p===43||p===45||p===46||te(p))&&r++<32?(e.consume(p),o):(r=0,u(p))}function a(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):p===null||p===32||p===60||Et(p)?t(p):(e.consume(p),a)}function u(p){return p===64?(e.consume(p),c):mu(p)?(e.consume(p),u):t(p)}function c(p){return te(p)?h(p):t(p)}function h(p){return p===46?(e.consume(p),r=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):d(p)}function d(p){if((p===45||te(p))&&r++<63){const m=p===45?d:h;return e.consume(p),m}return t(p)}}const mt={partial:!0,tokenize:Eu};function Eu(e,n,t){return r;function r(s){return $(s)?U(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||D(s)?n(s):t(s)}}const al={continuation:{tokenize:Au},exit:Iu,name:"blockQuote",tokenize:Nu};function Nu(e,n,t){const r=this;return i;function i(l){if(l===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),s}return t(l)}function s(l){return $(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function Au(e,n,t){const r=this;return i;function i(l){return $(l)?U(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return e.attempt(al,n,t)(l)}}function Iu(e){e.exit("blockQuote")}const ul={name:"characterEscape",tokenize:Tu};function Tu(e,n,t){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return sl(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(s)}}const cl={name:"characterReference",tokenize:zu};function zu(e,n,t){const r=this;let i=0,s,l;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),a}function a(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,l=te,c(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,l=gu,c):(e.enter("characterReferenceValue"),s=7,l=vn,c(h))}function c(h){if(h===59&&i){const d=e.exit("characterReferenceValue");return l===te&&!Jn(r.sliceSerialize(d))?t(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(h)&&i++<s?(e.consume(h),c):t(h)}}const Nn={partial:!0,tokenize:Pu};function Pu(e,n,t){const r=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s)}function s(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const _r={concrete:!0,name:"codeFenced",tokenize:Lu};function Lu(e,n,t){const r=this,i={partial:!0,tokenize:N};let s=0,l=0,o;return a;function a(w){return u(w)}function u(w){const P=r.events[r.events.length-1];return s=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,o=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(w)}function c(w){return w===o?(l++,e.consume(w),c):l<3?t(w):(e.exit("codeFencedFenceSequence"),$(w)?U(e,h,"whitespace")(w):h(w))}function h(w){return w===null||D(w)?(e.exit("codeFencedFence"),r.interrupt?n(w):e.check(Nn,y,v)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(w))}function d(w){return w===null||D(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(w)):$(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),U(e,p,"whitespace")(w)):w===96&&w===o?t(w):(e.consume(w),d)}function p(w){return w===null||D(w)?h(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(w))}function m(w){return w===null||D(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(w)):w===96&&w===o?t(w):(e.consume(w),m)}function y(w){return e.attempt(i,v,j)(w)}function j(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),b}function b(w){return s>0&&$(w)?U(e,E,"linePrefix",s+1)(w):E(w)}function E(w){return w===null||D(w)?e.check(Nn,y,v)(w):(e.enter("codeFlowValue"),S(w))}function S(w){return w===null||D(w)?(e.exit("codeFlowValue"),E(w)):(e.consume(w),S)}function v(w){return e.exit("codeFenced"),n(w)}function N(w,P,M){let F=0;return k;function k(H){return w.enter("lineEnding"),w.consume(H),w.exit("lineEnding"),I}function I(H){return w.enter("codeFencedFence"),$(H)?U(w,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):L(H)}function L(H){return H===o?(w.enter("codeFencedFenceSequence"),R(H)):M(H)}function R(H){return H===o?(F++,w.consume(H),R):F>=l?(w.exit("codeFencedFenceSequence"),$(H)?U(w,J,"whitespace")(H):J(H)):M(H)}function J(H){return H===null||D(H)?(w.exit("codeFencedFence"),P(H)):M(H)}}}const Zt={name:"codeIndented",tokenize:Du},Mu={partial:!0,tokenize:Fu};function Du(e,n,t){return r;function r(o){return e.enter("codeIndented"),ol(e,i,t,"linePrefix",4,4)(o)}function i(o){return o===null?l(o):D(o)?e.attempt(Mu,i,l)(o):(e.enter("codeFlowValue"),s(o))}function s(o){return o===null||D(o)?(e.exit("codeFlowValue"),i(o)):(e.consume(o),s)}function l(o){return e.exit("codeIndented"),n(o)}}function Fu(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):D(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):ol(e,n,s,"linePrefix",4,4)(l)}function s(l){return D(l)?i(l):t(l)}}const _u={name:"codeText",previous:Ru,resolve:Ou,tokenize:Bu};function Ou(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function Ru(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Bu(e,n,t){let r=0,i,s;return l;function l(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),a(h))}function a(h){return h===null?t(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),a):h===96?(s=e.enter("codeTextSequence"),i=0,c(h)):D(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),a):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||D(h)?(e.exit("codeTextData"),a(h)):(e.consume(h),u)}function c(h){return h===96?(e.consume(h),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(h)):(s.type="codeTextData",u(h))}}class $u{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&rt(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),rt(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),rt(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);rt(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);rt(this.left,t.reverse())}}}function rt(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function fl(e){const n={};let t=-1,r,i,s,l,o,a,u;const c=new $u(e);for(;++t<c.length;){for(;t in n;)t=n[t];if(r=c.get(t),t&&r[1].type==="chunkFlow"&&c.get(t-1)[1].type==="listItemPrefix"&&(a=r[1]._tokenizer.events,s=0,s<a.length&&a[s][1].type==="lineEndingBlank"&&(s+=2),s<a.length&&a[s][1].type==="content"))for(;++s<a.length&&a[s][1].type!=="content";)a[s][1].type==="chunkText"&&(a[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Hu(c,t)),t=n[t],u=!0);else if(r[1]._container){for(s=t,i=void 0;s--;)if(l=c.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},o=c.slice(i,t),o.unshift(r),c.splice(i,t-i+1,o))}}return ge(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function Hu(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const s=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,a=[],u={};let c,h,d=-1,p=t,m=0,y=0;const j=[y];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),h&&l.defineSkip(p.start),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(c),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=t;++d<o.length;)o[d][0]==="exit"&&o[d-1][0]==="enter"&&o[d][1].type===o[d-1][1].type&&o[d][1].start.line!==o[d][1].end.line&&(y=d+1,j.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(l.events=[],p?(p._tokenizer=void 0,p.previous=void 0):j.pop(),d=j.length;d--;){const b=o.slice(j[d],j[d+1]),E=s.pop();a.push([E,E+b.length-1]),e.splice(E,2,b)}for(a.reverse(),d=-1;++d<a.length;)u[m+a[d][0]]=m+a[d][1],m+=a[d][1]-a[d][0]-1;return u}const Uu={resolve:Vu,tokenize:Wu},qu={partial:!0,tokenize:Ju};function Vu(e){return fl(e),e}function Wu(e,n){let t;return r;function r(o){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):D(o)?e.check(qu,l,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),n(o)}function l(o){return e.consume(o),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Ju(e,n,t){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),U(e,s,"linePrefix")}function s(l){if(l===null||D(l))return t(l);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function hl(e,n,t,r,i,s,l,o,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return h;function h(b){return b===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(b),e.exit(s),d):b===null||b===32||b===41||Et(b)?t(b):(e.enter(r),e.enter(l),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(b))}function d(b){return b===62?(e.enter(s),e.consume(b),e.exit(s),e.exit(i),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===62?(e.exit("chunkString"),e.exit(o),d(b)):b===null||b===60||D(b)?t(b):(e.consume(b),b===92?m:p)}function m(b){return b===60||b===62||b===92?(e.consume(b),p):p(b)}function y(b){return!c&&(b===null||b===41||V(b))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),n(b)):c<u&&b===40?(e.consume(b),c++,y):b===41?(e.consume(b),c--,y):b===null||b===32||b===40||Et(b)?t(b):(e.consume(b),b===92?j:y)}function j(b){return b===40||b===41||b===92?(e.consume(b),y):y(b)}}function pl(e,n,t,r,i,s){const l=this;let o=0,a;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),c}function c(p){return o>999||p===null||p===91||p===93&&!a||p===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?t(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):D(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||D(p)||o++>999?(e.exit("chunkString"),c(p)):(e.consume(p),a||(a=!$(p)),p===92?d:h)}function d(p){return p===91||p===92||p===93?(e.consume(p),o++,h):h(p)}}function dl(e,n,t,r,i,s){let l;return o;function o(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),l=d===40?41:d,a):t(d)}function a(d){return d===l?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),n):(e.enter(s),u(d))}function u(d){return d===l?(e.exit(s),a(l)):d===null?t(d):D(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),U(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===l||d===null||D(d)?(e.exit("chunkString"),u(d)):(e.consume(d),d===92?h:c)}function h(d){return d===l||d===92?(e.consume(d),c):c(d)}}function st(e,n){let t;return r;function r(i){return D(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):$(i)?U(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Ku={name:"definition",tokenize:Xu},Gu={partial:!0,tokenize:Yu};function Xu(e,n,t){const r=this;let i;return s;function s(p){return e.enter("definition"),l(p)}function l(p){return pl.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return i=xe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),a):t(p)}function a(p){return V(p)?st(e,u)(p):u(p)}function u(p){return hl(e,c,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(Gu,h,h)(p)}function h(p){return $(p)?U(e,d,"whitespace")(p):d(p)}function d(p){return p===null||D(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function Yu(e,n,t){return r;function r(o){return V(o)?st(e,i)(o):t(o)}function i(o){return dl(e,s,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return $(o)?U(e,l,"whitespace")(o):l(o)}function l(o){return o===null||D(o)?n(o):t(o)}}const Qu={name:"hardBreakEscape",tokenize:Zu};function Zu(e,n,t){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return D(s)?(e.exit("hardBreakEscape"),n(s)):t(s)}}const ec={name:"headingAtx",resolve:tc,tokenize:nc};function tc(e,n){let t=e.length-2,r=3;if(e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r){const i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},s={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"};ge(e,r,t-r+1,[["enter",i,n],["enter",s,n],["exit",s,n],["exit",i,n]])}return e}function nc(e,n,t){let r=0;return i;function i(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),l(c)}function l(c){return c===35&&r++<6?(e.consume(c),l):c===null||V(c)?(e.exit("atxHeadingSequence"),o(c)):t(c)}function o(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||D(c)?(e.exit("atxHeading"),n(c)):$(c)?U(e,o,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),o(c))}function u(c){return c===null||c===35||V(c)?(e.exit("atxHeadingText"),o(c)):(e.consume(c),u)}}const ml=["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"],An=["pre","script","style","textarea"],rc={concrete:!0,name:"htmlFlow",resolveTo:lc,tokenize:sc},ic={partial:!0,tokenize:oc};function lc(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function sc(e,n,t){const r=this;let i,s,l,o,a;return u;function u(x){return c(x)}function c(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),h}function h(x){return x===33?(e.consume(x),d):x===47?(e.consume(x),s=!0,y):x===63?(e.consume(x),i=3,r.interrupt?n:g):ee(x)?(e.consume(x),l=String.fromCharCode(x),j):t(x)}function d(x){return x===45?(e.consume(x),i=2,p):x===91?(e.consume(x),i=5,o=0,m):ee(x)?(e.consume(x),i=4,r.interrupt?n:g):t(x)}function p(x){return x===45?(e.consume(x),r.interrupt?n:g):t(x)}function m(x){const me="CDATA[";return x===me.charCodeAt(o++)?(e.consume(x),o===me.length?r.interrupt?n:L:m):t(x)}function y(x){return ee(x)?(e.consume(x),l=String.fromCharCode(x),j):t(x)}function j(x){if(x===null||x===47||x===62||V(x)){const me=x===47,Re=l.toLowerCase();return!me&&!s&&An.includes(Re)?(i=1,r.interrupt?n(x):L(x)):ml.includes(l.toLowerCase())?(i=6,me?(e.consume(x),b):r.interrupt?n(x):L(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(x):s?E(x):S(x))}return x===45||te(x)?(e.consume(x),l+=String.fromCharCode(x),j):t(x)}function b(x){return x===62?(e.consume(x),r.interrupt?n:L):t(x)}function E(x){return $(x)?(e.consume(x),E):k(x)}function S(x){return x===47?(e.consume(x),k):x===58||x===95||ee(x)?(e.consume(x),v):$(x)?(e.consume(x),S):k(x)}function v(x){return x===45||x===46||x===58||x===95||te(x)?(e.consume(x),v):N(x)}function N(x){return x===61?(e.consume(x),w):$(x)?(e.consume(x),N):S(x)}function w(x){return x===null||x===60||x===61||x===62||x===96?t(x):x===34||x===39?(e.consume(x),a=x,P):$(x)?(e.consume(x),w):M(x)}function P(x){return x===a?(e.consume(x),a=null,F):x===null||D(x)?t(x):(e.consume(x),P)}function M(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||V(x)?N(x):(e.consume(x),M)}function F(x){return x===47||x===62||$(x)?S(x):t(x)}function k(x){return x===62?(e.consume(x),I):t(x)}function I(x){return x===null||D(x)?L(x):$(x)?(e.consume(x),I):t(x)}function L(x){return x===45&&i===2?(e.consume(x),ne):x===60&&i===1?(e.consume(x),Q):x===62&&i===4?(e.consume(x),de):x===63&&i===3?(e.consume(x),g):x===93&&i===5?(e.consume(x),we):D(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ic,Se,R)(x)):x===null||D(x)?(e.exit("htmlFlowData"),R(x)):(e.consume(x),L)}function R(x){return e.check(Nn,J,Se)(x)}function J(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),H}function H(x){return x===null||D(x)?R(x):(e.enter("htmlFlowData"),L(x))}function ne(x){return x===45?(e.consume(x),g):L(x)}function Q(x){return x===47?(e.consume(x),l="",pe):L(x)}function pe(x){if(x===62){const me=l.toLowerCase();return An.includes(me)?(e.consume(x),de):L(x)}return ee(x)&&l.length<8?(e.consume(x),l+=String.fromCharCode(x),pe):L(x)}function we(x){return x===93?(e.consume(x),g):L(x)}function g(x){return x===62?(e.consume(x),de):x===45&&i===2?(e.consume(x),g):L(x)}function de(x){return x===null||D(x)?(e.exit("htmlFlowData"),Se(x)):(e.consume(x),de)}function Se(x){return e.exit("htmlFlow"),n(x)}}function oc(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(mt,n,t)}}const ac={name:"htmlText",tokenize:uc};function uc(e,n,t){const r=this;let i,s,l;return o;function o(g){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(g),a}function a(g){return g===33?(e.consume(g),u):g===47?(e.consume(g),N):g===63?(e.consume(g),S):ee(g)?(e.consume(g),M):t(g)}function u(g){return g===45?(e.consume(g),c):g===91?(e.consume(g),s=0,m):ee(g)?(e.consume(g),E):t(g)}function c(g){return g===45?(e.consume(g),p):t(g)}function h(g){return g===null?t(g):g===45?(e.consume(g),d):D(g)?(l=h,Q(g)):(e.consume(g),h)}function d(g){return g===45?(e.consume(g),p):h(g)}function p(g){return g===62?ne(g):g===45?d(g):h(g)}function m(g){const de="CDATA[";return g===de.charCodeAt(s++)?(e.consume(g),s===de.length?y:m):t(g)}function y(g){return g===null?t(g):g===93?(e.consume(g),j):D(g)?(l=y,Q(g)):(e.consume(g),y)}function j(g){return g===93?(e.consume(g),b):y(g)}function b(g){return g===62?ne(g):g===93?(e.consume(g),b):y(g)}function E(g){return g===null||g===62?ne(g):D(g)?(l=E,Q(g)):(e.consume(g),E)}function S(g){return g===null?t(g):g===63?(e.consume(g),v):D(g)?(l=S,Q(g)):(e.consume(g),S)}function v(g){return g===62?ne(g):S(g)}function N(g){return ee(g)?(e.consume(g),w):t(g)}function w(g){return g===45||te(g)?(e.consume(g),w):P(g)}function P(g){return D(g)?(l=P,Q(g)):$(g)?(e.consume(g),P):ne(g)}function M(g){return g===45||te(g)?(e.consume(g),M):g===47||g===62||V(g)?F(g):t(g)}function F(g){return g===47?(e.consume(g),ne):g===58||g===95||ee(g)?(e.consume(g),k):D(g)?(l=F,Q(g)):$(g)?(e.consume(g),F):ne(g)}function k(g){return g===45||g===46||g===58||g===95||te(g)?(e.consume(g),k):I(g)}function I(g){return g===61?(e.consume(g),L):D(g)?(l=I,Q(g)):$(g)?(e.consume(g),I):F(g)}function L(g){return g===null||g===60||g===61||g===62||g===96?t(g):g===34||g===39?(e.consume(g),i=g,R):D(g)?(l=L,Q(g)):$(g)?(e.consume(g),L):(e.consume(g),J)}function R(g){return g===i?(e.consume(g),i=void 0,H):g===null?t(g):D(g)?(l=R,Q(g)):(e.consume(g),R)}function J(g){return g===null||g===34||g===39||g===60||g===61||g===96?t(g):g===47||g===62||V(g)?F(g):(e.consume(g),J)}function H(g){return g===47||g===62||V(g)?F(g):t(g)}function ne(g){return g===62?(e.consume(g),e.exit("htmlTextData"),e.exit("htmlText"),n):t(g)}function Q(g){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),pe}function pe(g){return $(g)?U(e,we,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(g):we(g)}function we(g){return e.enter("htmlTextData"),l(g)}}const Kn={name:"labelEnd",resolveAll:pc,resolveTo:dc,tokenize:mc},cc={tokenize:gc},fc={tokenize:xc},hc={tokenize:yc};function pc(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&ge(e,0,e.length,t),e}function dc(e,n){let t=e.length,r=0,i,s,l;for(;t--;){const c=e[t][1];if(i){if(c.type==="link"||c.type==="labelLink"&&c._inactive)break;e[t][0]==="enter"&&c.type==="labelLink"&&(c._inactive=!0)}else if(s){if(e[t][0]==="enter"&&(c.type==="labelImage"||c.type==="labelLink")&&!c._balanced&&(i=t,c.type!=="labelLink")){r=2;break}}else c.type==="labelEnd"&&(s=t)}const o={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},a={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",o,n],["enter",a,n]],l=he(l,e.slice(i+1,i+r+3)),l=he(l,[["enter",u,n]]),l=he(l,$t(n.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),n)),l=he(l,[["exit",u,n],e[s-2],e[s-1],["exit",a,n]]),l=he(l,e.slice(s+1)),l=he(l,[["exit",o,n]]),ge(e,i,e.length,l),e}function mc(e,n,t){const r=this,i=r._labelStarts;let s,l;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();s=i[i.length-1]}return o;function o(d){return s?s._inactive?h(d):(l=r.parser.defined.includes(xe(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),a):t(d)}function a(d){return d===40?e.attempt(cc,c,l?c:h)(d):d===91?e.attempt(fc,c,l?u:h)(d):l?c(d):h(d)}function u(d){return e.attempt(hc,c,h)(d)}function c(d){return i.pop(),n(d)}function h(d){return s._balanced=!0,t(d)}}function gc(e,n,t){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return V(h)?st(e,s)(h):s(h)}function s(h){return h===41?c(h):hl(e,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return V(h)?st(e,a)(h):c(h)}function o(h){return t(h)}function a(h){return h===34||h===39||h===40?dl(e,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):c(h)}function u(h){return V(h)?st(e,c)(h):c(h)}function c(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),n):t(h)}}function xc(e,n,t){const r=this;return i;function i(o){return pl.call(r,e,s,l,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(xe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(o):t(o)}function l(o){return t(o)}}function yc(e,n,t){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),n):t(s)}}const bc={name:"labelStartImage",resolveAll:Kn.resolveAll,tokenize:kc};function kc(e,n,t){const r=this;let i;return s;function s(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),l}function l(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),i=e.exit("labelImage"),o):t(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),n(a))}}const wc={name:"labelStartLink",resolveAll:Kn.resolveAll,tokenize:Sc};function Sc(e,n,t){const r=this;let i;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),i=e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),n(o))}}const en={name:"lineEnding",tokenize:Cc};function Cc(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),U(e,n,"linePrefix")}}const St={name:"thematicBreak",tokenize:jc};function jc(e,n,t){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),a(u)):r>=3&&(u===null||D(u))?(e.exit("thematicBreak"),n(u)):t(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),$(u)?U(e,o,"whitespace")(u):o(u))}}const oe={continuation:{tokenize:Ac},exit:Tc,name:"list",tokenize:Nc},vc={partial:!0,tokenize:zc},Ec={partial:!0,tokenize:Ic};function Nc(e,n,t){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return o;function o(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:vn(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(St,t,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(p)}return t(p)}function a(p){return vn(p)&&++l<10?(e.consume(p),a):(!r.interrupt||l<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):t(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(mt,r.interrupt?t:c,e.attempt(vc,d,h))}function c(p){return r.containerState.initialBlankLine=!0,s++,d(p)}function h(p){return $(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),d):t(p)}function d(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(p)}}function Ac(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(mt,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,U(e,n,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!$(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ec,n,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,U(e,e.attempt(oe,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Ic(e,n,t){const r=this;return U(e,i,"listItemIndent",r.containerState.size+1);function i(s){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(s):t(s)}}function Tc(e){e.exit(this.containerState.type)}function zc(e,n,t){const r=this;return U(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const l=r.events[r.events.length-1];return!$(s)&&l&&l[1].type==="listItemPrefixWhitespace"?n(s):t(s)}}const Or={name:"setextUnderline",resolveTo:Pc,tokenize:Lc};function Pc(e,n){const t=new Nt;let r=e.length,i,s,l;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(s=r)}else e[r][1].type==="content"&&t.add(r,1,[]),!l&&e[r][1].type==="definition"&&(l=r);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(t.add(s,0,[["enter",o,n]]),t.add(l+1,0,[["exit",e[i][1],n]]),e[i][1].end={...e[l][1].end}):e[i][1]=o,t.add(e.length,0,[["exit",o,n]]),t.consume(e),e}function Lc(e,n,t){const r=this;let i;return s;function s(u){let c=r.events.length,h;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){h=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=u,l(u)):t(u)}function l(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),$(u)?U(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||D(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const Mc={tokenize:Dc};function Dc(e){const n=this,t=e.attempt(mt,r,e.attempt(this.parser.constructs.flowInitial,i,U(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Uu,i)),"linePrefix")));return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const Fc={resolveAll:xl()},_c=gl("string"),Oc=gl("text");function gl(e){return{resolveAll:xl(e==="text"?Rc:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],s=t.attempt(i,l,o);return l;function l(c){return u(c)?s(c):o(c)}function o(c){if(c===null){t.consume(c);return}return t.enter("data"),t.consume(c),a}function a(c){return u(c)?(t.exit("data"),s(c)):(t.consume(c),a)}function u(c){if(c===null)return!0;const h=i[c];let d=-1;if(h)for(;++d<h.length;){const p=h[d];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function xl(e){return n;function n(t,r){let i=-1,s;for(;++i<=t.length;)s===void 0?t[i]&&t[i][1].type==="data"&&(s=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==s+2&&(t[s][1].end=t[i-1][1].end,t.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(t,r):t}}function Rc(e,n){const t=new Nt;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],s=n.sliceStream(i);let l=s.length,o=-1,a=0,u;for(;l--;){const c=s[l];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)u=!0,a++;else if(c!==-1){l++;break}}if(n._contentTypeTextTrailing&&r===e.length&&(a=0),a){const c={type:r===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:i.start._bufferIndex+o,_index:i.start._index+l,line:i.end.line,column:i.end.column-a,offset:i.end.offset-a},end:{...i.end}};i.end={...c.start},i.start.offset===i.end.offset?Object.assign(i,c):t.add(r,0,[["enter",c,n],["exit",c,n]])}r++}return t.consume(e),e}const Bc={42:oe,43:oe,45:oe,48:oe,49:oe,50:oe,51:oe,52:oe,53:oe,54:oe,55:oe,56:oe,57:oe,62:al},$c={91:Ku},Hc={[-2]:Zt,[-1]:Zt,32:Zt},Uc={35:ec,42:St,45:[Or,St],60:rc,61:Or,95:St,96:_r,126:_r},qc={38:cl,92:ul},Vc={[-5]:en,[-4]:en,[-3]:en,33:bc,38:cl,42:En,60:[ju,ac],91:wc,92:[Qu,ul],93:Kn,95:En,96:_u},Wc={null:[En,Fc]},Jc={null:[42,95]},Kc={null:[]},Gc=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Jc,contentInitial:$c,disable:Kc,document:Bc,flow:Uc,flowInitial:Hc,insideSpan:Wc,string:qc,text:Vc},Symbol.toStringTag,{value:"Module"}));function Xc(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},s=[];let l=[],o=[];const a={attempt:P(N),check:P(w),consume:E,enter:S,exit:v,interrupt:P(w,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:m,parser:e,previous:null,sliceSerialize:d,sliceStream:p,write:h};let c=n.tokenize.call(u,a);return n.resolveAll&&s.push(n),u;function h(I){return l=he(l,I),j(),l[l.length-1]!==null?[]:(M(n,0),u.events=$t(s,u.events,u),u.events)}function d(I,L){return Qc(p(I),L)}function p(I){return Yc(l,I)}function m(){const{_bufferIndex:I,_index:L,line:R,column:J,offset:H}=r;return{_bufferIndex:I,_index:L,line:R,column:J,offset:H}}function y(I){i[I.line]=I.column,k()}function j(){for(;r._index<l.length;){const I=l[r._index];if(typeof I=="string"){const L=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<I.length;)b(I.charCodeAt(r._bufferIndex))}else b(I)}}function b(I){c=c(I)}function E(I){D(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,k()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=I}function S(I,L){const R=L||{};return R.type=I,R.start=m(),u.events.push(["enter",R,u]),o.push(R),R}function v(I){const L=o.pop();return L.end=m(),u.events.push(["exit",L,u]),L}function N(I,L){M(I,L.from)}function w(I,L){L.restore()}function P(I,L){return R;function R(J,H,ne){let Q,pe,we,g;return Array.isArray(J)?Se(J):"tokenize"in J?Se([J]):de(J);function de(Y){return Qe;function Qe(ve){const Be=ve!==null&&Y[ve],$e=ve!==null&&Y.null,Kt=[...Array.isArray(Be)?Be:Be?[Be]:[],...Array.isArray($e)?$e:$e?[$e]:[]];return Se(Kt)(ve)}}function Se(Y){return Q=Y,pe=0,Y.length===0?ne:x(Y[pe])}function x(Y){return Qe;function Qe(ve){return g=F(),we=Y,Y.partial||(u.currentConstruct=Y),Y.name&&u.parser.constructs.disable.null.includes(Y.name)?Re():Y.tokenize.call(L?Object.assign(Object.create(u),L):u,a,me,Re)(ve)}}function me(Y){return I(we,g),H}function Re(Y){return g.restore(),++pe<Q.length?x(Q[pe]):ne}}}function M(I,L){I.resolveAll&&!s.includes(I)&&s.push(I),I.resolve&&ge(u.events,L,u.events.length-L,I.resolve(u.events.slice(L),u)),I.resolveTo&&(u.events=I.resolveTo(u.events,u))}function F(){const I=m(),L=u.previous,R=u.currentConstruct,J=u.events.length,H=Array.from(o);return{from:J,restore:ne};function ne(){r=I,u.previous=L,u.currentConstruct=R,u.events.length=J,o=H,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Yc(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,s=n.end._bufferIndex;let l;if(t===i)l=[e[t].slice(r,s)];else{if(l=e.slice(t,i),r>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}s>0&&l.push(e[i].slice(0,s))}return l}function Qc(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const s=e[t];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
|
|
4
|
+
`;break}case-3:{l=`\r
|
|
5
|
+
`;break}case-2:{l=n?" ":" ";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(s)}i=s===-2,r.push(l)}return r.join("")}function Zc(e){const r={constructs:il([Gc,...(e||{}).extensions||[]]),content:i(xu),defined:[],document:i(bu),flow:i(Mc),lazy:{},string:i(_c),text:i(Oc)};return r;function i(s){return l;function l(o){return Xc(r,s,o)}}}function ef(e){for(;!fl(e););return e}const Rr=/[\0\t\n\r]/g;function tf(){let e=1,n="",t=!0,r;return i;function i(s,l,o){s=n+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s));const a=[];let u=0;for(n="",t&&(s.charCodeAt(0)===65279&&u++,t=void 0);u<s.length;){Rr.lastIndex=u;const c=Rr.exec(s),h=c&&c.index!==void 0?c.index:s.length,d=s.charCodeAt(h);if(!c){n=s.slice(u);break}if(d===10&&u===h&&r)a.push(-3),r=void 0;else switch(r&&(a.push(-5),r=void 0),u<h&&(a.push(s.slice(u,h)),e+=h-u),d){case 0:{a.push(65533),e++;break}case 9:{const p=Math.ceil(e/4)*4;for(a.push(-2);e++<p;)a.push(-1);break}case 10:{a.push(-4),e=1;break}default:r=!0,e=1}u=h+1}return o&&(r&&a.push(-5),n&&a.push(n),a.push(null)),a}}const nf=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rf(e){return e.replace(nf,lf)}function lf(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),s=i===120||i===88;return ll(t.slice(s?2:1),s?16:10)}return Jn(t)||e}const yl={}.hasOwnProperty;function sf(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),of(t)(ef(Zc(t).document().write(tf()(e,n,!0))))}function of(e){const n={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(fr),autolinkProtocol:k,autolinkEmail:k,atxHeading:l(ar),blockQuote:l(Kt),characterEscape:k,characterReference:k,codeFenced:l(or),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(or,o),codeText:l(ts,o),codeTextData:k,data:k,codeFlowValue:k,definition:l(ns),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(rs),hardBreakEscape:l(ur),hardBreakTrailing:l(ur),htmlFlow:l(cr,o),htmlFlowData:k,htmlText:l(cr,o),htmlTextData:k,image:l(is),label:o,link:l(fr),listItem:l(ls),listItemValue:p,listOrdered:l(hr,d),listUnordered:l(hr),paragraph:l(ss),reference:me,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(ar),strong:l(os),thematicBreak:l(us)},exit:{atxHeading:u(),atxHeadingSequence:w,autolink:u(),autolinkEmail:$e,autolinkProtocol:Be,blockQuote:u(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:Qe,characterReference:ve,codeFenced:u(b),codeFencedFence:j,codeFencedFenceInfo:m,codeFencedFenceMeta:y,codeFlowValue:I,codeIndented:u(E),codeText:u(ne),codeTextData:I,data:I,definition:u(),definitionDestinationString:N,definitionLabelString:S,definitionTitleString:v,emphasis:u(),hardBreakEscape:u(R),hardBreakTrailing:u(R),htmlFlow:u(J),htmlFlowData:I,htmlText:u(H),htmlTextData:I,image:u(pe),label:g,labelText:we,lineEnding:L,link:u(Q),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Re,resourceDestinationString:de,resourceTitleString:Se,resource:x,setextHeading:u(F),setextHeadingLineSequence:M,setextHeadingText:P,strong:u(),thematicBreak:u()}};bl(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(C){let z={type:"root",children:[],position:void 0};const O={stack:[z],tokenStack:[],config:n,enter:a,exit:c,buffer:o,resume:h,data:t},B=[],le=[];let K=-1;for(;++K<C.length;)if(le.push(C[K]),C[K][1].type==="listOrdered"||C[K][1].type==="listUnordered")if(C[K][0]==="enter")B.push(le.length-1);else{const se=B.pop();s(le,se)}for(C=le,K=-1;++K<C.length;){const se=n[C[K][0]];C[K][0]==="enter"&&n.beforeEnter.length>0&&i(n.beforeEnter,{...O,sliceSerialize:C[K][2].sliceSerialize},C[K][1]),yl.call(se,C[K][1].type)&&se[C[K][1].type].call({...O,sliceSerialize:C[K][2].sliceSerialize},C[K][1]),C[K][0]==="exit"&&n.afterExit.length>0&&i(n.afterExit,{...O,sliceSerialize:C[K][2].sliceSerialize},C[K][1])}if(O.tokenStack.length>0){const se=O.tokenStack[O.tokenStack.length-1];(se[1]||Br).call(O,void 0,se[0])}for(z.position={start:Ee(C.length>0?C[0][1].start:{line:1,column:1,offset:0}),end:Ee(C.length>0?C[C.length-2][1].end:{line:1,column:1,offset:0})},K=-1;++K<n.transforms.length;)z=n.transforms[K](z)||z;return z}function i(C,z,O){let B=-1;for(;++B<C.length;)C[B].call(z,O)}function s(C,z){const O=C.length-1;let B=z-1,le=-1,K=!1,se,ye,Ze,et;const tt=[];for(;++B<=O;){const ue=C[B];switch(ue[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ue[0]==="enter"?le++:le--,et=void 0;break}case"lineEndingBlank":{ue[0]==="enter"&&(se&&!et&&!le&&!Ze&&(Ze=B),et=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:et=void 0}if(!le&&ue[0]==="enter"&&ue[1].type==="listItemPrefix"||le===-1&&ue[0]==="exit"&&(ue[1].type==="listUnordered"||ue[1].type==="listOrdered")){if(se){let He=B;for(ye=void 0;He--;){const Ce=C[He];if(Ce[1].type==="lineEnding"||Ce[1].type==="lineEndingBlank"){if(Ce[0]==="exit")continue;ye&&(C[ye][1].type="lineEndingBlank",K=!0),Ce[1].type="lineEnding",ye=He}else if(!(Ce[1].type==="linePrefix"||Ce[1].type==="blockQuotePrefix"||Ce[1].type==="blockQuotePrefixWhitespace"||Ce[1].type==="blockQuoteMarker"||Ce[1].type==="listItemIndent"))break}Ze&&(!ye||Ze<ye)&&(se._spread=!0),se.end=Object.assign({},ye?C[ye][1].start:ue[1].end),tt.push({at:ye||B,event:["exit",se,ue[2]]})}if(ue[1].type==="listItemPrefix"){const He={type:"listItem",_spread:!1,start:Object.assign({},ue[1].start),end:void 0};se=He,tt.push({at:B,event:["enter",He,ue[2]]}),Ze=void 0,et=!0}}}const pr=C.splice(z);let Gt=0;for(B=-1;++B<pr.length;){for(;Gt<tt.length&&tt[Gt].at===z+B;)C.push(tt[Gt++].event);C.push(pr[B])}C[z][1]._spread=K}function l(C,z){return O;function O(B){a.call(this,C(B),B),z&&z.call(this,B)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(C,z,O){this.stack[this.stack.length-1].children.push(C),this.stack.push(C),this.tokenStack.push([z,O||void 0]),C.position={start:Ee(z.start),end:void 0}}function u(C){return z;function z(O){C&&C.call(this,O),c.call(this,O)}}function c(C,z){const O=this.stack.pop(),B=this.tokenStack.pop();if(!B)throw new Error("Cannot close `"+C.type+"` ("+lt({start:C.start,end:C.end})+"): it’s not open");B[0].type!==C.type&&(z?z.call(this,C,B[0]):(B[1]||Br).call(this,C,B[0])),O.position.end=Ee(C.end)}function h(){return Bt(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(C){if(this.data.expectingFirstListItemValue){const z=this.stack[this.stack.length-2];z.start=Number.parseInt(this.sliceSerialize(C),10),this.data.expectingFirstListItemValue=void 0}}function m(){const C=this.resume(),z=this.stack[this.stack.length-1];z.lang=C}function y(){const C=this.resume(),z=this.stack[this.stack.length-1];z.meta=C}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const C=this.resume(),z=this.stack[this.stack.length-1];z.value=C.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const C=this.resume(),z=this.stack[this.stack.length-1];z.value=C.replace(/(\r?\n|\r)$/g,"")}function S(C){const z=this.resume(),O=this.stack[this.stack.length-1];O.label=z,O.identifier=xe(this.sliceSerialize(C)).toLowerCase()}function v(){const C=this.resume(),z=this.stack[this.stack.length-1];z.title=C}function N(){const C=this.resume(),z=this.stack[this.stack.length-1];z.url=C}function w(C){const z=this.stack[this.stack.length-1];if(!z.depth){const O=this.sliceSerialize(C).length;z.depth=O}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function M(C){const z=this.stack[this.stack.length-1];z.depth=this.sliceSerialize(C).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function k(C){const O=this.stack[this.stack.length-1].children;let B=O[O.length-1];(!B||B.type!=="text")&&(B=as(),B.position={start:Ee(C.start),end:void 0},O.push(B)),this.stack.push(B)}function I(C){const z=this.stack.pop();z.value+=this.sliceSerialize(C),z.position.end=Ee(C.end)}function L(C){const z=this.stack[this.stack.length-1];if(this.data.atHardBreak){const O=z.children[z.children.length-1];O.position.end=Ee(C.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(z.type)&&(k.call(this,C),I.call(this,C))}function R(){this.data.atHardBreak=!0}function J(){const C=this.resume(),z=this.stack[this.stack.length-1];z.value=C}function H(){const C=this.resume(),z=this.stack[this.stack.length-1];z.value=C}function ne(){const C=this.resume(),z=this.stack[this.stack.length-1];z.value=C}function Q(){const C=this.stack[this.stack.length-1];if(this.data.inReference){const z=this.data.referenceType||"shortcut";C.type+="Reference",C.referenceType=z,delete C.url,delete C.title}else delete C.identifier,delete C.label;this.data.referenceType=void 0}function pe(){const C=this.stack[this.stack.length-1];if(this.data.inReference){const z=this.data.referenceType||"shortcut";C.type+="Reference",C.referenceType=z,delete C.url,delete C.title}else delete C.identifier,delete C.label;this.data.referenceType=void 0}function we(C){const z=this.sliceSerialize(C),O=this.stack[this.stack.length-2];O.label=rf(z),O.identifier=xe(z).toLowerCase()}function g(){const C=this.stack[this.stack.length-1],z=this.resume(),O=this.stack[this.stack.length-1];if(this.data.inReference=!0,O.type==="link"){const B=C.children;O.children=B}else O.alt=z}function de(){const C=this.resume(),z=this.stack[this.stack.length-1];z.url=C}function Se(){const C=this.resume(),z=this.stack[this.stack.length-1];z.title=C}function x(){this.data.inReference=void 0}function me(){this.data.referenceType="collapsed"}function Re(C){const z=this.resume(),O=this.stack[this.stack.length-1];O.label=z,O.identifier=xe(this.sliceSerialize(C)).toLowerCase(),this.data.referenceType="full"}function Y(C){this.data.characterReferenceType=C.type}function Qe(C){const z=this.sliceSerialize(C),O=this.data.characterReferenceType;let B;O?(B=ll(z,O==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):B=Jn(z);const le=this.stack[this.stack.length-1];le.value+=B}function ve(C){const z=this.stack.pop();z.position.end=Ee(C.end)}function Be(C){I.call(this,C);const z=this.stack[this.stack.length-1];z.url=this.sliceSerialize(C)}function $e(C){I.call(this,C);const z=this.stack[this.stack.length-1];z.url="mailto:"+this.sliceSerialize(C)}function Kt(){return{type:"blockquote",children:[],position:void 0}}function or(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function ts(){return{type:"inlineCode",value:"",position:void 0}}function ns(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function rs(){return{type:"emphasis",children:[],position:void 0}}function ar(){return{type:"heading",depth:0,children:[],position:void 0}}function ur(){return{type:"break",position:void 0}}function cr(){return{type:"html",value:"",position:void 0}}function is(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function fr(){return{type:"link",title:null,url:"",children:[],position:void 0}}function hr(C){return{type:"list",ordered:C.type==="listOrdered",start:null,spread:C._spread,children:[],position:void 0}}function ls(C){return{type:"listItem",spread:C._spread,checked:null,children:[],position:void 0}}function ss(){return{type:"paragraph",children:[],position:void 0}}function os(){return{type:"strong",children:[],position:void 0}}function as(){return{type:"text",value:"",position:void 0}}function us(){return{type:"thematicBreak",position:void 0}}}function Ee(e){return{line:e.line,column:e.column,offset:e.offset}}function bl(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?bl(e,r):af(e,r)}}function af(e,n){let t;for(t in n)if(yl.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"afterExit":case"beforeEnter":{const r=n[t];r&&e[t].push(r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function Br(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+lt({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+lt({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+lt({start:n.start,end:n.end})+") is still open")}function uf(e){const n=this;n.parser=t;function t(r){return sf(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function cf(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function ff(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
|
|
6
|
+
`}]}function hf(e,n){const t=n.value?n.value+`
|
|
7
|
+
`:"",r={},i=n.lang?n.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(s.data={meta:n.meta}),e.patch(n,s),s=e.applyData(n,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(n,s),s}function pf(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function df(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function mf(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Ye(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let l,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=s+1,o+=1,e.footnoteCounts.set(r,o);const a={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(n,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(n,u),e.applyData(n,u)}function gf(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function xf(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function kl(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function yf(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return kl(e,n);const i={src:Ye(r.url||"")};n.alt!==null&&n.alt!==void 0&&(i.alt=n.alt),r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,s),e.applyData(n,s)}function bf(e,n){const t={src:Ye(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function kf(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function wf(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return kl(e,n);const i={href:Ye(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function Sf(e,n){const t={href:Ye(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Cf(e,n,t){const r=e.all(n),i=t?jf(t):wl(n),s={},l=[];if(typeof n.checked=="boolean"){const c=r[0];let h;c&&c.type==="element"&&c.tagName==="p"?h=c:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const c=r[o];(i||o!==0||c.type!=="element"||c.tagName!=="p")&&l.push({type:"text",value:`
|
|
8
|
+
`}),c.type==="element"&&c.tagName==="p"&&!i?l.push(...c.children):l.push(c)}const a=r[r.length-1];a&&(i||a.type!=="element"||a.tagName!=="p")&&l.push({type:"text",value:`
|
|
9
|
+
`});const u={type:"element",tagName:"li",properties:s,children:l};return e.patch(n,u),e.applyData(n,u)}function jf(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const{children:t}=e;let r=-1;for(;!n&&++r<t.length;)n=wl(t[r])}return n}function wl(e){const{spread:n}=e;return n??e.children.length>1}function vf(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const s={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,s),e.applyData(n,s)}function Ef(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Nf(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function Af(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function If(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],l),i.push(l)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},o=Un(n.children[1]),a=Yi(n.children[n.children.length-1]);o&&a&&(l.position={start:o,end:a}),i.push(l)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,s),e.applyData(n,s)}function Tf(e,n,t){const r=t?t.children:void 0,s=(r?r.indexOf(n):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,o=l?l.length:n.children.length;let a=-1;const u=[];for(;++a<o;){const h=n.children[a],d={},p=l?l[a]:void 0;p&&(d.align=p);let m={type:"element",tagName:s,properties:d,children:[]};h&&(m.children=e.all(h),e.patch(h,m),m=e.applyData(h,m)),u.push(m)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(n,c),e.applyData(n,c)}function zf(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const $r=9,Hr=32;function Pf(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const s=[];for(;r;)s.push(Ur(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return s.push(Ur(n.slice(i),i>0,!1)),s.join("")}function Ur(e,n,t){let r=0,i=e.length;if(n){let s=e.codePointAt(r);for(;s===$r||s===Hr;)r++,s=e.codePointAt(r)}if(t){let s=e.codePointAt(i-1);for(;s===$r||s===Hr;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Lf(e,n){const t={type:"text",value:Pf(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function Mf(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const Df={blockquote:cf,break:ff,code:hf,delete:pf,emphasis:df,footnoteReference:mf,heading:gf,html:xf,imageReference:yf,image:bf,inlineCode:kf,linkReference:wf,link:Sf,listItem:Cf,list:vf,paragraph:Ef,root:Nf,strong:Af,table:If,tableCell:zf,tableRow:Tf,text:Lf,thematicBreak:Mf,toml:xt,yaml:xt,definition:xt,footnoteDefinition:xt};function xt(){}const Sl=-1,Ht=0,ot=1,At=2,Gn=3,Xn=4,Yn=5,Qn=6,Cl=7,jl=8,{defineProperty:Ff}=Object,vl=typeof self=="object"?self:globalThis,qr=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new vl[e](n)},_f=(e,n)=>{const t=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,l]=n[i];switch(s){case Ht:case Sl:return t(l,i);case ot:{const o=t([],i);for(const a of l)o.push(r(a));return o}case At:{const o=t({},i);for(const[a,u]of l){const c=r(a),h=r(u);c==="__proto__"?Ff(o,c,{value:h,configurable:!0,enumerable:!0,writable:!0}):o[c]=h}return o}case Gn:return t(new Date(l),i);case Xn:{const{source:o,flags:a}=l;return t(new RegExp(o,a),i)}case Yn:{const o=t(new Map,i);for(const[a,u]of l)o.set(r(a),r(u));return o}case Qn:{const o=t(new Set,i);for(const a of l)o.add(r(a));return o}case Cl:{const{name:o,message:a}=l;return t(typeof vl[o]=="function"?qr(o,a):new Error(a),i)}case jl:return t(BigInt(l),i);case"BigInt":return t(Object(BigInt(l)),i);case"ArrayBuffer":return t(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:o}=new Uint8Array(l);return t(new DataView(o),l)}case"-0":return-0}return t(qr(s,l),i)};return r},Vr=e=>_f(new Map,e)(0),Me="",{toString:Of}={},{keys:Rf,is:Bf}=Object,it=e=>{const n=typeof e;if(n!=="object"||!e)return[Ht,n];const t=Of.call(e).slice(8,-1);switch(t){case"Array":return[ot,Me];case"Object":return[At,Me];case"Date":return[Gn,Me];case"RegExp":return[Xn,Me];case"Map":return[Yn,Me];case"Set":return[Qn,Me];case"DataView":return[ot,t]}return t.includes("Array")?[ot,t]:e instanceof Error?[Cl,e.name||"Error"]:[At,t]},yt=([e,n])=>e===Ht&&(n==="function"||n==="symbol"),$f=(e,n,t,r)=>{const i=(l,o)=>{const a=r.push(l)-1;return t.set(o,a),a},s=l=>{if(t.has(l))return t.get(l);let[o,a]=it(l);switch(o){case Ht:{let c=l;switch(a){case"bigint":o=jl,c=l.toString();break;case"number":if(!l&&Bf(l,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);c=null;break;case"undefined":return i([Sl],l)}return i([o,c],l)}case ot:{if(a){let d=l;return a==="DataView"?d=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(d=new Uint8Array(l)),i([a,[...d]],l)}const c=[],h=i([o,c],l);for(const d of l)c.push(s(d));return h}case At:{if(a)switch(a){case"BigInt":return i([a,l.toString()],l);case"Boolean":case"Number":case"String":return i([a,l.valueOf()],l)}if(n&&"toJSON"in l)return s(l.toJSON());const c=[],h=i([o,c],l);for(const d of Rf(l))(e||!yt(it(l[d])))&&c.push([s(d),s(l[d])]);return h}case Gn:return i([o,isNaN(l.getTime())?Me:l.toISOString()],l);case Xn:{const{source:c,flags:h}=l;return i([o,{source:c,flags:h}],l)}case Yn:{const c=[],h=i([o,c],l);for(const[d,p]of l)(e||!(yt(it(d))||yt(it(p))))&&c.push([s(d),s(p)]);return h}case Qn:{const c=[],h=i([o,c],l);for(const d of l)(e||!yt(it(d)))&&c.push(s(d));return h}}const{message:u}=l;return i([o,{name:a,message:u}],l)};return s},Wr=(e,{json:n,lossy:t}={})=>{const r=[];return $f(!(n||t),!!n,new Map,r)(e),r},It=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?Vr(Wr(e,n)):structuredClone(e):(e,n)=>Vr(Wr(e,n));function Hf(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function Uf(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function qf(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||Hf,r=e.options.footnoteBackLabel||Uf,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);c&&(o[u]=e.all(c))}for(u=-1;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;const h=o[u],d=String(c.identifier).toUpperCase(),p=Ye(d.toLowerCase());let m=0;const y=[],j=e.footnoteCounts.get(d);for(;j!==void 0&&++m<=j;){y.length>0&&y.push({type:"text",value:" "});let S=typeof t=="string"?t:t(u,m);typeof S=="string"&&(S={type:"text",value:S}),y.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,m),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const b=h[h.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const S=b.children[b.children.length-1];S&&S.type==="text"?S.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...y)}else h.push(...y);const E={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(h,!0)};e.patch(c,E),a.push(E)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...It(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
10
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
11
|
+
`}]}}const Ut=(function(e){if(e==null)return Kf;if(typeof e=="function")return qt(e);if(typeof e=="object")return Array.isArray(e)?Vf(e):Wf(e);if(typeof e=="string")return Jf(e);throw new Error("Expected function, string, or object as test")});function Vf(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=Ut(e[t]);return qt(r);function r(...i){let s=-1;for(;++s<n.length;)if(n[s].apply(this,i))return!0;return!1}}function Wf(e){const n=e;return qt(t);function t(r){const i=r;let s;for(s in e)if(i[s]!==n[s])return!1;return!0}}function Jf(e){return qt(n);function n(t){return t&&t.type===e}}function qt(e){return n;function n(t,r,i){return!!(Gf(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function Kf(){return!0}function Gf(e){return e!==null&&typeof e=="object"&&"type"in e}const El=[],Xf=!0,at=!1,In="skip";function Tn(e,n,t,r){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,s,l,o,a;if(typeof t=="function"||t&&typeof t=="object"?(s=n,l=t,r&&(i=!1)):(l=n,t&&(i=!1)),typeof l=="function")o=l;else if(l&&typeof l=="object"){if(!(l.enter===null||l.enter===void 0))if(typeof l.enter=="function")o=l.enter;else throw new Error("Unexpected value `"+l.enter+"` for `visitors.enter`, expected optional visitor");if(typeof l.exit=="function")a=l.exit;else throw new Error("Unexpected value `"+l.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+l+"` for `enter` or `visitors`, expected visitor or object with visitors");const u=Ut(s),c=i?1:-1;h(e,void 0,[])();function h(d,p,m){const y=d&&typeof d=="object"?d:{};if(typeof y.type=="string"){const b=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(j,"name",{value:"node ("+(d.type+(b?"<"+b+">":""))+")"})}return j;function j(){const b=!s||u(d,p,m[m.length-1]||void 0);let E=El;if(o&&b&&(E=Jr(o(d,m,p)),E[0]===at))return E;if("children"in d&&d.children){const S=d;if(S.children&&E[0]!==In){let v=(i?-1:S.children.length)+c;const N=[...m,S];for(;v>-1&&v<S.children.length;){const w=S.children[v],P=h(w,v,N)();if(P[0]===at)return P;v=typeof P[1]=="number"?P[1]:v+c}}}if(a&&b){const S=Jr(a(d,m,p));if(S[0]===In)throw new Error("Unexpected value `"+S[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(S[0]===at||typeof S[1]=="number")return S}return E}}}function Jr(e){return Array.isArray(e)?e:typeof e=="number"?[Xf,e]:e==null?El:[e]}function Vt(e,n,t,r){let i,s,l;s=n,l=t,typeof s=="function"?Tn(e,i,zn(s),l):Tn(e,i,Yf(s),l)}function Yf(e){return!e||typeof e!="object"?e:{enter:typeof e.enter=="function"?zn(e.enter):e.enter,exit:typeof e.exit=="function"?zn(e.exit):e.exit}}function zn(e){return n;function n(t,r,i){return e(t,i,r[r.length-1])}}const Pn={}.hasOwnProperty,Qf={};function Zf(e,n){const t=n||Qf,r=new Map,i=new Map,s=new Map,l={...Df,...t.handlers},o={all:u,applyData:th,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:l,one:a,options:t,patch:eh,wrap:rh};return Vt(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const h=String(c.identifier).toUpperCase();c.type==="definition"?r.has(h)||r.set(h,c):i.has(h)||i.set(h,c)}}),o;function a(c,h){const{type:d}=c,p=o.handlers[d];if(Pn.call(o.handlers,d)&&p)return p(o,c,h);if(o.options.passThrough&&o.options.passThrough.includes(d)){if("children"in c){const{children:y,...j}=c;return{...It(j),children:o.all(c)}}return It(c)}return(o.options.unknownHandler||nh)(o,c,h)}function u(c){const h=[];if("children"in c){const d=c.children;let p=-1;for(;++p<d.length;){const m=o.one(d[p],c);if(m){if(p&&d[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Kr(m.value)),!Array.isArray(m)&&m.type==="element")){const y=m.children[0];y&&y.type==="text"&&(y.value=Kr(y.value))}Array.isArray(m)?h.push(...m):h.push(m)}}}return h}}function eh(e,n){e.position&&(n.position=Ha(e))}function th(e,n){let t=n;if(e&&e.data){const{hChildren:r,hName:i,hProperties:s}=e.data;if(typeof i=="string")if(t.type==="element")t.tagName=i;else{const l="children"in t?t.children:[t];t={type:"element",tagName:i,properties:{},children:l}}t.type==="element"&&s&&Object.assign(t.properties,It(s)),"children"in t&&t.children&&r!==null&&r!==void 0&&(t.children=r)}return t}function nh(e,n){const t=n.data||{},r="value"in n&&!(Pn.call(t,"hProperties")||Pn.call(t,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function rh(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
|
|
12
|
+
`});++r<e.length;)r&&t.push({type:"text",value:`
|
|
13
|
+
`}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
|
|
14
|
+
`}),t}function Kr(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function Gr(e,n){const t=Zf(e,n),r=t.one(e,void 0),i=qf(t),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
15
|
+
`},i),s}function ih(e,n){return e&&"run"in e?async function(t,r){const i=Gr(t,{file:r,...n});await e.run(i,r)}:function(t,r){return Gr(t,{file:r,...e||n})}}function Xr(e){if(e)throw e}var tn,Yr;function lh(){if(Yr)return tn;Yr=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},s=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var c=e.call(u,"constructor"),h=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!h)return!1;var d;for(d in u);return typeof d>"u"||e.call(u,d)},l=function(u,c){t&&c.name==="__proto__"?t(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},o=function(u,c){if(c==="__proto__")if(e.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return tn=function a(){var u,c,h,d,p,m,y=arguments[0],j=1,b=arguments.length,E=!1;for(typeof y=="boolean"&&(E=y,y=arguments[1]||{},j=2),(y==null||typeof y!="object"&&typeof y!="function")&&(y={});j<b;++j)if(u=arguments[j],u!=null)for(c in u)h=o(y,c),d=o(u,c),y!==d&&(E&&d&&(s(d)||(p=i(d)))?(p?(p=!1,m=h&&i(h)?h:[]):m=h&&s(h)?h:{},l(y,{name:c,newValue:a(E,m,d)})):typeof d<"u"&&l(y,{name:c,newValue:d}));return y},tn}var sh=lh();const nn=So(sh);function Ln(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function oh(){const e=[],n={run:t,use:r};return n;function t(...i){let s=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...i);function o(a,...u){const c=e[++s];let h=-1;if(a){l(a);return}for(;++h<i.length;)(u[h]===null||u[h]===void 0)&&(u[h]=i[h]);i=u,c?ah(c,o)(...u):l(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function ah(e,n){let t;return r;function r(...l){const o=e.length>l.length;let a;o&&l.push(i);try{a=e.apply(this,l)}catch(u){const c=u;if(o&&t)throw c;return i(c)}o||(a&&a.then&&typeof a.then=="function"?a.then(s,i):a instanceof Error?i(a):s(a))}function i(l,...o){t||(t=!0,n(l,...o))}function s(l){i(null,l)}}const be={basename:uh,dirname:ch,extname:fh,join:hh,sep:"/"};function uh(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');gt(e);let t=0,r=-1,i=e.length,s;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){t=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,o=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){t=i+1;break}}else l<0&&(s=!0,l=i+1),o>-1&&(e.codePointAt(i)===n.codePointAt(o--)?o<0&&(r=i):(o=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function ch(e){if(gt(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function fh(e){gt(e);let n=e.length,t=-1,r=0,i=-1,s=0,l;for(;n--;){const o=e.codePointAt(n);if(o===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),o===46?i<0?i=n:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||t<0||s===0||s===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function hh(...e){let n=-1,t;for(;++n<e.length;)gt(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":ph(t)}function ph(e){gt(e);const n=e.codePointAt(0)===47;let t=dh(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function dh(e,n){let t="",r=0,i=-1,s=0,l=-1,o,a;for(;++l<=e.length;){if(l<e.length)o=e.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(i===l-1||s===1))if(i!==l-1&&s===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(a=t.lastIndexOf("/"),a!==t.length-1){a<0?(t="",r=0):(t=t.slice(0,a),r=t.length-1-t.lastIndexOf("/")),i=l,s=0;continue}}else if(t.length>0){t="",r=0,i=l,s=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,l):t=e.slice(i+1,l),r=l-i-1;i=l,s=0}else o===46&&s>-1?s++:s=-1}return t}function gt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const mh={cwd:gh};function gh(){return"/"}function Mn(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function xh(e){if(typeof e=="string")e=new URL(e);else if(!Mn(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return yh(e)}function yh(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t<n.length;)if(n.codePointAt(t)===37&&n.codePointAt(t+1)===50){const r=n.codePointAt(t+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}const rn=["history","path","basename","stem","extname","dirname"];class Nl{constructor(n){let t;n?Mn(n)?t={path:n}:typeof n=="string"||bh(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":mh.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<rn.length;){const s=rn[r];s in t&&t[s]!==void 0&&t[s]!==null&&(this[s]=s==="history"?[...t[s]]:t[s])}let i;for(i in t)rn.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?be.basename(this.path):void 0}set basename(n){sn(n,"basename"),ln(n,"basename"),this.path=be.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?be.dirname(this.path):void 0}set dirname(n){Qr(this.basename,"dirname"),this.path=be.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?be.extname(this.path):void 0}set extname(n){if(ln(n,"extname"),Qr(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=be.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Mn(n)&&(n=xh(n)),sn(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?be.basename(this.path,this.extname):void 0}set stem(n){sn(n,"stem"),ln(n,"stem"),this.path=be.join(this.dirname||"",n+(this.extname||""))}fail(n,t,r){const i=this.message(n,t,r);throw i.fatal=!0,i}info(n,t,r){const i=this.message(n,t,r);return i.fatal=void 0,i}message(n,t,r){const i=new Rt(n,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function ln(e,n){if(e&&e.includes(be.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+be.sep+"`")}function sn(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Qr(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function bh(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kh=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),wh={}.hasOwnProperty;class Zn extends kh{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=oh()}copy(){const n=new Zn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(nn(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(un("data",this.frozen),this.namespace[n]=t,this):wh.call(this.namespace,n)&&this.namespace[n]||void 0:n?(un("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=t.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const t=bt(n),r=this.parser||this.Parser;return on("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),on("process",this.parser||this.Parser),an("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(s,l){const o=bt(n),a=r.parse(o);r.run(a,o,function(c,h,d){if(c||!h||!d)return u(c);const p=h,m=r.stringify(p,d);jh(m)?d.value=m:d.result=m,u(c,d)});function u(c,h){c||!h?l(c):s?s(h):t(void 0,h)}}}processSync(n){let t=!1,r;return this.freeze(),on("processSync",this.parser||this.Parser),an("processSync",this.compiler||this.Compiler),this.process(n,i),ei("processSync","process",t),r;function i(s,l){t=!0,Xr(s),r=l}}run(n,t,r){Zr(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?s(void 0,r):new Promise(s);function s(l,o){const a=bt(t);i.run(n,a,u);function u(c,h,d){const p=h||n;c?o(c):l?l(p):r(void 0,p,d)}}}runSync(n,t){let r=!1,i;return this.run(n,t,s),ei("runSync","run",r),i;function s(l,o){Xr(l),i=o,r=!0}}stringify(n,t){this.freeze();const r=bt(t),i=this.compiler||this.Compiler;return an("stringify",i),Zr(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(un("use",this.frozen),n!=null)if(typeof n=="function")a(n,t);else if(typeof n=="object")Array.isArray(n)?o(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function s(u){if(typeof u=="function")a(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...h]=u;a(c,h)}else l(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function l(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(i.settings=nn(!0,i.settings,u.settings))}function o(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const h=u[c];s(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function a(u,c){let h=-1,d=-1;for(;++h<r.length;)if(r[h][0]===u){d=h;break}if(d===-1)r.push([u,...c]);else if(c.length>0){let[p,...m]=c;const y=r[d][1];Ln(y)&&Ln(p)&&(p=nn(!0,y,p)),r[d]=[u,p,...m]}}}}const Sh=new Zn().freeze();function on(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function an(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function un(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Zr(e){if(!Ln(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ei(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function bt(e){return Ch(e)?e:new Nl(e)}function Ch(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jh(e){return typeof e=="string"||vh(e)}function vh(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Eh="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ti=[],ni={allowDangerousHtml:!0},Nh=/^(https?|ircs?|mailto|xmpp)$/i,Ah=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ih(e){const n=Th(e),t=zh(e);return Ph(n.runSync(n.parse(t),t),e)}function Th(e){const n=e.rehypePlugins||ti,t=e.remarkPlugins||ti,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ni}:ni;return Sh().use(uf).use(t).use(ih,r).use(n)}function zh(e){const n=e.children||"",t=new Nl;return typeof n=="string"&&(t.value=n),t}function Ph(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,s=n.disallowedElements,l=n.skipHtml,o=n.unwrapDisallowed,a=n.urlTransform||Lh;for(const c of Ah)Object.hasOwn(n,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+Eh+c.id,void 0);return Vt(e,u),Ka(e,{Fragment:f.Fragment,components:i,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function u(c,h,d){if(c.type==="raw"&&d&&typeof h=="number")return l?d.children.splice(h,1):d.children[h]={type:"text",value:c.value},h;if(c.type==="element"){let p;for(p in Qt)if(Object.hasOwn(Qt,p)&&Object.hasOwn(c.properties,p)){const m=c.properties[p],y=Qt[p];(y===null||y.includes(c.tagName))&&(c.properties[p]=a(String(m||""),p,c))}}if(c.type==="element"){let p=t?!t.includes(c.tagName):s?s.includes(c.tagName):!1;if(!p&&r&&typeof h=="number"&&(p=!r(c,h,d)),p&&d&&typeof h=="number")return o&&c.children?d.children.splice(h,1,...c.children):d.children.splice(h,1),h}}}function Lh(e){const n=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||t!==-1&&n>t||r!==-1&&n>r||Nh.test(e.slice(0,n))?e:""}function ri(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+n.length);return r}function Mh(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Dh(e,n,t){const i=Ut((t||{}).ignore||[]),s=Fh(n);let l=-1;for(;++l<s.length;)Tn(e,o);function o(u,c,h){if(u.type==="text"&&typeof h=="number")return a(u,c,h);if(i(u,h,c[c.length-1]))return In}function a(u,c,h){const d=c[c.length-1],p=s[l][0],m=s[l][1];let y=0,j=!1,b=[];p.lastIndex=0;let E=p.exec(u.value);for(;E;){const v=E.index,N={index:E.index,input:E.input,stack:[...c,u]};let w=m(...E,N);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1)p.lastIndex=v+1;else{if(y!==v&&S({type:"text",value:u.value.slice(y,v)}),Array.isArray(w))for(const P of w)S(P);else w&&S(w);y=v+E[0].length,j=!0}if(!p.global)break;E=p.exec(u.value)}return j?(y<u.value.length&&S({type:"text",value:u.value.slice(y)}),d.children.splice(h,1,...b)):b=[u],h+b.length;function S(v){const N=b[b.length-1];N&&N.type==="text"&&v.type==="text"?N.value+=v.value:b.push(v)}}}function Fh(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=[],t=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<t.length;){const i=t[r];n.push([_h(i[0]),Oh(i[1])])}return n}function _h(e){return typeof e=="string"?new RegExp(Mh(e),"g"):e}function Oh(e){return typeof e=="function"?e:function(){return e}}const cn="phrasing",fn=["autolink","link","image","label"];function Rh(){return{transforms:[Wh],enter:{literalAutolink:$h,literalAutolinkEmail:hn,literalAutolinkHttp:hn,literalAutolinkWww:hn},exit:{literalAutolink:Vh,literalAutolinkEmail:qh,literalAutolinkHttp:Hh,literalAutolinkWww:Uh}}}function Bh(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:cn,notInConstruct:fn},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:cn,notInConstruct:fn},{character:":",before:"[ps]",after:"\\/",inConstruct:cn,notInConstruct:fn}]}}function $h(e){this.enter({type:"link",title:null,url:"",children:[],position:void 0},e)}function hn(e){this.config.enter.autolinkProtocol.call(this,e)}function Hh(e){this.config.exit.autolinkProtocol.call(this,e)}function Uh(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function qh(e){this.config.exit.autolinkEmail.call(this,e)}function Vh(e){this.exit(e)}function Wh(e){Dh(e,[[new RegExp("(?<![\\da-z])(https?:\\/\\/|www(?=\\.))([\\w-]*\\.[\\w\\-.]*)([^\\t\\n\\r ]*)","gi"),Jh],[new RegExp("(?<![\\w+\\-.@])xmpp:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)(\\/(?:[\\w\\-/]|\\.(?=[\\dA-Za-z]))*)?","g"),Xh],[new RegExp("(?<![\\w+\\-.@])mailto:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),Gh],[new RegExp("(?<![\\w+\\-.]|(?:^|[^\\d@A-Za-z])(?:mailto|xmpp):)([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),Kh]],{ignore:["link","linkReference"]})}function Jh(e,n,t,r,i){if(!Zh(i))return!1;let s="";if(/^w/i.test(n)&&(t=n+t,n="",s="http://"),dt(t.charCodeAt(0))||!Yh(t))return!1;const l=Qh(t+r),o={type:"link",title:null,url:s+n+l[0],children:[{type:"text",value:n+l[0],position:void 0}],position:void 0};return l[1]?[o,{type:"text",value:l[1],position:void 0}]:o}function Kh(e,n,t){return/[\d\-_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t,position:void 0}],position:void 0}}function Gh(e,n,t){if(/[\d\-_]$/.test(t))return!1;const r="mailto:"+n+"@"+t;return{type:"link",title:null,url:r,children:[{type:"text",value:r,position:void 0}],position:void 0}}function Xh(e,n,t,r,i){if(/[\d\-_]$/.test(t)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)==="@"))return!1;const s="xmpp:"+n+"@"+t+(r||"");return{type:"link",title:null,url:s,children:[{type:"text",value:s,position:void 0}],position:void 0}}function Yh(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[\dA-Za-z]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[\dA-Za-z]/.test(n[n.length-2])))}function Qh(e){let n=e.length;for(;n>0;){const l=e.charCodeAt(n-1);if(l===33||l===34||l===38||l===39||l===41||l===44||l===46||l===58||l===59||l===60||l===62||l===63||l===93||l===125)n--;else break}if(n===e.length)return[e,void 0];let t=e.slice(n);e=e.slice(0,n);let r=t.indexOf(")");const i=ri(e,"(");let s=ri(e,")");for(;r!==-1&&i>s;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),s++;return[e,t]}function Zh(e){const n=e.input.charCodeAt(e.index-1);return e.index===0||_e(n)||dt(n)}Al.peek=ap;function ep(){this.buffer()}function tp(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function np(){this.buffer()}function rp(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ip(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=xe(this.sliceSerialize(e)).toLowerCase(),t.label=n}function lp(e){this.exit(e)}function sp(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=xe(this.sliceSerialize(e)).toLowerCase(),t.label=n}function op(e){this.exit(e)}function ap(){return"["}function Al(e,n,t,r){const i=t.createTracker(r);let s=i.move("[^");const l=t.enter("footnoteReference"),o=t.enter("reference");return s+=i.move(t.safe(t.associationId(e),{after:"]",before:s})),o(),l(),s+=i.move("]"),s}function up(){return{enter:{gfmFootnoteCallString:ep,gfmFootnoteCall:tp,gfmFootnoteDefinitionLabelString:np,gfmFootnoteDefinition:rp},exit:{gfmFootnoteCallString:ip,gfmFootnoteCall:lp,gfmFootnoteDefinitionLabelString:sp,gfmFootnoteDefinition:op}}}function cp(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:Al},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,s,l){const o=s.createTracker(l);let a=o.move("[^");const u=s.enter("footnoteDefinition"),c=s.enter("label");return a+=o.move(s.safe(s.associationId(r),{before:a,after:"]"})),c(),a+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),a+=o.move((n?`
|
|
16
|
+
`:" ")+s.indentLines(s.containerFlow(r,o.current()),n?Il:fp))),u(),a}}function fp(e,n,t){return n===0?e:Il(e,n,t)}function Il(e,n,t){return(t?"":" ")+e}const hp=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];er.attention=xp;er.peek=yp;function pp(){return{canContainEols:["delete"],enter:{strikethrough:mp},exit:{strikethrough:gp}}}function dp(){return{handlers:{delete:er},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:hp}]}}function mp(e){this.enter({type:"delete",children:[],position:void 0},e)}function gp(e){this.exit(e)}function er(e,n,t,r){const i=t.createTracker(r),s=t.stack.includes("strikethrough")?"~":"~~",l=t.enter("strikethrough");let o=i.move(s);return o+=t.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move(s),l(),o}function xp(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function yp(){return"~"}function bp(e){return e.length}function kp(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||bp,s=[],l=[],o=[],a=[];let u=0,c=-1;for(;++c<e.length;){const y=[],j=[];let b=-1;for(e[c].length>u&&(u=e[c].length);++b<e[c].length;){const E=wp(e[c][b]);if(t.alignDelimiters!==!1){const S=i(E);j[b]=S,(a[b]===void 0||S>a[b])&&(a[b]=S)}y.push(E)}l[c]=y,o[c]=j}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<u;)s[h]=ii(r[h]);else{const y=ii(r);for(;++h<u;)s[h]=y}h=-1;const d=[],p=[];for(;++h<u;){const y=s[h];let j="",b="";y===99?(j=":",b=":"):y===108?j=":":y===114&&(b=":");let E=t.alignDelimiters===!1?1:Math.max(1,a[h]-j.length-b.length);const S=j+"-".repeat(E)+b;t.alignDelimiters!==!1&&(E=j.length+E+b.length,E>a[h]&&(a[h]=E),p[h]=E),d[h]=S}l.splice(1,0,d),o.splice(1,0,p),c=-1;const m=[];for(;++c<l.length;){const y=l[c],j=o[c],b=t.fillRows===!1?Math.max(1,l[c===1?0:c].length):u;h=-1;const E=[];for(;++h<b;){const S=y[h]||"";let v="",N="";if(t.alignDelimiters!==!1){const w=a[h]-(j[h]||0),P=s[h];if(P===114)v=" ".repeat(w);else if(P===99){const M=w/2;w%2?(v=" ".repeat(M+.5),N=" ".repeat(M-.5)):(v=" ".repeat(M),N=v)}else N=" ".repeat(w)}t.delimiterStart!==!1&&!h&&E.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&S==="")&&(t.delimiterStart!==!1||h)&&E.push(" "),t.alignDelimiters!==!1&&E.push(v),E.push(S),t.alignDelimiters!==!1&&E.push(N),t.padding!==!1&&E.push(" "),(t.delimiterEnd!==!1||h!==b-1)&&E.push("|")}m.push(t.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return m.join(`
|
|
17
|
+
`)}function wp(e){return e==null?"":String(e)}function ii(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}const Sp=Ut(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Cp(e,n,t,r){const i=t.enter("blockquote"),s=t.createTracker(r);s.move("> "),s.shift(2);const l=t.indentLines(t.containerFlow(e,s.current()),jp);return i(),l}function jp(e,n,t){return">"+(t?"":" ")+e}function vp(e,n){return li(e,n.inConstruct,!0)&&!li(e,n.notInConstruct,!1)}function li(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function si(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;){const s=t.unsafe[i];if(s.character===`
|
|
18
|
+
`&&!s.before&&!s.after&&vp(t.stack,s))return/[\t ]/.test(r.before)?"":" "}return`\\
|
|
19
|
+
`}function Ep(e,n){const t=String(e);let r=t.indexOf(n),i=r,s=0,l=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>l&&(l=s):s=1,i=r+n.length,r=t.indexOf(n,i);return l}function Np(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function Ap(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function Ip(e,n,t,r){const i=Ap(t),s=e.value||"";if(Np(e,t)){const h=t.enter("codeIndented"),d=t.indentLines(s,Tp);return h(),d}const l=t.createTracker(r),o=i.repeat(Math.max(Ep(s,i)+1,3)),a=t.enter("codeFenced"),u=i==="`"?"GraveAccent":"Tilde";let c=l.move(o);if(e.lang){const h=t.enter(`codeFencedLang${u}`);c+=l.move(t.safe(e.lang,{before:c,after:" ",encode:["`"],...l.current()})),h()}if(e.lang&&e.meta){const h=t.enter(`codeFencedMeta${u}`);c+=l.move(" "),c+=l.move(t.safe(e.meta,{before:c,after:`
|
|
20
|
+
`,encode:["`"],...l.current()})),h()}return c+=l.move(`
|
|
21
|
+
`),s&&(c+=l.move(s+`
|
|
22
|
+
`)),c+=l.move(o),a(),c}function Tp(e,n,t){return(t?"":" ")+e}function tr(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function zp(e,n,t,r){const i=tr(t),s=i==='"'?"Quote":"Apostrophe",l=t.enter("definition");let o=t.enter("label");const a=t.createTracker(r);let u=a.move("[");return u+=a.move(t.safe(t.associationId(e),{before:u,after:"]",...a.current()})),u+=a.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(o=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":`
|
|
23
|
+
`,...a.current()}))),o(),e.title&&(o=t.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(t.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),o()),l(),u}function Pp(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function Tt(e){const n=e.codePointAt(0);return n===void 0?"":String.fromCodePoint(n)}function Je(e){const n=e.codePointAt(e.length-2);return n!==void 0&&n>65535?e.slice(-2):e.slice(-1)}function Tl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function oi(e,n,t){const r=Te(e),i=Te(n);return r===void 0?i===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Lp(e){if(e.charCodeAt(0)!==60)return;const n=e.charCodeAt(1);if(n===33){const o=e.charCodeAt(2);return o===45?2:o===91?5:ee(o)?4:void 0}if(n===63)return 3;const t=n===47,r=t?2:1;let i=r,s=e.charCodeAt(i);if(!ee(s))return;for(;s===45||te(s);)s=e.charCodeAt(++i);const l=e.slice(r,i).toLowerCase();return!t&&s!==47&&An.includes(l)?1:ml.includes(l)?6:7}const zl=new Map([["*",!1],["_",!0]]);function Mp(e,n,t){const r=new Set;for(const s of e){const l=t.get(s);if(l&&s.attention&&n.some(o=>o.attention===s.attention))for(const o of l.tokens)r.add(o.attention)}const i=[];for(const s of e)s.attention&&r.delete(s.attention)&&i.push(s.attention);return i.reverse(),i}function Pl(e,n,t){const r=[],i=new Map,s=new Map;let l=0;for(;l<e.length;){if(!e[l].attention){l++;continue}const o=e[l].value.charAt(0),a=zl.get(o);let u=l+1;for(;u<e.length&&e[u].attention&&e[u].value.charAt(0)===o;)u++;const c=l?e[l-1].value:n,h=Te(c.charCodeAt(c.length-1)),d=Te((u<e.length?e[u].value:t).charCodeAt(0)),p=!d||d===2&&!!h,m=!h||h===2&&!!d,y={tokens:e.slice(l,u),markers:[],start:0,end:0,open:a?p&&(!!h||!m):p,close:a?m&&(!!d||!p):m,split:a!==void 0};for(const j of y.tokens){i.set(j,[...y.tokens]),s.set(j,y);let b=j.value.length;for(;b--;)y.markers.push(j)}y.end=y.markers.length,r.push(y),l=u}for(Fp(r,i),l=-1;++l<e.length;){const o=i.get(e[l]);if(o)return{attention:Mp(e,o,s),index:l}}}function kt(e,n){const t=e[n?0:e.length-1];if(!t||t.attention)return;const r=n?Tt(t.value):Je(t.value),i=Tl(r.codePointAt(0));if(n)t.value=i+t.value.slice(r.length);else{let s=t.value.slice(0,t.value.length-r.length),l=0;for(;s.charCodeAt(s.length-1-l)===92;)l++;l%2&&(s+="\\"),t.value=s+i}}function Dp(e,n,t,r,i){for(const s of t.attention){const l=n.get(s)||s.sequences[0];for(const o of s.sequences){if(o===l)continue;const a=new Map(n);a.set(s,o);const u=Wt(e,a,r,i),c=Pl(u,r,i);if(!c||c.index>t.index)return{chosen:a,mistake:c,tokens:u}}}}function Fp(e,n){const t=new Map;for(const r of e){const i=r.tokens[0].value.charAt(0);let s=t.get(i);s||(s=[],t.set(i,s));let l=r.close?s.length:0;for(;l--&&r.start<r.end;){const o=s[l],a=o.end-o.start,u=r.end-r.start;if(r.split?(o.close||r.open)&&u%3&&!((a+u)%3):a!==o.markers.length||a!==u)continue;const c=r.split?a>1&&u>1?2:1:u,h=o.markers.slice(o.end-c,o.end),d=r.markers.slice(r.start,r.start+c),p=h[0],m=d[0];if(p===h[c-1]&&p.value.length===c&&m===d[c-1]&&m.value.length===c&&p.attention===m.attention)n.delete(p),n.delete(m);else{const y=[...new Set([...h,...d])];for(const j of y){const b=n.get(j);b&&b.push(...y)}}o.end-=c,r.start+=c,o.start===o.end&&s.splice(l,1),l=s.length}r.open&&r.start<r.end&&s.push(r)}}function _p(e,n,t){if(n.length===0)throw new Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(t.length===0)throw new Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(const i of t)if(!Number.isSafeInteger(i)||i<1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as size, expected positive integer");const r=[];for(const i of n){if(i.length!==1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!sl(i.charCodeAt(0)))throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(const s of t)r.push(i.repeat(s))}return r}function Op(e,n,t){const r=n.indexStack,i=e.children||[],s=[];let l=-1,o=t.before;r.push(-1);let a=n.createTracker(t);for(;++l<i.length;){const u=i[l];let c;if(r[r.length-1]=l,l+1<i.length){let p=n.handle.handlers[i[l+1].type];p&&p.peek&&(p=p.peek),c=p?Tt(p(i[l+1],e,n,{before:"",after:"",...a.current()})):""}else c=t.after;const h=s[s.length-1];typeof h=="string"&&(o==="\r"||o===`
|
|
24
|
+
`)&&u.type==="html"&&Lp(u.value)!==7&&(s[s.length-1]=h.replace(/(\r?\n|\r)$/," "),o=" ",a=n.createTracker(t),a.move(Jt(s,t.before,t.after)));const d=n.handle.handlers[u.type];if(d&&d.attention){const p=nr(u,d.attention,n,a);if(!p)continue;s.push(p),o=Je(p.sequences[0])}else{const p=n.handle(u,e,n,{...a.current(),after:c,before:o});if(!p)continue;a.move(p),s.push(p),o=Je(p)}}return r.pop(),s}function nr(e,n,t,r){const{construct:i,markers:s,sizes:l}=n(e,t),o=_p(e.type,s,l),a=o[0],u=t.enter(i),c=t.createTracker(r.current());c.move(a);const h=Op(e,t,{...c.current(),before:a,after:a});if(u(),h.length!==0)return r.move(a),r.move(Jt(h,a,a)),r.move(a),{children:h,sequences:o}}function ai(e,n,t,r){let i=Wt(e,n,t,r),s=Pl(i,t,r);for(;s;){const l=Dp(e,n,s,t,r);if(!l)return;n=l.chosen,i=l.tokens,s=l.mistake}return i}function Ll(e,n,t,r){let i=t,s=-1;for(;++s<e.length;){const l=e[s];if(typeof l=="string"){i="";continue}const o=s===e.length-1?r:"",a=l.sequences.find(function(u){const c=u.charAt(0);return c!==i.charAt(0)&&c!==o.charAt(0)||e.length===1&&zl.has(c)&&u.length>t.length})||l.sequences[0];a!==l.sequences[0]&&n.set(l,a),Ll(l.children,n,a,a),i=a}}function Wt(e,n,t,r){const i=[];let s,l=Je(t),o=-1;for(;++o<e.length;){const a=e[o];if(typeof a=="string"){const S={value:a,attention:void 0};s&&s===Tt(a)&&kt([S],!0),s=void 0,i.push(S),S.value&&(l=Je(S.value));continue}const u=n.get(a)||a.sequences[0],c=u.charAt(0),h=e[o+1],d=l,p=Tt(h===void 0?r:typeof h=="string"?h:n.get(h)||h.sequences[0]),m=Wt(a.children,n,u,u),y=m[0].value,j=oi(d.charCodeAt(d.length-1),y.charCodeAt(0),c);j.inside&&kt(m,!0);const b=Je(m[m.length-1].value),E=oi(p.charCodeAt(0),b.charCodeAt(b.length-1),c);E.inside&&kt(m,!1),j.outside&&d!==`
|
|
25
|
+
`&&d!=="\r"&&kt(i,!1),E.outside&&(s=p),i.push({value:u,attention:a},...m,{value:u,attention:a}),l=u.charAt(u.length-1)}return i}function Jt(e,n,t){const r=new Map;Ll(e,r,n,t);const i=(r.size>0?ai(e,r,n,t):void 0)||ai(e,new Map,n,t)||Wt(e,new Map,n,t);let s="";for(const l of i)s+=l.value;return s}rr.attention=Ml;rr.peek=Rp;function rr(e,n,t,r){const i=t.enter("phrasing"),s=nr(e,Ml,t,t.createTracker(r)),l=s?Jt([s],r.before,r.after):"";return i(),l}function Ml(e,n){return{construct:"emphasis",markers:Pp(n)==="*"?["*","_"]:["_","*"],sizes:[1]}}function Rp(e,n,t){return t.options.emphasis||"*"}function Bp(e,n){let t=!1;return Vt(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,at}),!!((!e.depth||e.depth<3)&&Bt(e)&&(n.options.setext||t))}function $p(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),s=t.createTracker(r);if(Bp(e,t)){const h=t.enter("headingSetext"),d=t.enter("phrasing"),p=t.containerPhrasing(e,{...s.current(),before:`
|
|
26
|
+
`,after:`
|
|
27
|
+
`});return d(),h(),p+`
|
|
28
|
+
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
29
|
+
`))+1))}const l="#".repeat(i),o=t.enter("headingAtx"),a=t.enter("phrasing");s.move(l+" ");let u=t.containerPhrasing(e,{before:"# ",after:`
|
|
30
|
+
`,...s.current()});const c=u.charCodeAt(0);return(c===9||c===32)&&(u=Tl(c)+u.slice(1)),u=u?l+" "+u:l,t.options.closeAtx&&(u+=" "+l),a(),o(),u}Dl.peek=Hp;function Dl(e){return e.value||""}function Hp(){return"<"}Fl.peek=Up;function Fl(e,n,t,r){const i=tr(t),s=i==='"'?"Quote":"Apostrophe",l=t.enter("image");let o=t.enter("label");const a=t.createTracker(r);let u=a.move("![");return u+=a.move(t.safe(e.alt,{before:u,after:"]",...a.current()})),u+=a.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(o=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),o(),e.title&&(o=t.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(t.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),o()),u+=a.move(")"),l(),u}function Up(){return"!"}_l.peek=qp;function _l(e,n,t,r){const i=e.referenceType,s=t.enter("imageReference");let l=t.enter("label");const o=t.createTracker(r);let a=o.move("![");const u=t.safe(e.alt,{before:a,after:"]",...o.current()});a+=o.move(u+"]["),l();const c=t.stack;t.stack=c.filter(function(d){return d!=="phrasing"}),l=t.enter("reference");const h=t.safe(t.associationId(e),{before:a,after:"]",...o.current()});return l(),t.stack=c,s(),i==="full"||!u||u!==h?a+=o.move(h+"]"):i==="shortcut"?a=a.slice(0,-1):a+=o.move("]"),a}function qp(){return"!"}Ol.peek=Vp;function Ol(e,n,t){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<t.unsafe.length;){const l=t.unsafe[s],o=t.compilePattern(l);if(!l.atBreak)continue;let a;for(;a=o.exec(r);){let u=a.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(a.index+1)}}return i+r+i}function Vp(){return"`"}function Rl(e,n){const t=Bt(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(t===e.url||"mailto:"+t===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Bl.peek=Wp;function Bl(e,n,t,r){const i=tr(t),s=i==='"'?"Quote":"Apostrophe",l=t.createTracker(r);if(Rl(e,t)){const m=t.stack;t.stack=m.filter(function(b){return b!=="phrasing"});const y=t.enter("autolink");let j=l.move("<");return j+=l.move(t.containerPhrasing(e,{before:j,after:">",...l.current()})),j+=l.move(">"),y(),t.stack=m,j}const o=t.enter("link");let a=t.enter("label"),u=l.move("[");const c=t.containerPhrasing(e,{before:u,after:"](",...l.current()});u+=l.move(c),a(),u+=l.move("](");const h=/[\0- \u007F]/.test(e.url),d=r.before.charAt(r.before.length-1);let p=e.title||void 0;if(!p&&!h&&(d===`
|
|
31
|
+
`||d==="\r")){let m=0;for(;m<c.length&&c.charCodeAt(m)!==93;)m+=c.charCodeAt(m)===92?2:1;c.charCodeAt(m+1)===58&&(p="")}return!e.url&&typeof p=="string"||h?(a=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:typeof p=="string"?" ":")",...l.current()}))),a(),typeof p=="string"&&(a=t.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(t.safe(p,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),o(),u}function Wp(e,n,t){return Rl(e,t)?"<":"["}$l.peek=Jp;function $l(e,n,t,r){const i=e.referenceType,s=t.enter("linkReference");let l=t.enter("label");const o=t.createTracker(r);let a=o.move("[");const u=t.containerPhrasing(e,{before:a,after:"]",...o.current()});a+=o.move(u+"]["),l();const c=t.stack;t.stack=c.filter(function(d){return d!=="phrasing"}),l=t.enter("reference");const h=t.safe(t.associationId(e),{before:a,after:"]",...o.current()});return l(),t.stack=c,s(),i==="full"||!u||u!==h?a+=o.move(h+"]"):i==="shortcut"?a=a.slice(0,-1):a+=o.move("]"),a}function Jp(){return"["}function ir(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Kp(e){const n=ir(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Gp(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function Hl(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Xp(e,n,t,r){const i=t.enter("list"),s=t.bulletCurrent;let l=e.ordered?Gp(t):ir(t);const o=e.ordered?l==="."?")":".":Kp(t);let a=n&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!e.ordered){const c=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&c&&(!c.children||!c.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(a=!0),Hl(t)===l&&c){let h=-1;for(;++h<e.children.length;){const d=e.children[h];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){a=!0;break}}}}a&&(l=o),t.bulletCurrent=l;const u=t.containerFlow(e,r);return t.bulletLastUsed=l,t.bulletCurrent=s,i(),u}function Yp(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function Qp(e,n,t,r){const i=Yp(t);let s=t.bulletCurrent||ir(t);n&&n.type==="list"&&n.ordered&&(s=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+s);let l=s.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(l=Math.ceil(l/4)*4);const o=t.createTracker(r);o.move(s+" ".repeat(l-s.length)),o.shift(l);const a=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),c);return a(),u;function c(h,d,p){return d?(p?"":" ".repeat(l))+h:(p?s:s+" ".repeat(l-s.length))+h}}function Zp(e,n,t,r){const i=t.enter("paragraph"),s=t.enter("phrasing"),l=t.containerPhrasing(e,r);return s(),i(),l}function ed(e,n,t,r){if(!e.children.some(function(o){return Sp(o)}))return t.containerFlow(e,r);const s=t.enter("phrasing"),l=t.containerPhrasing(e,r);return s(),l}function td(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}lr.attention=Ul;lr.peek=nd;function lr(e,n,t,r){const i=t.enter("phrasing"),s=nr(e,Ul,t,t.createTracker(r)),l=s?Jt([s],r.before,r.after):"";return i(),l}function Ul(e,n){return{construct:"strong",markers:td(n)==="*"?["*","_"]:["_","*"],sizes:[2]}}function nd(e,n,t){return t.options.strong||"*"}function rd(e,n,t,r){const i=n?n.children:[],s=t.indexStack[t.indexStack.length-1];return t.safe(e.value,{...r,afterNode:i[s+1],beforeNode:i[s-1]})}function id(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function ld(e,n,t){const r=(Hl(t)+(t.options.ruleSpaces?" ":"")).repeat(id(t));return t.options.ruleSpaces?r.slice(0,-1):r}const Dn={blockquote:Cp,break:si,code:Ip,definition:zp,emphasis:rr,hardBreak:si,heading:$p,html:Dl,image:Fl,imageReference:_l,inlineCode:Ol,link:Bl,linkReference:$l,list:Xp,listItem:Qp,paragraph:Zp,root:ed,strong:lr,text:rd,thematicBreak:ld};function sd(){return{enter:{table:od,tableData:ui,tableHeader:ui,tableRow:ud},exit:{codeText:cd,table:ad,tableData:pn,tableHeader:pn,tableRow:pn}}}function od(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[],position:void 0},e),this.data.inTable=!0}function ad(e){this.exit(e),this.data.inTable=void 0}function ud(e){this.enter({type:"tableRow",children:[],position:void 0},e)}function pn(e){this.exit(e)}function ui(e){this.enter({type:"tableCell",children:[],position:void 0},e)}function cd(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,fd));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function fd(e,n){return n==="|"?n:e}function hd(e){const n=e||{},{tableCellPadding:t,tablePipeAlign:r,stringLength:i}=n,s=t?" ":"|";return{handlers:{inlineCode:d,table:l,tableCell:a,tableRow:o},join:[pd],unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
32
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}]};function l(p,m,y,j){const b=c(p,y,j),E=b[0];if(E){let S=p.align?p.align.length:0,v=-1;if(!S)for(;++v<b.length;)b[v].length>S&&(S=b[v].length);for(;E.length<S;)E.push("")}return u(b,p.align)}function o(p,m,y,j){const b=h(p,y,j),E=u([b]);return E.slice(0,E.indexOf(`
|
|
33
|
+
`))}function a(p,m,y,j){const b=y.enter("tableCell"),E=y.enter("phrasing"),S=y.containerPhrasing(p,{...j,before:s,after:s});return E(),b(),S}function u(p,m){return kp(p,{align:m,alignDelimiters:r,fillRows:!1,padding:t,stringLength:i})}function c(p,m,y){const{children:j}=p;let b=-1;const E=[],S=m.enter("table");for(;++b<j.length;)E[b]=h(j[b],m,y);return S(),E}function h(p,m,y){const{children:j}=p;let b=-1;const E=[],S=m.enter("tableRow");for(;++b<j.length;)E[b]=a(j[b],p,m,y);return S(),E}function d(p,m,y){const j=Dn.inlineCode(p,m,y);if(!y.stack.includes("tableCell"))return j;const b=[];let E=0,S=j.indexOf("|");for(;S!==-1;){let v=S;for(;v>E&&j.charCodeAt(v-1)===92;)v--;b.push(j.slice(E,S)),(S-v)%2===0&&b.push("\\"),E=S,S=j.indexOf("|",S+1)}return b.push(j.slice(E)),b.join("")}}function pd(e,n,t,r){if(e.type==="table"&&t.type==="listItem"&&t.spread===!1&&(n.type==="definition"||n.type==="heading"&&dd(n,r)||n.type==="paragraph"||n.type==="table"))return 1}function dd(e,n){let t=!1;return Vt(e,function(r){if(r.type==="break"||"value"in r&&/\r?\n|\r/.test(r.value))return t=!0,at}),!!((!e.depth||e.depth<3)&&Bt(e)&&(n.options.setext||t))}function md(){return{exit:{taskListCheckValueChecked:ci,taskListCheckValueUnchecked:ci,paragraph:xd}}}function gd(){return{handlers:{paragraph:yd},join:[bd]}}function ci(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function xd(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=n.children;let s=-1,l;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){l=o;break}}l===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start={...r.position.start}))}}this.exit(e)}function yd(e,n,t,r){if(!n||n.type!=="listItem"||ql(n)!==e)return Dn.paragraph(e,n,t,r);const i="["+(n.checked?"x":" ")+"] ",s=t.createTracker(r);s.move(i);const l=Dn.paragraph(e.children.length>0?e:{type:"paragraph",children:[{type:"text",value:" "}]},n,t,{...r,...s.current()});return i+l}function bd(e,n,t){if(!(e.type==="definition"&&t.type==="listItem"))return;const r=ql(t);if(r&&t.children.indexOf(e)<t.children.indexOf(r))return 0}function ql(e){if(typeof e.checked=="boolean")for(const n of e.children){if(n.type==="paragraph")return n;if(n.type!=="definition")return}}function kd(){return[Rh(),up(),pp(),sd(),md()]}function wd(e){return{extensions:[Bh(),cp(e),dp(),hd(e),gd()]}}const Sd={tokenize:Ad,partial:!0},Vl={tokenize:Id,partial:!0},Wl={tokenize:Td,partial:!0},Jl={tokenize:zd,partial:!0},Cd={tokenize:Pd,partial:!0},Kl={name:"wwwAutolink",tokenize:Ed,previous:Xl},Gl={name:"protocolAutolink",tokenize:Nd,previous:Yl},je={name:"emailAutolink",tokenize:vd,previous:Ql},ke={};function jd(){return{text:ke}}let Pe=48;for(;Pe<123;)ke[Pe]=je,Pe++,Pe===58?Pe=65:Pe===91&&(Pe=97);ke[43]=je;ke[45]=je;ke[46]=je;ke[95]=je;ke[72]=[je,Gl];ke[104]=[je,Gl];ke[87]=[je,Kl];ke[119]=[je,Kl];function vd(e,n,t){const r=this;let i,s;return l;function l(h){return!Fn(h)||!Ql.call(r,r.previous)||sr(r.events)?t(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(h))}function o(h){return Fn(h)?(e.consume(h),o):h===64?(e.consume(h),a):t(h)}function a(h){return h===46?e.check(Cd,c,u)(h):h===45||h===95||te(h)?(s=!0,e.consume(h),a):c(h)}function u(h){return e.consume(h),i=!0,a}function c(h){return s&&i&&ee(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(h)):t(h)}}function Ed(e,n,t){const r=this;return i;function i(l){return l!==87&&l!==119||!Xl.call(r,r.previous)||sr(r.events)?t(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Sd,e.attempt(Vl,e.attempt(Wl,s),t),t)(l))}function s(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function Nd(e,n,t){const r=this;let i="",s=!1;return l;function l(h){return(h===72||h===104)&&Yl.call(r,r.previous)&&!sr(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),o):t(h)}function o(h){if(ee(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),o;if(h===58){const d=i.toLowerCase();if(d==="http"||d==="https")return e.consume(h),a}return t(h)}function a(h){return h===47?(e.consume(h),s?u:(s=!0,a)):t(h)}function u(h){return h===null||Et(h)||V(h)||_e(h)||dt(h)?t(h):e.attempt(Vl,e.attempt(Wl,c),t)(h)}function c(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(h)}}function Ad(e,n,t){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),s):t(l)}function s(l){return l===null?t(l):n(l)}}function Id(e,n,t){let r,i,s;return l;function l(u){return u===46||u===95?e.check(Jl,a,o)(u):u===null||V(u)||_e(u)||u!==45&&dt(u)?a(u):(s=!0,e.consume(u),l)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),l}function a(u){return i||r||!s?t(u):n(u)}}function Td(e,n){let t=0,r=0;return i;function i(l){return l===40?(t++,e.consume(l),i):l===41&&r<t?s(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Jl,n,s)(l):l===null||V(l)||_e(l)?n(l):(e.consume(l),i)}function s(l){return l===41&&r++,e.consume(l),i}}function zd(e,n,t){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||V(o)||_e(o)?n(o):t(o)}function i(o){return o===null||o===40||o===91||V(o)||_e(o)?n(o):r(o)}function s(o){return ee(o)?l(o):t(o)}function l(o){return o===59?(e.consume(o),r):ee(o)?(e.consume(o),l):t(o)}}function Pd(e,n,t){return r;function r(s){return e.consume(s),i}function i(s){return te(s)?t(s):n(s)}}function Xl(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||V(e)}function Yl(e){return!ee(e)}function Ql(e){return!(e===47||Fn(e))}function Fn(e){return e===43||e===45||e===46||e===95||te(e)}function sr(e){let n=e.length,t=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){t=!0;break}if(r._gfmAutolinkLiteralWalkedInto){t=!1;break}}return e.length>0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const Ld={tokenize:$d,partial:!0};function Md(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Od,continuation:{tokenize:Rd},exit:Bd}},text:{91:{name:"gfmFootnoteCall",tokenize:_d},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Dd,resolveTo:Fd}}}}function Dd(e,n,t){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const a=r.events[i][1];if(a.type==="labelImage"){l=a;break}if(a.type==="gfmFootnoteCall"||a.type==="labelLink"||a.type==="label"||a.type==="image"||a.type==="link")break}return o;function o(a){if(!l||!l._balanced)return t(a);const u=xe(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?t(a):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),n(a))}}function Fd(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",s,n],["enter",l,n],["exit",l,n],["exit",s,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function _d(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,l;return o;function o(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),a}function a(h){return h!==94?t(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(h){if(s>999||h===93&&!l||h===null||h===91||V(h))return t(h);if(h===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return i.includes(xe(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(h)}return V(h)||(l=!0),s++,e.consume(h),h===92?c:u}function c(h){return h===91||h===92||h===93?(e.consume(h),s++,u):u(h)}}function Od(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,l=0,o;return a;function a(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):t(m)}function c(m){if(l>999||m===93&&!o||m===null||m===91||V(m))return t(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return s=xe(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return V(m)||(o=!0),l++,e.consume(m),m===92?h:c}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,c):c(m)}function d(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),U(e,p,"gfmFootnoteDefinitionWhitespace")):t(m)}function p(m){return n(m)}}function Rd(e,n,t){return e.check(mt,n,e.attempt(Ld,n,t))}function Bd(e){e.exit("gfmFootnoteDefinition")}function $d(e,n,t){const r=this;return U(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?n(s):t(s)}}function Hd(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,o){let a=-1;for(;++a<l.length;)if(l[a][0]==="enter"&&l[a][1].type==="strikethroughSequenceTemporary"&&l[a][1]._close){let u=a;for(;u--;)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[a][1].end.offset-l[a][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[a][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[a][1].end)},h={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[a][1].start)},d=[["enter",c,o],["enter",l[u][1],o],["exit",l[u][1],o],["enter",h,o]],p=o.parser.constructs.insideSpan.null;p&&ge(d,d.length,0,$t(p,l.slice(u+1,a),o)),ge(d,d.length,0,[["exit",h,o],["enter",l[a][1],o],["exit",l[a][1],o],["exit",c,o]]),ge(l,u-1,a-u+3,d),a=u+d.length-2;break}}for(a=-1;++a<l.length;)l[a][1].type==="strikethroughSequenceTemporary"&&(l[a][1].type="data");return l}function s(l,o,a){const u=this.previous,c=this.events;let h=0;return d;function d(m){return u===126&&c[c.length-1][1].type!=="characterEscape"?a(m):(l.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const y=Te(u);if(m===126)return h>1?a(m):(l.consume(m),h++,p);if(h<2&&!t)return a(m);const j=l.exit("strikethroughSequenceTemporary"),b=Te(m);return j._open=!b||b===2&&!!y,j._close=!y||y===2&&!!b,o(m)}}}class Ud{constructor(){this.map=[],this.index=new Map}add(n,t,r){qd(this,n,t,r)}consume(n){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let i=r.pop();for(;i;){for(const s of i)n.push(s);i=r.pop()}this.map.length=0,this.index.clear()}}function qd(e,n,t,r){if(t===0&&r.length===0)return;const i=e.index.get(n);if(i){i[1]+=t,i[2].push(...r);return}const s=[n,t,r];e.map.push(s),e.index.set(n,s)}function Vd(e,n){let t=!1;const r=[];for(;n<e.length;){const i=e[n];if(t){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);n+=1}return r}function Wd(){return{flow:{null:{name:"table",tokenize:Jd,resolveAll:Kd}}}}function Jd(e,n,t){const r=this;let i=0,s=0,l;return o;function o(k){let I=r.events.length-1;for(;I>-1;){const{type:J}=r.events[I][1];if(J==="lineEnding"||J==="linePrefix")I--;else break}const L=I>-1?r.events[I][1].type:null,R=L==="tableHead"||L==="tableRow"?w:a;return R===w&&r.parser.lazy[r.now().line]?t(k):R(k)}function a(k){return e.enter("tableHead"),e.enter("tableRow"),u(k)}function u(k){return k===124||(l=!0,s+=1),c(k)}function c(k){return k===null?t(k):D(k)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),p):t(k):$(k)?U(e,c,"whitespace")(k):(s+=1,l&&(l=!1,i+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),l=!0,c):(e.enter("data"),h(k)))}function h(k){return k===null||k===124||V(k)?(e.exit("data"),c(k)):(e.consume(k),k===92?d:h)}function d(k){return k===92||k===124?(e.consume(k),h):h(k)}function p(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(k):(e.enter("tableDelimiterRow"),l=!1,$(k)?U(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):m(k))}function m(k){return k===45||k===58?j(k):k===124?(l=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),y):N(k)}function y(k){return $(k)?U(e,j,"whitespace")(k):j(k)}function j(k){return k===58?(s+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),b):k===45?(s+=1,b(k)):k===null||D(k)?v(k):N(k)}function b(k){return k===45?(e.enter("tableDelimiterFiller"),E(k)):N(k)}function E(k){return k===45?(e.consume(k),E):k===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(k))}function S(k){return $(k)?U(e,v,"whitespace")(k):v(k)}function v(k){return k===124?m(k):k===null||D(k)?!l||i!==s?N(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(k)):N(k)}function N(k){return t(k)}function w(k){return e.enter("tableRow"),P(k)}function P(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),P):k===null||D(k)?(e.exit("tableRow"),n(k)):$(k)?U(e,P,"whitespace")(k):(e.enter("data"),M(k))}function M(k){return k===null||k===124||V(k)?(e.exit("data"),P(k)):(e.consume(k),k===92?F:M)}function F(k){return k===92||k===124?(e.consume(k),M):M(k)}}function Kd(e,n){let t=-1,r=!0,i=0,s=[0,0,0,0],l=[0,0,0,0],o=!1,a=0,u,c,h;const d=new Ud;for(;++t<e.length;){const p=e[t],m=p[1];p[0]==="enter"?m.type==="tableHead"?(o=!1,a!==0&&(fi(d,n,a,u,c),c=void 0,a=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},d.add(t,0,[["enter",u,n]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,h=void 0,s=[0,0,0,0],l=[0,t+1,0,0],o&&(o=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},d.add(t,0,[["enter",c,n]])),i=m.type==="tableDelimiterRow"?2:c?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],h=wt(d,n,s,i,void 0,h),s=[0,0,0,0]),l[2]=t)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(l[0]=l[1],h=wt(d,n,s,i,void 0,h)),s=l,l=[s[1],t,0,0])):m.type==="tableHead"?(o=!0,a=t):m.type==="tableRow"||m.type==="tableDelimiterRow"?(a=t,s[1]!==0?(l[0]=l[1],h=wt(d,n,s,i,t,h)):l[1]!==0&&(h=wt(d,n,l,i,t,h)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(l[3]=t)}for(a!==0&&fi(d,n,a,u,c),d.consume(n.events),t=-1;++t<n.events.length;){const p=n.events[t];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=Vd(n.events,t))}return e}function wt(e,n,t,r,i,s){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";t[0]!==0&&(s.end=Object.assign({},qe(n.events,t[0])),e.add(t[0],0,[["exit",s,n]]));const a=qe(n.events,t[1]);if(s={type:l,start:Object.assign({},a),end:Object.assign({},a)},e.add(t[1],0,[["enter",s,n]]),t[2]!==0){const u=qe(n.events,t[2]),c=qe(n.events,t[3]),h={type:o,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(t[2],0,[["enter",h,n]]),r!==2){const d=n.events[t[2]],p=n.events[t[3]];if(d[1].end=Object.assign({},p[1].end),d[1].type="chunkText",d[1].contentType="text",t[3]>t[2]+1){const m=t[2]+1,y=t[3]-t[2]-1;e.add(m,y,[])}}e.add(t[3]+1,0,[["exit",h,n]])}return i!==void 0&&(s.end=Object.assign({},qe(n.events,i)),e.add(i,0,[["exit",s,n]]),s=void 0),s}function fi(e,n,t,r,i){const s=[],l=qe(n.events,t);i&&(i.end=Object.assign({},l),s.push(["exit",i,n])),r.end=Object.assign({},l),s.push(["exit",r,n]),e.add(t+1,0,s)}function qe(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const Gd={name:"tasklistCheck",tokenize:Yd};function Xd(){return{text:{91:Gd}}}function Yd(e,n,t){const r=this;return i;function i(a){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(a):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),s)}function s(a){return V(a)?(e.enter("taskListCheckValueUnchecked"),e.consume(a),e.exit("taskListCheckValueUnchecked"),l):a===88||a===120?(e.enter("taskListCheckValueChecked"),e.consume(a),e.exit("taskListCheckValueChecked"),l):t(a)}function l(a){return a===93?(e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(a)}function o(a){return D(a)?n(a):$(a)?e.check({tokenize:Qd},n,t)(a):t(a)}}function Qd(e,n,t){return U(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function Zd(e){return il([jd(),Md(),Hd(e),Wd(),Xd()])}const em={};function tm(e){const n=this,t=e||em,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Zd(t)),s.push(kd()),l.push(wd(t))}const Le=()=>`${window.routePrefix??""}/docs/api`,nm=e=>`${window.routePrefix??""}/docs/${encodeURIComponent(e)}`,zt={list:async(e,n)=>{const{data:t}=await Z.getJson(`${Le()}/list`,{params:{locale:e},signal:n});return t.documents??[]},keywords:async(e,n)=>{const{data:t}=await Z.getJson(`${Le()}/keywords`,{params:{locale:e},signal:n});return t.keywords??{}},search:async(e,n)=>{const{data:t}=await Z.getJson(`${Le()}/search`,{params:{q:e.query||void 0,keywords:e.keywords?.length?e.keywords.join(","):void 0,url:e.url||void 0,model:e.model||void 0,locale:e.locale||void 0},signal:n});return t.results??[]},context:async(e,n,t,r)=>{const{data:i}=await Z.getJson(`${Le()}/context`,{params:{url:e,model:n,locale:t},signal:r});return i.documents??[]},doc:async(e,n,t)=>{const{data:r}=await Z.getJson(`${Le()}/doc/${encodeURIComponent(e)}`,{params:{locale:n},signal:t});return r},resolve:async(e,n,t)=>{if(n.length===0)return{};const{data:r}=await Z.getJson(`${Le()}/resolve`,{params:{from:e,refs:n.join(",")},signal:t});return r.resolved??{}},schema:async(e,n)=>{const{data:t}=await Z.getJson(`${Le()}/schema`,{params:{model:e},signal:n});return t}},Ct=e=>e.trim().toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,""),Rm=e=>{const n=[];let t=!1;for(const r of e.split(`
|
|
34
|
+
`)){if(/^\s*(```|~~~)/.test(r)){t=!t;continue}if(t)continue;const i=/^(#{2,3})\s+(.+?)\s*#*\s*$/.exec(r);if(!i)continue;const s=i[2].replace(/[*_`]/g,"").trim();n.push({depth:i[1].length,title:s,slug:Ct(s)})}return n},rm=e=>{const n=new Set,t=/\]\(\s*([^)\s]+)/g;let r;for(;(r=t.exec(e))!==null;){const i=r[1];!i||i.startsWith("#")||i.startsWith("/")||/^[a-z][a-z0-9+.-]*:/i.test(i)||i.startsWith("//")||n.add(i)}return[...n]},Ve=e=>e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(Ve).join(""):A.isValidElement(e)?Ve(e.props.children):"",im=()=>typeof document<"u"&&document.documentElement.classList.contains("dark"),lm=()=>{const[e,n]=A.useState(!1);return{isCopied:e,copy:r=>{!r||typeof navigator>"u"||!navigator.clipboard||navigator.clipboard.writeText(r).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)},()=>{})}}},sm=({code:e})=>{const[n,t]=A.useState(null),[r,i]=A.useState(!1),s=A.useId().replace(/[^a-zA-Z0-9]/g,"");return A.useEffect(()=>{let l=!1;return t(null),i(!1),Co(()=>import("./mermaid.core-dItKH28w.js").then(o=>o.bi),__vite__mapDeps([0,1,2,3]),import.meta.url).then(async({default:o})=>{o.initialize({startOnLoad:!1,securityLevel:"strict",theme:im()?"dark":"default"});const a=await o.render(`mermaid-${s}`,e);l||t(a.svg)}).catch(()=>{l||i(!0)}),()=>{l=!0}},[e,s]),r?f.jsx("pre",{className:"aui-md-pre border-border/50 bg-muted/30 overflow-x-auto rounded-xl border p-3.5 text-[13px]",children:e}):n?f.jsx("div",{className:"my-3 flex justify-center overflow-x-auto rounded-xl border p-3 [&_svg]:max-w-full",dangerouslySetInnerHTML:{__html:n}}):f.jsx("div",{className:"bg-muted/30 text-muted-foreground my-3 rounded-xl border p-4 text-sm",children:"…"})},om=({source:e})=>{const[n,t]=A.useState(null),[r,i]=A.useState(null),[s,l]=A.useState(!1),o=A.useMemo(()=>{try{const a=JSON.parse(e);return a&&typeof a=="object"?a:null}catch{return null}},[e]);return A.useEffect(()=>{if(!o){l(!0);return}if(o.fields){t(o.fields),i(o.title??null);return}if(!o.model){l(!0);return}const a=new AbortController;return zt.schema(o.model,a.signal).then(u=>{a.signal.aborted||(t(u.fields),i(o.title??u.title))}).catch(()=>{a.signal.aborted||l(!0)}),()=>a.abort()},[o]),s?f.jsx("pre",{className:"aui-md-pre border-border/50 bg-muted/30 overflow-x-auto rounded-xl border p-3.5 text-[13px]",children:e}):f.jsx(Ui,{className:"my-3",fields:n,title:r,loading:!n})},am=({language:e,code:n})=>{const{isCopied:t,copy:r}=lm();return f.jsxs("div",{className:"my-3",children:[f.jsxs("div",{className:"border-border/50 bg-muted/50 flex items-center justify-between rounded-t-xl border border-b-0 px-3.5 py-1.5 text-xs",children:[f.jsx("span",{className:"text-muted-foreground font-medium lowercase",children:e}),f.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground transition-colors",onClick:()=>r(n),"aria-label":"Copy",children:t?f.jsx(bi,{className:"size-3.5"}):f.jsx(jo,{className:"size-3.5"})})]}),f.jsx("pre",{className:"aui-md-pre border-border/50 bg-muted/30 overflow-x-auto rounded-b-xl border border-t-0 p-3.5 text-[13px] leading-relaxed",children:f.jsx("code",{children:n})})]})};function um({markdown:e,docLinks:n={},onDocLink:t,className:r}){const i=A.useMemo(()=>({h1:({className:s,children:l,...o})=>f.jsx("h1",{id:Ct(Ve(l)),className:G("aui-md-h1 mt-6 mb-3 scroll-mt-20 text-2xl font-semibold first:mt-0",s),...o,children:l}),h2:({className:s,children:l,...o})=>f.jsx("h2",{id:Ct(Ve(l)),className:G("aui-md-h2 mt-6 mb-2 scroll-mt-20 text-xl font-semibold first:mt-0",s),...o,children:l}),h3:({className:s,children:l,...o})=>f.jsx("h3",{id:Ct(Ve(l)),className:G("aui-md-h3 mt-5 mb-2 scroll-mt-20 text-lg font-semibold first:mt-0",s),...o,children:l}),h4:({className:s,...l})=>f.jsx("h4",{className:G("aui-md-h4 mt-4 mb-1.5 text-base font-medium first:mt-0",s),...l}),p:({className:s,...l})=>f.jsx("p",{className:G("aui-md-p my-3 leading-relaxed first:mt-0 last:mb-0",s),...l}),a:({className:s,href:l,children:o,...a})=>{const u=(l??"").trim(),c=G("aui-md-a text-primary hover:text-primary/80 underline underline-offset-2",s);if(u.startsWith("#"))return f.jsx("a",{className:c,href:u,...a,children:o});if(/^[a-z][a-z0-9+.-]*:/i.test(u)||u.startsWith("//"))return f.jsx("a",{className:c,href:u,target:"_blank",rel:"noreferrer",...a,children:o});if(u.startsWith("/"))return f.jsx("a",{className:c,href:u,onClick:p=>{p.button!==0||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey||(p.preventDefault(),ht.visit(u))},...a,children:o});const d=n[u]??n[u.replace(/#.*$/,"")];return!d||!t?f.jsx("span",{className:G("text-foreground",s),children:o}):f.jsx("a",{className:c,href:nm(d),onClick:p=>{p.button!==0||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey||(p.preventDefault(),t(d))},...a,children:o})},blockquote:({className:s,...l})=>f.jsx("blockquote",{className:G("aui-md-blockquote border-muted-foreground/30 text-muted-foreground my-3 border-s-2 ps-4",s),...l}),ul:({className:s,...l})=>f.jsx("ul",{className:G("aui-md-ul marker:text-muted-foreground my-3 ms-5 list-disc [&>li]:mt-1",s),...l}),ol:({className:s,...l})=>f.jsx("ol",{className:G("aui-md-ol marker:text-muted-foreground my-3 ms-5 list-decimal [&>li]:mt-1",s),...l}),li:({className:s,...l})=>f.jsx("li",{className:G("aui-md-li leading-relaxed",s),...l}),hr:({className:s,...l})=>f.jsx("hr",{className:G("aui-md-hr border-muted-foreground/20 my-4",s),...l}),table:({className:s,...l})=>f.jsx("div",{className:"my-3 overflow-x-auto",children:f.jsx("table",{className:G("aui-md-table w-full border-separate border-spacing-0 text-sm",s),...l})}),th:({className:s,...l})=>f.jsx("th",{className:G("aui-md-th bg-muted px-3 py-1.5 text-start font-medium first:rounded-ss-lg last:rounded-se-lg",s),...l}),td:({className:s,...l})=>f.jsx("td",{className:G("aui-md-td border-muted-foreground/20 border-s border-b px-3 py-1.5 text-start last:border-e",s),...l}),tr:({className:s,...l})=>f.jsx("tr",{className:G("aui-md-tr m-0 border-b p-0 first:border-t",s),...l}),img:({className:s,...l})=>f.jsx("img",{className:G("my-3 max-w-full rounded-lg border",s),...l}),code:({className:s,...l})=>f.jsx("code",{className:G("aui-md-inline-code bg-muted rounded-md px-1.5 py-0.5 font-mono text-[0.85em]",s),...l}),pre:({children:s})=>{const l=Array.isArray(s)?s[0]:s;if(!A.isValidElement(l))return f.jsx("pre",{className:"aui-md-pre border-border/50 bg-muted/30 my-3 overflow-x-auto rounded-xl border p-3.5 text-[13px]",children:s});const o=/language-([\w-]+)/.exec(l.props.className??"")?.[1]??"",a=Ve(l.props.children).replace(/\n$/,"");return o==="mermaid"?f.jsx(sm,{code:a}):o==="schema"?f.jsx(om,{source:a}):f.jsx(am,{language:o||"text",code:a})}}),[n,t]);return f.jsx("div",{className:G("aui-md text-sm",r),children:f.jsx(Ih,{remarkPlugins:[tm],components:i,children:e})})}function cm(e,n){const[t,r]=A.useState(null),[i,s]=A.useState({}),[l,o]=A.useState(!1),[a,u]=A.useState(!1);return A.useEffect(()=>{if(!e){r(null),s({}),u(!1);return}const c=new AbortController;return o(!0),u(!1),zt.doc(e,n,c.signal).then(async h=>{if(c.signal.aborted)return;r(h);const d=rm(h.markdown),p=d.length>0?await zt.resolve(h.meta.id,d,c.signal).catch(()=>({})):{};c.signal.aborted||s(p)}).catch(()=>{c.signal.aborted||(r(null),u(!0))}).finally(()=>{c.signal.aborted||o(!1)}),()=>c.abort()},[e,n]),{content:t,docLinks:i,loading:l,error:a}}const fm="adminizer:ai-attach-doc";function hm(e){window.__adminizerAttachDoc__=e,window.dispatchEvent(new CustomEvent(fm,{detail:e}))}const ut="info",hi=()=>{if(typeof window>"u")return{open:!1,docId:null};const e=window.location.hash.replace(/^#/,"");return e===ut?{open:!0,docId:null}:e.startsWith(`${ut}=`)?{open:!0,docId:decodeURIComponent(e.slice(ut.length+1))||null}:{open:!1,docId:null}},pm=e=>{const{pathname:n,search:t}=window.location;window.history.pushState(null,"",`${n}${t}${e}`),window.dispatchEvent(new HashChangeEvent("hashchange"))},dm=()=>{const[e,n]=A.useState(hi);return A.useEffect(()=>{const t=()=>n(hi());window.addEventListener("hashchange",t),window.addEventListener("popstate",t);const r=ht.on("navigate",t);return()=>{window.removeEventListener("hashchange",t),window.removeEventListener("popstate",t),r()}},[]),e},mm=()=>{const e=ie();return A.useMemo(()=>{const n=window.routePrefix??"",t=(e.url||window.location.pathname).split(/[?#]/)[0],r=n&&t.startsWith(n)?t.slice(n.length):t,i=/^\/model\/([^/]+)/.exec(r);return i?decodeURIComponent(i[1]):null},[e.url])};function gm({open:e,docId:n,items:t,model:r,onOpenDoc:i,onClose:s}){const{t:l,locale:o}=Ke(),{isEnabled:a,openChat:u}=Ot(),[c,h]=A.useState(void 0),{content:d,docLinks:p,loading:m,error:y}=cm(e?n:null,c??o),[j,b]=A.useState(null),[E,S]=A.useState(!1),[v,N]=A.useState("docs");A.useEffect(()=>h(void 0),[n]),A.useEffect(()=>{if(!e||!r)return;const F=new AbortController;return b(null),S(!1),zt.schema(r,F.signal).then(k=>{F.signal.aborted||b(k)}).catch(()=>{F.signal.aborted||S(!0)}),()=>F.abort()},[r,e]);const w=A.useMemo(()=>{const F=new Map;for(const k of t){const I=k.section??"";F.set(I,[...F.get(I)??[],k])}return[...F.entries()]},[t]),P=A.useRef(!1),M=()=>{d&&(P.current=!0,s(),u(),hm({id:d.meta.id,title:d.meta.title}))};return f.jsx(Eo,{open:e,onOpenChange:F=>!F&&s(),children:f.jsxs(No,{side:"right",className:"z-[1002] w-full gap-0 p-0 sm:max-w-xl",onCloseAutoFocus:F=>{P.current&&(P.current=!1,F.preventDefault())},children:[f.jsxs(Ao,{className:"border-b px-4 py-3",children:[f.jsxs("div",{className:"flex items-center gap-2 pe-8",children:[n&&f.jsx(re,{variant:"ghost",size:"icon",className:"-ms-2 shrink-0",onClick:()=>i(null),"aria-label":l("Back to contents"),children:f.jsx(Io,{className:"size-4"})}),f.jsx(To,{className:"truncate",children:n?d?.meta.title??l("Documentation"):l("Page documentation")})]}),f.jsx(zo,{className:"sr-only",children:l("Documentation")})]}),f.jsxs(Po,{value:r?v:"docs",onValueChange:N,className:"flex min-h-0 flex-1 flex-col gap-0",children:[r&&f.jsxs(Lo,{className:"mx-4 mt-3 w-fit",children:[f.jsx(xr,{value:"docs",children:l("Documentation")}),f.jsx(xr,{value:"schema",children:l("Schema")})]}),f.jsx(yr,{value:"docs",className:"min-h-0 flex-1 overflow-y-auto px-4 py-3",children:n?m&&!d?f.jsx("p",{className:"text-muted-foreground text-sm",children:l("Loading...")}):y||!d?f.jsx("p",{className:"text-muted-foreground text-sm",children:l("Failed to load documentation")}):f.jsxs("div",{className:"flex flex-col gap-3",children:[(d.meta.locales?.length??0)>1&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("span",{className:"text-muted-foreground text-xs",children:l("Language")}),d.meta.locales?.map(F=>f.jsx("button",{type:"button",onClick:()=>h(F),className:G("rounded-full border px-2 py-0.5 text-xs uppercase transition-colors",F===d.locale?"bg-primary text-primary-foreground border-transparent":"hover:bg-accent"),children:F},F))]}),f.jsx(um,{markdown:d.markdown,docLinks:p,onDocLink:i})]}):t.length===0?f.jsx("p",{className:"text-muted-foreground text-sm",children:l("Nothing found")}):f.jsx("div",{className:"flex flex-col gap-4",children:w.map(([F,k])=>f.jsxs("div",{className:"flex flex-col gap-1",children:[F&&f.jsx("div",{className:"text-muted-foreground px-1 text-xs font-medium uppercase",children:F}),k.map(I=>f.jsxs("button",{type:"button",onClick:()=>i(I.id),className:"hover:bg-accent flex items-center gap-2 rounded-md px-2 py-1.5 text-start text-sm transition-colors",children:[f.jsx(Mo,{className:"text-muted-foreground size-4 shrink-0"}),f.jsx("span",{className:"truncate",children:I.title})]},I.id))]},F))})}),r&&f.jsx(yr,{value:"schema",className:"min-h-0 flex-1 overflow-y-auto px-4 py-3",children:f.jsx(Ui,{fields:j?.fields??(E?[]:null),title:j?.title??r,loading:!j&&!E})})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2 border-t px-4 py-3",children:[f.jsx(re,{variant:"ghost",size:"sm",asChild:!0,children:f.jsxs(fe,{href:`${window.routePrefix}/docs${n?`/${encodeURIComponent(n)}`:""}`,children:[f.jsx(Do,{className:"size-4"}),l("Open in knowledge base")]})}),a&&d&&f.jsxs(re,{variant:"outline",size:"sm",onClick:M,children:[f.jsx(wi,{className:"size-4"}),l("Send to assistant")]})]})]})})}function xm(){const n=ie().props.docs,{t}=Ke(),{open:r,docId:i}=dm(),s=mm(),l=A.useCallback(c=>{pm(c?`#${ut}=${encodeURIComponent(c)}`:`#${ut}`)},[]),o=A.useCallback(()=>{const{pathname:c,search:h}=window.location;window.history.pushState(null,"",`${c}${h}`),window.dispatchEvent(new HashChangeEvent("hashchange"))},[]);if(!n)return null;const a=n.items??[],u=a.length>0||!!s;return f.jsxs(f.Fragment,{children:[u&&f.jsxs(Dt,{children:[f.jsx(Ft,{asChild:!0,children:f.jsx(re,{variant:"ghost",size:"icon",className:"shrink-0",onClick:()=>l(null),"aria-label":t("Page documentation"),children:f.jsx(vo,{className:"size-4"})})}),f.jsx(_t,{side:"bottom",className:"z-[1002]",children:f.jsx("span",{children:t("Page documentation")})})]}),f.jsx(gm,{open:r,docId:i,items:a,model:s,onOpenDoc:l,onClose:o})]})}function Zl({breadcrumbs:e=[]}){return f.jsx("header",{className:"border-sidebar-border/50 flex h-16 shrink-0 items-center gap-2 border-b px-6 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12 md:px-4",children:f.jsxs("div",{className:"flex justify-between w-full",children:[f.jsx("div",{className:"flex items-center gap-2",children:f.jsx(Ie,{name:"HeaderStart",Default:ym,breadcrumbs:e})}),f.jsx("div",{className:"flex gap-4 items-center",children:f.jsx(Ie,{name:"HeaderActions",Default:bm,breadcrumbs:e})})]})})}function ym({breadcrumbs:e=[]}){return f.jsxs(f.Fragment,{children:[f.jsx(Fo,{className:"-ml-1"}),f.jsx(Oi,{breadcrumbs:e})]})}function bm(){const{tabs:e}=ji(),n=ie();return f.jsxs(f.Fragment,{children:[f.jsx(Hi,{}),f.jsx(ha,{}),f.jsx(xm,{}),n.props.history&&f.jsx(fe,{href:`${window.routePrefix}/history/view-all`,children:f.jsx(re,{variant:"ghost",size:"icon",className:"shrink-0",children:f.jsx(_o,{})})}),f.jsx($i,{}),n.props.notifications&&(e===null?f.jsx("div",{className:"w-[40px] flex-none flex justify-center",children:f.jsx(Ge,{className:"size-4 animate-spin"})}):e.length?f.jsx(fa,{}):null),f.jsx(Bi,{})]})}const es=A.memo(({children:e,breadcrumbs:n=[],className:t})=>{const r=ie(),i=n.length?n:r.props.breadcrumbs??[];return f.jsxs(Ii,{variant:"sidebar",children:[f.jsx(Si,{title:r.props.title}),f.jsx(Ie,{name:"Sidebar",Default:_i}),f.jsxs(Oo,{className:"overflow-hidden",children:[f.jsx(Ie,{name:"Header",Default:Zl,breadcrumbs:i}),f.jsx("div",{"data-scroll-region":"content",className:G("relative flex min-h-0 flex-1 overflow-y-auto overscroll-contain",t),children:f.jsx("div",{className:"flex min-h-full w-full flex-col",children:e})})]})]})}),dn=new Map,_n=new Map;function km(e){let n=dn.get(e);return n||(n=import(e).then(t=>(_n.set(e,t),t)),n.catch(()=>dn.delete(e)),dn.set(e,n)),n}function wm(e){if([...document.head.querySelectorAll("link[rel='stylesheet']")].some(r=>r.href.includes(e)))return;const t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t)}const pi=[],di=[];function Sm(e,n=[]){const t=e.join(`
|
|
35
|
+
`),r=e.every(l=>_n.has(l))?e.map(l=>_n.get(l)):null,[i,s]=A.useState({key:"",modules:pi,errors:[]});return A.useEffect(()=>{if(n.forEach(wm),r)return;let l=!1;return Promise.allSettled(e.map(km)).then(o=>{l||s({key:t,modules:o.map(a=>a.status==="fulfilled"?a.value:null),errors:o.flatMap(a=>a.status==="rejected"?[a.reason]:[])})}),()=>{l=!0}},[t,n.join(`
|
|
36
|
+
`)]),!e.length||r?{modules:r??pi,loading:!1,errors:di}:i.key===t?{modules:i.modules,loading:!1,errors:i.errors}:{modules:null,loading:!0,errors:di}}const Cm={root:"stock",layers:[],stylesheets:[]};function jm(e){if(!e||typeof e!="object")return Cm;const{root:n,layers:t,stylesheets:r}=e;return{root:n==="none"?"none":"stock",layers:Array.isArray(t)?t.filter(i=>typeof i?.module=="string"):[],stylesheets:Array.isArray(r)?r.filter(i=>typeof i=="string"):[]}}function vm(e,n){const t={};for(const r of Di)n[r]!==void 0&&(t[r]=n[r]);return e.default==="Layout"&&n.default!==void 0&&(t.Layout=n.default),t}function Em({children:e,className:n}){return f.jsx("div",{"data-scroll-region":"content",className:G("flex min-h-svh w-full flex-col",n),children:e})}function Nm({head:e}){return f.jsxs("div",{className:"flex h-svh w-full items-center justify-center",children:[e,f.jsx(Ge,{className:"size-10 animate-spin text-neutral-500"})]})}const Am=[];function Im({children:e,breadcrumbs:n=[],className:t}){const r=ie(),i=r.props.adminContext,s=jm(i?.layout),l=A.useMemo(()=>s.layers.map(p=>p.module),[s.layers.map(p=>p.module).join(`
|
|
37
|
+
`)]),o=Sm(l,s.stylesheets),a=A.useMemo(()=>o.modules?o.modules.flatMap((p,m)=>p?[vm(s.layers[m],p)]:[]):Am,[l,o.modules?.length,o.loading]);A.useEffect(()=>{o.errors.forEach(p=>console.error("[Adminizer] Failed to load a context layout module",p))},[o.errors]);const u=f.jsx(Si,{title:r.props.title});if(o.loading)return f.jsx(Nm,{head:u});const c=n.length?n:r.props.breadcrumbs??[],h=s.root==="none"?Em:es,d=s.root==="none"||a.some(p=>p.Layout!==void 0);return f.jsxs(ia,{layers:a,children:[d&&u,f.jsx(Ie,{name:"Layout",Default:h,breadcrumbs:c,className:t,context:i,children:e})]})}const Tm=[],zm=[];function Pm(){const e=ie(),{adminContext:n,adminContexts:t=zm,menu:r,menuSections:i}=e.props,s=r??Tm,l=A.useMemo(()=>Ti(zi(s),e.url),[s,e.url]),o=A.useCallback(u=>l!==null&&vt(u)===l,[l]),a=A.useCallback(u=>{const c=t.find(h=>h.id===u);c&&ht.visit(c.link)},[t]);return{context:n,contexts:t,menu:s,sections:i??{},isActive:o,switchTo:a}}const Lm=Object.freeze(Object.defineProperty({__proto__:null,AppShell:Ii,AppSidebar:_i,AppSidebarHeader:Zl,Breadcrumbs:Oi,ContextSwitcher:Mi,DefaultLayout:es,GlobalSearch:Hi,MaterialIcon:W,NavMain:Pi,NavUser:Bi,ThemeSwitcher:$i,UserInfo:Bn,UserMenuContent:Ri,useAdminContext:Pm},Symbol.toStringTag,{value:"Module"}));function Mm(){window.AdminizerShell??={},Object.assign(window.AdminizerShell,Lm)}Mm();const Dm=A.memo(({children:e,className:n,breadcrumbs:t})=>f.jsx(Qo,{children:f.jsx(Im,{breadcrumbs:t,className:n,children:e})})),Bm=(e,n={})=>{const t=e;return t.layout=r=>f.jsx(Dm,{...n,children:r}),t};export{um as M,cm as a,nm as b,W as c,zt as d,Rm as e,ji as f,hm as s,Ot as u,Bm as w};
|