adminizer 5.2.0-build.31 → 5.2.0-build.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/assets/{abnfDiagram-VCTEODGH-BtJg_wq8.js → abnfDiagram-VCTEODGH-DbgbyJcA.js} +1 -1
  2. package/assets/{add-CcMmw50d.js → add-CZSjZSj4.js} +1 -1
  3. package/assets/{add-group-BI7Il1o9.js → add-group-D2OXN23o.js} +1 -1
  4. package/assets/{add-user-CbTznIir.js → add-user-DWw6yqHq.js} +1 -1
  5. package/assets/{app-Cg7dXJfk.js → app-6gn6IblM.js} +2 -2
  6. package/assets/{arc-BH-jID2f.js → arc-Ds8Mu0yU.js} +1 -1
  7. package/assets/{architectureDiagram-5GKGNRK7-BmFO29Ca.js → architectureDiagram-5GKGNRK7-BgImmyg4.js} +1 -1
  8. package/assets/{blockDiagram-I7D4REHJ-kmdi7zCh.js → blockDiagram-I7D4REHJ-CICNz1pJ.js} +1 -1
  9. package/assets/{c4Diagram-7LVT6UL2-BqfDgZbz.js → c4Diagram-7LVT6UL2-PO45Obwl.js} +1 -1
  10. package/assets/{catalog-BefPw8hG.js → catalog-yW12d58W.js} +1 -1
  11. package/assets/channel-CVjHBlbP.js +1 -0
  12. package/assets/{chunk-2Q5K7J3B-5iRxjfuJ.js → chunk-2Q5K7J3B-Bw5ZGE4l.js} +1 -1
  13. package/assets/{chunk-5VM5RSS4-BhQiByv7.js → chunk-5VM5RSS4-CGXR0Oqz.js} +1 -1
  14. package/assets/{chunk-F27PBJKO-IjJk4n9A.js → chunk-F27PBJKO-CrHFA3QY.js} +1 -1
  15. package/assets/{chunk-IMKFNOWR-ymA9WbHJ.js → chunk-IMKFNOWR-2vxZURAx.js} +1 -1
  16. package/assets/{chunk-JWPE2WC7-Dyix1HHX.js → chunk-JWPE2WC7-DsNFW3Fc.js} +1 -1
  17. package/assets/{chunk-POPQ4Y6H-IQ0zsMJS.js → chunk-POPQ4Y6H-B9iEE0gK.js} +1 -1
  18. package/assets/{chunk-SVP7TREG-CXCxziXD.js → chunk-SVP7TREG-gdJM9rxR.js} +1 -1
  19. package/assets/{chunk-TICWLB2K-BcvDM7WB.js → chunk-TICWLB2K-na_1Z3ZQ.js} +1 -1
  20. package/assets/{chunk-XXDRQBXY-c2W5S_dd.js → chunk-XXDRQBXY-BCIKd4yk.js} +1 -1
  21. package/assets/classDiagram-ZZMXUADV-DUJsEIfw.js +1 -0
  22. package/assets/classDiagram-v2-VYDZK3BY-DUJsEIfw.js +1 -0
  23. package/assets/{cose-bilkent-JH36ORCC-B5pmdKpq.js → cose-bilkent-JH36ORCC-BuPwEvrz.js} +1 -1
  24. package/assets/{cynefin-OW5HDTMX-HzbUuFkc.js → cynefin-OW5HDTMX-BBWNZZ5h.js} +1 -1
  25. package/assets/{cynefinDiagram-5FMLGOSQ-DUOm6HTV.js → cynefinDiagram-5FMLGOSQ-CFTmYo7z.js} +1 -1
  26. package/assets/{dagre-GXQ25YYZ-Cq_xhTkE.js → dagre-GXQ25YYZ-BA5RSLP2.js} +1 -1
  27. package/assets/{dashboard-D_XSE-mA.js → dashboard-By8UkLaw.js} +1 -1
  28. package/assets/{diagram-S7CK7UJ4-BB0h2Ycq.js → diagram-S7CK7UJ4-BvhL0CjC.js} +1 -1
  29. package/assets/{diagram-UQ7AKVKN-UmvM898J.js → diagram-UQ7AKVKN-zw7Uct_H.js} +1 -1
  30. package/assets/{diagram-VSXAHHWV-C3pfgVZR.js → diagram-VSXAHHWV-Bvgp8Yy3.js} +1 -1
  31. package/assets/{diagram-VX7I27RA-S-iQHosH.js → diagram-VX7I27RA-q44rgp03.js} +1 -1
  32. package/assets/{diagram-Z3DM3KII-wkmwXnCL.js → diagram-Z3DM3KII-DKWm9OV0.js} +1 -1
  33. package/assets/{docs-DmiXIQku.js → docs-ChZhTONp.js} +1 -1
  34. package/assets/{ebnfDiagram-PWID7BFC-TXvp9u_g.js → ebnfDiagram-PWID7BFC-hv0LYjtJ.js} +1 -1
  35. package/assets/{erDiagram-RLTQ6QDP-D3kVz7Nb.js → erDiagram-RLTQ6QDP-CgWLeFqJ.js} +1 -1
  36. package/assets/{flowDiagram-HODETNUW-7gxPRGUj.js → flowDiagram-HODETNUW-DaF8dBdu.js} +1 -1
  37. package/assets/{ganttDiagram-EL5Y4UJY-CPN-jcnj.js → ganttDiagram-EL5Y4UJY-_PIGuWrs.js} +1 -1
  38. package/assets/{gitGraphDiagram-WWUBYQGX-Br1ZEaO6.js → gitGraphDiagram-WWUBYQGX-C0J3HKXb.js} +1 -1
  39. package/assets/{history-Bu1mzK4I.js → history-Mnjs7E36.js} +1 -1
  40. package/assets/{infoDiagram-27XIBGKW-zYs7bQjE.js → infoDiagram-27XIBGKW-DGKmA2HC.js} +1 -1
  41. package/assets/{init-user-fQwp0v90.js → init-user-CSUX8Zph.js} +1 -1
  42. package/assets/{ishikawaDiagram-5VMMS53U-BjXTvzge.js → ishikawaDiagram-5VMMS53U-sBPJ_zmB.js} +1 -1
  43. package/assets/{journeyDiagram-3NMN7TZE-CBfsgbN2.js → journeyDiagram-3NMN7TZE-C_I6XtEx.js} +1 -1
  44. package/assets/{kanban-definition-UXKFOSKX-CrzhTXng.js → kanban-definition-UXKFOSKX-DJXuEpuj.js} +1 -1
  45. package/assets/{layout-BUEOcJh3.js → layout-CDuOg8Qq.js} +1 -1
  46. package/assets/{linear-Djausokh.js → linear-DYRQeDMx.js} +1 -1
  47. package/assets/{list-ACmum9cV.js → list-C5s9ablZ.js} +1 -1
  48. package/assets/{login-BQuIs2j8.js → login-CvdKFskG.js} +1 -1
  49. package/assets/manifest.json +276 -276
  50. package/assets/{media-manager-CU4vMw1V.js → media-manager-BKafzZHC.js} +1 -1
  51. package/assets/{mermaid.core-Dojzw60O.js → mermaid.core-3Xq6zKVA.js} +5 -5
  52. package/assets/{mindmap-definition-YA3MSWOX-s62CDc7B.js → mindmap-definition-YA3MSWOX-TxmPbCcJ.js} +1 -1
  53. package/assets/{module-Cb67xTGv.js → module-C5ct1ybj.js} +1 -1
  54. package/assets/{notification-BTTSwP6c.js → notification-CPhQJoOk.js} +1 -1
  55. package/assets/{pegDiagram-XKGWAZYB-C61Y70Sx.js → pegDiagram-XKGWAZYB-D8aHLl6X.js} +1 -1
  56. package/assets/{pieDiagram-E7YTZNPT-p2kr4IMf.js → pieDiagram-E7YTZNPT-DPECFdHR.js} +1 -1
  57. package/assets/{quadrantDiagram-AXDQQJYC-Bt0TmDnC.js → quadrantDiagram-AXDQQJYC-CAwJ1sa3.js} +1 -1
  58. package/assets/{railroadDiagram-O6MQD6OU-3OLC0D_j.js → railroadDiagram-O6MQD6OU-2Z1DiRqD.js} +1 -1
  59. package/assets/{register-BIVlQHtg.js → register-j2fRPw-h.js} +1 -1
  60. package/assets/{requirementDiagram-BXWQKSXE-DX_wfhH_.js → requirementDiagram-BXWQKSXE-CLSJHCUR.js} +1 -1
  61. package/assets/{ru-CQbDDiCI.js → ru-Ctt5rhuw.js} +1 -1
  62. package/assets/{sankeyDiagram-P5KCCOFB-C5owbfFt.js → sankeyDiagram-P5KCCOFB-W7cqHKvP.js} +1 -1
  63. package/assets/{sequenceDiagram-WJ2MYXX4-C9LP6Bzy.js → sequenceDiagram-WJ2MYXX4-DUJm3o3w.js} +1 -1
  64. package/assets/{sizeCapture-INFHLROL-B7ZoWp62.js → sizeCapture-INFHLROL-tVk02ZBq.js} +1 -1
  65. package/assets/{stateDiagram-D77RDMKH-uWI0NoaS.js → stateDiagram-D77RDMKH-XANTYlIR.js} +1 -1
  66. package/assets/stateDiagram-v2-MP3YSRHH-D4PUgzoJ.js +1 -0
  67. package/assets/{swimlanes-42K2YHIH-B665ttwU.js → swimlanes-42K2YHIH-1bGEFd1q.js} +1 -1
  68. package/assets/swimlanesDiagram-VR7AAH4N-CCjpImEw.js +8 -0
  69. package/assets/{timeline-definition-24CTP7MA-BI5S9uY1.js → timeline-definition-24CTP7MA-A_L0NAjr.js} +1 -1
  70. package/assets/{use-appearance-CETqIse6.js → use-appearance-DexcS2XF.js} +1 -1
  71. package/assets/{user-filters-list-CyxWxLux.js → user-filters-list-DYS6ypS7.js} +1 -1
  72. package/assets/{vennDiagram-4TSXK5OY-Ba9orEWx.js → vennDiagram-4TSXK5OY-CkVuIPLv.js} +1 -1
  73. package/assets/{wardleyDiagram-VM6X3IG4-DTWvvomz.js → wardleyDiagram-VM6X3IG4-CAid-4O_.js} +1 -1
  74. package/assets/{welcome-CaSypMCF.js → welcome-1CccLOAC.js} +1 -1
  75. package/assets/{with-app-layout-BNrVlaFw.js → with-app-layout-l9hNx3ta.js} +3 -3
  76. package/assets/{xychartDiagram-S5SC5T6Z-d9Kf7FbS.js → xychartDiagram-S5SC5T6Z-WPk9HFyA.js} +1 -1
  77. package/interfaces/adminpanelConfig.d.ts +9 -0
  78. package/lib/Adminizer.js +1 -1
  79. package/package.json +1 -1
  80. package/system/bindExpressUtils.d.ts +9 -1
  81. package/system/bindExpressUtils.js +9 -4
  82. package/assets/channel-X5bzKz26.js +0 -1
  83. package/assets/classDiagram-ZZMXUADV-EpRQ1LwP.js +0 -1
  84. package/assets/classDiagram-v2-VYDZK3BY-EpRQ1LwP.js +0 -1
  85. package/assets/stateDiagram-v2-MP3YSRHH-B_Bjdct-.js +0 -1
  86. package/assets/swimlanesDiagram-VR7AAH4N-BDCBtik2.js +0 -8
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid.core-Dojzw60O.js","./app-Cg7dXJfk.js","./app-DM8KzeFz.css","./isObject-DL-BuaBl.js"])))=>i.map(i=>d[i]);
2
- import{r as A,u as re,a as Je,bo as Ql,j as c,q as ee,i as Zl,k as es,l as ts,m as ns,n as rs,o as Xe,bY as ci,d as ne,X as fi,bZ as is,T as ls,b_ as ss,c as X,b$ as hi,c0 as fn,c1 as as,f as St,c2 as os,c3 as We,c4 as Ae,aB as Tt,aC as Pt,c5 as Ie,aE as zt,aF as zn,aG as Lt,c6 as us,c7 as cs,c8 as fs,bl as Ge,c9 as hs,ca as hn,cb as ps,cc as pn,cd as dn,ce as mn,cf as ds,p as pe,b2 as ms,bX as gs,cg as xs,bp as ys,b3 as bs,b4 as ks,b5 as ws,ch as Ss,b6 as Cs,b7 as js,L as Vt,I as vs,bf as Es,ci as Ns,be as As,cj as pi,ck as Ln,cl as di,cm as Is,cn as Ts,co as Ps,cp as zs,cq as Ls,cr as Ds,cs as Ms,ct as _s,cu as Fs,cv as Rs,cw as Os,cx as ur,cy as cr,cz as fr,cA as Bs,cB as $s,cC as Hs,cD as Us,cE as qs,cF as Vs,cG as Ws,cH as Gs,cI as Js,cJ as Xs,H as Ks,cK as Ys,cL as Qs,cM as Zs,cN as ea,bk as ta,N as Dt,O as Mt,av as na,Q as _t,b as ft,e as mi,S as ra,cO as ia,aZ as la,a_ as sa,a$ as aa,b0 as oa,b1 as ua,aA as gi,bM as ca,Z as fa,P as ha,cP as pa,cQ as da,cR as ma,bB as ga,cS as xa,cT as ya,aw as ba,ax as ka,ay as hr,az as pr,F as wa,B as Sa,cU as Ca,cV as ja,cW as xi,cX as va}from"./app-Cg7dXJfk.js";import{i as Ea,u as Na}from"./use-appearance-CETqIse6.js";const yi=A.createContext(void 0),Aa=({children:e})=>{const[n,t]=A.useState([]),[r,i]=A.useState([]),[s,l]=A.useState([]),[a,o]=A.useState(!1),[u,f]=A.useState(null),[h,d]=A.useState(""),p=re(),{t:m}=Je(),w=Ql.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]),C=[...r,...s],k=async()=>{try{const y=await ee.getJson(`${window.routePrefix}/notifications/api`,{params:{unreadOnly:!0,limit:4}});t(y.data)}catch(y){console.error("Error fetching bell notifications:",y)}},N=async()=>{await k()},j=async()=>{try{const y=await ee.getJson(`${window.routePrefix}/notifications/api/get-classes`);y.data&&(f(y.data.activeServices),d(y.data.initTab))}catch(y){console.error("Error fetching tabs:",y)}},v=async(y,I)=>{try{if(!y){await E(I);return}const L=await ee.postJson(`${window.routePrefix}/notifications/api/search`,{s:y,notificationClass:I});l(L.data)}catch(L){console.error("Error searching notifications:",L)}},E=async y=>{o(!0);try{const I=`${window.routePrefix}/notifications/api/${y}`,L=await ee.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{o(!1)}},b=async(y,I)=>{try{const L=`${window.routePrefix}/notifications/api/${y}`,O=await ee.getJson(L,{params:{limit:20,skip:I,unreadOnly:!1}});return l(_=>[..._,...O.data]),O.data}catch(L){return console.error("Error paginating notifications:",L),[]}};A.useEffect(()=>{if(!p.props.notifications)return;k();const y=new EventSource(`${window.routePrefix}/notifications/api/stream`);return y.addEventListener("connected",I=>{j()}),y.addEventListener("notification",I=>{const L=JSON.parse(I.data);i(O=>[L,...O]),t(O=>[L,...O].slice(0,4))}),y.onerror=()=>{console.error("SSE connection error")},()=>y.close()},[]);const z=async(y,I)=>{try{await ee.putJson(`${window.routePrefix}/notifications/api/${y}/${I}/read`,{}),i(L=>L.map(O=>O.id===I?{...O,read:!0}:O)),l(L=>L.map(O=>O.id===I?{...O,read:!0}:O)),t([])}catch(L){console.error("Error marking as read:",L)}},M=async()=>{try{await ee.putJson(`${window.routePrefix}/notifications/api/read-all`,{}),i(y=>y.map(I=>({...I,read:!0}))),l(y=>y.map(I=>({...I,read:!0}))),await k()}catch(y){console.error("Error marking all as read:",y)}},R=n.filter(y=>!y.read).length;return c.jsx(yi.Provider,{value:{bellNotifications:n,allNotifications:C,unreadCount:R,getTabs:j,tabs:u,initTab:h,search:v,markAsRead:z,markAllAsRead:M,messages:w,fetchAllNotifications:E,paginateNotifications:b,loading:a,refreshBellNotifications:N},children:e})},bi=()=>{const e=A.useContext(yi);if(e===void 0)throw new Error("useNotifications must be used within a NotificationProvider");return e},ki="adminizer.aiAssistant.state",Ia=()=>{if(!(typeof window>"u")){try{const e=window.localStorage.getItem(ki);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}},Ta=e=>{if(!(typeof window>"u")){window.__adminizerAiAssistantState__=e;try{window.localStorage.setItem(ki,JSON.stringify(e))}catch{}}},wi=A.createContext(void 0),Pa=({children:e})=>{const t=re().props.aiAssistant,r=A.useMemo(()=>Ia(),[]),[i,s]=A.useState(()=>r?.isOpen??!1),[l,a]=A.useState([]),[o,u]=A.useState(()=>r?.activeModel??t?.defaultModel??void 0),[f,h]=A.useState(!1),[d,p]=A.useState(null),m=t?.enabled??!1,w=A.useCallback(async()=>{if(m)try{h(!0);const{data:E}=await ee.getJson(`${window.routePrefix}/api/ai-assistant/models`);a(E),u(b=>b&&E.some(M=>M.id===b)?b:t?.defaultModel&&E.some(M=>M.id===t.defaultModel)?t.defaultModel:E[0]?.id)}catch(E){console.error("Failed to load AI assistant models",E),p("Unable to load AI assistant models")}finally{h(!1)}},[t?.defaultModel,m]);A.useEffect(()=>{m&&w()},[w,m]);const C=A.useCallback(E=>{u(E)},[]),k=A.useCallback(()=>s(!0),[]),N=A.useCallback(()=>s(!1),[]),j=A.useCallback(()=>s(E=>!E),[]);A.useEffect(()=>{m||s(!1)},[m]),A.useEffect(()=>{Ta({isOpen:i,activeModel:o})},[o,i]);const v=A.useMemo(()=>({isEnabled:m,isOpen:i,openChat:k,closeChat:N,toggleChat:j,models:l,activeModel:o,setActiveModel:C,loading:f,error:d}),[o,N,d,m,i,f,l,k,C,j]);return c.jsx(wi.Provider,{value:v,children:e})},Ft=()=>{const e=A.useContext(wi);if(!e)throw new Error("useAiAssistant must be used within an AiAssistantProvider");return e},za=()=>`${window.routePrefix??""}/assets/ai-assistant/agent.es.js?v=${window.adminizerVersion??""}`;function La({width:e="min(25vw, 420px)",isResizing:n=!1,onResizeStart:t}){const{isEnabled:r,isOpen:i,closeChat:s,models:l,activeModel:a,setActiveModel:o,loading:u,error:f}=Ft(),[h,d]=A.useState(null),[p,m]=A.useState(null);if(A.useEffect(()=>{if(!i||h||p)return;let N=!1;return import(za()).then(j=>{N||d(()=>j.default)}).catch(j=>{console.error("Failed to load the AI assistant UI",j),N||m("Unable to load the AI assistant UI")}),()=>{N=!0}},[h,i,p]),!r)return null;const w=l.find(N=>N.id===a),C=c.jsx(ne,{variant:"ghost",size:"icon",onClick:s,"aria-label":"Close AI assistant",children:c.jsx(fi,{className:"size-4"})}),k=c.jsxs(c.Fragment,{children:[l.length>1&&c.jsxs(Zl,{value:a,onValueChange:o,children:[c.jsx(es,{className:"h-8 w-36 text-xs","aria-label":"Select assistant",children:c.jsx(ts,{placeholder:"Assistant"})}),c.jsx(ns,{className:"z-[70]",children:l.map(N=>c.jsx(rs,{value:N.id,children:N.name},N.id))})]}),C]});return c.jsxs("aside",{id:"ai-assistant-panel","aria-label":"AI assistant chat","aria-hidden":!i,className:ci("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:[c.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}),a&&h&&!p?c.jsx(h,{routePrefix:window.routePrefix??"",modelId:a,title:w?.name,layout:"panel",headerActions:k},a):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[c.jsx("span",{className:"font-semibold leading-tight",children:"AI assistant"}),C]}),c.jsx("div",{className:"flex flex-1 items-center justify-center p-6 text-center text-sm text-muted-foreground",children:p||f?c.jsx("span",{className:"text-destructive",children:p??f}):!u&&l.length===0?c.jsx("span",{children:"No AI models are available for your account."}):c.jsx(Xe,{className:"size-8 animate-spin"})})]})]})}const Da="25vw",dr="margin-right 300ms ease-in-out",Si=.25,Ma=.55,Ci="adminizer.aiAssistant.panelWidth",gn=()=>({min:Math.round(window.innerWidth*Si),max:Math.round(window.innerWidth*Ma)}),_a=()=>window.innerWidth*Si,Fa=()=>{try{const e=Number(window.localStorage.getItem(Ci));if(!Number.isFinite(e))return null;const{min:n,max:t}=gn();return Math.min(t,Math.max(n,e))}catch{return null}};function Ra({children:e,panelWidth:n=Da}){const{isEnabled:t,isOpen:r}=Ft(),[i,s]=A.useState(Fa),[l,a]=A.useState(!1),o=i===null?n:`${i}px`,u=A.useCallback(f=>{if(window.innerWidth<768)return;f.preventDefault();const h=f.clientX,d=i??_a(),p=document.body.style.userSelect;document.body.style.userSelect="none",a(!0);const m=C=>{const{min:k,max:N}=gn(),j=Math.min(N,Math.max(k,d+h-C.clientX));s(Math.round(j))},w=()=>{document.body.style.userSelect=p,a(!1),document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",w),document.removeEventListener("pointercancel",w)};document.addEventListener("pointermove",m),document.addEventListener("pointerup",w),document.addEventListener("pointercancel",w)},[i]);return A.useEffect(()=>{if(i!==null)try{window.localStorage.setItem(Ci,String(i))}catch{}},[i]),A.useEffect(()=>{const f=document.getElementById("app");if(!f)return;const h=f.style.transition,d=h?.includes("margin-right");return d||(f.style.transition=h?`${h}, ${dr}`:dr),f.classList.add("ai-assistant-host"),f.style.setProperty("--ai-assistant-panel-width",o),()=>{f.classList.remove("ai-assistant-host"),f.style.removeProperty("--ai-assistant-panel-width"),f.style.removeProperty("--ai-assistant-panel-actual-width"),f.style.removeProperty("margin-right"),delete f.dataset.aiAssistantOpen,d||(f.style.transition=h)}},[o]),A.useEffect(()=>{const f=document.getElementById("app");if(!f)return;const h=window.innerWidth<768,d=h?"100vw":o;f.style.setProperty("--ai-assistant-panel-actual-width",d),t&&r?(f.style.marginRight=h?"0":o,f.dataset.aiAssistantOpen="true"):(f.style.removeProperty("margin-right"),f.dataset.aiAssistantOpen="false");const p=()=>{const m=window.innerWidth<768,w=m?"100vw":o;if(f.style.setProperty("--ai-assistant-panel-actual-width",w),i!==null&&!m){const{min:C,max:k}=gn();s(N=>N===null?N:Math.min(k,Math.max(C,N)))}t&&r&&(f.style.marginRight=m?"0":o)};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[o,i,t,r]),c.jsxs(c.Fragment,{children:[e,c.jsx(La,{width:o,isResizing:l,onResizeStart:u})]})}function Oa({children:e}){return A.useEffect(()=>{Ea()},[]),c.jsx(Aa,{children:c.jsx(Pa,{children:c.jsxs(is,{children:[e,c.jsx(Ra,{}),c.jsx(ls,{position:"top-center",richColors:!0,closeButton:!0})]})})})}const ji=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"?c.jsx("div",{className:"flex min-h-screen w-full flex-col",children:e}):c.jsx(ss,{className:"h-svh overflow-hidden",defaultOpen:t,open:t,onOpenChange:i,children:e})});function K({name:e,className:n,style:t}){return c.jsx("span",{className:X("material-icons-outlined",n),style:t,children:e})}function Ct(e){return e.split(/[?#]/)[0].replace(/\/+$/,"")}function vi(e,n){const t=Ct(n);let r=null;for(const i of e){if(!i)continue;const s=Ct(i);(t===s||t.startsWith(`${s}/`))&&(r===null||s.length>r.length)&&(r=s)}return r}function Ei(e){return e.flatMap(n=>[n.link,...(n.actions??[]).map(t=>t.link)])}const Ba="folder",$a="radio_button_checked",Ue=A.forwardRef(({entry:e,...n},t)=>{const r=c.jsxs(c.Fragment,{children:[e.icon&&c.jsx(K,{name:e.icon,className:"!text-[18px]"}),c.jsx("span",{children:e.title})]});return e.type==="blank"?c.jsx("a",{...n,ref:t,href:e.link,target:"_blank",rel:"noopener noreferrer",children:r}):c.jsx(pe,{...n,ref:t,href:e.link,children:r})});Ue.displayName="EntryLink";function Ni({items:e=[]}){const n=re(),{state:t,isMobile:r}=hi(),i=t==="collapsed"&&!r,s=n.props.menuSections??{},l=(v,E)=>s[v]?.icon||E.find(b=>b.icon)?.icon||Ba,a=e.reduce((v,E)=>{const b=E.section||"Platform";return v[b]||(v[b]=[]),v[b].push(E),v},{}),o=Object.keys(a).sort((v,E)=>{const b=s[v]?.order,z=s[E]?.order;return b!==void 0&&z!==void 0?b-z:b!==void 0?-1:z!==void 0?1:v==="Platform"?-1:E==="Platform"||v==="System"?1:E==="System"?-1:v.localeCompare(E)}),[u,f]=A.useState(()=>{const v={};return e.forEach(E=>{const b=E.section||"Platform";v[b]=!1}),v}),[h,d]=A.useState(()=>{const v={};return e.forEach(E=>{const b=E.section||"Platform";v[b]=!1}),v}),p=vi(Ei(e),n.url),m=v=>p!==null&&Ct(v)===p,w=A.useRef(u),C=A.useRef(h);w.current=u,C.current=h;const k=v=>{for(const E of v){const b=E.actions?.find(z=>m(z.link));if(b)return b}return v.find(E=>m(E.link))??null},N=({item:v})=>v.actions?.length>0?c.jsx(hs,{asChild:!0,defaultOpen:m(v.link)||v.actions.some(E=>m(E.link)),className:"group/collapsible",children:c.jsxs(Ae,{children:[c.jsx(hn,{asChild:!0,children:c.jsxs(Ie,{tooltip:v.title,children:[c.jsx(K,{name:v.icon,className:"!text-[18px]"}),c.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:v.title}),c.jsx(St,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),c.jsx(ps,{children:c.jsx(pn,{children:v.actions?.map(E=>c.jsx(dn,{children:c.jsx(mn,{asChild:!0,isActive:m(E.link),children:c.jsx(Ue,{entry:E})})},E.id))})})]})},v.title):c.jsxs(Ae,{children:[c.jsx(Ie,{asChild:!0,isActive:m(v.link),tooltip:{children:v.title},children:c.jsx(Ue,{entry:v})}),v.badge?c.jsx(ds,{children:v.badge}):null]},v.title),j=({section:v,itemsInSection:E})=>{const b=k(E);return c.jsx(fn,{className:"px-2 py-0",children:c.jsxs(We,{children:[c.jsx(Ae,{children:c.jsxs(Tt,{children:[c.jsx(Pt,{asChild:!0,children:c.jsxs(Ie,{isActive:!!b,"aria-label":v,children:[c.jsx(K,{name:l(v,E),className:"!text-[18px]"}),c.jsx("span",{children:v})]})}),c.jsxs(zt,{side:"right",align:"start",className:"min-w-56 z-[1003]",children:[c.jsxs(zn,{className:"flex items-center gap-2",children:[c.jsx(K,{name:l(v,E),className:"!text-[18px]"}),c.jsx("span",{children:v})]}),c.jsx(Lt,{}),E.map(z=>z.actions?.length>0?c.jsxs(us,{children:[c.jsxs(cs,{children:[z.icon&&c.jsx(K,{name:z.icon,className:"!text-[18px]"}),c.jsx("span",{children:z.title})]}),c.jsx(fs,{className:"z-[1003]",children:z.actions?.map(M=>c.jsx(Ge,{asChild:!0,children:c.jsx(Ue,{entry:M})},M.id||M.title))})]},z.id||z.title):c.jsx(Ge,{asChild:!0,children:c.jsx(Ue,{entry:z})},z.id||z.title))]})]})}),b&&c.jsx(Ae,{children:c.jsx(Ie,{asChild:!0,isActive:!0,tooltip:b.title,children:c.jsx(Ue,{entry:{...b,icon:b.icon||$a}})})})]})})};return c.jsx(c.Fragment,{children:o.map(v=>{const E=a[v];if(i)return c.jsx(j,{section:v,itemsInSection:E},v);const b=E.some(M=>M.actions?.length>0?M.actions.some(R=>m(R.link)):m(M.link)),z=h[v]?u[v]:b;return c.jsxs(fn,{className:"px-2 py-0",children:[c.jsx(as,{asChild:!0,className:"cursor-pointer",onClick:()=>{const y=!(C.current[v]?w.current[v]:b);d(I=>({...I,[v]:!0})),f(I=>({...I,[v]:y}))},children:c.jsxs("div",{className:"flex w-full items-center gap-2",children:[c.jsx(K,{name:l(v,E),className:"!text-[16px]"}),c.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:v}),c.jsx(St,{className:`ml-auto shrink-0 transform transition-transform duration-200 ${z?"rotate-90":""}`})]})}),z&&c.jsx(os,{children:c.jsx(We,{children:E.map(M=>c.jsx(N,{item:M},M.id||M.title))})})]},v)})})}const Ha=5*1024*1024,Ua=(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},Ai=A.memo(({routePrefix:e,triggerLabel:n,placeholder:t,t:r,onClose:i})=>{const[s,l]=A.useState(""),[a,o]=A.useState(""),[u,f]=A.useState([]),[h,d]=A.useState({}),[p,m]=A.useState(!1),[w,C]=A.useState(!1),k=A.useRef(null),N=E=>{if(!E)return;const b={},z=[];Array.from(E).forEach(M=>{M.size>Ha?b[M.name]=r("File size exceeds the 5 MB limit"):z.push(M)}),f(M=>[...M,...z]),Object.keys(b).length&&d(M=>({...M,...b}))},j=E=>f(b=>b.filter((z,M)=>M!==E)),v=async E=>{if(E.preventDefault(),!s.trim()){d({title:r("Title is required")});return}m(!0),d({});const b=new FormData;b.append("title",s.trim()),b.append("description",a.trim()),u.forEach(z=>b.append("files",z));try{await ee.post(`${e}/api/feedback`,b),C(!0)}catch(z){const M=Ua(z,r("Internal server error"));d({_global:M}),m(!1)}};return A.useEffect(()=>{if(!w)return;const E=setTimeout(i,2e3);return()=>clearTimeout(E)},[w,i]),w?c.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-24 text-center",children:[c.jsx(Ss,{size:48,className:"text-green-500 dark:text-green-400"}),c.jsx("p",{className:"text-base font-medium",children:r("Feedback sent successfully")})]}):c.jsxs(c.Fragment,{children:[c.jsxs(Cs,{className:"mb-4",children:[c.jsx(js,{children:n??r("Feedback")}),t&&c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t})]}),c.jsxs("form",{onSubmit:v,className:"space-y-5",noValidate:!0,children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Vt,{htmlFor:"fb-title",children:r("Title")}),c.jsx(vs,{id:"fb-title",value:s,onChange:E=>l(E.target.value),disabled:p,placeholder:r("Title"),className:h.title?"border-destructive":""}),h.title&&c.jsx("p",{className:"text-xs text-destructive",children:h.title})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Vt,{htmlFor:"fb-desc",children:r("Description")}),c.jsx(Es,{id:"fb-desc",value:a,onChange:E=>o(E.target.value),disabled:p,placeholder:r("Description"),rows:5,className:"resize-none"})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Vt,{children:r("Attach files")}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>k.current?.click(),disabled:p,children:[c.jsx(Ns,{size:14,className:"mr-1"}),r("Attach files")]}),c.jsx("span",{className:"text-xs text-muted-foreground",children:r("Max 5 MB per file")})]}),c.jsx("input",{ref:k,type:"file",multiple:!0,className:"hidden",onChange:E=>N(E.target.files),disabled:p}),u.length>0&&c.jsx("ul",{className:"mt-2 space-y-1",children:u.map((E,b)=>c.jsxs("li",{className:"flex items-center justify-between rounded-md border bg-muted/40 px-3 py-1.5 text-xs",children:[c.jsx("span",{className:"truncate max-w-[340px]",children:E.name}),c.jsx("button",{type:"button",onClick:()=>j(b),className:"ml-2 text-muted-foreground hover:text-destructive transition-colors","aria-label":r("Remove file"),disabled:p,children:c.jsx(fi,{size:13})})]},b))}),Object.entries(h).filter(([E])=>E!=="title"&&E!=="_global").map(([E,b])=>c.jsx("p",{className:"text-xs text-destructive",children:b},E))]}),h._global&&c.jsx("p",{className:"text-xs text-destructive",children:h._global}),c.jsx(As,{children:c.jsx(ne,{type:"submit",disabled:p,children:p?c.jsxs(c.Fragment,{children:[c.jsx(Xe,{size:14,className:"mr-1.5 animate-spin"}),r("Sending...")]}):r("Send")})})]})]})});Ai.displayName="FeedbackForm";function qa(){const e=re(),{t:n}=Je(),t=e.props.routePrefix??window.routePrefix??"",r=e.props.feedbackTriggerLabel??null,i=e.props.feedbackPlaceholder??null,[s,l]=A.useState(!1),[a,o]=A.useState(0),u=A.useCallback(()=>l(!1),[]),f=A.useCallback(h=>{l(h),h||o(d=>d+1)},[]);return c.jsxs(ms,{open:s,onOpenChange:f,children:[c.jsx(gs,{asChild:!0,children:c.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:[c.jsx(xs,{size:13}),r??n("Send feedback")]})}),ys.createPortal(c.jsx(bs,{}),document.body),c.jsx(ks,{children:c.jsx(ws,{children:c.jsx(Ai,{routePrefix:t,triggerLabel:r,placeholder:i,t:n,onClose:u},a)})})]})}const mr="rocket_launch";function Ii({className:e,side:n="bottom"}){const t=re(),{adminContext:r,adminContexts:i=[],brand:s}=t.props,l=pi(),a=(t.props.section??[]).slice(1).flatMap(o=>o.subItems?.length?o.subItems:[o]);return c.jsxs(Tt,{children:[c.jsx(Pt,{asChild:!0,children:c.jsxs(ne,{variant:"ghost",className:X("w-full justify-start px-2! cursor-pointer",e),children:[c.jsx(K,{name:r?.icon??mr,className:"!text-[18px]"}),c.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap group-data-[state=collapsed]:hidden",children:r?.title??s}),c.jsx(Ln,{className:"ml-auto group-data-[state=collapsed]:hidden"})]})}),c.jsxs(zt,{side:l?"bottom":n,align:"start",className:"min-w-56 z-[1003]",children:[c.jsx(zn,{className:"text-xs text-muted-foreground",children:s}),i.map(o=>c.jsx(Ge,{asChild:!0,children:c.jsxs(pe,{href:o.link,className:"flex gap-2 items-center cursor-pointer",children:[c.jsx(K,{name:o.icon??mr,className:"!text-[18px]"}),c.jsx("span",{children:o.title}),o.id===r?.id&&c.jsx(di,{className:"ml-auto size-4"})]})},o.id)),a.length>0&&c.jsx(Lt,{}),a.map(o=>c.jsx(Ge,{asChild:!0,children:o.type==="blank"?c.jsxs("a",{href:o.link,target:"_blank",rel:"noreferrer",className:"flex gap-2 items-center",children:[o.icon&&c.jsx(K,{name:o.icon,className:"!text-[18px]"}),c.jsx("span",{children:o.title})]}):c.jsxs(pe,{href:o.link,className:"flex gap-2 items-center",children:[o.icon&&c.jsx(K,{name:o.icon,className:"!text-[18px]"}),c.jsx("span",{children:o.title})]})},o.id))]})]})}const Ti=["Layout","Sidebar","SidebarHeader","SidebarContent","SidebarFooter","Header","HeaderStart","HeaderActions"],Pi=A.createContext({});function Va({layers:e,children:n}){const t=A.useMemo(()=>{const r={};for(const i of e)for(const s of Ti){const l=i[s];(typeof l=="function"||typeof l=="object"&&l!==null)&&(r[s]??=[]).push(l)}return r},[e]);return c.jsx(Pi.Provider,{value:t,children:n})}class Wa 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 Te({name:e,Default:n,...t}){const r=A.useContext(Pi)[e],i=A.useMemo(()=>{let s=n;for(const l of r??[]){const a=s,o=u=>c.jsx(Wa,{name:e,fallback:()=>c.jsx(a,{...u}),children:c.jsx(l,{...u,Default:a})});o.displayName=`ShellSlot(${e})`,s=o}return s},[r,n,e]);return c.jsx(i,{...t})}function zi(){return c.jsxs(Is,{collapsible:"icon",variant:"inset",children:[c.jsx(Ts,{children:c.jsx(Te,{name:"SidebarHeader",Default:Ga})}),c.jsx(Ps,{children:c.jsx(Te,{name:"SidebarContent",Default:Ja})}),c.jsx(zs,{children:c.jsx(Te,{name:"SidebarFooter",Default:Xa})})]})}function Ga(){const e=re(),n=(e.props.adminContexts?.length??0)>1;return c.jsx(We,{children:c.jsx(Ae,{children:n?c.jsx(Ii,{side:"right"}):c.jsxs(c.Fragment,{children:[c.jsx(Ls,{className:"p-0 shadow-none border-none bg-transparent hidden md:block",children:c.jsxs(Ds,{children:[c.jsx(Ms,{asChild:!0,className:"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground rounded-md",children:c.jsx(Ie,{asChild:!0,children:c.jsx(ne,{variant:"ghost",asChild:!0,className:`w-full px-2! ${e.props.section?"":"pointer-events-none"}`,children:c.jsxs("div",{children:[c.jsx(K,{name:"rocket_launch",className:"!text-[18px]"}),c.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:e.props.brand}),e.props.section&&c.jsx(Ln,{className:"ml-auto group-data-[state=collapsed]:hidden"})]})})})}),e.props.section&&c.jsx(_s,{side:"right",className:"z-[1003]",children:e.props.section.map(t=>c.jsx("div",{children:t.subItems?c.jsxs(Fs,{children:[c.jsxs(Rs,{className:"flex gap-2 items-center cursor-pointer",children:[c.jsx(K,{name:t.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:t.title})]}),c.jsx(Os,{children:t.subItems.map(r=>c.jsx(ur,{children:r.type==="blank"?c.jsxs("a",{href:r.link,target:"_blank",className:"flex gap-2 items-center",children:[r.icon&&c.jsx(K,{name:r.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:r.title})]},r.id):c.jsxs(pe,{href:r.link,className:"flex gap-2 items-center",children:[r.icon&&c.jsx(K,{name:r.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:r.title})]},r.id)},r.id))})]}):c.jsx(ur,{children:t.type==="blank"?c.jsxs("a",{href:t.link,target:"_blank",className:"flex gap-2 items-center",children:[t.icon&&c.jsx(K,{name:t.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:t.title})]}):c.jsxs(pe,{href:t.link,className:"flex gap-2 items-center",children:[t.icon&&c.jsx(K,{name:t.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:t.title})]})})},t.id))})]})}),c.jsx(fn,{className:"px-2 py-0 block md:hidden",children:c.jsx(We,{children:c.jsx(cr,{asChild:!0,className:"group/collapsible",children:c.jsxs(Ae,{children:[c.jsx(hn,{asChild:!0,children:c.jsxs(Ie,{children:[c.jsx(K,{name:"rocket_launch",className:"!text-[18px]"}),c.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:e.props.brand}),e.props.section&&c.jsx(St,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),e.props.section&&c.jsx(fr,{children:c.jsx(pn,{children:e.props.section&&e.props.section.map(t=>t.subItems?c.jsx(We,{children:c.jsx(cr,{asChild:!0,className:"group/collapsible-sub",children:c.jsxs(Ae,{children:[c.jsx(hn,{asChild:!0,children:c.jsxs(Ie,{children:[c.jsx(K,{name:t.icon,className:"!text-[18px]"}),c.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:t.title}),c.jsx(St,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible-sub:rotate-90"})]})}),c.jsx(fr,{children:c.jsx(pn,{children:t.subItems.map(r=>c.jsx(dn,{children:c.jsx(mn,{asChild:!0,children:r.type==="blank"?c.jsxs("a",{href:r.link,target:"_blank",className:"flex gap-2 items-center",children:[r.icon&&c.jsx(K,{name:r.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:r.title})]}):c.jsxs(pe,{href:r.link,className:"flex gap-2 items-center",children:[r.icon&&c.jsx(K,{name:r.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:r.title})]})})},r.id))})})]})})},t.id):c.jsx(dn,{children:c.jsx(mn,{asChild:!0,children:t.type==="blank"?c.jsxs("a",{href:t.link,target:"_blank",className:"flex gap-2 items-center",children:[t.icon&&c.jsx(K,{name:t.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:t.title})]}):c.jsxs(pe,{href:t.link,className:"flex gap-2 items-center",children:[t.icon&&c.jsx(K,{name:t.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:t.title})]})})},t.id))})})]})})})})]})},e.props.brand)})}function Ja(){const e=re();return c.jsx(Ni,{items:e.props.menu})}function Xa(){const e=re();return c.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-10-26T04:46:54.682Z").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?c.jsx("a",{href:n.link,target:"_blank",rel:"noreferrer",title:n.hint??void 0,className:s,children:i}):c.jsx("span",{title:n.hint??void 0,className:s,children:i})})(),e.props.showFeedback&&c.jsx(qa,{})]})}function Li({breadcrumbs:e}){return c.jsx(c.Fragment,{children:e.length>0&&c.jsx(Bs,{children:c.jsx($s,{children:e.map((n,t)=>{const r=t===e.length-1;return c.jsxs(A.Fragment,{children:[c.jsx(Hs,{children:r||!n.href?c.jsx(Us,{children:n.title}):c.jsx(qs,{asChild:!0,children:c.jsx(pe,{href:n.href,children:n.title})})}),!r&&c.jsx(Vs,{})]},t)})})})})}function Ka(){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 Dn({user:e,showEmail:n=!1}){const t=Ka();return c.jsxs(c.Fragment,{children:[c.jsxs(Ws,{className:"h-8 w-8 overflow-hidden rounded-full",children:[c.jsx(Gs,{src:e.avatar,alt:e.login}),c.jsx(Js,{className:"rounded-lg bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white",children:t(e.login)})]}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-medium",children:e.login}),n&&c.jsx("span",{className:"text-muted-foreground truncate text-xs",children:e.email})]})]})}function Ya(){return A.useCallback(()=>{document.body.style.removeProperty("pointer-events")},[])}function Di({user:e,logout:n,logoutBtn:t}){const r=Ya();return c.jsxs(c.Fragment,{children:[c.jsx(zn,{className:"p-0 font-normal",children:c.jsx("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:c.jsx(Dn,{user:e,showEmail:!0})})}),c.jsx(Lt,{}),c.jsx(Ge,{asChild:!0,children:c.jsxs(pe,{className:"block w-full cursor-pointer",method:"get",href:n,as:"button",onClick:r,children:[c.jsx(Xs,{className:"mr-2"}),t]})})]})}function Mi(){const{auth:e,logout:n,logoutBtn:t}=re().props,{state:r}=hi(),i=pi();return c.jsx(We,{children:c.jsx(Ae,{children:c.jsxs(Tt,{children:[c.jsx(Pt,{asChild:!0,children:c.jsxs(Ie,{size:"lg",className:"text-sidebar-accent-foreground data-[state=open]:bg-sidebar-accent group focus-visible:ring-0 cursor-pointer",children:[c.jsx(Dn,{user:e.user}),c.jsx(Ln,{className:"ml-auto size-4"})]})}),c.jsx(zt,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg z-[1002]",align:"end",side:i?"bottom":r==="collapsed"?"left":"bottom",children:c.jsx(Di,{user:e.user,logout:n,logoutBtn:t})})]})})})}function _i(){const{appearance:e,updateAppearance:n}=Na(),t={light:"dark",dark:"system",system:"light"},r={light:Zs,dark:Qs,system:Ys},i=()=>n(t[e]),s=r[e];return c.jsx(ne,{variant:"ghost",size:"icon",onClick:i,className:"shrink-0",children:c.jsx(Ks,{iconNode:s})})}function Qa(){const{bellNotifications:e,markAsRead:n,unreadCount:t,refreshBellNotifications:r,messages:i}=bi(),[s,l]=A.useState(!1),a=async(u,f)=>{l(!0);try{await n(u,f),await r()}catch(h){console.error("Error marking as read:",h)}finally{l(!1)}},o=u=>{const f=new Date,h=new Date(u),d=f.getTime()-h.getTime(),p=Math.floor(d/1e3),m=new Intl.RelativeTimeFormat("en",{numeric:"auto"});if(p<60)return m.format(-p,"second");const w=Math.floor(p/60);if(w<60)return m.format(-w,"minute");const C=Math.floor(w/60);if(C<24)return m.format(-C,"hour");const k=Math.floor(C/24);if(k<30)return m.format(-k,"day");const N=Math.floor(k/30);if(N<12)return m.format(-N,"month");const j=Math.floor(N/12);return m.format(-j,"year")};return c.jsxs(Tt,{children:[c.jsx(Pt,{asChild:!0,className:"cursor-pointer data-[state=open]:bg-sidebar-accent",children:c.jsxs(ne,{variant:"ghost",className:"relative",children:[c.jsx(ea,{}),t>0&&c.jsx("div",{className:"absolute top-1.5 right-1.5 size-1.5 rounded-full bg-destructive"})]})}),c.jsxs(zt,{className:"z-[1002] p-2",align:"end",onCloseAutoFocus:u=>u.preventDefault(),children:[c.jsx(ta,{className:`${s?"opacity-50 pointer-events-none":""}`,children:e.length===0?c.jsx("div",{className:"p-4 text-center text-muted-foreground",children:i["No notifications"]}):e.map(u=>c.jsxs("div",{children:[c.jsx(Ge,{asChild:!0,className:"cursor-pointer",onSelect:f=>{f.preventDefault(),ft.visit(`${window.routePrefix}/notifications?type=${u.notificationClass}`)},children:c.jsxs("div",{className:"grid grid-cols-[32px_250px] grid-rows-[auto_1fr] items-start gap-x-4 gap-y-2",children:[u.icon?c.jsx(K,{name:u.icon.icon,style:{color:u.icon.iconColor},className:"!text-[32px]"}):c.jsx("div",{}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"font-medium",children:u.title}),c.jsx("span",{className:"truncate",children:u.message})]}),c.jsxs("div",{className:"col-start-2 flex justify-between flex-nowrap items-center",children:[c.jsx("div",{className:"flex flex-nowrap gap-2 items-center",children:c.jsx("div",{children:o(u.createdAt)})}),c.jsxs(Dt,{children:[c.jsx(Mt,{asChild:!0,children:c.jsx(ne,{variant:"ghost",size:"icon",className:"size-4",onClick:f=>{f.stopPropagation(),a(u.notificationClass,u.id)},children:c.jsx(na,{className:"text-primary"})})}),c.jsx(_t,{side:"left",className:"z-[1003]",children:c.jsx("p",{children:i["Make read"]})})]})]})]})}),c.jsx(Lt,{})]},u.id))}),c.jsx(ne,{variant:"secondary",asChild:!0,children:c.jsxs(pe,{href:`${window.routePrefix}/notifications`,className:`w-full ${s?"opacity-50 pointer-events-none":""}`,children:[i["View All"],s&&c.jsx(Xe,{className:"h-4 w-4 animate-spin"})]})})]})]})}function Za(){const{isEnabled:e,isOpen:n,toggleChat:t,models:r,loading:i}=Ft();if(!e)return null;const s=r.length>0;return c.jsx(c.Fragment,{children:c.jsxs(Dt,{children:[c.jsx(Mt,{asChild:!0,children:c.jsx(ne,{variant:"ghost",className:ci("relative",{"text-primary":n}),onClick:t,"aria-expanded":n,"aria-haspopup":"true","aria-controls":"ai-assistant-panel",disabled:!s&&i,children:i&&!s?c.jsx(Xe,{className:"size-4 animate-spin"}):c.jsx(mi,{className:"size-4"})})}),c.jsx(_t,{side:"bottom",className:"z-[1002]",children:c.jsx("span",{children:"AI assistant"})})]})})}const eo=200,gr="adminizer:ai-search-admin-links";function Fi(){const e=re(),{t:n}=Je(),[t,r]=A.useState(!1),[i,s]=A.useState(""),[l,a]=A.useState([]),[o,u]=A.useState(!1);A.useEffect(()=>{const d=m=>{m.defaultPrevented||!(m.metaKey||m.ctrlKey)||m.key.toLowerCase()!=="k"||(m.preventDefault(),r(w=>!w))},p=m=>{const w=m.detail;s(typeof w?.query=="string"?w.query:""),r(!0)};return window.addEventListener("keydown",d),window.addEventListener(gr,p),()=>{window.removeEventListener("keydown",d),window.removeEventListener(gr,p)}},[]),A.useEffect(()=>{if(!t)return;let d=!1;u(!0);const p=window.setTimeout(async()=>{try{const{data:m}=await ee.getJson(`${window.routePrefix}/api/links/search?q=${encodeURIComponent(i)}`);d||a(m.results.filter(w=>w.link))}catch{d||a([])}finally{d||u(!1)}},eo);return()=>{d=!0,window.clearTimeout(p)}},[t,i]);const f=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),ft.visit(d)},[]);return e.props.auth?.user?c.jsxs(c.Fragment,{children:[c.jsxs(Dt,{children:[c.jsx(Mt,{asChild:!0,children:c.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0",onClick:()=>r(!0),"aria-label":n("Search"),children:c.jsx(ra,{className:"size-4"})})}),c.jsx(_t,{side:"bottom",className:"z-[1002]",children:c.jsxs("span",{children:[n("Search")," · Ctrl K"]})})]}),c.jsxs(ia,{open:t,onOpenChange:r,shouldFilter:!1,title:n("Search"),description:n("Search"),children:[c.jsx(la,{value:i,onValueChange:s,placeholder:`${n("Search")}…`}),c.jsxs(sa,{children:[c.jsx(aa,{children:o?"…":n("Nothing found","Nothing found")}),f.map(([d,p])=>c.jsx(oa,{heading:d,children:p.map(m=>c.jsxs(ua,{value:m.id,onSelect:()=>h(m.link),children:[c.jsx("span",{className:"truncate",children:m.title}),m.description&&c.jsx("span",{className:"text-muted-foreground ml-2 truncate text-xs",children:m.description})]},m.id))},d))]})]})]}):null}function Ri({fields:e,title:n,loading:t=!1,className:r}){const{t:i}=Je();return c.jsxs("div",{className:X("overflow-hidden rounded-xl border",r),children:[n&&c.jsx("div",{className:"bg-muted/50 border-b px-3 py-1.5 text-sm font-medium",children:n}),t||!e?c.jsx("div",{className:"text-muted-foreground p-3 text-sm",children:i("Loading...")}):e.length===0?c.jsx("div",{className:"text-muted-foreground p-3 text-sm",children:i("No fields to display")}):c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-muted/30 text-muted-foreground",children:[c.jsx("th",{className:"px-3 py-1.5 text-start font-medium",children:i("Field")}),c.jsx("th",{className:"px-3 py-1.5 text-start font-medium",children:i("Type")}),c.jsx("th",{className:"px-3 py-1.5 text-start font-medium",children:i("Required")})]})}),c.jsx("tbody",{children:e.map(s=>c.jsxs("tr",{className:"border-t",children:[c.jsxs("td",{className:"px-3 py-1.5",children:[c.jsx("span",{className:"font-medium",children:s.title||s.name}),s.title&&s.title!==s.name&&c.jsx("span",{className:"text-muted-foreground ms-2 font-mono text-xs",children:s.name})]}),c.jsx("td",{className:"px-3 py-1.5 font-mono text-xs",children:s.type}),c.jsx("td",{className:"px-3 py-1.5",children:s.required?i("Yes"):i("No")})]},s.name))})]})]})}function to(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const no=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ro=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,io={};function xr(e,n){return(io.jsx?ro:no).test(e)}const lo=/[ \t\n\f\r]/g;function so(e){return typeof e=="object"?e.type==="text"?yr(e.value):!1:yr(e)}function yr(e){return e.replace(lo,"")===""}class ht{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}ht.prototype.normal={};ht.prototype.property={};ht.prototype.space=void 0;function Oi(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new ht(t,r,n)}function xn(e){return e.toLowerCase()}class ue{constructor(n,t){this.attribute=t,this.property=n}}ue.prototype.attribute="";ue.prototype.booleanish=!1;ue.prototype.boolean=!1;ue.prototype.commaOrSpaceSeparated=!1;ue.prototype.commaSeparated=!1;ue.prototype.defined=!1;ue.prototype.mustUseProperty=!1;ue.prototype.number=!1;ue.prototype.overloadedBoolean=!1;ue.prototype.property="";ue.prototype.spaceSeparated=!1;ue.prototype.space=void 0;let ao=0;const B=Fe(),Y=Fe(),yn=Fe(),T=Fe(),W=Fe(),Me=Fe(),fe=Fe();function Fe(){return 2**++ao}const bn=Object.freeze(Object.defineProperty({__proto__:null,boolean:B,booleanish:Y,commaOrSpaceSeparated:fe,commaSeparated:Me,number:T,overloadedBoolean:yn,spaceSeparated:W},Symbol.toStringTag,{value:"Module"})),Wt=Object.keys(bn);class Mn extends ue{constructor(n,t,r,i){let s=-1;if(super(n,t),br(this,"space",i),typeof r=="number")for(;++s<Wt.length;){const l=Wt[s];br(this,Wt[s],(r&bn[l])===bn[l])}}}Mn.prototype.defined=!0;function br(e,n,t){t&&(e[n]=t)}function Ke(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const s=new Mn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),n[r]=s,t[xn(r)]=r,t[xn(s.attribute)]=r}return new ht(n,t,e.space)}const Bi=Ke({properties:{ariaActiveDescendant:null,ariaAtomic:Y,ariaAutoComplete:null,ariaBusy:Y,ariaChecked:Y,ariaColCount:T,ariaColIndex:T,ariaColSpan:T,ariaControls:W,ariaCurrent:null,ariaDescribedBy:W,ariaDetails:null,ariaDisabled:Y,ariaDropEffect:W,ariaErrorMessage:null,ariaExpanded:Y,ariaFlowTo:W,ariaGrabbed:Y,ariaHasPopup:null,ariaHidden:Y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:W,ariaLevel:T,ariaLive:null,ariaModal:Y,ariaMultiLine:Y,ariaMultiSelectable:Y,ariaOrientation:null,ariaOwns:W,ariaPlaceholder:null,ariaPosInSet:T,ariaPressed:Y,ariaReadOnly:Y,ariaRelevant:null,ariaRequired:Y,ariaRoleDescription:W,ariaRowCount:T,ariaRowIndex:T,ariaRowSpan:T,ariaSelected:Y,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 $i(e,n){return n in e?e[n]:n}function Hi(e,n){return $i(e,n.toLowerCase())}const oo=Ke({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Me,acceptCharset:W,accessKey:W,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alpha:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:W,autoFocus:B,autoPlay:B,blocking:W,capture:null,charSet:null,checked:B,cite:null,className:W,closedBy:null,colorSpace:null,cols:T,colSpan:T,command:null,commandFor:null,content:null,contentEditable:Y,controls:B,controlsList:W,coords:T|Me,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:yn,draggable:Y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:W,height:T,hidden:yn,high:T,href:null,hrefLang:null,htmlFor:W,httpEquiv:W,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:W,itemRef:W,itemScope:B,itemType:W,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:T,manifest:null,max:null,maxLength:T,media:null,method:null,min:null,minLength:T,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,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:B,optimum:T,pattern:null,ping:W,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:W,required:B,reversed:B,rows:T,rowSpan:T,sandbox:W,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootCustomElementRegistry:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shadowRootSerializable:B,shape:null,size:T,sizes:null,slot:null,span:T,spellCheck:Y,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:B,useMap:null,value:Y,width:T,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:W,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:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:T,leftMargin:T,link:null,longDesc:null,lowSrc:null,marginHeight:T,marginWidth:T,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:T,rules:null,scheme:null,scrolling:Y,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:B,disablePictureInPicture:B,disableRemotePlayback:B,exportParts:Me,part:W,prefix:null,property:null,results:T,security:null,unselectable:null},space:"html",transform:Hi}),uo=Ke({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:fe,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:W,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:B,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:Me,g2:Me,glyphName:Me,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:fe,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:W,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:T,pointsAtY:T,pointsAtZ:T,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fe,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fe,rev:fe,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fe,requiredFeatures:fe,requiredFonts:fe,requiredFormats:fe,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:fe,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:fe,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:fe,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:$i}),Ui=Ke({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()}}),qi=Ke({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Hi}),Vi=Ke({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),co={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"},fo=/[A-Z]/g,kr=/-[a-z]/g,ho=/^data[-\w.:]+$/i;function po(e,n){const t=xn(n);let r=n,i=ue;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&ho.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(kr,go);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!kr.test(s)){let l=s.replace(fo,mo);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=Mn}return new i(r,n)}function mo(e){return"-"+e.toLowerCase()}function go(e){return e.charAt(1).toUpperCase()}const xo=Oi([Bi,oo,Ui,qi,Vi],"html"),_n=Oi([Bi,uo,Ui,qi,Vi],"svg");function yo(e){return e.join(" ").trim()}var He={},Gt,wr;function bo(){if(wr)return Gt;wr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,o=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid.core-3Xq6zKVA.js","./app-6gn6IblM.js","./app-DM8KzeFz.css","./isObject-DL-BuaBl.js"])))=>i.map(i=>d[i]);
2
+ import{r as A,u as re,a as Je,bo as Ql,j as c,q as ee,i as Zl,k as es,l as ts,m as ns,n as rs,o as Xe,bY as ci,d as ne,X as fi,bZ as is,T as ls,b_ as ss,c as X,b$ as hi,c0 as fn,c1 as as,f as St,c2 as os,c3 as We,c4 as Ae,aB as Tt,aC as Pt,c5 as Ie,aE as zt,aF as zn,aG as Lt,c6 as us,c7 as cs,c8 as fs,bl as Ge,c9 as hs,ca as hn,cb as ps,cc as pn,cd as dn,ce as mn,cf as ds,p as pe,b2 as ms,bX as gs,cg as xs,bp as ys,b3 as bs,b4 as ks,b5 as ws,ch as Ss,b6 as Cs,b7 as js,L as Vt,I as vs,bf as Es,ci as Ns,be as As,cj as pi,ck as Ln,cl as di,cm as Is,cn as Ts,co as Ps,cp as zs,cq as Ls,cr as Ds,cs as Ms,ct as _s,cu as Fs,cv as Rs,cw as Os,cx as ur,cy as cr,cz as fr,cA as Bs,cB as $s,cC as Hs,cD as Us,cE as qs,cF as Vs,cG as Ws,cH as Gs,cI as Js,cJ as Xs,H as Ks,cK as Ys,cL as Qs,cM as Zs,cN as ea,bk as ta,N as Dt,O as Mt,av as na,Q as _t,b as ft,e as mi,S as ra,cO as ia,aZ as la,a_ as sa,a$ as aa,b0 as oa,b1 as ua,aA as gi,bM as ca,Z as fa,P as ha,cP as pa,cQ as da,cR as ma,bB as ga,cS as xa,cT as ya,aw as ba,ax as ka,ay as hr,az as pr,F as wa,B as Sa,cU as Ca,cV as ja,cW as xi,cX as va}from"./app-6gn6IblM.js";import{i as Ea,u as Na}from"./use-appearance-DexcS2XF.js";const yi=A.createContext(void 0),Aa=({children:e})=>{const[n,t]=A.useState([]),[r,i]=A.useState([]),[s,l]=A.useState([]),[a,o]=A.useState(!1),[u,f]=A.useState(null),[h,d]=A.useState(""),p=re(),{t:m}=Je(),w=Ql.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]),C=[...r,...s],k=async()=>{try{const y=await ee.getJson(`${window.routePrefix}/notifications/api`,{params:{unreadOnly:!0,limit:4}});t(y.data)}catch(y){console.error("Error fetching bell notifications:",y)}},N=async()=>{await k()},j=async()=>{try{const y=await ee.getJson(`${window.routePrefix}/notifications/api/get-classes`);y.data&&(f(y.data.activeServices),d(y.data.initTab))}catch(y){console.error("Error fetching tabs:",y)}},v=async(y,I)=>{try{if(!y){await E(I);return}const L=await ee.postJson(`${window.routePrefix}/notifications/api/search`,{s:y,notificationClass:I});l(L.data)}catch(L){console.error("Error searching notifications:",L)}},E=async y=>{o(!0);try{const I=`${window.routePrefix}/notifications/api/${y}`,L=await ee.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{o(!1)}},b=async(y,I)=>{try{const L=`${window.routePrefix}/notifications/api/${y}`,O=await ee.getJson(L,{params:{limit:20,skip:I,unreadOnly:!1}});return l(_=>[..._,...O.data]),O.data}catch(L){return console.error("Error paginating notifications:",L),[]}};A.useEffect(()=>{if(!p.props.notifications)return;k();const y=new EventSource(`${window.routePrefix}/notifications/api/stream`);return y.addEventListener("connected",I=>{j()}),y.addEventListener("notification",I=>{const L=JSON.parse(I.data);i(O=>[L,...O]),t(O=>[L,...O].slice(0,4))}),y.onerror=()=>{console.error("SSE connection error")},()=>y.close()},[]);const z=async(y,I)=>{try{await ee.putJson(`${window.routePrefix}/notifications/api/${y}/${I}/read`,{}),i(L=>L.map(O=>O.id===I?{...O,read:!0}:O)),l(L=>L.map(O=>O.id===I?{...O,read:!0}:O)),t([])}catch(L){console.error("Error marking as read:",L)}},M=async()=>{try{await ee.putJson(`${window.routePrefix}/notifications/api/read-all`,{}),i(y=>y.map(I=>({...I,read:!0}))),l(y=>y.map(I=>({...I,read:!0}))),await k()}catch(y){console.error("Error marking all as read:",y)}},R=n.filter(y=>!y.read).length;return c.jsx(yi.Provider,{value:{bellNotifications:n,allNotifications:C,unreadCount:R,getTabs:j,tabs:u,initTab:h,search:v,markAsRead:z,markAllAsRead:M,messages:w,fetchAllNotifications:E,paginateNotifications:b,loading:a,refreshBellNotifications:N},children:e})},bi=()=>{const e=A.useContext(yi);if(e===void 0)throw new Error("useNotifications must be used within a NotificationProvider");return e},ki="adminizer.aiAssistant.state",Ia=()=>{if(!(typeof window>"u")){try{const e=window.localStorage.getItem(ki);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}},Ta=e=>{if(!(typeof window>"u")){window.__adminizerAiAssistantState__=e;try{window.localStorage.setItem(ki,JSON.stringify(e))}catch{}}},wi=A.createContext(void 0),Pa=({children:e})=>{const t=re().props.aiAssistant,r=A.useMemo(()=>Ia(),[]),[i,s]=A.useState(()=>r?.isOpen??!1),[l,a]=A.useState([]),[o,u]=A.useState(()=>r?.activeModel??t?.defaultModel??void 0),[f,h]=A.useState(!1),[d,p]=A.useState(null),m=t?.enabled??!1,w=A.useCallback(async()=>{if(m)try{h(!0);const{data:E}=await ee.getJson(`${window.routePrefix}/api/ai-assistant/models`);a(E),u(b=>b&&E.some(M=>M.id===b)?b:t?.defaultModel&&E.some(M=>M.id===t.defaultModel)?t.defaultModel:E[0]?.id)}catch(E){console.error("Failed to load AI assistant models",E),p("Unable to load AI assistant models")}finally{h(!1)}},[t?.defaultModel,m]);A.useEffect(()=>{m&&w()},[w,m]);const C=A.useCallback(E=>{u(E)},[]),k=A.useCallback(()=>s(!0),[]),N=A.useCallback(()=>s(!1),[]),j=A.useCallback(()=>s(E=>!E),[]);A.useEffect(()=>{m||s(!1)},[m]),A.useEffect(()=>{Ta({isOpen:i,activeModel:o})},[o,i]);const v=A.useMemo(()=>({isEnabled:m,isOpen:i,openChat:k,closeChat:N,toggleChat:j,models:l,activeModel:o,setActiveModel:C,loading:f,error:d}),[o,N,d,m,i,f,l,k,C,j]);return c.jsx(wi.Provider,{value:v,children:e})},Ft=()=>{const e=A.useContext(wi);if(!e)throw new Error("useAiAssistant must be used within an AiAssistantProvider");return e},za=()=>`${window.routePrefix??""}/assets/ai-assistant/agent.es.js?v=${window.adminizerVersion??""}`;function La({width:e="min(25vw, 420px)",isResizing:n=!1,onResizeStart:t}){const{isEnabled:r,isOpen:i,closeChat:s,models:l,activeModel:a,setActiveModel:o,loading:u,error:f}=Ft(),[h,d]=A.useState(null),[p,m]=A.useState(null);if(A.useEffect(()=>{if(!i||h||p)return;let N=!1;return import(za()).then(j=>{N||d(()=>j.default)}).catch(j=>{console.error("Failed to load the AI assistant UI",j),N||m("Unable to load the AI assistant UI")}),()=>{N=!0}},[h,i,p]),!r)return null;const w=l.find(N=>N.id===a),C=c.jsx(ne,{variant:"ghost",size:"icon",onClick:s,"aria-label":"Close AI assistant",children:c.jsx(fi,{className:"size-4"})}),k=c.jsxs(c.Fragment,{children:[l.length>1&&c.jsxs(Zl,{value:a,onValueChange:o,children:[c.jsx(es,{className:"h-8 w-36 text-xs","aria-label":"Select assistant",children:c.jsx(ts,{placeholder:"Assistant"})}),c.jsx(ns,{className:"z-[70]",children:l.map(N=>c.jsx(rs,{value:N.id,children:N.name},N.id))})]}),C]});return c.jsxs("aside",{id:"ai-assistant-panel","aria-label":"AI assistant chat","aria-hidden":!i,className:ci("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:[c.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}),a&&h&&!p?c.jsx(h,{routePrefix:window.routePrefix??"",modelId:a,title:w?.name,layout:"panel",headerActions:k},a):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[c.jsx("span",{className:"font-semibold leading-tight",children:"AI assistant"}),C]}),c.jsx("div",{className:"flex flex-1 items-center justify-center p-6 text-center text-sm text-muted-foreground",children:p||f?c.jsx("span",{className:"text-destructive",children:p??f}):!u&&l.length===0?c.jsx("span",{children:"No AI models are available for your account."}):c.jsx(Xe,{className:"size-8 animate-spin"})})]})]})}const Da="25vw",dr="margin-right 300ms ease-in-out",Si=.25,Ma=.55,Ci="adminizer.aiAssistant.panelWidth",gn=()=>({min:Math.round(window.innerWidth*Si),max:Math.round(window.innerWidth*Ma)}),_a=()=>window.innerWidth*Si,Fa=()=>{try{const e=Number(window.localStorage.getItem(Ci));if(!Number.isFinite(e))return null;const{min:n,max:t}=gn();return Math.min(t,Math.max(n,e))}catch{return null}};function Ra({children:e,panelWidth:n=Da}){const{isEnabled:t,isOpen:r}=Ft(),[i,s]=A.useState(Fa),[l,a]=A.useState(!1),o=i===null?n:`${i}px`,u=A.useCallback(f=>{if(window.innerWidth<768)return;f.preventDefault();const h=f.clientX,d=i??_a(),p=document.body.style.userSelect;document.body.style.userSelect="none",a(!0);const m=C=>{const{min:k,max:N}=gn(),j=Math.min(N,Math.max(k,d+h-C.clientX));s(Math.round(j))},w=()=>{document.body.style.userSelect=p,a(!1),document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",w),document.removeEventListener("pointercancel",w)};document.addEventListener("pointermove",m),document.addEventListener("pointerup",w),document.addEventListener("pointercancel",w)},[i]);return A.useEffect(()=>{if(i!==null)try{window.localStorage.setItem(Ci,String(i))}catch{}},[i]),A.useEffect(()=>{const f=document.getElementById("app");if(!f)return;const h=f.style.transition,d=h?.includes("margin-right");return d||(f.style.transition=h?`${h}, ${dr}`:dr),f.classList.add("ai-assistant-host"),f.style.setProperty("--ai-assistant-panel-width",o),()=>{f.classList.remove("ai-assistant-host"),f.style.removeProperty("--ai-assistant-panel-width"),f.style.removeProperty("--ai-assistant-panel-actual-width"),f.style.removeProperty("margin-right"),delete f.dataset.aiAssistantOpen,d||(f.style.transition=h)}},[o]),A.useEffect(()=>{const f=document.getElementById("app");if(!f)return;const h=window.innerWidth<768,d=h?"100vw":o;f.style.setProperty("--ai-assistant-panel-actual-width",d),t&&r?(f.style.marginRight=h?"0":o,f.dataset.aiAssistantOpen="true"):(f.style.removeProperty("margin-right"),f.dataset.aiAssistantOpen="false");const p=()=>{const m=window.innerWidth<768,w=m?"100vw":o;if(f.style.setProperty("--ai-assistant-panel-actual-width",w),i!==null&&!m){const{min:C,max:k}=gn();s(N=>N===null?N:Math.min(k,Math.max(C,N)))}t&&r&&(f.style.marginRight=m?"0":o)};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[o,i,t,r]),c.jsxs(c.Fragment,{children:[e,c.jsx(La,{width:o,isResizing:l,onResizeStart:u})]})}function Oa({children:e}){return A.useEffect(()=>{Ea()},[]),c.jsx(Aa,{children:c.jsx(Pa,{children:c.jsxs(is,{children:[e,c.jsx(Ra,{}),c.jsx(ls,{position:"top-center",richColors:!0,closeButton:!0})]})})})}const ji=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"?c.jsx("div",{className:"flex min-h-screen w-full flex-col",children:e}):c.jsx(ss,{className:"h-svh overflow-hidden",defaultOpen:t,open:t,onOpenChange:i,children:e})});function K({name:e,className:n,style:t}){return c.jsx("span",{className:X("material-icons-outlined",n),style:t,children:e})}function Ct(e){return e.split(/[?#]/)[0].replace(/\/+$/,"")}function vi(e,n){const t=Ct(n);let r=null;for(const i of e){if(!i)continue;const s=Ct(i);(t===s||t.startsWith(`${s}/`))&&(r===null||s.length>r.length)&&(r=s)}return r}function Ei(e){return e.flatMap(n=>[n.link,...(n.actions??[]).map(t=>t.link)])}const Ba="folder",$a="radio_button_checked",Ue=A.forwardRef(({entry:e,...n},t)=>{const r=c.jsxs(c.Fragment,{children:[e.icon&&c.jsx(K,{name:e.icon,className:"!text-[18px]"}),c.jsx("span",{children:e.title})]});return e.type==="blank"?c.jsx("a",{...n,ref:t,href:e.link,target:"_blank",rel:"noopener noreferrer",children:r}):c.jsx(pe,{...n,ref:t,href:e.link,children:r})});Ue.displayName="EntryLink";function Ni({items:e=[]}){const n=re(),{state:t,isMobile:r}=hi(),i=t==="collapsed"&&!r,s=n.props.menuSections??{},l=(v,E)=>s[v]?.icon||E.find(b=>b.icon)?.icon||Ba,a=e.reduce((v,E)=>{const b=E.section||"Platform";return v[b]||(v[b]=[]),v[b].push(E),v},{}),o=Object.keys(a).sort((v,E)=>{const b=s[v]?.order,z=s[E]?.order;return b!==void 0&&z!==void 0?b-z:b!==void 0?-1:z!==void 0?1:v==="Platform"?-1:E==="Platform"||v==="System"?1:E==="System"?-1:v.localeCompare(E)}),[u,f]=A.useState(()=>{const v={};return e.forEach(E=>{const b=E.section||"Platform";v[b]=!1}),v}),[h,d]=A.useState(()=>{const v={};return e.forEach(E=>{const b=E.section||"Platform";v[b]=!1}),v}),p=vi(Ei(e),n.url),m=v=>p!==null&&Ct(v)===p,w=A.useRef(u),C=A.useRef(h);w.current=u,C.current=h;const k=v=>{for(const E of v){const b=E.actions?.find(z=>m(z.link));if(b)return b}return v.find(E=>m(E.link))??null},N=({item:v})=>v.actions?.length>0?c.jsx(hs,{asChild:!0,defaultOpen:m(v.link)||v.actions.some(E=>m(E.link)),className:"group/collapsible",children:c.jsxs(Ae,{children:[c.jsx(hn,{asChild:!0,children:c.jsxs(Ie,{tooltip:v.title,children:[c.jsx(K,{name:v.icon,className:"!text-[18px]"}),c.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:v.title}),c.jsx(St,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),c.jsx(ps,{children:c.jsx(pn,{children:v.actions?.map(E=>c.jsx(dn,{children:c.jsx(mn,{asChild:!0,isActive:m(E.link),children:c.jsx(Ue,{entry:E})})},E.id))})})]})},v.title):c.jsxs(Ae,{children:[c.jsx(Ie,{asChild:!0,isActive:m(v.link),tooltip:{children:v.title},children:c.jsx(Ue,{entry:v})}),v.badge?c.jsx(ds,{children:v.badge}):null]},v.title),j=({section:v,itemsInSection:E})=>{const b=k(E);return c.jsx(fn,{className:"px-2 py-0",children:c.jsxs(We,{children:[c.jsx(Ae,{children:c.jsxs(Tt,{children:[c.jsx(Pt,{asChild:!0,children:c.jsxs(Ie,{isActive:!!b,"aria-label":v,children:[c.jsx(K,{name:l(v,E),className:"!text-[18px]"}),c.jsx("span",{children:v})]})}),c.jsxs(zt,{side:"right",align:"start",className:"min-w-56 z-[1003]",children:[c.jsxs(zn,{className:"flex items-center gap-2",children:[c.jsx(K,{name:l(v,E),className:"!text-[18px]"}),c.jsx("span",{children:v})]}),c.jsx(Lt,{}),E.map(z=>z.actions?.length>0?c.jsxs(us,{children:[c.jsxs(cs,{children:[z.icon&&c.jsx(K,{name:z.icon,className:"!text-[18px]"}),c.jsx("span",{children:z.title})]}),c.jsx(fs,{className:"z-[1003]",children:z.actions?.map(M=>c.jsx(Ge,{asChild:!0,children:c.jsx(Ue,{entry:M})},M.id||M.title))})]},z.id||z.title):c.jsx(Ge,{asChild:!0,children:c.jsx(Ue,{entry:z})},z.id||z.title))]})]})}),b&&c.jsx(Ae,{children:c.jsx(Ie,{asChild:!0,isActive:!0,tooltip:b.title,children:c.jsx(Ue,{entry:{...b,icon:b.icon||$a}})})})]})})};return c.jsx(c.Fragment,{children:o.map(v=>{const E=a[v];if(i)return c.jsx(j,{section:v,itemsInSection:E},v);const b=E.some(M=>M.actions?.length>0?M.actions.some(R=>m(R.link)):m(M.link)),z=h[v]?u[v]:b;return c.jsxs(fn,{className:"px-2 py-0",children:[c.jsx(as,{asChild:!0,className:"cursor-pointer",onClick:()=>{const y=!(C.current[v]?w.current[v]:b);d(I=>({...I,[v]:!0})),f(I=>({...I,[v]:y}))},children:c.jsxs("div",{className:"flex w-full items-center gap-2",children:[c.jsx(K,{name:l(v,E),className:"!text-[16px]"}),c.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:v}),c.jsx(St,{className:`ml-auto shrink-0 transform transition-transform duration-200 ${z?"rotate-90":""}`})]})}),z&&c.jsx(os,{children:c.jsx(We,{children:E.map(M=>c.jsx(N,{item:M},M.id||M.title))})})]},v)})})}const Ha=5*1024*1024,Ua=(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},Ai=A.memo(({routePrefix:e,triggerLabel:n,placeholder:t,t:r,onClose:i})=>{const[s,l]=A.useState(""),[a,o]=A.useState(""),[u,f]=A.useState([]),[h,d]=A.useState({}),[p,m]=A.useState(!1),[w,C]=A.useState(!1),k=A.useRef(null),N=E=>{if(!E)return;const b={},z=[];Array.from(E).forEach(M=>{M.size>Ha?b[M.name]=r("File size exceeds the 5 MB limit"):z.push(M)}),f(M=>[...M,...z]),Object.keys(b).length&&d(M=>({...M,...b}))},j=E=>f(b=>b.filter((z,M)=>M!==E)),v=async E=>{if(E.preventDefault(),!s.trim()){d({title:r("Title is required")});return}m(!0),d({});const b=new FormData;b.append("title",s.trim()),b.append("description",a.trim()),u.forEach(z=>b.append("files",z));try{await ee.post(`${e}/api/feedback`,b),C(!0)}catch(z){const M=Ua(z,r("Internal server error"));d({_global:M}),m(!1)}};return A.useEffect(()=>{if(!w)return;const E=setTimeout(i,2e3);return()=>clearTimeout(E)},[w,i]),w?c.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-24 text-center",children:[c.jsx(Ss,{size:48,className:"text-green-500 dark:text-green-400"}),c.jsx("p",{className:"text-base font-medium",children:r("Feedback sent successfully")})]}):c.jsxs(c.Fragment,{children:[c.jsxs(Cs,{className:"mb-4",children:[c.jsx(js,{children:n??r("Feedback")}),t&&c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t})]}),c.jsxs("form",{onSubmit:v,className:"space-y-5",noValidate:!0,children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Vt,{htmlFor:"fb-title",children:r("Title")}),c.jsx(vs,{id:"fb-title",value:s,onChange:E=>l(E.target.value),disabled:p,placeholder:r("Title"),className:h.title?"border-destructive":""}),h.title&&c.jsx("p",{className:"text-xs text-destructive",children:h.title})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Vt,{htmlFor:"fb-desc",children:r("Description")}),c.jsx(Es,{id:"fb-desc",value:a,onChange:E=>o(E.target.value),disabled:p,placeholder:r("Description"),rows:5,className:"resize-none"})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Vt,{children:r("Attach files")}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>k.current?.click(),disabled:p,children:[c.jsx(Ns,{size:14,className:"mr-1"}),r("Attach files")]}),c.jsx("span",{className:"text-xs text-muted-foreground",children:r("Max 5 MB per file")})]}),c.jsx("input",{ref:k,type:"file",multiple:!0,className:"hidden",onChange:E=>N(E.target.files),disabled:p}),u.length>0&&c.jsx("ul",{className:"mt-2 space-y-1",children:u.map((E,b)=>c.jsxs("li",{className:"flex items-center justify-between rounded-md border bg-muted/40 px-3 py-1.5 text-xs",children:[c.jsx("span",{className:"truncate max-w-[340px]",children:E.name}),c.jsx("button",{type:"button",onClick:()=>j(b),className:"ml-2 text-muted-foreground hover:text-destructive transition-colors","aria-label":r("Remove file"),disabled:p,children:c.jsx(fi,{size:13})})]},b))}),Object.entries(h).filter(([E])=>E!=="title"&&E!=="_global").map(([E,b])=>c.jsx("p",{className:"text-xs text-destructive",children:b},E))]}),h._global&&c.jsx("p",{className:"text-xs text-destructive",children:h._global}),c.jsx(As,{children:c.jsx(ne,{type:"submit",disabled:p,children:p?c.jsxs(c.Fragment,{children:[c.jsx(Xe,{size:14,className:"mr-1.5 animate-spin"}),r("Sending...")]}):r("Send")})})]})]})});Ai.displayName="FeedbackForm";function qa(){const e=re(),{t:n}=Je(),t=e.props.routePrefix??window.routePrefix??"",r=e.props.feedbackTriggerLabel??null,i=e.props.feedbackPlaceholder??null,[s,l]=A.useState(!1),[a,o]=A.useState(0),u=A.useCallback(()=>l(!1),[]),f=A.useCallback(h=>{l(h),h||o(d=>d+1)},[]);return c.jsxs(ms,{open:s,onOpenChange:f,children:[c.jsx(gs,{asChild:!0,children:c.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:[c.jsx(xs,{size:13}),r??n("Send feedback")]})}),ys.createPortal(c.jsx(bs,{}),document.body),c.jsx(ks,{children:c.jsx(ws,{children:c.jsx(Ai,{routePrefix:t,triggerLabel:r,placeholder:i,t:n,onClose:u},a)})})]})}const mr="rocket_launch";function Ii({className:e,side:n="bottom"}){const t=re(),{adminContext:r,adminContexts:i=[],brand:s}=t.props,l=pi(),a=(t.props.section??[]).slice(1).flatMap(o=>o.subItems?.length?o.subItems:[o]);return c.jsxs(Tt,{children:[c.jsx(Pt,{asChild:!0,children:c.jsxs(ne,{variant:"ghost",className:X("w-full justify-start px-2! cursor-pointer",e),children:[c.jsx(K,{name:r?.icon??mr,className:"!text-[18px]"}),c.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap group-data-[state=collapsed]:hidden",children:r?.title??s}),c.jsx(Ln,{className:"ml-auto group-data-[state=collapsed]:hidden"})]})}),c.jsxs(zt,{side:l?"bottom":n,align:"start",className:"min-w-56 z-[1003]",children:[c.jsx(zn,{className:"text-xs text-muted-foreground",children:s}),i.map(o=>c.jsx(Ge,{asChild:!0,children:c.jsxs(pe,{href:o.link,className:"flex gap-2 items-center cursor-pointer",children:[c.jsx(K,{name:o.icon??mr,className:"!text-[18px]"}),c.jsx("span",{children:o.title}),o.id===r?.id&&c.jsx(di,{className:"ml-auto size-4"})]})},o.id)),a.length>0&&c.jsx(Lt,{}),a.map(o=>c.jsx(Ge,{asChild:!0,children:o.type==="blank"?c.jsxs("a",{href:o.link,target:"_blank",rel:"noreferrer",className:"flex gap-2 items-center",children:[o.icon&&c.jsx(K,{name:o.icon,className:"!text-[18px]"}),c.jsx("span",{children:o.title})]}):c.jsxs(pe,{href:o.link,className:"flex gap-2 items-center",children:[o.icon&&c.jsx(K,{name:o.icon,className:"!text-[18px]"}),c.jsx("span",{children:o.title})]})},o.id))]})]})}const Ti=["Layout","Sidebar","SidebarHeader","SidebarContent","SidebarFooter","Header","HeaderStart","HeaderActions"],Pi=A.createContext({});function Va({layers:e,children:n}){const t=A.useMemo(()=>{const r={};for(const i of e)for(const s of Ti){const l=i[s];(typeof l=="function"||typeof l=="object"&&l!==null)&&(r[s]??=[]).push(l)}return r},[e]);return c.jsx(Pi.Provider,{value:t,children:n})}class Wa 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 Te({name:e,Default:n,...t}){const r=A.useContext(Pi)[e],i=A.useMemo(()=>{let s=n;for(const l of r??[]){const a=s,o=u=>c.jsx(Wa,{name:e,fallback:()=>c.jsx(a,{...u}),children:c.jsx(l,{...u,Default:a})});o.displayName=`ShellSlot(${e})`,s=o}return s},[r,n,e]);return c.jsx(i,{...t})}function zi(){return c.jsxs(Is,{collapsible:"icon",variant:"inset",children:[c.jsx(Ts,{children:c.jsx(Te,{name:"SidebarHeader",Default:Ga})}),c.jsx(Ps,{children:c.jsx(Te,{name:"SidebarContent",Default:Ja})}),c.jsx(zs,{children:c.jsx(Te,{name:"SidebarFooter",Default:Xa})})]})}function Ga(){const e=re(),n=(e.props.adminContexts?.length??0)>1;return c.jsx(We,{children:c.jsx(Ae,{children:n?c.jsx(Ii,{side:"right"}):c.jsxs(c.Fragment,{children:[c.jsx(Ls,{className:"p-0 shadow-none border-none bg-transparent hidden md:block",children:c.jsxs(Ds,{children:[c.jsx(Ms,{asChild:!0,className:"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground rounded-md",children:c.jsx(Ie,{asChild:!0,children:c.jsx(ne,{variant:"ghost",asChild:!0,className:`w-full px-2! ${e.props.section?"":"pointer-events-none"}`,children:c.jsxs("div",{children:[c.jsx(K,{name:"rocket_launch",className:"!text-[18px]"}),c.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:e.props.brand}),e.props.section&&c.jsx(Ln,{className:"ml-auto group-data-[state=collapsed]:hidden"})]})})})}),e.props.section&&c.jsx(_s,{side:"right",className:"z-[1003]",children:e.props.section.map(t=>c.jsx("div",{children:t.subItems?c.jsxs(Fs,{children:[c.jsxs(Rs,{className:"flex gap-2 items-center cursor-pointer",children:[c.jsx(K,{name:t.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:t.title})]}),c.jsx(Os,{children:t.subItems.map(r=>c.jsx(ur,{children:r.type==="blank"?c.jsxs("a",{href:r.link,target:"_blank",className:"flex gap-2 items-center",children:[r.icon&&c.jsx(K,{name:r.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:r.title})]},r.id):c.jsxs(pe,{href:r.link,className:"flex gap-2 items-center",children:[r.icon&&c.jsx(K,{name:r.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:r.title})]},r.id)},r.id))})]}):c.jsx(ur,{children:t.type==="blank"?c.jsxs("a",{href:t.link,target:"_blank",className:"flex gap-2 items-center",children:[t.icon&&c.jsx(K,{name:t.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:t.title})]}):c.jsxs(pe,{href:t.link,className:"flex gap-2 items-center",children:[t.icon&&c.jsx(K,{name:t.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:t.title})]})})},t.id))})]})}),c.jsx(fn,{className:"px-2 py-0 block md:hidden",children:c.jsx(We,{children:c.jsx(cr,{asChild:!0,className:"group/collapsible",children:c.jsxs(Ae,{children:[c.jsx(hn,{asChild:!0,children:c.jsxs(Ie,{children:[c.jsx(K,{name:"rocket_launch",className:"!text-[18px]"}),c.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:e.props.brand}),e.props.section&&c.jsx(St,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),e.props.section&&c.jsx(fr,{children:c.jsx(pn,{children:e.props.section&&e.props.section.map(t=>t.subItems?c.jsx(We,{children:c.jsx(cr,{asChild:!0,className:"group/collapsible-sub",children:c.jsxs(Ae,{children:[c.jsx(hn,{asChild:!0,children:c.jsxs(Ie,{children:[c.jsx(K,{name:t.icon,className:"!text-[18px]"}),c.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:t.title}),c.jsx(St,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible-sub:rotate-90"})]})}),c.jsx(fr,{children:c.jsx(pn,{children:t.subItems.map(r=>c.jsx(dn,{children:c.jsx(mn,{asChild:!0,children:r.type==="blank"?c.jsxs("a",{href:r.link,target:"_blank",className:"flex gap-2 items-center",children:[r.icon&&c.jsx(K,{name:r.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:r.title})]}):c.jsxs(pe,{href:r.link,className:"flex gap-2 items-center",children:[r.icon&&c.jsx(K,{name:r.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:r.title})]})})},r.id))})})]})})},t.id):c.jsx(dn,{children:c.jsx(mn,{asChild:!0,children:t.type==="blank"?c.jsxs("a",{href:t.link,target:"_blank",className:"flex gap-2 items-center",children:[t.icon&&c.jsx(K,{name:t.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:t.title})]}):c.jsxs(pe,{href:t.link,className:"flex gap-2 items-center",children:[t.icon&&c.jsx(K,{name:t.icon,className:"!text-[18px]"}),c.jsx("span",{className:"hover:underline",children:t.title})]})})},t.id))})})]})})})})]})},e.props.brand)})}function Ja(){const e=re();return c.jsx(Ni,{items:e.props.menu})}function Xa(){const e=re();return c.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-10-26T04:56:19.979Z").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?c.jsx("a",{href:n.link,target:"_blank",rel:"noreferrer",title:n.hint??void 0,className:s,children:i}):c.jsx("span",{title:n.hint??void 0,className:s,children:i})})(),e.props.showFeedback&&c.jsx(qa,{})]})}function Li({breadcrumbs:e}){return c.jsx(c.Fragment,{children:e.length>0&&c.jsx(Bs,{children:c.jsx($s,{children:e.map((n,t)=>{const r=t===e.length-1;return c.jsxs(A.Fragment,{children:[c.jsx(Hs,{children:r||!n.href?c.jsx(Us,{children:n.title}):c.jsx(qs,{asChild:!0,children:c.jsx(pe,{href:n.href,children:n.title})})}),!r&&c.jsx(Vs,{})]},t)})})})})}function Ka(){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 Dn({user:e,showEmail:n=!1}){const t=Ka();return c.jsxs(c.Fragment,{children:[c.jsxs(Ws,{className:"h-8 w-8 overflow-hidden rounded-full",children:[c.jsx(Gs,{src:e.avatar,alt:e.login}),c.jsx(Js,{className:"rounded-lg bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white",children:t(e.login)})]}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-medium",children:e.login}),n&&c.jsx("span",{className:"text-muted-foreground truncate text-xs",children:e.email})]})]})}function Ya(){return A.useCallback(()=>{document.body.style.removeProperty("pointer-events")},[])}function Di({user:e,logout:n,logoutBtn:t}){const r=Ya();return c.jsxs(c.Fragment,{children:[c.jsx(zn,{className:"p-0 font-normal",children:c.jsx("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:c.jsx(Dn,{user:e,showEmail:!0})})}),c.jsx(Lt,{}),c.jsx(Ge,{asChild:!0,children:c.jsxs(pe,{className:"block w-full cursor-pointer",method:"get",href:n,as:"button",onClick:r,children:[c.jsx(Xs,{className:"mr-2"}),t]})})]})}function Mi(){const{auth:e,logout:n,logoutBtn:t}=re().props,{state:r}=hi(),i=pi();return c.jsx(We,{children:c.jsx(Ae,{children:c.jsxs(Tt,{children:[c.jsx(Pt,{asChild:!0,children:c.jsxs(Ie,{size:"lg",className:"text-sidebar-accent-foreground data-[state=open]:bg-sidebar-accent group focus-visible:ring-0 cursor-pointer",children:[c.jsx(Dn,{user:e.user}),c.jsx(Ln,{className:"ml-auto size-4"})]})}),c.jsx(zt,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg z-[1002]",align:"end",side:i?"bottom":r==="collapsed"?"left":"bottom",children:c.jsx(Di,{user:e.user,logout:n,logoutBtn:t})})]})})})}function _i(){const{appearance:e,updateAppearance:n}=Na(),t={light:"dark",dark:"system",system:"light"},r={light:Zs,dark:Qs,system:Ys},i=()=>n(t[e]),s=r[e];return c.jsx(ne,{variant:"ghost",size:"icon",onClick:i,className:"shrink-0",children:c.jsx(Ks,{iconNode:s})})}function Qa(){const{bellNotifications:e,markAsRead:n,unreadCount:t,refreshBellNotifications:r,messages:i}=bi(),[s,l]=A.useState(!1),a=async(u,f)=>{l(!0);try{await n(u,f),await r()}catch(h){console.error("Error marking as read:",h)}finally{l(!1)}},o=u=>{const f=new Date,h=new Date(u),d=f.getTime()-h.getTime(),p=Math.floor(d/1e3),m=new Intl.RelativeTimeFormat("en",{numeric:"auto"});if(p<60)return m.format(-p,"second");const w=Math.floor(p/60);if(w<60)return m.format(-w,"minute");const C=Math.floor(w/60);if(C<24)return m.format(-C,"hour");const k=Math.floor(C/24);if(k<30)return m.format(-k,"day");const N=Math.floor(k/30);if(N<12)return m.format(-N,"month");const j=Math.floor(N/12);return m.format(-j,"year")};return c.jsxs(Tt,{children:[c.jsx(Pt,{asChild:!0,className:"cursor-pointer data-[state=open]:bg-sidebar-accent",children:c.jsxs(ne,{variant:"ghost",className:"relative",children:[c.jsx(ea,{}),t>0&&c.jsx("div",{className:"absolute top-1.5 right-1.5 size-1.5 rounded-full bg-destructive"})]})}),c.jsxs(zt,{className:"z-[1002] p-2",align:"end",onCloseAutoFocus:u=>u.preventDefault(),children:[c.jsx(ta,{className:`${s?"opacity-50 pointer-events-none":""}`,children:e.length===0?c.jsx("div",{className:"p-4 text-center text-muted-foreground",children:i["No notifications"]}):e.map(u=>c.jsxs("div",{children:[c.jsx(Ge,{asChild:!0,className:"cursor-pointer",onSelect:f=>{f.preventDefault(),ft.visit(`${window.routePrefix}/notifications?type=${u.notificationClass}`)},children:c.jsxs("div",{className:"grid grid-cols-[32px_250px] grid-rows-[auto_1fr] items-start gap-x-4 gap-y-2",children:[u.icon?c.jsx(K,{name:u.icon.icon,style:{color:u.icon.iconColor},className:"!text-[32px]"}):c.jsx("div",{}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"font-medium",children:u.title}),c.jsx("span",{className:"truncate",children:u.message})]}),c.jsxs("div",{className:"col-start-2 flex justify-between flex-nowrap items-center",children:[c.jsx("div",{className:"flex flex-nowrap gap-2 items-center",children:c.jsx("div",{children:o(u.createdAt)})}),c.jsxs(Dt,{children:[c.jsx(Mt,{asChild:!0,children:c.jsx(ne,{variant:"ghost",size:"icon",className:"size-4",onClick:f=>{f.stopPropagation(),a(u.notificationClass,u.id)},children:c.jsx(na,{className:"text-primary"})})}),c.jsx(_t,{side:"left",className:"z-[1003]",children:c.jsx("p",{children:i["Make read"]})})]})]})]})}),c.jsx(Lt,{})]},u.id))}),c.jsx(ne,{variant:"secondary",asChild:!0,children:c.jsxs(pe,{href:`${window.routePrefix}/notifications`,className:`w-full ${s?"opacity-50 pointer-events-none":""}`,children:[i["View All"],s&&c.jsx(Xe,{className:"h-4 w-4 animate-spin"})]})})]})]})}function Za(){const{isEnabled:e,isOpen:n,toggleChat:t,models:r,loading:i}=Ft();if(!e)return null;const s=r.length>0;return c.jsx(c.Fragment,{children:c.jsxs(Dt,{children:[c.jsx(Mt,{asChild:!0,children:c.jsx(ne,{variant:"ghost",className:ci("relative",{"text-primary":n}),onClick:t,"aria-expanded":n,"aria-haspopup":"true","aria-controls":"ai-assistant-panel",disabled:!s&&i,children:i&&!s?c.jsx(Xe,{className:"size-4 animate-spin"}):c.jsx(mi,{className:"size-4"})})}),c.jsx(_t,{side:"bottom",className:"z-[1002]",children:c.jsx("span",{children:"AI assistant"})})]})})}const eo=200,gr="adminizer:ai-search-admin-links";function Fi(){const e=re(),{t:n}=Je(),[t,r]=A.useState(!1),[i,s]=A.useState(""),[l,a]=A.useState([]),[o,u]=A.useState(!1);A.useEffect(()=>{const d=m=>{m.defaultPrevented||!(m.metaKey||m.ctrlKey)||m.key.toLowerCase()!=="k"||(m.preventDefault(),r(w=>!w))},p=m=>{const w=m.detail;s(typeof w?.query=="string"?w.query:""),r(!0)};return window.addEventListener("keydown",d),window.addEventListener(gr,p),()=>{window.removeEventListener("keydown",d),window.removeEventListener(gr,p)}},[]),A.useEffect(()=>{if(!t)return;let d=!1;u(!0);const p=window.setTimeout(async()=>{try{const{data:m}=await ee.getJson(`${window.routePrefix}/api/links/search?q=${encodeURIComponent(i)}`);d||a(m.results.filter(w=>w.link))}catch{d||a([])}finally{d||u(!1)}},eo);return()=>{d=!0,window.clearTimeout(p)}},[t,i]);const f=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),ft.visit(d)},[]);return e.props.auth?.user?c.jsxs(c.Fragment,{children:[c.jsxs(Dt,{children:[c.jsx(Mt,{asChild:!0,children:c.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0",onClick:()=>r(!0),"aria-label":n("Search"),children:c.jsx(ra,{className:"size-4"})})}),c.jsx(_t,{side:"bottom",className:"z-[1002]",children:c.jsxs("span",{children:[n("Search")," · Ctrl K"]})})]}),c.jsxs(ia,{open:t,onOpenChange:r,shouldFilter:!1,title:n("Search"),description:n("Search"),children:[c.jsx(la,{value:i,onValueChange:s,placeholder:`${n("Search")}…`}),c.jsxs(sa,{children:[c.jsx(aa,{children:o?"…":n("Nothing found","Nothing found")}),f.map(([d,p])=>c.jsx(oa,{heading:d,children:p.map(m=>c.jsxs(ua,{value:m.id,onSelect:()=>h(m.link),children:[c.jsx("span",{className:"truncate",children:m.title}),m.description&&c.jsx("span",{className:"text-muted-foreground ml-2 truncate text-xs",children:m.description})]},m.id))},d))]})]})]}):null}function Ri({fields:e,title:n,loading:t=!1,className:r}){const{t:i}=Je();return c.jsxs("div",{className:X("overflow-hidden rounded-xl border",r),children:[n&&c.jsx("div",{className:"bg-muted/50 border-b px-3 py-1.5 text-sm font-medium",children:n}),t||!e?c.jsx("div",{className:"text-muted-foreground p-3 text-sm",children:i("Loading...")}):e.length===0?c.jsx("div",{className:"text-muted-foreground p-3 text-sm",children:i("No fields to display")}):c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-muted/30 text-muted-foreground",children:[c.jsx("th",{className:"px-3 py-1.5 text-start font-medium",children:i("Field")}),c.jsx("th",{className:"px-3 py-1.5 text-start font-medium",children:i("Type")}),c.jsx("th",{className:"px-3 py-1.5 text-start font-medium",children:i("Required")})]})}),c.jsx("tbody",{children:e.map(s=>c.jsxs("tr",{className:"border-t",children:[c.jsxs("td",{className:"px-3 py-1.5",children:[c.jsx("span",{className:"font-medium",children:s.title||s.name}),s.title&&s.title!==s.name&&c.jsx("span",{className:"text-muted-foreground ms-2 font-mono text-xs",children:s.name})]}),c.jsx("td",{className:"px-3 py-1.5 font-mono text-xs",children:s.type}),c.jsx("td",{className:"px-3 py-1.5",children:s.required?i("Yes"):i("No")})]},s.name))})]})]})}function to(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const no=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ro=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,io={};function xr(e,n){return(io.jsx?ro:no).test(e)}const lo=/[ \t\n\f\r]/g;function so(e){return typeof e=="object"?e.type==="text"?yr(e.value):!1:yr(e)}function yr(e){return e.replace(lo,"")===""}class ht{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}ht.prototype.normal={};ht.prototype.property={};ht.prototype.space=void 0;function Oi(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new ht(t,r,n)}function xn(e){return e.toLowerCase()}class ue{constructor(n,t){this.attribute=t,this.property=n}}ue.prototype.attribute="";ue.prototype.booleanish=!1;ue.prototype.boolean=!1;ue.prototype.commaOrSpaceSeparated=!1;ue.prototype.commaSeparated=!1;ue.prototype.defined=!1;ue.prototype.mustUseProperty=!1;ue.prototype.number=!1;ue.prototype.overloadedBoolean=!1;ue.prototype.property="";ue.prototype.spaceSeparated=!1;ue.prototype.space=void 0;let ao=0;const B=Fe(),Y=Fe(),yn=Fe(),T=Fe(),W=Fe(),Me=Fe(),fe=Fe();function Fe(){return 2**++ao}const bn=Object.freeze(Object.defineProperty({__proto__:null,boolean:B,booleanish:Y,commaOrSpaceSeparated:fe,commaSeparated:Me,number:T,overloadedBoolean:yn,spaceSeparated:W},Symbol.toStringTag,{value:"Module"})),Wt=Object.keys(bn);class Mn extends ue{constructor(n,t,r,i){let s=-1;if(super(n,t),br(this,"space",i),typeof r=="number")for(;++s<Wt.length;){const l=Wt[s];br(this,Wt[s],(r&bn[l])===bn[l])}}}Mn.prototype.defined=!0;function br(e,n,t){t&&(e[n]=t)}function Ke(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const s=new Mn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),n[r]=s,t[xn(r)]=r,t[xn(s.attribute)]=r}return new ht(n,t,e.space)}const Bi=Ke({properties:{ariaActiveDescendant:null,ariaAtomic:Y,ariaAutoComplete:null,ariaBusy:Y,ariaChecked:Y,ariaColCount:T,ariaColIndex:T,ariaColSpan:T,ariaControls:W,ariaCurrent:null,ariaDescribedBy:W,ariaDetails:null,ariaDisabled:Y,ariaDropEffect:W,ariaErrorMessage:null,ariaExpanded:Y,ariaFlowTo:W,ariaGrabbed:Y,ariaHasPopup:null,ariaHidden:Y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:W,ariaLevel:T,ariaLive:null,ariaModal:Y,ariaMultiLine:Y,ariaMultiSelectable:Y,ariaOrientation:null,ariaOwns:W,ariaPlaceholder:null,ariaPosInSet:T,ariaPressed:Y,ariaReadOnly:Y,ariaRelevant:null,ariaRequired:Y,ariaRoleDescription:W,ariaRowCount:T,ariaRowIndex:T,ariaRowSpan:T,ariaSelected:Y,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 $i(e,n){return n in e?e[n]:n}function Hi(e,n){return $i(e,n.toLowerCase())}const oo=Ke({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Me,acceptCharset:W,accessKey:W,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alpha:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:W,autoFocus:B,autoPlay:B,blocking:W,capture:null,charSet:null,checked:B,cite:null,className:W,closedBy:null,colorSpace:null,cols:T,colSpan:T,command:null,commandFor:null,content:null,contentEditable:Y,controls:B,controlsList:W,coords:T|Me,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:yn,draggable:Y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:W,height:T,hidden:yn,high:T,href:null,hrefLang:null,htmlFor:W,httpEquiv:W,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:W,itemRef:W,itemScope:B,itemType:W,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:T,manifest:null,max:null,maxLength:T,media:null,method:null,min:null,minLength:T,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,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:B,optimum:T,pattern:null,ping:W,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:W,required:B,reversed:B,rows:T,rowSpan:T,sandbox:W,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootCustomElementRegistry:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shadowRootSerializable:B,shape:null,size:T,sizes:null,slot:null,span:T,spellCheck:Y,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:B,useMap:null,value:Y,width:T,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:W,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:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:T,leftMargin:T,link:null,longDesc:null,lowSrc:null,marginHeight:T,marginWidth:T,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:T,rules:null,scheme:null,scrolling:Y,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:B,disablePictureInPicture:B,disableRemotePlayback:B,exportParts:Me,part:W,prefix:null,property:null,results:T,security:null,unselectable:null},space:"html",transform:Hi}),uo=Ke({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:fe,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:W,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:B,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:Me,g2:Me,glyphName:Me,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:fe,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:W,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:T,pointsAtY:T,pointsAtZ:T,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fe,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fe,rev:fe,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fe,requiredFeatures:fe,requiredFonts:fe,requiredFormats:fe,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:fe,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:fe,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:fe,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:$i}),Ui=Ke({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()}}),qi=Ke({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Hi}),Vi=Ke({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),co={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"},fo=/[A-Z]/g,kr=/-[a-z]/g,ho=/^data[-\w.:]+$/i;function po(e,n){const t=xn(n);let r=n,i=ue;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&ho.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(kr,go);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!kr.test(s)){let l=s.replace(fo,mo);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=Mn}return new i(r,n)}function mo(e){return"-"+e.toLowerCase()}function go(e){return e.charAt(1).toUpperCase()}const xo=Oi([Bi,oo,Ui,qi,Vi],"html"),_n=Oi([Bi,uo,Ui,qi,Vi],"svg");function yo(e){return e.join(" ").trim()}var He={},Gt,wr;function bo(){if(wr)return Gt;wr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,o=`
3
3
  `,u="/",f="*",h="",d="comment",p="declaration";function m(C,k){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];k=k||{};var N=1,j=1;function v(_){var D=_.match(n);D&&(N+=D.length);var V=_.lastIndexOf(o);j=~V?_.length-V:j+_.length}function E(){var _={line:N,column:j};return function(D){return D.position=new b(_),R(),D}}function b(_){this.start=_,this.end={line:N,column:j},this.source=k.source}b.prototype.content=C;function z(_){var D=new Error(k.source+":"+N+":"+j+": "+_);if(D.reason=_,D.filename=k.source,D.line=N,D.column=j,D.source=C,!k.silent)throw D}function M(_){var D=_.exec(C);if(D){var V=D[0];return v(V),C=C.slice(V.length),D}}function R(){M(t)}function y(_){var D;for(_=_||[];D=I();)D!==!1&&_.push(D);return _}function I(){var _=E();if(!(u!=C.charAt(0)||f!=C.charAt(1))){for(var D=2;h!=C.charAt(D)&&(f!=C.charAt(D)||u!=C.charAt(D+1));)++D;if(D+=2,h===C.charAt(D-1))return z("End of comment missing");var V=C.slice(2,D-2);return j+=2,v(V),C=C.slice(D),j+=2,_({type:d,comment:V})}}function L(){var _=E(),D=M(r);if(D){if(I(),!M(i))return z("property missing ':'");var V=M(s),Q=_({type:p,property:w(D[0].replace(e,h)),value:V?w(V[0].replace(e,h)):h});return M(l),Q}}function O(){var _=[];y(_);for(var D;D=L();)D!==!1&&(_.push(D),y(_));return _}return R(),O()}function w(C){return C?C.replace(a,h):h}return Gt=m,Gt}var Sr;function ko(){if(Sr)return He;Sr=1;var e=He&&He.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(He,"__esModule",{value:!0}),He.default=t;const n=e(bo());function t(r,i){let s=null;if(!r||typeof r!="string")return s;const l=(0,n.default)(r),a=typeof i=="function";return l.forEach(o=>{if(o.type!=="declaration")return;const{property:u,value:f}=o;a?i(u,f,o):f&&(s=s||{},s[u]=f)}),s}return He}var nt={},Cr;function wo(){if(Cr)return nt;Cr=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(u){return!u||t.test(u)||e.test(u)},l=function(u,f){return f.toUpperCase()},a=function(u,f){return"".concat(f,"-")},o=function(u,f){return f===void 0&&(f={}),s(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(n,l))};return nt.camelCase=o,nt}var rt,jr;function So(){if(jr)return rt;jr=1;var e=rt&&rt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(ko()),t=wo();function r(i,s){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(a,o){a&&o&&(l[(0,t.camelCase)(a,s)]=o)}),l}return r.default=r,rt=r,rt}var Co=So();const jo=gi(Co),Wi=Gi("end"),Fn=Gi("start");function Gi(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 vo(e){const n=Fn(e),t=Wi(e);if(n&&t)return{start:n,end:t}}function st(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?vr(e.position):"start"in e||"end"in e?vr(e):"line"in e||"column"in e?kn(e):""}function kn(e){return Er(e&&e.line)+":"+Er(e&&e.column)}function vr(e){return kn(e&&e.start)+"-"+kn(e&&e.end)}function Er(e){return e&&typeof e=="number"?e:1}class ie 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 o=r.indexOf(":");o===-1?s.ruleId=r:(s.source=r.slice(0,o),s.ruleId=r.slice(o+1))}if(!s.place&&s.ancestors&&s.ancestors){const o=s.ancestors[s.ancestors.length-1];o&&(s.place=o.position)}const a=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=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=st(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}}ie.prototype.file="";ie.prototype.name="";ie.prototype.reason="";ie.prototype.message="";ie.prototype.stack="";ie.prototype.column=void 0;ie.prototype.line=void 0;ie.prototype.ancestors=void 0;ie.prototype.cause=void 0;ie.prototype.fatal=void 0;ie.prototype.place=void 0;ie.prototype.ruleId=void 0;ie.prototype.source=void 0;const Rn={}.hasOwnProperty,Eo=new Map,No=/[A-Z]/g,Ao=new Set(["table","tbody","thead","tfoot","tr"]),Io=new Set(["td","th"]),Ji="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function To(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=Ro(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=Fo(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"?_n:xo,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},s=Xi(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Xi(e,n,t){if(n.type==="element")return Po(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return zo(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Do(e,n,t);if(n.type==="mdxjsEsm")return Lo(e,n);if(n.type==="root")return Mo(e,n,t);if(n.type==="text")return _o(e,n)}function Po(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=_n,e.schema=i),e.ancestors.push(n);const s=Yi(e,n.tagName,!1),l=Oo(e,n);let a=Bn(e,n);return Ao.has(n.tagName)&&(a=a.filter(function(o){return typeof o=="string"?!so(o):!0})),Ki(e,l,s,n),On(l,a),e.ancestors.pop(),e.schema=r,e.create(n,s,l,t)}function zo(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)}ct(e,n.position)}function Lo(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);ct(e,n.position)}function Do(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=_n,e.schema=i),e.ancestors.push(n);const s=n.name===null?e.Fragment:Yi(e,n.name,!0),l=Bo(e,n),a=Bn(e,n);return Ki(e,l,s,n),On(l,a),e.ancestors.pop(),e.schema=r,e.create(n,s,l,t)}function Mo(e,n,t){const r={};return On(r,Bn(e,n)),e.create(n,e.Fragment,r,t)}function _o(e,n){return n.value}function Ki(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function On(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Fo(e,n,t){return r;function r(i,s,l,a){const u=Array.isArray(l.children)?t:n;return a?u(s,l,a):u(s,l)}}function Ro(e,n){return t;function t(r,i,s,l){const a=Array.isArray(s.children),o=Fn(r);return n(i,s,l,a,{columnNumber:o?o.column-1:void 0,fileName:e,lineNumber:o?o.line:void 0},void 0)}}function Oo(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Rn.call(n.properties,i)){const s=$o(e,i,n.properties[i]);if(s){const[l,a]=s;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Io.has(n.tagName)?r=a:t[l]=a}}if(r){const s=t.style||(t.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Bo(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 a=l.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else ct(e,n.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else ct(e,n.position);else s=r.value===null?!0:r.value;t[i]=s}return t}function Bn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Eo;for(;++r<n.children.length;){const s=n.children[r];let l;if(e.passKeys){const o=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(o){const u=i.get(o)||0;l=o+"-"+u,i.set(o,u+1)}}const a=Xi(e,s,l);a!==void 0&&t.push(a)}return t}function $o(e,n,t){const r=po(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?to(t):yo(t)),r.property==="style"){let i=typeof t=="object"?t:Ho(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Uo(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?co[r.property]||r.property:r.attribute,t]}}function Ho(e,n){try{return jo(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new ie("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Ji+"#cannot-parse-style-attribute",i}}function Yi(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 a=xr(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=l}else r=xr(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Rn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ct(e)}function ct(e,n){const t=new ie("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=Ji+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Uo(e){const n={};let t;for(t in e)Rn.call(e,t)&&(n[qo(t)]=e[t]);return n}function qo(e){let n=e.replace(No,Vo);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Vo(e){return"-"+e.toLowerCase()}const Jt={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"]},Wo={};function $n(e,n){const t=Wo,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Qi(e,r,i)}function Qi(e,n,t){if(Go(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 Nr(e.children,n,t)}return Array.isArray(e)?Nr(e,n,t):""}function Nr(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Qi(e[i],n,t);return r.join("")}function Go(e){return!!(e&&typeof e=="object")}const Ar=document.createElement("i");function Hn(e){const n="&"+e+";";Ar.innerHTML=n;const t=Ar.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function xe(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?(xe(e,e.length,0,n),e):n}const Ir={}.hasOwnProperty;function Zi(e){const n={};let t=-1;for(;++t<e.length;)Jo(n,e[t]);return n}function Jo(e,n){let t;for(t in n){const i=(Ir.call(e,t)?e[t]:void 0)||(e[t]={}),s=n[t];let l;if(s)for(l in s){Ir.call(i,l)||(i[l]=[]);const a=s[l];Xo(i[l],Array.isArray(a)?a:a?[a]:[])}}}function Xo(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);xe(e,0,0,r)}function el(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 ye(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const le=Pe(/[A-Za-z]/),te=Pe(/[\dA-Za-z]/),Ko=Pe(/[#-'*+\--9=?A-Z^-~]/);function jt(e){return e!==null&&(e<32||e===127)}const wn=Pe(/\d/),Yo=Pe(/[\dA-Fa-f]/),Qo=Pe(/[!-/:-@[-`{-~]/);function F(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function U(e){return e===-2||e===-1||e===32}const Rt=Pe(new RegExp("\\p{P}|\\p{S}","u")),_e=Pe(/\s/);function Pe(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 a=e.charCodeAt(t+1);s<56320&&a>56319&&a<57344?(l=String.fromCharCode(s,a),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 q(e,n,t,r){const i=r?r-1:1/0;let s=0;return l;function l(o){return U(o)?(e.enter(t),a(o)):n(o)}function a(o){return U(o)&&s++<i?(e.consume(o),a):(e.exit(t),n(o))}}function tl(e,n,t,r,i,s){let l=0;return a;function a(f){return U(f)?(e.enter(r),o(f)):u(f)}function o(f){return U(f)&&l<s?(e.consume(f),l++,o):(e.exit(r),u(f))}function u(f){return l>=i?n(f):t(f)}}const Zo={tokenize:eu};function eu(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),q(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const o=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=o),t=o,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return F(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),l)}}let vt=class{constructor(){this.index=new Map,this.map=[]}add(n,t,r){Tr(this,n,t,r,!1)}addBefore(n,t,r){Tr(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 Tr(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 tu={tokenize:nu},Pr={tokenize:ru};function nu(e){const n=this,t=[];let r=0,i,s,l;return a;function a(j){if(r<t.length){const v=t[r];return n.containerState=v[1],e.attempt(v[0].continuation,o,u)(j)}return u(j)}function o(j){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&N();const v=n.events.length;let E=v,b;for(;E--;)if(n.events[E][0]==="exit"&&n.events[E][1].type==="chunkFlow"){b=n.events[E][1].end;break}k(r);let z=v;for(;z<n.events.length;)n.events[z][1].end={...b},z++;const M=new vt;return M.add(E+1,0,n.events.slice(v)),M.add(v,z-v,[]),M.consume(n.events),u(j)}return a(j)}function u(j){if(r===t.length){if(!i)return d(j);if(i.currentConstruct&&i.currentConstruct.concrete)return m(j);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Pr,f,h)(j)}function f(j){return i&&N(),k(r),d(j)}function h(j){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,m(j)}function d(j){return n.containerState={},e.attempt(Pr,p,m)(j)}function p(j){return r++,t.push([n.currentConstruct,n.containerState]),d(j)}function m(j){if(j===null){i&&N(),k(0),e.consume(j);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),w(j)}function w(j){if(j===null){C(e.exit("chunkFlow"),!0),k(0),e.consume(j);return}return F(j)?(e.consume(j),C(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(j),w)}function C(j,v){const E=n.sliceStream(j);if(v&&E.push(null),j.previous=s,s&&(s.next=j),s=j,i.defineSkip(j.start),i.write(E),n.parser.lazy[j.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<l&&(!i.events[b][1].end||i.events[b][1].end.offset>l))return;const z=n.events.length;let M=z,R,y;for(;M--;)if(n.events[M][0]==="exit"&&n.events[M][1].type==="chunkFlow"){if(R){y=n.events[M][1].end;break}R=!0}for(k(r),b=z;b<n.events.length;)n.events[b][1].end={...y},b++;const I=new vt;I.add(M+1,0,n.events.slice(z)),I.add(z,b-z,[]),I.consume(n.events)}}function k(j){let v=t.length;for(;v-- >j;){const E=t[v];n.containerState=E[1],E[0].exit.call(n,e)}t.length=j}function N(){i.write([null]),s=void 0,i=void 0,n.containerState._closeFlow=void 0}}function ru(e,n,t){return q(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Et(e){if(e===null||G(e)||_e(e))return 1;if(Rt(e))return 2}function Ot(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 Sn={name:"attention",resolveAll:iu,tokenize:lu};function iu(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},a={...e[t][1].start};zr(l,-s),zr(a,s);const o={type:s>1?"strongSequence":"emphasisSequence",start:l,end:{...e[i][1].end}},u={type:s>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:a},f={type:s>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[t][1].start}},h={type:s>1?"strong":"emphasis",start:{...o.start},end:{...u.end}};e[i][1].end={...o.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",o,n],["exit",o,n],["enter",f,n]]),r=he(r,Ot(n.parser.constructs.insideSpan.null,e.slice(i+1,t),n)),r=he(r,[["exit",f,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]])),xe(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 lu(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Et(r);let s;return l;function l(o){return s=o,e.enter("attentionSequence"),a(o)}function a(o){if(o===s)return e.consume(o),a;const u=e.exit("attentionSequence"),f=Et(o),h=!f||f===2&&i||t.includes(o)&&o!==42&&o!==95,d=!i||i===2&&f||t.includes(r)&&r!==42&&r!==95;return u._open=!!(s===42?h:h&&(i||!d)),u._close=!!(s===42?d:d&&(f||!h)),n(o)}}function zr(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const su={name:"autolink",tokenize:au};function au(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 le(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,a(p)):u(p)}function a(p){return p===58?(e.consume(p),r=0,o):(p===43||p===45||p===46||te(p))&&r++<32?(e.consume(p),a):(r=0,u(p))}function o(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||jt(p)?t(p):(e.consume(p),o)}function u(p){return p===64?(e.consume(p),f):Ko(p)?(e.consume(p),u):t(p)}function f(p){return te(p)?h(p):t(p)}function h(p){return p===46?(e.consume(p),r=0,f):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 pt={partial:!0,tokenize:ou};function ou(e,n,t){return r;function r(s){return U(s)?q(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||F(s)?n(s):t(s)}}const nl={continuation:{tokenize:cu},exit:fu,name:"blockQuote",tokenize:uu};function uu(e,n,t){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),s}return t(l)}function s(l){return U(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function cu(e,n,t){const r=this;return i;function i(l){return U(l)?q(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return e.attempt(nl,n,t)(l)}}function fu(e){e.exit("blockQuote")}const rl={name:"characterEscape",tokenize:hu};function hu(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 Qo(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(s)}}const il={name:"characterReference",tokenize:pu};function pu(e,n,t){const r=this;let i=0,s,l;return a;function a(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),o}function o(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,l=te,f(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,l=Yo,f):(e.enter("characterReferenceValue"),s=7,l=wn,f(h))}function f(h){if(h===59&&i){const d=e.exit("characterReferenceValue");return l===te&&!Hn(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),f):t(h)}}const Cn={partial:!0,tokenize:du};function du(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 Lr={concrete:!0,name:"codeFenced",tokenize:mu};function mu(e,n,t){const r=this,i={partial:!0,tokenize:E};let s=0,l=0,a;return o;function o(b){return u(b)}function u(b){const z=r.events[r.events.length-1];return s=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(b)}function f(b){return b===a?(l++,e.consume(b),f):l<3?t(b):(e.exit("codeFencedFenceSequence"),U(b)?q(e,h,"whitespace")(b):h(b))}function h(b){return b===null||F(b)?(e.exit("codeFencedFence"),r.interrupt?n(b):e.check(Cn,w,v)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===null||F(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(b)):U(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),q(e,p,"whitespace")(b)):b===96&&b===a?t(b):(e.consume(b),d)}function p(b){return b===null||F(b)?h(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||F(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(b)):b===96&&b===a?t(b):(e.consume(b),m)}function w(b){return e.attempt(i,v,C)(b)}function C(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),k}function k(b){return s>0&&U(b)?q(e,N,"linePrefix",s+1)(b):N(b)}function N(b){return b===null||F(b)?e.check(Cn,w,v)(b):(e.enter("codeFlowValue"),j(b))}function j(b){return b===null||F(b)?(e.exit("codeFlowValue"),N(b)):(e.consume(b),j)}function v(b){return e.exit("codeFenced"),n(b)}function E(b,z,M){let R=0;return y;function y(D){return b.enter("lineEnding"),b.consume(D),b.exit("lineEnding"),I}function I(D){return b.enter("codeFencedFence"),U(D)?q(b,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):L(D)}function L(D){return D===a?(b.enter("codeFencedFenceSequence"),O(D)):M(D)}function O(D){return D===a?(R++,b.consume(D),O):R>=l?(b.exit("codeFencedFenceSequence"),U(D)?q(b,_,"whitespace")(D):_(D)):M(D)}function _(D){return D===null||F(D)?(b.exit("codeFencedFence"),z(D)):M(D)}}}const Xt={name:"codeIndented",tokenize:xu},gu={partial:!0,tokenize:yu};function xu(e,n,t){return r;function r(a){return e.enter("codeIndented"),tl(e,i,t,"linePrefix",4,4)(a)}function i(a){return a===null?l(a):F(a)?e.attempt(gu,i,l)(a):(e.enter("codeFlowValue"),s(a))}function s(a){return a===null||F(a)?(e.exit("codeFlowValue"),i(a)):(e.consume(a),s)}function l(a){return e.exit("codeIndented"),n(a)}}function yu(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):F(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):tl(e,n,s,"linePrefix",4,4)(l)}function s(l){return F(l)?i(l):t(l)}}const bu={name:"codeText",previous:wu,resolve:ku,tokenize:Su};function ku(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 wu(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Su(e,n,t){let r=0,i,s;return l;function l(h){return e.enter("codeText"),e.enter("codeTextSequence"),a(h)}function a(h){return h===96?(e.consume(h),r++,a):(e.exit("codeTextSequence"),o(h))}function o(h){return h===null?t(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),o):h===96?(s=e.enter("codeTextSequence"),i=0,f(h)):F(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),o):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||F(h)?(e.exit("codeTextData"),o(h)):(e.consume(h),u)}function f(h){return h===96?(e.consume(h),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(h)):(s.type="codeTextData",u(h))}}class Cu{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&&it(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),it(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),it(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);it(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);it(this.left,t.reverse())}}}function it(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 ll(e){const n={};let t=-1,r,i,s,l,a,o,u;const f=new Cu(e);for(;++t<f.length;){for(;t in n;)t=n[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(o=r[1]._tokenizer.events,s=0,s<o.length&&o[s][1].type==="lineEndingBlank"&&(s+=2),s<o.length&&o[s][1].type==="content"))for(;++s<o.length&&o[s][1].type!=="content";)o[s][1].type==="chunkText"&&(o[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,ju(f,t)),t=n[t],u=!0);else if(r[1]._container){for(s=t,i=void 0;s--;)if(l=f.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.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={...f.get(i)[1].start},a=f.slice(i,t),a.unshift(r),f.splice(i,t-i+1,a))}}return xe(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function ju(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 a=l.events,o=[],u={};let f,h,d=-1,p=t,m=0,w=0;const C=[w];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),h&&l.defineSkip(p.start),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=t;++d<a.length;)a[d][0]==="exit"&&a[d-1][0]==="enter"&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(w=d+1,C.push(w),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(l.events=[],p?(p._tokenizer=void 0,p.previous=void 0):C.pop(),d=C.length;d--;){const k=a.slice(C[d],C[d+1]),N=s.pop();o.push([N,N+k.length-1]),e.splice(N,2,k)}for(o.reverse(),d=-1;++d<o.length;)u[m+o[d][0]]=m+o[d][1],m+=o[d][1]-o[d][0]-1;return u}const vu={resolve:Nu,tokenize:Au},Eu={partial:!0,tokenize:Iu};function Nu(e){return ll(e),e}function Au(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):F(a)?e.check(Eu,l,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function l(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Iu(e,n,t){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),q(e,s,"linePrefix")}function s(l){if(l===null||F(l))return t(l);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function sl(e,n,t,r,i,s,l,a,o){const u=o||Number.POSITIVE_INFINITY;let f=0;return h;function h(k){return k===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(k),e.exit(s),d):k===null||k===32||k===41||jt(k)?t(k):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(k))}function d(k){return k===62?(e.enter(s),e.consume(k),e.exit(s),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===62?(e.exit("chunkString"),e.exit(a),d(k)):k===null||k===60||F(k)?t(k):(e.consume(k),k===92?m:p)}function m(k){return k===60||k===62||k===92?(e.consume(k),p):p(k)}function w(k){return!f&&(k===null||k===41||G(k))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),n(k)):f<u&&k===40?(e.consume(k),f++,w):k===41?(e.consume(k),f--,w):k===null||k===32||k===40||jt(k)?t(k):(e.consume(k),k===92?C:w)}function C(k){return k===40||k===41||k===92?(e.consume(k),w):w(k)}}function al(e,n,t,r,i,s){const l=this;let a=0,o;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),f}function f(p){return a>999||p===null||p===91||p===93&&!o||p===94&&!a&&"_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):F(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||F(p)||a++>999?(e.exit("chunkString"),f(p)):(e.consume(p),o||(o=!U(p)),p===92?d:h)}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}}function ol(e,n,t,r,i,s){let l;return a;function a(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,o):t(d)}function o(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),o(l)):d===null?t(d):F(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),q(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===l||d===null||F(d)?(e.exit("chunkString"),u(d)):(e.consume(d),d===92?h:f)}function h(d){return d===l||d===92?(e.consume(d),f):f(d)}}function at(e,n){let t;return r;function r(i){return F(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):U(i)?q(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Tu={name:"definition",tokenize:zu},Pu={partial:!0,tokenize:Lu};function zu(e,n,t){const r=this;let i;return s;function s(p){return e.enter("definition"),l(p)}function l(p){return al.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=ye(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),o):t(p)}function o(p){return G(p)?at(e,u)(p):u(p)}function u(p){return sl(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(Pu,h,h)(p)}function h(p){return U(p)?q(e,d,"whitespace")(p):d(p)}function d(p){return p===null||F(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function Lu(e,n,t){return r;function r(a){return G(a)?at(e,i)(a):t(a)}function i(a){return ol(e,s,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return U(a)?q(e,l,"whitespace")(a):l(a)}function l(a){return a===null||F(a)?n(a):t(a)}}const Du={name:"hardBreakEscape",tokenize:Mu};function Mu(e,n,t){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return F(s)?(e.exit("hardBreakEscape"),n(s)):t(s)}}const _u={name:"headingAtx",resolve:Fu,tokenize:Ru};function Fu(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"};xe(e,r,t-r+1,[["enter",i,n],["enter",s,n],["exit",s,n],["exit",i,n]])}return e}function Ru(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),s(f)}function s(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||G(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),o(f)):f===null||F(f)?(e.exit("atxHeading"),n(f)):U(f)?q(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function o(f){return f===35?(e.consume(f),o):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||G(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const Ou=["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"],Dr=["pre","script","style","textarea"],Bu={concrete:!0,name:"htmlFlow",resolveTo:Hu,tokenize:Uu},$u={partial:!0,tokenize:qu};function Hu(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 Uu(e,n,t){const r=this;let i,s,l,a,o;return u;function u(x){return f(x)}function f(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,w):x===63?(e.consume(x),i=3,r.interrupt?n:g):le(x)?(e.consume(x),l=String.fromCharCode(x),C):t(x)}function d(x){return x===45?(e.consume(x),i=2,p):x===91?(e.consume(x),i=5,a=0,m):le(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 ge="CDATA[";return x===ge.charCodeAt(a++)?(e.consume(x),a===ge.length?r.interrupt?n:L:m):t(x)}function w(x){return le(x)?(e.consume(x),l=String.fromCharCode(x),C):t(x)}function C(x){if(x===null||x===47||x===62||G(x)){const ge=x===47,Re=l.toLowerCase();return!ge&&!s&&Dr.includes(Re)?(i=1,r.interrupt?n(x):L(x)):Ou.includes(l.toLowerCase())?(i=6,ge?(e.consume(x),k):r.interrupt?n(x):L(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(x):s?N(x):j(x))}return x===45||te(x)?(e.consume(x),l+=String.fromCharCode(x),C):t(x)}function k(x){return x===62?(e.consume(x),r.interrupt?n:L):t(x)}function N(x){return U(x)?(e.consume(x),N):y(x)}function j(x){return x===47?(e.consume(x),y):x===58||x===95||le(x)?(e.consume(x),v):U(x)?(e.consume(x),j):y(x)}function v(x){return x===45||x===46||x===58||x===95||te(x)?(e.consume(x),v):E(x)}function E(x){return x===61?(e.consume(x),b):U(x)?(e.consume(x),E):j(x)}function b(x){return x===null||x===60||x===61||x===62||x===96?t(x):x===34||x===39?(e.consume(x),o=x,z):U(x)?(e.consume(x),b):M(x)}function z(x){return x===o?(e.consume(x),o=null,R):x===null||F(x)?t(x):(e.consume(x),z)}function M(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||G(x)?E(x):(e.consume(x),M)}function R(x){return x===47||x===62||U(x)?j(x):t(x)}function y(x){return x===62?(e.consume(x),I):t(x)}function I(x){return x===null||F(x)?L(x):U(x)?(e.consume(x),I):t(x)}function L(x){return x===45&&i===2?(e.consume(x),V):x===60&&i===1?(e.consume(x),Q):x===62&&i===4?(e.consume(x),me):x===63&&i===3?(e.consume(x),g):x===93&&i===5?(e.consume(x),Se):F(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check($u,Ce,O)(x)):x===null||F(x)?(e.exit("htmlFlowData"),O(x)):(e.consume(x),L)}function O(x){return e.check(Cn,_,Ce)(x)}function _(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),D}function D(x){return x===null||F(x)?O(x):(e.enter("htmlFlowData"),L(x))}function V(x){return x===45?(e.consume(x),g):L(x)}function Q(x){return x===47?(e.consume(x),l="",de):L(x)}function de(x){if(x===62){const ge=l.toLowerCase();return Dr.includes(ge)?(e.consume(x),me):L(x)}return le(x)&&l.length<8?(e.consume(x),l+=String.fromCharCode(x),de):L(x)}function Se(x){return x===93?(e.consume(x),g):L(x)}function g(x){return x===62?(e.consume(x),me):x===45&&i===2?(e.consume(x),g):L(x)}function me(x){return x===null||F(x)?(e.exit("htmlFlowData"),Ce(x)):(e.consume(x),me)}function Ce(x){return e.exit("htmlFlow"),n(x)}}function qu(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(pt,n,t)}}const Vu={name:"htmlText",tokenize:Wu};function Wu(e,n,t){const r=this;let i,s,l;return a;function a(g){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(g),o}function o(g){return g===33?(e.consume(g),u):g===47?(e.consume(g),E):g===63?(e.consume(g),j):le(g)?(e.consume(g),M):t(g)}function u(g){return g===45?(e.consume(g),f):g===91?(e.consume(g),s=0,m):le(g)?(e.consume(g),N):t(g)}function f(g){return g===45?(e.consume(g),p):t(g)}function h(g){return g===null?t(g):g===45?(e.consume(g),d):F(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?V(g):g===45?d(g):h(g)}function m(g){const me="CDATA[";return g===me.charCodeAt(s++)?(e.consume(g),s===me.length?w:m):t(g)}function w(g){return g===null?t(g):g===93?(e.consume(g),C):F(g)?(l=w,Q(g)):(e.consume(g),w)}function C(g){return g===93?(e.consume(g),k):w(g)}function k(g){return g===62?V(g):g===93?(e.consume(g),k):w(g)}function N(g){return g===null||g===62?V(g):F(g)?(l=N,Q(g)):(e.consume(g),N)}function j(g){return g===null?t(g):g===63?(e.consume(g),v):F(g)?(l=j,Q(g)):(e.consume(g),j)}function v(g){return g===62?V(g):j(g)}function E(g){return le(g)?(e.consume(g),b):t(g)}function b(g){return g===45||te(g)?(e.consume(g),b):z(g)}function z(g){return F(g)?(l=z,Q(g)):U(g)?(e.consume(g),z):V(g)}function M(g){return g===45||te(g)?(e.consume(g),M):g===47||g===62||G(g)?R(g):t(g)}function R(g){return g===47?(e.consume(g),V):g===58||g===95||le(g)?(e.consume(g),y):F(g)?(l=R,Q(g)):U(g)?(e.consume(g),R):V(g)}function y(g){return g===45||g===46||g===58||g===95||te(g)?(e.consume(g),y):I(g)}function I(g){return g===61?(e.consume(g),L):F(g)?(l=I,Q(g)):U(g)?(e.consume(g),I):R(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,O):F(g)?(l=L,Q(g)):U(g)?(e.consume(g),L):(e.consume(g),_)}function O(g){return g===i?(e.consume(g),i=void 0,D):g===null?t(g):F(g)?(l=O,Q(g)):(e.consume(g),O)}function _(g){return g===null||g===34||g===39||g===60||g===61||g===96?t(g):g===47||g===62||G(g)?R(g):(e.consume(g),_)}function D(g){return g===47||g===62||G(g)?R(g):t(g)}function V(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"),de}function de(g){return U(g)?q(e,Se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(g):Se(g)}function Se(g){return e.enter("htmlTextData"),l(g)}}const Un={name:"labelEnd",resolveAll:Ku,resolveTo:Yu,tokenize:Qu},Gu={tokenize:Zu},Ju={tokenize:ec},Xu={tokenize:tc};function Ku(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&&xe(e,0,e.length,t),e}function Yu(e,n){let t=e.length,r=0,i,s,l;for(;t--;){const f=e[t][1];if(i){if(f.type==="link"||f.type==="labelLink"&&f._inactive)break;e[t][0]==="enter"&&f.type==="labelLink"&&(f._inactive=!0)}else if(s){if(e[t][0]==="enter"&&(f.type==="labelImage"||f.type==="labelLink")&&!f._balanced&&(i=t,f.type!=="labelLink")){r=2;break}}else f.type==="labelEnd"&&(s=t)}const a={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},o={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",a,n],["enter",o,n]],l=he(l,e.slice(i+1,i+r+3)),l=he(l,[["enter",u,n]]),l=he(l,Ot(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",o,n]]),l=he(l,e.slice(s+1)),l=he(l,[["exit",a,n]]),xe(e,i,e.length,l),e}function Qu(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 a;function a(d){return s?s._inactive?h(d):(l=r.parser.defined.includes(ye(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),o):t(d)}function o(d){return d===40?e.attempt(Gu,f,l?f:h)(d):d===91?e.attempt(Ju,f,l?u:h)(d):l?f(d):h(d)}function u(d){return e.attempt(Xu,f,h)(d)}function f(d){return i.pop(),n(d)}function h(d){return s._balanced=!0,t(d)}}function Zu(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 G(h)?at(e,s)(h):s(h)}function s(h){return h===41?f(h):sl(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return G(h)?at(e,o)(h):f(h)}function a(h){return t(h)}function o(h){return h===34||h===39||h===40?ol(e,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):f(h)}function u(h){return G(h)?at(e,f)(h):f(h)}function f(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),n):t(h)}}function ec(e,n,t){const r=this;return i;function i(a){return al.call(r,e,s,l,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(ye(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function l(a){return t(a)}}function tc(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 nc={name:"labelStartImage",resolveAll:Un.resolveAll,tokenize:rc};function rc(e,n,t){const r=this;let i;return s;function s(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),l}function l(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),i=e.exit("labelImage"),a):t(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),n(o))}}const ic={name:"labelStartLink",resolveAll:Un.resolveAll,tokenize:lc};function lc(e,n,t){const r=this;let i;return s;function s(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),i=e.exit("labelLink"),l}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),n(a))}}const Kt={name:"lineEnding",tokenize:sc};function sc(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),q(e,n,"linePrefix")}}const bt={name:"thematicBreak",tokenize:ac};function ac(e,n,t){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),o(u)):r>=3&&(u===null||F(u))?(e.exit("thematicBreak"),n(u)):t(u)}function o(u){return u===i?(e.consume(u),r++,o):(e.exit("thematicBreakSequence"),U(u)?q(e,a,"whitespace")(u):a(u))}}const oe={continuation:{tokenize:fc},exit:pc,name:"list",tokenize:cc},oc={partial:!0,tokenize:dc},uc={partial:!0,tokenize:hc};function cc(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 a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:wn(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(bt,t,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),o(p)}return t(p)}function o(p){return wn(p)&&++l<10?(e.consume(p),o):(!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(pt,r.interrupt?t:f,e.attempt(oc,d,h))}function f(p){return r.containerState.initialBlankLine=!0,s++,d(p)}function h(p){return U(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 fc(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(pt,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,q(e,n,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!U(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(uc,n,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,q(e,e.attempt(oe,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function hc(e,n,t){const r=this;return q(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 pc(e){e.exit(this.containerState.type)}function dc(e,n,t){const r=this;return q(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!U(s)&&l&&l[1].type==="listItemPrefixWhitespace"?n(s):t(s)}}const Mr={name:"setextUnderline",resolveTo:mc,tokenize:gc};function mc(e,n){const t=new vt;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 a={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",a,n]]),t.add(l+1,0,[["exit",e[i][1],n]]),e[i][1].end={...e[l][1].end}):e[i][1]=a,t.add(e.length,0,[["exit",a,n]]),t.consume(e),e}function gc(e,n,t){const r=this;let i;return s;function s(u){let f=r.events.length,h;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){h=r.events[f][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"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),U(u)?q(e,o,"lineSuffix")(u):o(u))}function o(u){return u===null||F(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const xc={tokenize:yc};function yc(e){const n=this,t=e.attempt(pt,r,e.attempt(this.parser.constructs.flowInitial,i,q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(vu,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 bc={resolveAll:cl()},kc=ul("string"),wc=ul("text");function ul(e){return{resolveAll:cl(e==="text"?Sc:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],s=t.attempt(i,l,a);return l;function l(f){return u(f)?s(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),o}function o(f){return u(f)?(t.exit("data"),s(f)):(t.consume(f),o)}function u(f){if(f===null)return!0;const h=i[f];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 cl(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 Sc(e,n){const t=new vt;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,a=-1,o=0,u;for(;l--;){const f=s[l];if(typeof f=="string"){for(a=f.length;f.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(f===-2)u=!0,o++;else if(f!==-1){l++;break}}if(n._contentTypeTextTrailing&&r===e.length&&(o=0),o){const f={type:r===e.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?a:i.start._bufferIndex+a,_index:i.start._index+l,line:i.end.line,column:i.end.column-o,offset:i.end.offset-o},end:{...i.end}};i.end={...f.start},i.start.offset===i.end.offset?Object.assign(i,f):t.add(r,0,[["enter",f,n],["exit",f,n]])}r++}return t.consume(e),e}const Cc={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:nl},jc={91:Tu},vc={[-2]:Xt,[-1]:Xt,32:Xt},Ec={35:_u,42:bt,45:[Mr,bt],60:Bu,61:Mr,95:bt,96:Lr,126:Lr},Nc={38:il,92:rl},Ac={[-5]:Kt,[-4]:Kt,[-3]:Kt,33:nc,38:il,42:Sn,60:[su,Vu],91:ic,92:[Du,rl],93:Un,95:Sn,96:bu},Ic={null:[Sn,bc]},Tc={null:[42,95]},Pc={null:[]},zc=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Tc,contentInitial:jc,disable:Pc,document:Cc,flow:Ec,flowInitial:vc,insideSpan:Ic,string:Nc,text:Ac},Symbol.toStringTag,{value:"Module"}));function Lc(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=[],a=[];const o={attempt:z(E),check:z(b),consume:N,enter:j,exit:v,interrupt:z(b,{interrupt:!0})},u={code:null,containerState:{},defineSkip:w,events:[],now:m,parser:e,previous:null,sliceSerialize:d,sliceStream:p,write:h};let f=n.tokenize.call(u,o);return n.resolveAll&&s.push(n),u;function h(I){return l=he(l,I),C(),l[l.length-1]!==null?[]:(M(n,0),u.events=Ot(s,u.events,u),u.events)}function d(I,L){return Mc(p(I),L)}function p(I){return Dc(l,I)}function m(){const{_bufferIndex:I,_index:L,line:O,column:_,offset:D}=r;return{_bufferIndex:I,_index:L,line:O,column:_,offset:D}}function w(I){i[I.line]=I.column,y()}function C(){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;)k(I.charCodeAt(r._bufferIndex))}else k(I)}}function k(I){f=f(I)}function N(I){F(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,y()):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 j(I,L){const O=L||{};return O.type=I,O.start=m(),u.events.push(["enter",O,u]),a.push(O),O}function v(I){const L=a.pop();return L.end=m(),u.events.push(["exit",L,u]),L}function E(I,L){M(I,L.from)}function b(I,L){L.restore()}function z(I,L){return O;function O(_,D,V){let Q,de,Se,g;return Array.isArray(_)?Ce(_):"tokenize"in _?Ce([_]):me(_);function me(Z){return Qe;function Qe(Ee){const Oe=Ee!==null&&Z[Ee],Be=Ee!==null&&Z.null,Ut=[...Array.isArray(Oe)?Oe:Oe?[Oe]:[],...Array.isArray(Be)?Be:Be?[Be]:[]];return Ce(Ut)(Ee)}}function Ce(Z){return Q=Z,de=0,Z.length===0?V:x(Z[de])}function x(Z){return Qe;function Qe(Ee){return g=R(),Se=Z,Z.partial||(u.currentConstruct=Z),Z.name&&u.parser.constructs.disable.null.includes(Z.name)?Re():Z.tokenize.call(L?Object.assign(Object.create(u),L):u,o,ge,Re)(Ee)}}function ge(Z){return I(Se,g),D}function Re(Z){return g.restore(),++de<Q.length?x(Q[de]):V}}}function M(I,L){I.resolveAll&&!s.includes(I)&&s.push(I),I.resolve&&xe(u.events,L,u.events.length-L,I.resolve(u.events.slice(L),u)),I.resolveTo&&(u.events=I.resolveTo(u.events,u))}function R(){const I=m(),L=u.previous,O=u.currentConstruct,_=u.events.length,D=Array.from(a);return{from:_,restore:V};function V(){r=I,u.previous=L,u.currentConstruct=O,u.events.length=_,a=D,y()}}function y(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Dc(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 a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}s>0&&l.push(e[i].slice(0,s))}return l}function Mc(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
4
  `;break}case-3:{l=`\r
5
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 _c(e){const r={constructs:Zi([zc,...(e||{}).extensions||[]]),content:i(Zo),defined:[],document:i(tu),flow:i(xc),lazy:{},string:i(kc),text:i(wc)};return r;function i(s){return l;function l(a){return Lc(r,s,a)}}}function Fc(e){for(;!ll(e););return e}const _r=/[\0\t\n\r]/g;function Rc(){let e=1,n="",t=!0,r;return i;function i(s,l,a){s=n+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s));const o=[];let u=0;for(n="",t&&(s.charCodeAt(0)===65279&&u++,t=void 0);u<s.length;){_r.lastIndex=u;const f=_r.exec(s),h=f&&f.index!==void 0?f.index:s.length,d=s.charCodeAt(h);if(!f){n=s.slice(u);break}if(d===10&&u===h&&r)o.push(-3),r=void 0;else switch(r&&(o.push(-5),r=void 0),u<h&&(o.push(s.slice(u,h)),e+=h-u),d){case 0:{o.push(65533),e++;break}case 9:{const p=Math.ceil(e/4)*4;for(o.push(-2);e++<p;)o.push(-1);break}case 10:{o.push(-4),e=1;break}default:r=!0,e=1}u=h+1}return a&&(r&&o.push(-5),n&&o.push(n),o.push(null)),o}}const Oc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Bc(e){return e.replace(Oc,$c)}function $c(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),s=i===120||i===88;return el(t.slice(s?2:1),s?16:10)}return Hn(t)||e}const fl={}.hasOwnProperty;function Hc(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),Uc(t)(Fc(_c(t).document().write(Rc()(e,n,!0))))}function Uc(e){const n={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(sr),autolinkProtocol:y,autolinkEmail:y,atxHeading:l(rr),blockQuote:l(Ut),characterEscape:y,characterReference:y,codeFenced:l(nr),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:l(nr,a),codeText:l(Ul,a),codeTextData:y,data:y,codeFlowValue:y,definition:l(ql),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:l(Vl),hardBreakEscape:l(ir),hardBreakTrailing:l(ir),htmlFlow:l(lr,a),htmlFlowData:y,htmlText:l(lr,a),htmlTextData:y,image:l(Wl),label:a,link:l(sr),listItem:l(Gl),listItemValue:p,listOrdered:l(ar,d),listUnordered:l(ar),paragraph:l(Jl),reference:ge,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:l(rr),strong:l(Xl),thematicBreak:l(Yl)},exit:{atxHeading:u(),atxHeadingSequence:b,autolink:u(),autolinkEmail:Be,autolinkProtocol:Oe,blockQuote:u(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:Qe,characterReference:Ee,codeFenced:u(k),codeFencedFence:C,codeFencedFenceInfo:m,codeFencedFenceMeta:w,codeFlowValue:I,codeIndented:u(N),codeText:u(V),codeTextData:I,data:I,definition:u(),definitionDestinationString:E,definitionLabelString:j,definitionTitleString:v,emphasis:u(),hardBreakEscape:u(O),hardBreakTrailing:u(O),htmlFlow:u(_),htmlFlowData:I,htmlText:u(D),htmlTextData:I,image:u(de),label:g,labelText:Se,lineEnding:L,link:u(Q),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Re,resourceDestinationString:me,resourceTitleString:Ce,resource:x,setextHeading:u(R),setextHeadingLineSequence:M,setextHeadingText:z,strong:u(),thematicBreak:u()}};hl(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(S){let P={type:"root",children:[],position:void 0};const $={stack:[P],tokenStack:[],config:n,enter:o,exit:f,buffer:a,resume:h,data:t},H=[],se=[];let J=-1;for(;++J<S.length;)if(se.push(S[J]),S[J][1].type==="listOrdered"||S[J][1].type==="listUnordered")if(S[J][0]==="enter")H.push(se.length-1);else{const ae=H.pop();s(se,ae)}for(S=se,J=-1;++J<S.length;){const ae=n[S[J][0]];S[J][0]==="enter"&&n.beforeEnter.length>0&&i(n.beforeEnter,{...$,sliceSerialize:S[J][2].sliceSerialize},S[J][1]),fl.call(ae,S[J][1].type)&&ae[S[J][1].type].call({...$,sliceSerialize:S[J][2].sliceSerialize},S[J][1]),S[J][0]==="exit"&&n.afterExit.length>0&&i(n.afterExit,{...$,sliceSerialize:S[J][2].sliceSerialize},S[J][1])}if($.tokenStack.length>0){const ae=$.tokenStack[$.tokenStack.length-1];(ae[1]||Fr).call($,void 0,ae[0])}for(P.position={start:Ne(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:Ne(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},J=-1;++J<n.transforms.length;)P=n.transforms[J](P)||P;return P}function i(S,P,$){let H=-1;for(;++H<S.length;)S[H].call(P,$)}function s(S,P){const $=S.length-1;let H=P-1,se=-1,J=!1,ae,be,Ze,et;const tt=[];for(;++H<=$;){const ce=S[H];switch(ce[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ce[0]==="enter"?se++:se--,et=void 0;break}case"lineEndingBlank":{ce[0]==="enter"&&(ae&&!et&&!se&&!Ze&&(Ze=H),et=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:et=void 0}if(!se&&ce[0]==="enter"&&ce[1].type==="listItemPrefix"||se===-1&&ce[0]==="exit"&&(ce[1].type==="listUnordered"||ce[1].type==="listOrdered")){if(ae){let $e=H;for(be=void 0;$e--;){const je=S[$e];if(je[1].type==="lineEnding"||je[1].type==="lineEndingBlank"){if(je[0]==="exit")continue;be&&(S[be][1].type="lineEndingBlank",J=!0),je[1].type="lineEnding",be=$e}else if(!(je[1].type==="linePrefix"||je[1].type==="blockQuotePrefix"||je[1].type==="blockQuotePrefixWhitespace"||je[1].type==="blockQuoteMarker"||je[1].type==="listItemIndent"))break}Ze&&(!be||Ze<be)&&(ae._spread=!0),ae.end=Object.assign({},be?S[be][1].start:ce[1].end),tt.push({at:be||H,event:["exit",ae,ce[2]]})}if(ce[1].type==="listItemPrefix"){const $e={type:"listItem",_spread:!1,start:Object.assign({},ce[1].start),end:void 0};ae=$e,tt.push({at:H,event:["enter",$e,ce[2]]}),Ze=void 0,et=!0}}}const or=S.splice(P);let qt=0;for(H=-1;++H<or.length;){for(;qt<tt.length&&tt[qt].at===P+H;)S.push(tt[qt++].event);S.push(or[H])}S[P][1]._spread=J}function l(S,P){return $;function $(H){o.call(this,S(H),H),P&&P.call(this,H)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(S,P,$){this.stack[this.stack.length-1].children.push(S),this.stack.push(S),this.tokenStack.push([P,$||void 0]),S.position={start:Ne(P.start),end:void 0}}function u(S){return P;function P($){S&&S.call(this,$),f.call(this,$)}}function f(S,P){const $=this.stack.pop(),H=this.tokenStack.pop();if(!H)throw new Error("Cannot close `"+S.type+"` ("+st({start:S.start,end:S.end})+"): it’s not open");H[0].type!==S.type&&(P?P.call(this,S,H[0]):(H[1]||Fr).call(this,S,H[0])),$.position.end=Ne(S.end)}function h(){return $n(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(S){if(this.data.expectingFirstListItemValue){const P=this.stack[this.stack.length-2];P.start=Number.parseInt(this.sliceSerialize(S),10),this.data.expectingFirstListItemValue=void 0}}function m(){const S=this.resume(),P=this.stack[this.stack.length-1];P.lang=S}function w(){const S=this.resume(),P=this.stack[this.stack.length-1];P.meta=S}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const S=this.resume(),P=this.stack[this.stack.length-1];P.value=S.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const S=this.resume(),P=this.stack[this.stack.length-1];P.value=S.replace(/(\r?\n|\r)$/g,"")}function j(S){const P=this.resume(),$=this.stack[this.stack.length-1];$.label=P,$.identifier=ye(this.sliceSerialize(S)).toLowerCase()}function v(){const S=this.resume(),P=this.stack[this.stack.length-1];P.title=S}function E(){const S=this.resume(),P=this.stack[this.stack.length-1];P.url=S}function b(S){const P=this.stack[this.stack.length-1];if(!P.depth){const $=this.sliceSerialize(S).length;P.depth=$}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function M(S){const P=this.stack[this.stack.length-1];P.depth=this.sliceSerialize(S).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function y(S){const $=this.stack[this.stack.length-1].children;let H=$[$.length-1];(!H||H.type!=="text")&&(H=Kl(),H.position={start:Ne(S.start),end:void 0},$.push(H)),this.stack.push(H)}function I(S){const P=this.stack.pop();P.value+=this.sliceSerialize(S),P.position.end=Ne(S.end)}function L(S){const P=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $=P.children[P.children.length-1];$.position.end=Ne(S.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(P.type)&&(y.call(this,S),I.call(this,S))}function O(){this.data.atHardBreak=!0}function _(){const S=this.resume(),P=this.stack[this.stack.length-1];P.value=S}function D(){const S=this.resume(),P=this.stack[this.stack.length-1];P.value=S}function V(){const S=this.resume(),P=this.stack[this.stack.length-1];P.value=S}function Q(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=P,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function de(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=P,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function Se(S){const P=this.sliceSerialize(S),$=this.stack[this.stack.length-2];$.label=Bc(P),$.identifier=ye(P).toLowerCase()}function g(){const S=this.stack[this.stack.length-1],P=this.resume(),$=this.stack[this.stack.length-1];if(this.data.inReference=!0,$.type==="link"){const H=S.children;$.children=H}else $.alt=P}function me(){const S=this.resume(),P=this.stack[this.stack.length-1];P.url=S}function Ce(){const S=this.resume(),P=this.stack[this.stack.length-1];P.title=S}function x(){this.data.inReference=void 0}function ge(){this.data.referenceType="collapsed"}function Re(S){const P=this.resume(),$=this.stack[this.stack.length-1];$.label=P,$.identifier=ye(this.sliceSerialize(S)).toLowerCase(),this.data.referenceType="full"}function Z(S){this.data.characterReferenceType=S.type}function Qe(S){const P=this.sliceSerialize(S),$=this.data.characterReferenceType;let H;$?(H=el(P,$==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):H=Hn(P);const se=this.stack[this.stack.length-1];se.value+=H}function Ee(S){const P=this.stack.pop();P.position.end=Ne(S.end)}function Oe(S){I.call(this,S);const P=this.stack[this.stack.length-1];P.url=this.sliceSerialize(S)}function Be(S){I.call(this,S);const P=this.stack[this.stack.length-1];P.url="mailto:"+this.sliceSerialize(S)}function Ut(){return{type:"blockquote",children:[],position:void 0}}function nr(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function Ul(){return{type:"inlineCode",value:"",position:void 0}}function ql(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Vl(){return{type:"emphasis",children:[],position:void 0}}function rr(){return{type:"heading",depth:0,children:[],position:void 0}}function ir(){return{type:"break",position:void 0}}function lr(){return{type:"html",value:"",position:void 0}}function Wl(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function sr(){return{type:"link",title:null,url:"",children:[],position:void 0}}function ar(S){return{type:"list",ordered:S.type==="listOrdered",start:null,spread:S._spread,children:[],position:void 0}}function Gl(S){return{type:"listItem",spread:S._spread,checked:null,children:[],position:void 0}}function Jl(){return{type:"paragraph",children:[],position:void 0}}function Xl(){return{type:"strong",children:[],position:void 0}}function Kl(){return{type:"text",value:"",position:void 0}}function Yl(){return{type:"thematicBreak",position:void 0}}}function Ne(e){return{line:e.line,column:e.column,offset:e.offset}}function hl(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?hl(e,r):qc(e,r)}}function qc(e,n){let t;for(t in n)if(fl.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 Fr(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+st({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+st({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+st({start:n.start,end:n.end})+") is still open")}function Vc(e){const n=this;n.parser=t;function t(r){return Hc(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Wc(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 Gc(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
@@ -28,7 +28,7 @@ import{r as A,u as re,a as Je,bo as Ql,j as c,q as ee,i as Zl,k as es,l as ts,m
28
28
  `,...s.current()});const f=u.charCodeAt(0);return(f===9||f===32)&&(u=mp(f)+u.slice(1)),u=u?l+" "+u:l,t.options.closeAtx&&(u+=" "+l),o(),a(),u}jl.peek=yp;function jl(e){return e.value||""}function yp(){return"<"}vl.peek=bp;function vl(e,n,t,r){const i=Yn(t),s=i==='"'?"Quote":"Apostrophe",l=t.enter("image");let a=t.enter("label");const o=t.createTracker(r);let u=o.move("![");return u+=o.move(t.safe(e.alt,{before:u,after:"]",...o.current()})),u+=o.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(t.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(a=t.enter("destinationRaw"),u+=o.move(t.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),a(),e.title&&(a=t.enter(`title${s}`),u+=o.move(" "+i),u+=o.move(t.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),a()),u+=o.move(")"),l(),u}function bp(){return"!"}El.peek=kp;function El(e,n,t,r){const i=e.referenceType,s=t.enter("imageReference");let l=t.enter("label");const a=t.createTracker(r);let o=a.move("![");const u=t.safe(e.alt,{before:o,after:"]",...a.current()});o+=a.move(u+"]["),l();const f=t.stack;t.stack=f.filter(function(d){return d!=="phrasing"}),l=t.enter("reference");const h=t.safe(t.associationId(e),{before:o,after:"]",...a.current()});return l(),t.stack=f,s(),i==="full"||!u||u!==h?o+=a.move(h+"]"):i==="shortcut"?o=o.slice(0,-1):o+=a.move("]"),o}function kp(){return"!"}Nl.peek=wp;function Nl(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],a=t.compilePattern(l);if(!l.atBreak)continue;let o;for(;o=a.exec(r);){let u=o.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(o.index+1)}}return i+r+i}function wp(){return"`"}function Al(e,n){const t=$n(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))}Il.peek=Sp;function Il(e,n,t,r){const i=Yn(t),s=i==='"'?"Quote":"Apostrophe",l=t.createTracker(r);if(Al(e,t)){const f=t.stack;t.stack=f.filter(function(p){return p!=="phrasing"});const h=t.enter("autolink");let d=l.move("<");return d+=l.move(t.containerPhrasing(e,{before:d,after:">",...l.current()})),d+=l.move(">"),h(),t.stack=f,d}const a=t.enter("link");let o=t.enter("label"),u=l.move("[");return u+=l.move(t.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=t.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(t.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),u+=l.move(")"),a(),u}function Sp(e,n,t){return Al(e,t)?"<":"["}Tl.peek=Cp;function Tl(e,n,t,r){const i=e.referenceType,s=t.enter("linkReference");let l=t.enter("label");const a=t.createTracker(r);let o=a.move("[");const u=t.containerPhrasing(e,{before:o,after:"]",...a.current()});o+=a.move(u+"]["),l();const f=t.stack;t.stack=f.filter(function(d){return d!=="phrasing"}),l=t.enter("reference");const h=t.safe(t.associationId(e),{before:o,after:"]",...a.current()});return l(),t.stack=f,s(),i==="full"||!u||u!==h?o+=a.move(h+"]"):i==="shortcut"?o=o.slice(0,-1):o+=a.move("]"),o}function Cp(){return"["}function Zn(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 jp(e){const n=Zn(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 vp(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 Pl(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 Ep(e,n,t,r){const i=t.enter("list"),s=t.bulletCurrent;let l=e.ordered?vp(t):Zn(t);const a=e.ordered?l==="."?")":".":jp(t);let o=n&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&f&&(!f.children||!f.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&&(o=!0),Pl(t)===l&&f){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"){o=!0;break}}}}o&&(l=a),t.bulletCurrent=l;const u=t.containerFlow(e,r);return t.bulletLastUsed=l,t.bulletCurrent=s,i(),u}function Np(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 Ap(e,n,t,r){const i=Np(t);let s=t.bulletCurrent||Zn(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 a=t.createTracker(r);a.move(s+" ".repeat(l-s.length)),a.shift(l);const o=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,a.current()),f);return o(),u;function f(h,d,p){return d?(p?"":" ".repeat(l))+h:(p?s:s+" ".repeat(l-s.length))+h}}function Ip(e,n,t,r){const i=t.enter("paragraph"),s=t.enter("phrasing"),l=t.containerPhrasing(e,r);return s(),i(),l}function Tp(e,n,t,r){if(!e.children.some(function(a){return np(a)}))return t.containerFlow(e,r);const s=t.enter("phrasing"),l=t.containerPhrasing(e,r);return s(),l}function Pp(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}er.attention=zp;er.peek=Lp;function er(e,n,t,r){const i=t.enter("phrasing"),s=t.containerPhrasing({type:"root",children:[e]},r);return i(),s}function zp(e,n){return{construct:"strong",markers:Pp(n)==="*"?["*","_"]:["_","*"],sizes:[2]}}function Lp(e,n,t){return t.options.strong||"*"}function Dp(e,n,t,r){const i=n?n.children:[],s=i.indexOf(e);return t.safe(e.value,{...r,afterNode:i[s+1],beforeNode:i[s-1]})}function Mp(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 _p(e,n,t){const r=(Pl(t)+(t.options.ruleSpaces?" ":"")).repeat(Mp(t));return t.options.ruleSpaces?r.slice(0,-1):r}const zl={blockquote:rp,break:ri,code:up,definition:fp,emphasis:Qn,hardBreak:ri,heading:xp,html:jl,image:vl,imageReference:El,inlineCode:Nl,link:Il,linkReference:Tl,list:Ep,listItem:Ap,paragraph:Ip,root:Tp,strong:er,text:Dp,thematicBreak:_p};function Fp(){return{enter:{table:Rp,tableData:ii,tableHeader:ii,tableRow:Bp},exit:{codeText:$p,table:Op,tableData:un,tableHeader:un,tableRow:un}}}function Rp(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function Op(e){this.exit(e),this.data.inTable=void 0}function Bp(e){this.enter({type:"tableRow",children:[]},e)}function un(e){this.exit(e)}function ii(e){this.enter({type:"tableCell",children:[]},e)}function $p(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,Hp));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function Hp(e,n){return n==="|"?n:e}function Up(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,s=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
29
29
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:l,tableCell:o,tableRow:a}};function l(p,m,w,C){return u(f(p,w,C),p.align)}function a(p,m,w,C){const k=h(p,w,C),N=u([k]);return N.slice(0,N.indexOf(`
30
30
  `))}function o(p,m,w,C){const k=w.enter("tableCell"),N=w.enter("phrasing"),j=w.containerPhrasing(p,{...C,before:s,after:s});return N(),k(),j}function u(p,m){return ep(p,{align:m,alignDelimiters:r,padding:t,stringLength:i})}function f(p,m,w){const C=p.children;let k=-1;const N=[],j=m.enter("table");for(;++k<C.length;)N[k]=h(C[k],m,w);return j(),N}function h(p,m,w){const C=p.children;let k=-1;const N=[],j=m.enter("tableRow");for(;++k<C.length;)N[k]=o(C[k],p,m,w);return j(),N}function d(p,m,w){let C=zl.inlineCode(p,m,w);return w.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function qp(){return{exit:{taskListCheckValueChecked:li,taskListCheckValueUnchecked:li,paragraph:Wp}}}function Vp(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Gp}}}function li(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function Wp(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 a=i[s];if(a.type==="paragraph"){l=a;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=Object.assign({},r.position.start)))}}this.exit(e)}function Gp(e,n,t,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",a=t.createTracker(r);s&&a.move(l);let o=zl.listItem(e,n,t,{...r,...a.current()});return s&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),o;function u(f){return f+l}}function Jp(){return[Sh(),Uh(),Gh(),Fp(),qp()]}function Xp(e){return{extensions:[Ch(),qh(e),Jh(),Up(e),Vp()]}}const Kp={tokenize:nd,partial:!0},Ll={tokenize:rd,partial:!0},Dl={tokenize:id,partial:!0},Ml={tokenize:ld,partial:!0},Yp={tokenize:sd,partial:!0},_l={name:"wwwAutolink",tokenize:ed,previous:Rl},Fl={name:"protocolAutolink",tokenize:td,previous:Ol},ve={name:"emailAutolink",tokenize:Zp,previous:Bl},we={};function Qp(){return{text:we}}let ze=48;for(;ze<123;)we[ze]=ve,ze++,ze===58?ze=65:ze===91&&(ze=97);we[43]=ve;we[45]=ve;we[46]=ve;we[95]=ve;we[72]=[ve,Fl];we[104]=[ve,Fl];we[87]=[ve,_l];we[119]=[ve,_l];function Zp(e,n,t){const r=this;let i,s;return l;function l(h){return!Tn(h)||!Bl.call(r,r.previous)||tr(r.events)?t(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(h))}function a(h){return Tn(h)?(e.consume(h),a):h===64?(e.consume(h),o):t(h)}function o(h){return h===46?e.check(Yp,f,u)(h):h===45||h===95||te(h)?(s=!0,e.consume(h),o):f(h)}function u(h){return e.consume(h),i=!0,o}function f(h){return s&&i&&le(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||!Rl.call(r,r.previous)||tr(r.events)?t(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Kp,e.attempt(Ll,e.attempt(Dl,s),t),t)(l))}function s(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function td(e,n,t){const r=this;let i="",s=!1;return l;function l(h){return(h===72||h===104)&&Ol.call(r,r.previous)&&!tr(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),a):t(h)}function a(h){if(le(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),a;if(h===58){const d=i.toLowerCase();if(d==="http"||d==="https")return e.consume(h),o}return t(h)}function o(h){return h===47?(e.consume(h),s?u:(s=!0,o)):t(h)}function u(h){return h===null||jt(h)||G(h)||_e(h)||Rt(h)?t(h):e.attempt(Ll,e.attempt(Dl,f),t)(h)}function f(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(h)}}function nd(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 rd(e,n,t){let r,i,s;return l;function l(u){return u===46||u===95?e.check(Ml,o,a)(u):u===null||G(u)||_e(u)||u!==45&&Rt(u)?o(u):(s=!0,e.consume(u),l)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),l}function o(u){return i||r||!s?t(u):n(u)}}function id(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(Ml,n,s)(l):l===null||G(l)||_e(l)?n(l):(e.consume(l),i)}function s(l){return l===41&&r++,e.consume(l),i}}function ld(e,n,t){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||G(a)||_e(a)?n(a):t(a)}function i(a){return a===null||a===40||a===91||G(a)||_e(a)?n(a):r(a)}function s(a){return le(a)?l(a):t(a)}function l(a){return a===59?(e.consume(a),r):le(a)?(e.consume(a),l):t(a)}}function sd(e,n,t){return r;function r(s){return e.consume(s),i}function i(s){return te(s)?t(s):n(s)}}function Rl(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||G(e)}function Ol(e){return!le(e)}function Bl(e){return!(e===47||Tn(e))}function Tn(e){return e===43||e===45||e===46||e===95||te(e)}function tr(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 ad={tokenize:md,partial:!0};function od(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:hd,continuation:{tokenize:pd},exit:dd}},text:{91:{name:"gfmFootnoteCall",tokenize:fd},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ud,resolveTo:cd}}}}function ud(e,n,t){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){l=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return a;function a(o){if(!l||!l._balanced)return t(o);const u=ye(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?t(o):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),n(o))}}function cd(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)},a=[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,...a),e}function fd(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,l;return a;function a(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),o}function o(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||G(h))return t(h);if(h===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return i.includes(ye(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(h)}return G(h)||(l=!0),s++,e.consume(h),h===92?f:u}function f(h){return h===91||h===92||h===93?(e.consume(h),s++,u):u(h)}}function hd(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,l=0,a;return o;function o(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",f):t(m)}function f(m){if(l>999||m===93&&!a||m===null||m===91||G(m))return t(m);if(m===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return s=ye(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return G(m)||(a=!0),l++,e.consume(m),m===92?h:f}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}function d(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),q(e,p,"gfmFootnoteDefinitionWhitespace")):t(m)}function p(m){return n(m)}}function pd(e,n,t){return e.check(pt,n,e.attempt(ad,n,t))}function dd(e){e.exit("gfmFootnoteDefinition")}function md(e,n,t){const r=this;return q(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 gd(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,a){let o=-1;for(;++o<l.length;)if(l[o][0]==="enter"&&l[o][1].type==="strikethroughSequenceTemporary"&&l[o][1]._close){let u=o;for(;u--;)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[o][1].end.offset-l[o][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[o][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[o][1].end)},h={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[o][1].start)},d=[["enter",f,a],["enter",l[u][1],a],["exit",l[u][1],a],["enter",h,a]],p=a.parser.constructs.insideSpan.null;p&&xe(d,d.length,0,Ot(p,l.slice(u+1,o),a)),xe(d,d.length,0,[["exit",h,a],["enter",l[o][1],a],["exit",l[o][1],a],["exit",f,a]]),xe(l,u-1,o-u+3,d),o=u+d.length-2;break}}for(o=-1;++o<l.length;)l[o][1].type==="strikethroughSequenceTemporary"&&(l[o][1].type="data");return l}function s(l,a,o){const u=this.previous,f=this.events;let h=0;return d;function d(m){return u===126&&f[f.length-1][1].type!=="characterEscape"?o(m):(l.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const w=Et(u);if(m===126)return h>1?o(m):(l.consume(m),h++,p);if(h<2&&!t)return o(m);const C=l.exit("strikethroughSequenceTemporary"),k=Et(m);return C._open=!k||k===2&&!!w,C._close=!w||w===2&&!!k,a(m)}}}class xd{constructor(){this.map=[],this.index=new Map}add(n,t,r){yd(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 yd(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 bd(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 kd(){return{flow:{null:{name:"table",tokenize:wd,resolveAll:Sd}}}}function wd(e,n,t){const r=this;let i=0,s=0,l;return a;function a(y){let I=r.events.length-1;for(;I>-1;){const{type:_}=r.events[I][1];if(_==="lineEnding"||_==="linePrefix")I--;else break}const L=I>-1?r.events[I][1].type:null,O=L==="tableHead"||L==="tableRow"?b:o;return O===b&&r.parser.lazy[r.now().line]?t(y):O(y)}function o(y){return e.enter("tableHead"),e.enter("tableRow"),u(y)}function u(y){return y===124||(l=!0,s+=1),f(y)}function f(y){return y===null?t(y):F(y)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):t(y):U(y)?q(e,f,"whitespace")(y):(s+=1,l&&(l=!1,i+=1),y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),h(y)))}function h(y){return y===null||y===124||G(y)?(e.exit("data"),f(y)):(e.consume(y),y===92?d:h)}function d(y){return y===92||y===124?(e.consume(y),h):h(y)}function p(y){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(y):(e.enter("tableDelimiterRow"),l=!1,U(y)?q(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):m(y))}function m(y){return y===45||y===58?C(y):y===124?(l=!0,e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),w):E(y)}function w(y){return U(y)?q(e,C,"whitespace")(y):C(y)}function C(y){return y===58?(s+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),k):y===45?(s+=1,k(y)):y===null||F(y)?v(y):E(y)}function k(y){return y===45?(e.enter("tableDelimiterFiller"),N(y)):E(y)}function N(y){return y===45?(e.consume(y),N):y===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(y))}function j(y){return U(y)?q(e,v,"whitespace")(y):v(y)}function v(y){return y===124?m(y):y===null||F(y)?!l||i!==s?E(y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(y)):E(y)}function E(y){return t(y)}function b(y){return e.enter("tableRow"),z(y)}function z(y){return y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),z):y===null||F(y)?(e.exit("tableRow"),n(y)):U(y)?q(e,z,"whitespace")(y):(e.enter("data"),M(y))}function M(y){return y===null||y===124||G(y)?(e.exit("data"),z(y)):(e.consume(y),y===92?R:M)}function R(y){return y===92||y===124?(e.consume(y),M):M(y)}}function Sd(e,n){let t=-1,r=!0,i=0,s=[0,0,0,0],l=[0,0,0,0],a=!1,o=0,u,f,h;const d=new xd;for(;++t<e.length;){const p=e[t],m=p[1];p[0]==="enter"?m.type==="tableHead"?(a=!1,o!==0&&(si(d,n,o,u,f),f=void 0,o=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],a&&(a=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},d.add(t,0,[["enter",f,n]])),i=m.type==="tableDelimiterRow"?2:f?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=yt(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=yt(d,n,s,i,void 0,h)),s=l,l=[s[1],t,0,0])):m.type==="tableHead"?(a=!0,o=t):m.type==="tableRow"||m.type==="tableDelimiterRow"?(o=t,s[1]!==0?(l[0]=l[1],h=yt(d,n,s,i,t,h)):l[1]!==0&&(h=yt(d,n,l,i,t,h)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(l[3]=t)}for(o!==0&&si(d,n,o,u,f),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=bd(n.events,t))}return e}function yt(e,n,t,r,i,s){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";t[0]!==0&&(s.end=Object.assign({},qe(n.events,t[0])),e.add(t[0],0,[["exit",s,n]]));const o=qe(n.events,t[1]);if(s={type:l,start:Object.assign({},o),end:Object.assign({},o)},e.add(t[1],0,[["enter",s,n]]),t[2]!==0){const u=qe(n.events,t[2]),f=qe(n.events,t[3]),h={type:a,start:Object.assign({},u),end:Object.assign({},f)};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,w=t[3]-t[2]-1;e.add(m,w,[])}}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 si(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 Cd={name:"tasklistCheck",tokenize:vd};function jd(){return{text:{91:Cd}}}function vd(e,n,t){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(o):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),s)}function s(o){return G(o)?(e.enter("taskListCheckValueUnchecked"),e.consume(o),e.exit("taskListCheckValueUnchecked"),l):o===88||o===120?(e.enter("taskListCheckValueChecked"),e.consume(o),e.exit("taskListCheckValueChecked"),l):t(o)}function l(o){return o===93?(e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):t(o)}function a(o){return F(o)?n(o):U(o)?e.check({tokenize:Ed},n,t)(o):t(o)}}function Ed(e,n,t){return q(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function Nd(e){return Zi([Qp(),od(),gd(e),kd(),jd()])}const Ad={};function Id(e){const n=this,t=e||Ad,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Nd(t)),s.push(Jp()),l.push(Xp(t))}const Le=()=>`${window.routePrefix??""}/docs/api`,Td=e=>`${window.routePrefix??""}/docs/${encodeURIComponent(e)}`,It={list:async(e,n)=>{const{data:t}=await ee.getJson(`${Le()}/list`,{params:{locale:e},signal:n});return t.documents??[]},keywords:async(e,n)=>{const{data:t}=await ee.getJson(`${Le()}/keywords`,{params:{locale:e},signal:n});return t.keywords??{}},search:async(e,n)=>{const{data:t}=await ee.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 ee.getJson(`${Le()}/context`,{params:{url:e,model:n,locale:t},signal:r});return i.documents??[]},doc:async(e,n,t)=>{const{data:r}=await ee.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 ee.getJson(`${Le()}/resolve`,{params:{from:e,refs:n.join(",")},signal:t});return r.resolved??{}},schema:async(e,n)=>{const{data:t}=await ee.getJson(`${Le()}/schema`,{params:{model:e},signal:n});return t}},wt=e=>e.trim().toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,""),pm=e=>{const n=[];let t=!1;for(const r of e.split(`
31
- `)){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:wt(s)})}return n},Pd=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):"",zd=()=>typeof document<"u"&&document.documentElement.classList.contains("dark"),Ld=()=>{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)},()=>{})}}},Dd=({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),ca(()=>import("./mermaid.core-Dojzw60O.js").then(a=>a.bI),__vite__mapDeps([0,1,2,3]),import.meta.url).then(async({default:a})=>{a.initialize({startOnLoad:!1,securityLevel:"strict",theme:zd()?"dark":"default"});const o=await a.render(`mermaid-${s}`,e);l||t(o.svg)}).catch(()=>{l||i(!0)}),()=>{l=!0}},[e,s]),r?c.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?c.jsx("div",{className:"my-3 flex justify-center overflow-x-auto rounded-xl border p-3 [&_svg]:max-w-full",dangerouslySetInnerHTML:{__html:n}}):c.jsx("div",{className:"bg-muted/30 text-muted-foreground my-3 rounded-xl border p-4 text-sm",children:"…"})},Md=({source:e})=>{const[n,t]=A.useState(null),[r,i]=A.useState(null),[s,l]=A.useState(!1),a=A.useMemo(()=>{try{const o=JSON.parse(e);return o&&typeof o=="object"?o:null}catch{return null}},[e]);return A.useEffect(()=>{if(!a){l(!0);return}if(a.fields){t(a.fields),i(a.title??null);return}if(!a.model){l(!0);return}const o=new AbortController;return It.schema(a.model,o.signal).then(u=>{o.signal.aborted||(t(u.fields),i(a.title??u.title))}).catch(()=>{o.signal.aborted||l(!0)}),()=>o.abort()},[a]),s?c.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}):c.jsx(Ri,{className:"my-3",fields:n,title:r,loading:!n})},_d=({language:e,code:n})=>{const{isCopied:t,copy:r}=Ld();return c.jsxs("div",{className:"my-3",children:[c.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:[c.jsx("span",{className:"text-muted-foreground font-medium lowercase",children:e}),c.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground transition-colors",onClick:()=>r(n),"aria-label":"Copy",children:t?c.jsx(di,{className:"size-3.5"}):c.jsx(fa,{className:"size-3.5"})})]}),c.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:c.jsx("code",{children:n})})]})};function Fd({markdown:e,docLinks:n={},onDocLink:t,className:r}){const i=A.useMemo(()=>({h1:({className:s,children:l,...a})=>c.jsx("h1",{id:wt(Ve(l)),className:X("aui-md-h1 mt-6 mb-3 scroll-mt-20 text-2xl font-semibold first:mt-0",s),...a,children:l}),h2:({className:s,children:l,...a})=>c.jsx("h2",{id:wt(Ve(l)),className:X("aui-md-h2 mt-6 mb-2 scroll-mt-20 text-xl font-semibold first:mt-0",s),...a,children:l}),h3:({className:s,children:l,...a})=>c.jsx("h3",{id:wt(Ve(l)),className:X("aui-md-h3 mt-5 mb-2 scroll-mt-20 text-lg font-semibold first:mt-0",s),...a,children:l}),h4:({className:s,...l})=>c.jsx("h4",{className:X("aui-md-h4 mt-4 mb-1.5 text-base font-medium first:mt-0",s),...l}),p:({className:s,...l})=>c.jsx("p",{className:X("aui-md-p my-3 leading-relaxed first:mt-0 last:mb-0",s),...l}),a:({className:s,href:l,children:a,...o})=>{const u=(l??"").trim(),f=X("aui-md-a text-primary hover:text-primary/80 underline underline-offset-2",s);if(u.startsWith("#"))return c.jsx("a",{className:f,href:u,...o,children:a});if(/^[a-z][a-z0-9+.-]*:/i.test(u)||u.startsWith("//"))return c.jsx("a",{className:f,href:u,target:"_blank",rel:"noreferrer",...o,children:a});if(u.startsWith("/"))return c.jsx("a",{className:f,href:u,onClick:p=>{p.button!==0||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey||(p.preventDefault(),ft.visit(u))},...o,children:a});const d=n[u]??n[u.replace(/#.*$/,"")];return!d||!t?c.jsx("span",{className:X("text-foreground",s),children:a}):c.jsx("a",{className:f,href:Td(d),onClick:p=>{p.button!==0||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey||(p.preventDefault(),t(d))},...o,children:a})},blockquote:({className:s,...l})=>c.jsx("blockquote",{className:X("aui-md-blockquote border-muted-foreground/30 text-muted-foreground my-3 border-s-2 ps-4",s),...l}),ul:({className:s,...l})=>c.jsx("ul",{className:X("aui-md-ul marker:text-muted-foreground my-3 ms-5 list-disc [&>li]:mt-1",s),...l}),ol:({className:s,...l})=>c.jsx("ol",{className:X("aui-md-ol marker:text-muted-foreground my-3 ms-5 list-decimal [&>li]:mt-1",s),...l}),li:({className:s,...l})=>c.jsx("li",{className:X("aui-md-li leading-relaxed",s),...l}),hr:({className:s,...l})=>c.jsx("hr",{className:X("aui-md-hr border-muted-foreground/20 my-4",s),...l}),table:({className:s,...l})=>c.jsx("div",{className:"my-3 overflow-x-auto",children:c.jsx("table",{className:X("aui-md-table w-full border-separate border-spacing-0 text-sm",s),...l})}),th:({className:s,...l})=>c.jsx("th",{className:X("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})=>c.jsx("td",{className:X("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})=>c.jsx("tr",{className:X("aui-md-tr m-0 border-b p-0 first:border-t",s),...l}),img:({className:s,...l})=>c.jsx("img",{className:X("my-3 max-w-full rounded-lg border",s),...l}),code:({className:s,...l})=>c.jsx("code",{className:X("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 c.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 a=/language-([\w-]+)/.exec(l.props.className??"")?.[1]??"",o=Ve(l.props.children).replace(/\n$/,"");return a==="mermaid"?c.jsx(Dd,{code:o}):a==="schema"?c.jsx(Md,{source:o}):c.jsx(_d,{language:a||"text",code:o})}}),[n,t]);return c.jsx("div",{className:X("aui-md text-sm",r),children:c.jsx(hh,{remarkPlugins:[Id],components:i,children:e})})}function Rd(e,n){const[t,r]=A.useState(null),[i,s]=A.useState({}),[l,a]=A.useState(!1),[o,u]=A.useState(!1);return A.useEffect(()=>{if(!e){r(null),s({}),u(!1);return}const f=new AbortController;return a(!0),u(!1),It.doc(e,n,f.signal).then(async h=>{if(f.signal.aborted)return;r(h);const d=Pd(h.markdown),p=d.length>0?await It.resolve(h.meta.id,d,f.signal).catch(()=>({})):{};f.signal.aborted||s(p)}).catch(()=>{f.signal.aborted||(r(null),u(!0))}).finally(()=>{f.signal.aborted||a(!1)}),()=>f.abort()},[e,n]),{content:t,docLinks:i,loading:l,error:o}}const Od="adminizer:ai-attach-doc";function Bd(e){window.__adminizerAttachDoc__=e,window.dispatchEvent(new CustomEvent(Od,{detail:e}))}const ut="info",ai=()=>{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}},$d=e=>{const{pathname:n,search:t}=window.location;window.history.pushState(null,"",`${n}${t}${e}`),window.dispatchEvent(new HashChangeEvent("hashchange"))},Hd=()=>{const[e,n]=A.useState(ai);return A.useEffect(()=>{const t=()=>n(ai());window.addEventListener("hashchange",t),window.addEventListener("popstate",t);const r=ft.on("navigate",t);return()=>{window.removeEventListener("hashchange",t),window.removeEventListener("popstate",t),r()}},[]),e},Ud=()=>{const e=re();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 qd({open:e,docId:n,items:t,model:r,onOpenDoc:i,onClose:s}){const{t:l,locale:a}=Je(),{isEnabled:o,openChat:u}=Ft(),[f,h]=A.useState(void 0),{content:d,docLinks:p,loading:m,error:w}=Rd(e?n:null,f??a),[C,k]=A.useState(null),[N,j]=A.useState(!1),[v,E]=A.useState("docs");A.useEffect(()=>h(void 0),[n]),A.useEffect(()=>{if(!e||!r)return;const R=new AbortController;return k(null),j(!1),It.schema(r,R.signal).then(y=>{R.signal.aborted||k(y)}).catch(()=>{R.signal.aborted||j(!0)}),()=>R.abort()},[r,e]);const b=A.useMemo(()=>{const R=new Map;for(const y of t){const I=y.section??"";R.set(I,[...R.get(I)??[],y])}return[...R.entries()]},[t]),z=A.useRef(!1),M=()=>{d&&(z.current=!0,s(),u(),Bd({id:d.meta.id,title:d.meta.title}))};return c.jsx(pa,{open:e,onOpenChange:R=>!R&&s(),children:c.jsxs(da,{side:"right",className:"z-[1002] w-full gap-0 p-0 sm:max-w-xl",onCloseAutoFocus:R=>{z.current&&(z.current=!1,R.preventDefault())},children:[c.jsxs(ma,{className:"border-b px-4 py-3",children:[c.jsxs("div",{className:"flex items-center gap-2 pe-8",children:[n&&c.jsx(ne,{variant:"ghost",size:"icon",className:"-ms-2 shrink-0",onClick:()=>i(null),"aria-label":l("Back to contents"),children:c.jsx(ga,{className:"size-4"})}),c.jsx(xa,{className:"truncate",children:n?d?.meta.title??l("Documentation"):l("Page documentation")})]}),c.jsx(ya,{className:"sr-only",children:l("Documentation")})]}),c.jsxs(ba,{value:r?v:"docs",onValueChange:E,className:"flex min-h-0 flex-1 flex-col gap-0",children:[r&&c.jsxs(ka,{className:"mx-4 mt-3 w-fit",children:[c.jsx(hr,{value:"docs",children:l("Documentation")}),c.jsx(hr,{value:"schema",children:l("Schema")})]}),c.jsx(pr,{value:"docs",className:"min-h-0 flex-1 overflow-y-auto px-4 py-3",children:n?m&&!d?c.jsx("p",{className:"text-muted-foreground text-sm",children:l("Loading...")}):w||!d?c.jsx("p",{className:"text-muted-foreground text-sm",children:l("Failed to load documentation")}):c.jsxs("div",{className:"flex flex-col gap-3",children:[(d.meta.locales?.length??0)>1&&c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:l("Language")}),d.meta.locales?.map(R=>c.jsx("button",{type:"button",onClick:()=>h(R),className:X("rounded-full border px-2 py-0.5 text-xs uppercase transition-colors",R===d.locale?"bg-primary text-primary-foreground border-transparent":"hover:bg-accent"),children:R},R))]}),c.jsx(Fd,{markdown:d.markdown,docLinks:p,onDocLink:i})]}):t.length===0?c.jsx("p",{className:"text-muted-foreground text-sm",children:l("Nothing found")}):c.jsx("div",{className:"flex flex-col gap-4",children:b.map(([R,y])=>c.jsxs("div",{className:"flex flex-col gap-1",children:[R&&c.jsx("div",{className:"text-muted-foreground px-1 text-xs font-medium uppercase",children:R}),y.map(I=>c.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:[c.jsx(wa,{className:"text-muted-foreground size-4 shrink-0"}),c.jsx("span",{className:"truncate",children:I.title})]},I.id))]},R))})}),r&&c.jsx(pr,{value:"schema",className:"min-h-0 flex-1 overflow-y-auto px-4 py-3",children:c.jsx(Ri,{fields:C?.fields??(N?[]:null),title:C?.title??r,loading:!C&&!N})})]}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t px-4 py-3",children:[c.jsx(ne,{variant:"ghost",size:"sm",asChild:!0,children:c.jsxs(pe,{href:`${window.routePrefix}/docs${n?`/${encodeURIComponent(n)}`:""}`,children:[c.jsx(Sa,{className:"size-4"}),l("Open in knowledge base")]})}),o&&d&&c.jsxs(ne,{variant:"outline",size:"sm",onClick:M,children:[c.jsx(mi,{className:"size-4"}),l("Send to assistant")]})]})]})})}function Vd(){const n=re().props.docs,{t}=Je(),{open:r,docId:i}=Hd(),s=Ud(),l=A.useCallback(f=>{$d(f?`#${ut}=${encodeURIComponent(f)}`:`#${ut}`)},[]),a=A.useCallback(()=>{const{pathname:f,search:h}=window.location;window.history.pushState(null,"",`${f}${h}`),window.dispatchEvent(new HashChangeEvent("hashchange"))},[]);if(!n)return null;const o=n.items??[],u=o.length>0||!!s;return c.jsxs(c.Fragment,{children:[u&&c.jsxs(Dt,{children:[c.jsx(Mt,{asChild:!0,children:c.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0",onClick:()=>l(null),"aria-label":t("Page documentation"),children:c.jsx(ha,{className:"size-4"})})}),c.jsx(_t,{side:"bottom",className:"z-[1002]",children:c.jsx("span",{children:t("Page documentation")})})]}),c.jsx(qd,{open:r,docId:i,items:o,model:s,onOpenDoc:l,onClose:a})]})}function $l({breadcrumbs:e=[]}){return c.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:c.jsxs("div",{className:"flex justify-between w-full",children:[c.jsx("div",{className:"flex items-center gap-2",children:c.jsx(Te,{name:"HeaderStart",Default:Wd,breadcrumbs:e})}),c.jsx("div",{className:"flex gap-4 items-center",children:c.jsx(Te,{name:"HeaderActions",Default:Gd,breadcrumbs:e})})]})})}function Wd({breadcrumbs:e=[]}){return c.jsxs(c.Fragment,{children:[c.jsx(Ca,{className:"-ml-1"}),c.jsx(Li,{breadcrumbs:e})]})}function Gd(){const{tabs:e}=bi(),n=re();return c.jsxs(c.Fragment,{children:[c.jsx(Fi,{}),c.jsx(Za,{}),c.jsx(Vd,{}),n.props.history&&c.jsx(pe,{href:`${window.routePrefix}/history/view-all`,children:c.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0",children:c.jsx(ja,{})})}),c.jsx(_i,{}),n.props.notifications&&(e===null?c.jsx("div",{className:"w-[40px] flex-none flex justify-center",children:c.jsx(Xe,{className:"size-4 animate-spin"})}):e.length?c.jsx(Qa,{}):null),c.jsx(Mi,{})]})}const Hl=A.memo(({children:e,breadcrumbs:n=[],className:t})=>{const r=re(),i=n.length?n:r.props.breadcrumbs??[];return c.jsxs(ji,{variant:"sidebar",children:[c.jsx(xi,{title:r.props.title}),c.jsx(Te,{name:"Sidebar",Default:zi}),c.jsxs(va,{className:"overflow-hidden",children:[c.jsx(Te,{name:"Header",Default:$l,breadcrumbs:i}),c.jsx("div",{"data-scroll-region":"content",className:X("relative flex min-h-0 flex-1 overflow-y-auto overscroll-contain",t),children:c.jsx("div",{className:"flex min-h-full w-full flex-col",children:e})})]})]})}),cn=new Map,Pn=new Map;function Jd(e){let n=cn.get(e);return n||(n=import(e).then(t=>(Pn.set(e,t),t)),n.catch(()=>cn.delete(e)),cn.set(e,n)),n}function Xd(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 oi=[],ui=[];function Kd(e,n=[]){const t=e.join(`
31
+ `)){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:wt(s)})}return n},Pd=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):"",zd=()=>typeof document<"u"&&document.documentElement.classList.contains("dark"),Ld=()=>{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)},()=>{})}}},Dd=({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),ca(()=>import("./mermaid.core-3Xq6zKVA.js").then(a=>a.bI),__vite__mapDeps([0,1,2,3]),import.meta.url).then(async({default:a})=>{a.initialize({startOnLoad:!1,securityLevel:"strict",theme:zd()?"dark":"default"});const o=await a.render(`mermaid-${s}`,e);l||t(o.svg)}).catch(()=>{l||i(!0)}),()=>{l=!0}},[e,s]),r?c.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?c.jsx("div",{className:"my-3 flex justify-center overflow-x-auto rounded-xl border p-3 [&_svg]:max-w-full",dangerouslySetInnerHTML:{__html:n}}):c.jsx("div",{className:"bg-muted/30 text-muted-foreground my-3 rounded-xl border p-4 text-sm",children:"…"})},Md=({source:e})=>{const[n,t]=A.useState(null),[r,i]=A.useState(null),[s,l]=A.useState(!1),a=A.useMemo(()=>{try{const o=JSON.parse(e);return o&&typeof o=="object"?o:null}catch{return null}},[e]);return A.useEffect(()=>{if(!a){l(!0);return}if(a.fields){t(a.fields),i(a.title??null);return}if(!a.model){l(!0);return}const o=new AbortController;return It.schema(a.model,o.signal).then(u=>{o.signal.aborted||(t(u.fields),i(a.title??u.title))}).catch(()=>{o.signal.aborted||l(!0)}),()=>o.abort()},[a]),s?c.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}):c.jsx(Ri,{className:"my-3",fields:n,title:r,loading:!n})},_d=({language:e,code:n})=>{const{isCopied:t,copy:r}=Ld();return c.jsxs("div",{className:"my-3",children:[c.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:[c.jsx("span",{className:"text-muted-foreground font-medium lowercase",children:e}),c.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground transition-colors",onClick:()=>r(n),"aria-label":"Copy",children:t?c.jsx(di,{className:"size-3.5"}):c.jsx(fa,{className:"size-3.5"})})]}),c.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:c.jsx("code",{children:n})})]})};function Fd({markdown:e,docLinks:n={},onDocLink:t,className:r}){const i=A.useMemo(()=>({h1:({className:s,children:l,...a})=>c.jsx("h1",{id:wt(Ve(l)),className:X("aui-md-h1 mt-6 mb-3 scroll-mt-20 text-2xl font-semibold first:mt-0",s),...a,children:l}),h2:({className:s,children:l,...a})=>c.jsx("h2",{id:wt(Ve(l)),className:X("aui-md-h2 mt-6 mb-2 scroll-mt-20 text-xl font-semibold first:mt-0",s),...a,children:l}),h3:({className:s,children:l,...a})=>c.jsx("h3",{id:wt(Ve(l)),className:X("aui-md-h3 mt-5 mb-2 scroll-mt-20 text-lg font-semibold first:mt-0",s),...a,children:l}),h4:({className:s,...l})=>c.jsx("h4",{className:X("aui-md-h4 mt-4 mb-1.5 text-base font-medium first:mt-0",s),...l}),p:({className:s,...l})=>c.jsx("p",{className:X("aui-md-p my-3 leading-relaxed first:mt-0 last:mb-0",s),...l}),a:({className:s,href:l,children:a,...o})=>{const u=(l??"").trim(),f=X("aui-md-a text-primary hover:text-primary/80 underline underline-offset-2",s);if(u.startsWith("#"))return c.jsx("a",{className:f,href:u,...o,children:a});if(/^[a-z][a-z0-9+.-]*:/i.test(u)||u.startsWith("//"))return c.jsx("a",{className:f,href:u,target:"_blank",rel:"noreferrer",...o,children:a});if(u.startsWith("/"))return c.jsx("a",{className:f,href:u,onClick:p=>{p.button!==0||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey||(p.preventDefault(),ft.visit(u))},...o,children:a});const d=n[u]??n[u.replace(/#.*$/,"")];return!d||!t?c.jsx("span",{className:X("text-foreground",s),children:a}):c.jsx("a",{className:f,href:Td(d),onClick:p=>{p.button!==0||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey||(p.preventDefault(),t(d))},...o,children:a})},blockquote:({className:s,...l})=>c.jsx("blockquote",{className:X("aui-md-blockquote border-muted-foreground/30 text-muted-foreground my-3 border-s-2 ps-4",s),...l}),ul:({className:s,...l})=>c.jsx("ul",{className:X("aui-md-ul marker:text-muted-foreground my-3 ms-5 list-disc [&>li]:mt-1",s),...l}),ol:({className:s,...l})=>c.jsx("ol",{className:X("aui-md-ol marker:text-muted-foreground my-3 ms-5 list-decimal [&>li]:mt-1",s),...l}),li:({className:s,...l})=>c.jsx("li",{className:X("aui-md-li leading-relaxed",s),...l}),hr:({className:s,...l})=>c.jsx("hr",{className:X("aui-md-hr border-muted-foreground/20 my-4",s),...l}),table:({className:s,...l})=>c.jsx("div",{className:"my-3 overflow-x-auto",children:c.jsx("table",{className:X("aui-md-table w-full border-separate border-spacing-0 text-sm",s),...l})}),th:({className:s,...l})=>c.jsx("th",{className:X("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})=>c.jsx("td",{className:X("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})=>c.jsx("tr",{className:X("aui-md-tr m-0 border-b p-0 first:border-t",s),...l}),img:({className:s,...l})=>c.jsx("img",{className:X("my-3 max-w-full rounded-lg border",s),...l}),code:({className:s,...l})=>c.jsx("code",{className:X("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 c.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 a=/language-([\w-]+)/.exec(l.props.className??"")?.[1]??"",o=Ve(l.props.children).replace(/\n$/,"");return a==="mermaid"?c.jsx(Dd,{code:o}):a==="schema"?c.jsx(Md,{source:o}):c.jsx(_d,{language:a||"text",code:o})}}),[n,t]);return c.jsx("div",{className:X("aui-md text-sm",r),children:c.jsx(hh,{remarkPlugins:[Id],components:i,children:e})})}function Rd(e,n){const[t,r]=A.useState(null),[i,s]=A.useState({}),[l,a]=A.useState(!1),[o,u]=A.useState(!1);return A.useEffect(()=>{if(!e){r(null),s({}),u(!1);return}const f=new AbortController;return a(!0),u(!1),It.doc(e,n,f.signal).then(async h=>{if(f.signal.aborted)return;r(h);const d=Pd(h.markdown),p=d.length>0?await It.resolve(h.meta.id,d,f.signal).catch(()=>({})):{};f.signal.aborted||s(p)}).catch(()=>{f.signal.aborted||(r(null),u(!0))}).finally(()=>{f.signal.aborted||a(!1)}),()=>f.abort()},[e,n]),{content:t,docLinks:i,loading:l,error:o}}const Od="adminizer:ai-attach-doc";function Bd(e){window.__adminizerAttachDoc__=e,window.dispatchEvent(new CustomEvent(Od,{detail:e}))}const ut="info",ai=()=>{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}},$d=e=>{const{pathname:n,search:t}=window.location;window.history.pushState(null,"",`${n}${t}${e}`),window.dispatchEvent(new HashChangeEvent("hashchange"))},Hd=()=>{const[e,n]=A.useState(ai);return A.useEffect(()=>{const t=()=>n(ai());window.addEventListener("hashchange",t),window.addEventListener("popstate",t);const r=ft.on("navigate",t);return()=>{window.removeEventListener("hashchange",t),window.removeEventListener("popstate",t),r()}},[]),e},Ud=()=>{const e=re();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 qd({open:e,docId:n,items:t,model:r,onOpenDoc:i,onClose:s}){const{t:l,locale:a}=Je(),{isEnabled:o,openChat:u}=Ft(),[f,h]=A.useState(void 0),{content:d,docLinks:p,loading:m,error:w}=Rd(e?n:null,f??a),[C,k]=A.useState(null),[N,j]=A.useState(!1),[v,E]=A.useState("docs");A.useEffect(()=>h(void 0),[n]),A.useEffect(()=>{if(!e||!r)return;const R=new AbortController;return k(null),j(!1),It.schema(r,R.signal).then(y=>{R.signal.aborted||k(y)}).catch(()=>{R.signal.aborted||j(!0)}),()=>R.abort()},[r,e]);const b=A.useMemo(()=>{const R=new Map;for(const y of t){const I=y.section??"";R.set(I,[...R.get(I)??[],y])}return[...R.entries()]},[t]),z=A.useRef(!1),M=()=>{d&&(z.current=!0,s(),u(),Bd({id:d.meta.id,title:d.meta.title}))};return c.jsx(pa,{open:e,onOpenChange:R=>!R&&s(),children:c.jsxs(da,{side:"right",className:"z-[1002] w-full gap-0 p-0 sm:max-w-xl",onCloseAutoFocus:R=>{z.current&&(z.current=!1,R.preventDefault())},children:[c.jsxs(ma,{className:"border-b px-4 py-3",children:[c.jsxs("div",{className:"flex items-center gap-2 pe-8",children:[n&&c.jsx(ne,{variant:"ghost",size:"icon",className:"-ms-2 shrink-0",onClick:()=>i(null),"aria-label":l("Back to contents"),children:c.jsx(ga,{className:"size-4"})}),c.jsx(xa,{className:"truncate",children:n?d?.meta.title??l("Documentation"):l("Page documentation")})]}),c.jsx(ya,{className:"sr-only",children:l("Documentation")})]}),c.jsxs(ba,{value:r?v:"docs",onValueChange:E,className:"flex min-h-0 flex-1 flex-col gap-0",children:[r&&c.jsxs(ka,{className:"mx-4 mt-3 w-fit",children:[c.jsx(hr,{value:"docs",children:l("Documentation")}),c.jsx(hr,{value:"schema",children:l("Schema")})]}),c.jsx(pr,{value:"docs",className:"min-h-0 flex-1 overflow-y-auto px-4 py-3",children:n?m&&!d?c.jsx("p",{className:"text-muted-foreground text-sm",children:l("Loading...")}):w||!d?c.jsx("p",{className:"text-muted-foreground text-sm",children:l("Failed to load documentation")}):c.jsxs("div",{className:"flex flex-col gap-3",children:[(d.meta.locales?.length??0)>1&&c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:l("Language")}),d.meta.locales?.map(R=>c.jsx("button",{type:"button",onClick:()=>h(R),className:X("rounded-full border px-2 py-0.5 text-xs uppercase transition-colors",R===d.locale?"bg-primary text-primary-foreground border-transparent":"hover:bg-accent"),children:R},R))]}),c.jsx(Fd,{markdown:d.markdown,docLinks:p,onDocLink:i})]}):t.length===0?c.jsx("p",{className:"text-muted-foreground text-sm",children:l("Nothing found")}):c.jsx("div",{className:"flex flex-col gap-4",children:b.map(([R,y])=>c.jsxs("div",{className:"flex flex-col gap-1",children:[R&&c.jsx("div",{className:"text-muted-foreground px-1 text-xs font-medium uppercase",children:R}),y.map(I=>c.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:[c.jsx(wa,{className:"text-muted-foreground size-4 shrink-0"}),c.jsx("span",{className:"truncate",children:I.title})]},I.id))]},R))})}),r&&c.jsx(pr,{value:"schema",className:"min-h-0 flex-1 overflow-y-auto px-4 py-3",children:c.jsx(Ri,{fields:C?.fields??(N?[]:null),title:C?.title??r,loading:!C&&!N})})]}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t px-4 py-3",children:[c.jsx(ne,{variant:"ghost",size:"sm",asChild:!0,children:c.jsxs(pe,{href:`${window.routePrefix}/docs${n?`/${encodeURIComponent(n)}`:""}`,children:[c.jsx(Sa,{className:"size-4"}),l("Open in knowledge base")]})}),o&&d&&c.jsxs(ne,{variant:"outline",size:"sm",onClick:M,children:[c.jsx(mi,{className:"size-4"}),l("Send to assistant")]})]})]})})}function Vd(){const n=re().props.docs,{t}=Je(),{open:r,docId:i}=Hd(),s=Ud(),l=A.useCallback(f=>{$d(f?`#${ut}=${encodeURIComponent(f)}`:`#${ut}`)},[]),a=A.useCallback(()=>{const{pathname:f,search:h}=window.location;window.history.pushState(null,"",`${f}${h}`),window.dispatchEvent(new HashChangeEvent("hashchange"))},[]);if(!n)return null;const o=n.items??[],u=o.length>0||!!s;return c.jsxs(c.Fragment,{children:[u&&c.jsxs(Dt,{children:[c.jsx(Mt,{asChild:!0,children:c.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0",onClick:()=>l(null),"aria-label":t("Page documentation"),children:c.jsx(ha,{className:"size-4"})})}),c.jsx(_t,{side:"bottom",className:"z-[1002]",children:c.jsx("span",{children:t("Page documentation")})})]}),c.jsx(qd,{open:r,docId:i,items:o,model:s,onOpenDoc:l,onClose:a})]})}function $l({breadcrumbs:e=[]}){return c.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:c.jsxs("div",{className:"flex justify-between w-full",children:[c.jsx("div",{className:"flex items-center gap-2",children:c.jsx(Te,{name:"HeaderStart",Default:Wd,breadcrumbs:e})}),c.jsx("div",{className:"flex gap-4 items-center",children:c.jsx(Te,{name:"HeaderActions",Default:Gd,breadcrumbs:e})})]})})}function Wd({breadcrumbs:e=[]}){return c.jsxs(c.Fragment,{children:[c.jsx(Ca,{className:"-ml-1"}),c.jsx(Li,{breadcrumbs:e})]})}function Gd(){const{tabs:e}=bi(),n=re();return c.jsxs(c.Fragment,{children:[c.jsx(Fi,{}),c.jsx(Za,{}),c.jsx(Vd,{}),n.props.history&&c.jsx(pe,{href:`${window.routePrefix}/history/view-all`,children:c.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0",children:c.jsx(ja,{})})}),c.jsx(_i,{}),n.props.notifications&&(e===null?c.jsx("div",{className:"w-[40px] flex-none flex justify-center",children:c.jsx(Xe,{className:"size-4 animate-spin"})}):e.length?c.jsx(Qa,{}):null),c.jsx(Mi,{})]})}const Hl=A.memo(({children:e,breadcrumbs:n=[],className:t})=>{const r=re(),i=n.length?n:r.props.breadcrumbs??[];return c.jsxs(ji,{variant:"sidebar",children:[c.jsx(xi,{title:r.props.title}),c.jsx(Te,{name:"Sidebar",Default:zi}),c.jsxs(va,{className:"overflow-hidden",children:[c.jsx(Te,{name:"Header",Default:$l,breadcrumbs:i}),c.jsx("div",{"data-scroll-region":"content",className:X("relative flex min-h-0 flex-1 overflow-y-auto overscroll-contain",t),children:c.jsx("div",{className:"flex min-h-full w-full flex-col",children:e})})]})]})}),cn=new Map,Pn=new Map;function Jd(e){let n=cn.get(e);return n||(n=import(e).then(t=>(Pn.set(e,t),t)),n.catch(()=>cn.delete(e)),cn.set(e,n)),n}function Xd(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 oi=[],ui=[];function Kd(e,n=[]){const t=e.join(`
32
32
  `),r=e.every(l=>Pn.has(l))?e.map(l=>Pn.get(l)):null,[i,s]=A.useState({key:"",modules:oi,errors:[]});return A.useEffect(()=>{if(n.forEach(Xd),r)return;let l=!1;return Promise.allSettled(e.map(Jd)).then(a=>{l||s({key:t,modules:a.map(o=>o.status==="fulfilled"?o.value:null),errors:a.flatMap(o=>o.status==="rejected"?[o.reason]:[])})}),()=>{l=!0}},[t,n.join(`
33
33
  `)]),!e.length||r?{modules:r??oi,loading:!1,errors:ui}:i.key===t?{modules:i.modules,loading:!1,errors:i.errors}:{modules:null,loading:!0,errors:ui}}const Yd={root:"stock",layers:[],stylesheets:[]};function Qd(e){if(!e||typeof e!="object")return Yd;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 Zd(e,n){const t={};for(const r of Ti)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 c.jsx("div",{"data-scroll-region":"content",className:X("flex min-h-svh w-full flex-col",n),children:e})}function tm({head:e}){return c.jsxs("div",{className:"flex h-svh w-full items-center justify-center",children:[e,c.jsx(Xe,{className:"size-10 animate-spin text-neutral-500"})]})}const nm=[];function rm({children:e,breadcrumbs:n=[],className:t}){const r=re(),i=r.props.adminContext,s=Qd(i?.layout),l=A.useMemo(()=>s.layers.map(p=>p.module),[s.layers.map(p=>p.module).join(`
34
34
  `)]),a=Kd(l,s.stylesheets),o=A.useMemo(()=>a.modules?a.modules.flatMap((p,m)=>p?[Zd(s.layers[m],p)]:[]):nm,[l,a.modules?.length,a.loading]);A.useEffect(()=>{a.errors.forEach(p=>console.error("[Adminizer] Failed to load a context layout module",p))},[a.errors]);const u=c.jsx(xi,{title:r.props.title});if(a.loading)return c.jsx(tm,{head:u});const f=n.length?n:r.props.breadcrumbs??[],h=s.root==="none"?em:Hl,d=s.root==="none"||o.some(p=>p.Layout!==void 0);return c.jsxs(Va,{layers:o,children:[d&&u,c.jsx(Te,{name:"Layout",Default:h,breadcrumbs:f,className:t,context:i,children:e})]})}const im=[],lm=[];function sm(){const e=re(),{adminContext:n,adminContexts:t=lm,menu:r,menuSections:i}=e.props,s=r??im,l=A.useMemo(()=>vi(Ei(s),e.url),[s,e.url]),a=A.useCallback(u=>l!==null&&Ct(u)===l,[l]),o=A.useCallback(u=>{const f=t.find(h=>h.id===u);f&&ft.visit(f.link)},[t]);return{context:n,contexts:t,menu:s,sections:i??{},isActive:a,switchTo:o}}const am=Object.freeze(Object.defineProperty({__proto__:null,AppShell:ji,AppSidebar:zi,AppSidebarHeader:$l,Breadcrumbs:Li,ContextSwitcher:Ii,DefaultLayout:Hl,GlobalSearch:Fi,MaterialIcon:K,NavMain:Ni,NavUser:Mi,ThemeSwitcher:_i,UserInfo:Dn,UserMenuContent:Di,useAdminContext:sm},Symbol.toStringTag,{value:"Module"}));function om(){window.AdminizerShell??={},Object.assign(window.AdminizerShell,am)}om();const um=A.memo(({children:e,className:n,breadcrumbs:t})=>c.jsx(Oa,{children:c.jsx(rm,{breadcrumbs:t,className:n,children:e})})),dm=(e,n={})=>{const t=e;return t.layout=r=>c.jsx(um,{...n,children:r}),t};export{Fd as M,Rd as a,Td as b,K as c,It as d,pm as e,bi as f,Bd as s,Ft as u,dm as w};