cognova 0.2.20 → 0.2.22

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 (175) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{CCeM5lW2.js → -O86rjFZ.js} +1 -1
  3. package/.output/public/_nuxt/{BXxZokD_.js → -Q9J9PRu.js} +1 -1
  4. package/.output/public/_nuxt/{Hh9mv0Ek.js → 0DkCurh5.js} +1 -1
  5. package/.output/public/_nuxt/{CjJPkhbc.js → 49whOfsW.js} +1 -1
  6. package/.output/public/_nuxt/{DqR9SdeU.js → 4Vi9hKJC.js} +1 -1
  7. package/.output/public/_nuxt/{BoCU3mWu.js → 66GNa6MU.js} +1 -1
  8. package/.output/public/_nuxt/9dGxQN-2.js +1 -0
  9. package/.output/public/_nuxt/{DhlIWT8K.js → 9wWq016N.js} +1 -1
  10. package/.output/public/_nuxt/{BD5rPkc2.js → B04GYyxD.js} +1 -1
  11. package/.output/public/_nuxt/{DwrmFEZN.js → B0KPvVav.js} +1 -1
  12. package/.output/public/_nuxt/{Cywo6tZI.js → B1meh0Ci.js} +1 -1
  13. package/.output/public/_nuxt/{C5Cu9Fx6.js → B53zbEPa.js} +1 -1
  14. package/.output/public/_nuxt/{B20jNAhm.js → B6-aFDg7.js} +1 -1
  15. package/.output/public/_nuxt/{kkAMoB43.js → B6lgiDn1.js} +1 -1
  16. package/.output/public/_nuxt/{BgavRUl_.js → B7uuK82m.js} +1 -1
  17. package/.output/public/_nuxt/{BWqJInD3.js → B9OPrqTh.js} +1 -1
  18. package/.output/public/_nuxt/{DLHnP6tw.js → BA646MN4.js} +1 -1
  19. package/.output/public/_nuxt/{mzM4BGtv.js → BDhTzPPo.js} +1 -1
  20. package/.output/public/_nuxt/{CZNOaqeX.js → BDzVzzBM.js} +1 -1
  21. package/.output/public/_nuxt/{DTlSLSo1.js → BEkFNtxw.js} +3 -3
  22. package/.output/public/_nuxt/{B_hNqC64.js → BI7-RNYV.js} +1 -1
  23. package/.output/public/_nuxt/{rIgg2Arf.js → BN8XazaH.js} +3 -3
  24. package/.output/public/_nuxt/{TSYrPbLR.js → BNP0kT7B.js} +1 -1
  25. package/.output/public/_nuxt/{BhhMUror.js → BPfVf7kt.js} +1 -1
  26. package/.output/public/_nuxt/{BxsQlbgl.js → BQGDi8tM.js} +1 -1
  27. package/.output/public/_nuxt/{Br6epbzY.js → BUXewbUG.js} +1 -1
  28. package/.output/public/_nuxt/{Y59XKprr.js → BW0FZi7D.js} +1 -1
  29. package/.output/public/_nuxt/{Br81Sr2R.js → BXmijQzM.js} +1 -1
  30. package/.output/public/_nuxt/{C-78dDNd.js → BZFf3mr_.js} +1 -1
  31. package/.output/public/_nuxt/{C7hFztZL.js → BZx0xqxG.js} +1 -1
  32. package/.output/public/_nuxt/{DjsqyRqt.js → BbElT9yG.js} +1 -1
  33. package/.output/public/_nuxt/{BHUy5EAj.js → BjyHtuwq.js} +1 -1
  34. package/.output/public/_nuxt/{C4sG6rdW.js → BnfOmQBX.js} +1 -1
  35. package/.output/public/_nuxt/BoqEl-F1.js +1 -0
  36. package/.output/public/_nuxt/{C_A_NkeC.js → Bq2pktu_.js} +2 -2
  37. package/.output/public/_nuxt/{C2Gh3qqr.js → Br712gOY.js} +1 -1
  38. package/.output/public/_nuxt/{PamJNol9.js → Bs4sk8vv.js} +1 -1
  39. package/.output/public/_nuxt/{DL4EpgqQ.js → Bt87rSlM.js} +1 -1
  40. package/.output/public/_nuxt/{DFTEBTzZ.js → BtOA13zl.js} +1 -1
  41. package/.output/public/_nuxt/{TNpdJOlc.js → Bti4Nb4c.js} +1 -1
  42. package/.output/public/_nuxt/{BZ7DAtPi.js → Bu0HhyZq.js} +1 -1
  43. package/.output/public/_nuxt/{D867g6Ds.js → Bv25Wgb9.js} +1 -1
  44. package/.output/public/_nuxt/{CqS0zXYQ.js → BwMPB_Mu.js} +1 -1
  45. package/.output/public/_nuxt/{CS8SdmH2.js → BzkqPhn-.js} +1 -1
  46. package/.output/public/_nuxt/{BZm9w7en.js → C35LJkds.js} +1 -1
  47. package/.output/public/_nuxt/{DcJ0GstJ.js → C4VW2EjN.js} +1 -1
  48. package/.output/public/_nuxt/{C2-_hcwB.js → C6FzuEFH.js} +1 -1
  49. package/.output/public/_nuxt/{X0o5GcBb.js → C866FgGj.js} +1 -1
  50. package/.output/public/_nuxt/{BOCn_SGf.js → CBqC92gC.js} +3 -3
  51. package/.output/public/_nuxt/{D49P2RhG.js → CD2Wt775.js} +1 -1
  52. package/.output/public/_nuxt/{BzrhNhdT.js → CE491BHV.js} +1 -1
  53. package/.output/public/_nuxt/{BAY3_Hrq.js → CF8ziKf1.js} +1 -1
  54. package/.output/public/_nuxt/{B3OpTH_e.js → CFE6wnRK.js} +1 -1
  55. package/.output/public/_nuxt/{BVYYP4eQ.js → CFjVdIUR.js} +1 -1
  56. package/.output/public/_nuxt/{Dsuag_iW.js → CGPn0bIO.js} +1 -1
  57. package/.output/public/_nuxt/{BtrNCc2S.js → CKSWEIag.js} +1 -1
  58. package/.output/public/_nuxt/{BgIS9_ti.js → CL9cB3YW.js} +1 -1
  59. package/.output/public/_nuxt/{BWQ7zE01.js → CLUsxCN7.js} +1 -1
  60. package/.output/public/_nuxt/{CVVtVzXC.js → CM5aLXsq.js} +1 -1
  61. package/.output/public/_nuxt/{DZikIgHK.js → CN_jZBEh.js} +1 -1
  62. package/.output/public/_nuxt/{B-yW4SD3.js → CNgf0D2d.js} +1 -1
  63. package/.output/public/_nuxt/{CHbHVtCy.js → CPYFvNZ2.js} +1 -1
  64. package/.output/public/_nuxt/{PY5EGujn.js → CQTD64un.js} +1 -1
  65. package/.output/public/_nuxt/{DpSM97eH.js → CRLO8tx3.js} +1 -1
  66. package/.output/public/_nuxt/{DxE8r3r4.js → CTIUqf4N.js} +1 -1
  67. package/.output/public/_nuxt/{CLNcmNQS.js → CUDpi0L3.js} +1 -1
  68. package/.output/public/_nuxt/{C_doutX-.js → CY4SEsrB.js} +1 -1
  69. package/.output/public/_nuxt/{LR0kCjbe.js → CYAPNNGW.js} +1 -1
  70. package/.output/public/_nuxt/{CHnVFnBW.js → CZV2u8Xx.js} +1 -1
  71. package/.output/public/_nuxt/{CAVUAxNU.js → C_TYqFbT.js} +1 -1
  72. package/.output/public/_nuxt/{D3cEeQh7.js → CdIGoC9r.js} +1 -1
  73. package/.output/public/_nuxt/{U-eBrbR4.js → CiPQXVBy.js} +1 -1
  74. package/.output/public/_nuxt/{DEFWIjWl.js → Cif20myG.js} +1 -1
  75. package/.output/public/_nuxt/{DNAMjHbb.js → Ck1KJ2HV.js} +1 -1
  76. package/.output/public/_nuxt/{Cet4T_yO.js → CkSyHzm-.js} +1 -1
  77. package/.output/public/_nuxt/{CuvkTsqs.js → ClKTC8bU.js} +1 -1
  78. package/.output/public/_nuxt/CltqyXO5.js +1 -0
  79. package/.output/public/_nuxt/{BS1t375R.js → CmuSeGko.js} +1 -1
  80. package/.output/public/_nuxt/{CkrW8sGL.js → Cn_NBSuo.js} +1 -1
  81. package/.output/public/_nuxt/{C2OHaW6l.js → CvUov1Ey.js} +1 -1
  82. package/.output/public/_nuxt/{BQi8LIrn.js → CwY5tLRb.js} +1 -1
  83. package/.output/public/_nuxt/{C3xzleKP.js → CwoQ23uO.js} +1 -1
  84. package/.output/public/_nuxt/{1wCoXZ14.js → Cwoe6TAi.js} +1 -1
  85. package/.output/public/_nuxt/{CbDLhrNA.js → CxTuME0Z.js} +2 -2
  86. package/.output/public/_nuxt/{BGYoW3kO.js → Cyjm1APH.js} +1 -1
  87. package/.output/public/_nuxt/{C6Eoiclo.js → Cyo4VJ6S.js} +1 -1
  88. package/.output/public/_nuxt/{Be47YE2L.js → D-WxGaym.js} +1 -1
  89. package/.output/public/_nuxt/{0GqCtQ9S.js → D0SYimTY.js} +1 -1
  90. package/.output/public/_nuxt/{G_CsVlOR.js → D82AhPdI.js} +1 -1
  91. package/.output/public/_nuxt/{DVdnhfXT.js → D9dLxr1_.js} +1 -1
  92. package/.output/public/_nuxt/{C3szZmvA.js → D9jU4ocP.js} +1 -1
  93. package/.output/public/_nuxt/{C1oaoi1p.js → DAQeLqQw.js} +1 -1
  94. package/.output/public/_nuxt/{DM20WaLq.js → DDg2H-HK.js} +1 -1
  95. package/.output/public/_nuxt/{Co0UxVsx.js → DESvLlSI.js} +1 -1
  96. package/.output/public/_nuxt/{B9_vmatf.js → DFSB3QxC.js} +1 -1
  97. package/.output/public/_nuxt/{RlvwEbHv.js → DFqzAgzP.js} +1 -1
  98. package/.output/public/_nuxt/{Bj5e7QPz.js → DJuYHeIc.js} +1 -1
  99. package/.output/public/_nuxt/{D1reIfpX.js → DK0AJoGL.js} +1 -1
  100. package/.output/public/_nuxt/{XQNzmQy9.js → DQdWxVax.js} +1 -1
  101. package/.output/public/_nuxt/{z-MP0bB7.js → DRF-DnQg.js} +1 -1
  102. package/.output/public/_nuxt/{hCeWb_38.js → DUf0f355.js} +1 -1
  103. package/.output/public/_nuxt/{jTT1R-Vz.js → DWnLv2oh.js} +1 -1
  104. package/.output/public/_nuxt/{vCFAHwdt.js → DXkvGTEB.js} +1 -1
  105. package/.output/public/_nuxt/{CePKCqSb.js → DZncVjYt.js} +1 -1
  106. package/.output/public/_nuxt/{jC4pIK1p.js → DaAG12aj.js} +1 -1
  107. package/.output/public/_nuxt/{D2edadpd.js → Db66Rsfj.js} +1 -1
  108. package/.output/public/_nuxt/{B9Y3_B5G.js → DbLjznUU.js} +1 -1
  109. package/.output/public/_nuxt/{CxMuZEwX.js → Dfzca1IN.js} +1 -1
  110. package/.output/public/_nuxt/{MYeLvJGV.js → DhvuBruY.js} +1 -1
  111. package/.output/public/_nuxt/{Daf2MbWG.js → Dj9yr6QC.js} +1 -1
  112. package/.output/public/_nuxt/{_-TGPiLQ.js → DjJn4g73.js} +1 -1
  113. package/.output/public/_nuxt/{2J1KxdHv.js → DkAUrkyD.js} +1 -1
  114. package/.output/public/_nuxt/{DhN3_DYH.js → DkybthvX.js} +1 -1
  115. package/.output/public/_nuxt/{CkZT4LGq.js → DlNwSYeM.js} +1 -1
  116. package/.output/public/_nuxt/{pwJTkIQ4.js → Dm5HyQgM.js} +1 -1
  117. package/.output/public/_nuxt/{t8B72leH.js → Dn7zgQZh.js} +1 -1
  118. package/.output/public/_nuxt/{D41A2mE2.js → DoIqoxBH.js} +1 -1
  119. package/.output/public/_nuxt/{Bnn59-FS.js → Dqx39Omg.js} +1 -1
  120. package/.output/public/_nuxt/{8WMJQbWG.js → DrQVjmDX.js} +1 -1
  121. package/.output/public/_nuxt/{6VDUZECX.js → DuYzdzqK.js} +1 -1
  122. package/.output/public/_nuxt/{BLdMRpJD.js → DvZW6QuM.js} +1 -1
  123. package/.output/public/_nuxt/{CTGm_mc8.js → DxztGg8Y.js} +1 -1
  124. package/.output/public/_nuxt/{BTGeP1bA.js → EPFrlLUV.js} +1 -1
  125. package/.output/public/_nuxt/{hrPTRWjM.js → JsQhjNzl.js} +1 -1
  126. package/.output/public/_nuxt/{D_YGqvw_.js → NApXVVQD.js} +1 -1
  127. package/.output/public/_nuxt/{9Rw88G6h.js → OwiFxd0L.js} +1 -1
  128. package/.output/public/_nuxt/{BXdQ9ASJ.js → QAfF68DH.js} +1 -1
  129. package/.output/public/_nuxt/{CPwCTHun.js → QDt0Bhze.js} +1 -1
  130. package/.output/public/_nuxt/{DhSvBSt3.js → RF9kzKHY.js} +1 -1
  131. package/.output/public/_nuxt/{Dtr_0IbE.js → RzJhlhBq.js} +1 -1
  132. package/.output/public/_nuxt/{NKs0EGrh.js → SHHFgixe.js} +1 -1
  133. package/.output/public/_nuxt/V5ro_Ide.js +1 -0
  134. package/.output/public/_nuxt/{YZQjZgsH.js → Zge3ScOQ.js} +1 -1
  135. package/.output/public/_nuxt/{Bh0yGTzr.js → Zj8SE5Ja.js} +1 -1
  136. package/.output/public/_nuxt/{DHRexj9X.js → ZjXNlFkb.js} +1 -1
  137. package/.output/public/_nuxt/{DcYKh6QA.js → _5GQc09B.js} +1 -1
  138. package/.output/public/_nuxt/{CDcQ31Eh.js → aK4BeJQk.js} +1 -1
  139. package/.output/public/_nuxt/builds/latest.json +1 -1
  140. package/.output/public/_nuxt/builds/meta/7e5adf59-e667-40b7-9580-af4ed8971b6c.json +1 -0
  141. package/.output/public/_nuxt/{C5gfF7J1.js → cQU5gXxh.js} +1 -1
  142. package/.output/public/_nuxt/{CxSijT71.js → cq8AG_FV.js} +1 -1
  143. package/.output/public/_nuxt/{o-s8JBm2.js → d2FXPfMj.js} +1 -1
  144. package/.output/public/_nuxt/{UuqXScSw.js → dD3g22lS.js} +1 -1
  145. package/.output/public/_nuxt/{subdxgSQ.js → f35n4CdE.js} +1 -1
  146. package/.output/public/_nuxt/{HStC1ZyE.js → gWMUdeHB.js} +1 -1
  147. package/.output/public/_nuxt/{CTQFGHjS.js → i2HesToX.js} +1 -1
  148. package/.output/public/_nuxt/{V04-MrLN.js → iIxC-lNx.js} +1 -1
  149. package/.output/public/_nuxt/{D1uV2uir.js → nRp8uM7H.js} +1 -1
  150. package/.output/public/_nuxt/{DP8t9VWs.js → oBlsjU0k.js} +1 -1
  151. package/.output/public/_nuxt/{-mGU8_Hv.js → rH7JJqZQ.js} +1 -1
  152. package/.output/public/_nuxt/{D_k1YwXm.js → tak9pMy9.js} +1 -1
  153. package/.output/public/_nuxt/{BrkEOLHu.js → vebhRA6y.js} +1 -1
  154. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  155. package/.output/server/chunks/build/{integrations-D5JWURiJ.mjs → integrations-Hf4O1jkW.mjs} +24 -77
  156. package/.output/server/chunks/build/integrations-Hf4O1jkW.mjs.map +1 -0
  157. package/.output/server/chunks/build/server.mjs +1 -1
  158. package/.output/server/chunks/build/styles.mjs +4 -4
  159. package/.output/server/chunks/nitro/nitro.mjs +912 -998
  160. package/.output/server/chunks/routes/api/webhooks/bluebubbles.post.mjs +6 -1
  161. package/.output/server/chunks/routes/api/webhooks/bluebubbles.post.mjs.map +1 -1
  162. package/.output/server/package.json +1 -1
  163. package/app/pages/settings/integrations.vue +2 -23
  164. package/dist/cli/index.js +3 -0
  165. package/package.json +1 -1
  166. package/server/api/webhooks/bluebubbles.post.ts +8 -0
  167. package/server/bridge/adapters/imessage.ts +21 -140
  168. package/server/middleware/auth.ts +1 -0
  169. package/shared/types/index.ts +0 -2
  170. package/.output/public/_nuxt/B9o6sFST.js +0 -1
  171. package/.output/public/_nuxt/CskGv_Km.js +0 -1
  172. package/.output/public/_nuxt/DTR31rjp.js +0 -1
  173. package/.output/public/_nuxt/Gyw_2f6x.js +0 -1
  174. package/.output/public/_nuxt/builds/meta/d528449f-50ac-4f95-b7da-122a1fdd6e85.json +0 -1
  175. package/.output/server/chunks/build/integrations-D5JWURiJ.mjs.map +0 -1
@@ -1 +1 @@
1
- import{_ as J}from"./BhhMUror.js";import{_ as W,a as X}from"./CHnVFnBW.js";import{_ as Y}from"./D_k1YwXm.js";import{_ as ee}from"./DqR9SdeU.js";import{_ as te}from"./jC4pIK1p.js";import{_ as oe}from"./MYeLvJGV.js";import{e as u,an as ae,i as ne,d as re,aj as le,h as M,C as se,M as k,Z as l,w as a,a as c,ak as w,o as _,ac as s,c as U,al as ce,am as ie,_ as ue,a0 as me,af as y,a$ as de,ab as S,aa as pe,b0 as fe}from"./BOCn_SGf.js";import{_ as _e}from"./D2edadpd.js";import{_ as ye}from"./DHRexj9X.js";import{_ as he}from"./BgavRUl_.js";import{f as ve}from"./CWePHsZr.js";import"./BZm9w7en.js";import"./hCeWb_38.js";import"./8WMJQbWG.js";import"./BWqJInD3.js";import"./B9o6sFST.js";import"./jTT1R-Vz.js";import"./C6Eoiclo.js";import"./CxMuZEwX.js";import"./hrPTRWjM.js";import"./DZikIgHK.js";import"./DTR31rjp.js";import"./D41A2mE2.js";import"./C6Y-ieo6.js";import"./Br81Sr2R.js";import"./C1oaoi1p.js";import"./88opOQSr.js";import"./CVVtVzXC.js";import"./BzrhNhdT.js";import"./BLdMRpJD.js";import"./V04-MrLN.js";import"./C8ut0f5H.js";function ge(){const m=u([]),d=u(!0),p=u(null),g=ae({query:"",chunkType:"all",limit:50});async function b(i){d.value=!0,p.value=null;const e={...g,...i};try{const o={};e.query&&(o.query=e.query),e.chunkType&&e.chunkType!=="all"&&(o.chunkType=e.chunkType),e.projectPath&&(o.projectPath=e.projectPath),e.limit&&(o.limit=String(e.limit));const f=await $fetch("/api/memory/search",{query:o});return m.value=f.data,f.data}catch(o){throw p.value="Failed to load memories",console.error("Failed to load memories:",o),o}finally{d.value=!1}}async function x(i){try{await $fetch(`/api/memory/${i}`,{method:"DELETE"}),m.value=m.value.filter(e=>e.id!==i)}catch(e){throw console.error("Failed to delete memory:",e),e}}const h=ne(()=>{const i=m.value.reduce((e,o)=>(e[o.chunkType]=(e[o.chunkType]||0)+1,e),{});return{total:m.value.length,byType:i}});return{memories:m,loading:d,error:p,filters:g,stats:h,fetchMemories:b,deleteMemory:x}}const be={class:"contents"},xe={class:"p-4"},Te={key:0,class:"space-y-3"},ke={key:1,class:"flex flex-col items-center justify-center h-64 text-neutral-500"},we=["title"],De={class:"flex items-center gap-2"},$e={class:"w-16 h-1.5 bg-neutral-200 dark:bg-neutral-700 rounded-full overflow-hidden"},Ce={class:"text-xs text-muted"},Me={class:"text-sm text-muted"},Ue={class:"text-sm text-muted"},D="__all__",ct=re({__name:"memories",setup(m){const d=le(),{memories:p,loading:g,filters:b,stats:x,fetchMemories:h,deleteMemory:i}=ge(),e=u(!1),o=u(null),f=u(!1),F=[{value:D,label:"All Types"},{value:"decision",label:"Decisions"},{value:"fact",label:"Facts"},{value:"solution",label:"Solutions"},{value:"pattern",label:"Patterns"},{value:"preference",label:"Preferences"},{value:"summary",label:"Summaries"}],T=u(D),v=u("");M(T,n=>{b.chunkType=n===D?"all":n,h()});const V=fe(()=>{b.query=v.value||void 0,h()},300);M(v,V);function A(n){o.value=n,e.value=!0}async function q(){if(o.value){f.value=!0;try{await i(o.value),d.add({title:"Memory deleted",color:"success"}),e.value=!1}catch{d.add({title:"Failed to delete memory",color:"error"})}finally{f.value=!1,o.value=null}}}function N(n){switch(n){case"decision":return"primary";case"fact":return"info";case"solution":return"success";case"pattern":return"warning";case"preference":return"neutral";case"summary":return"neutral";default:return"neutral"}}function B(n){switch(n){case"decision":return"i-lucide-git-branch";case"fact":return"i-lucide-info";case"solution":return"i-lucide-check-circle";case"pattern":return"i-lucide-repeat";case"preference":return"i-lucide-settings";case"summary":return"i-lucide-file-text";default:return"i-lucide-circle"}}function K(n){return ve(new Date(n),{addSuffix:!0})}const L=[{accessorKey:"chunkType",header:"Type"},{accessorKey:"content",header:"Content"},{accessorKey:"relevanceScore",header:"Relevance"},{accessorKey:"accessCount",header:"Accessed"},{accessorKey:"createdAt",header:"Created"},{accessorKey:"actions",header:""}];function P(n){return[[{label:"Delete",icon:"i-lucide-trash-2",color:"error",onSelect:()=>A(n)}]]}return se(()=>{h()}),(n,r)=>{const $=J,j=X,E=Y,z=ee,I=te,R=oe,C=ue,O=me,Q=_e,Z=ye,G=W,H=he;return _(),k("div",be,[l(G,{id:"memories",grow:""},{header:a(()=>[l(j,{title:"Memories"},{leading:a(()=>[c(x).total>0?(_(),U($,{key:0,color:"neutral",variant:"subtle",class:"ml-2"},{default:a(()=>[S(y(c(x).total),1)]),_:1})):pe("",!0)]),_:1}),l(I,null,{left:a(()=>[l(E,{modelValue:c(T),"onUpdate:modelValue":r[0]||(r[0]=t=>w(T)?T.value=t:null),items:F,"value-key":"value",class:"w-40"},null,8,["modelValue"])]),right:a(()=>[l(z,{modelValue:c(v),"onUpdate:modelValue":r[1]||(r[1]=t=>w(v)?v.value=t:null),placeholder:"Search memories...",icon:"i-lucide-search",class:"w-64"},null,8,["modelValue"])]),_:1})]),body:a(()=>[s("div",xe,[c(g)?(_(),k("div",Te,[(_(),k(ce,null,ie(10,t=>l(R,{key:t,class:"h-12 w-full"})),64))])):c(p).length===0?(_(),k("div",ke,[l(C,{name:"i-lucide-brain",class:"w-12 h-12 mb-4"}),r[4]||(r[4]=s("p",{class:"text-lg font-medium"}," No memories yet ",-1)),r[5]||(r[5]=s("p",{class:"text-sm text-center max-w-md mt-2"}," Memories are automatically extracted from your Claude conversations. They will appear here once extraction hooks are triggered. ",-1))])):(_(),U(Z,{key:2,data:c(p),columns:L},{"chunkType-cell":a(({row:t})=>[l($,{color:N(t.original.chunkType),variant:"subtle",size:"sm"},{default:a(()=>[l(C,{name:B(t.original.chunkType),class:"w-3 h-3 mr-1"},null,8,["name"]),S(" "+y(t.original.chunkType),1)]),_:2},1032,["color"])]),"content-cell":a(({row:t})=>[s("span",{class:"text-sm line-clamp-2",title:t.original.content},y(t.original.content),9,we)]),"relevanceScore-cell":a(({row:t})=>[s("div",De,[s("div",$e,[s("div",{class:"h-full bg-primary-500 rounded-full",style:de({width:`${t.original.relevanceScore*100}%`})},null,4)]),s("span",Ce,y((t.original.relevanceScore*100).toFixed(0))+"% ",1)])]),"accessCount-cell":a(({row:t})=>[s("span",Me,y(t.original.accessCount)+"x ",1)]),"createdAt-cell":a(({row:t})=>[s("span",Ue,y(K(t.original.createdAt)),1)]),"actions-cell":a(({row:t})=>[l(Q,{items:P(t.original.id)},{default:a(()=>[l(O,{icon:"i-lucide-more-horizontal",color:"neutral",variant:"ghost",size:"xs"})]),_:1},8,["items"])]),_:1},8,["data"]))])]),_:1}),l(H,{open:c(e),"onUpdate:open":r[2]||(r[2]=t=>w(e)?e.value=t:null),title:"Delete Memory",description:"Are you sure you want to delete this memory? This action cannot be undone.","confirm-label":"Delete","confirm-color":"error",icon:"i-lucide-trash-2",loading:c(f),onConfirm:q,onCancel:r[3]||(r[3]=t=>o.value=null)},null,8,["open","loading"])])}}});export{ct as default};
1
+ import{_ as J}from"./BPfVf7kt.js";import{_ as W,a as X}from"./CZV2u8Xx.js";import{_ as Y}from"./tak9pMy9.js";import{_ as ee}from"./4Vi9hKJC.js";import{_ as te}from"./DaAG12aj.js";import{_ as oe}from"./DhvuBruY.js";import{e as u,an as ae,i as ne,d as re,aj as le,h as M,C as se,M as k,Z as l,w as a,a as c,ak as w,o as _,ac as s,c as U,al as ce,am as ie,_ as ue,a0 as me,af as y,a$ as de,ab as S,aa as pe,b0 as fe}from"./CBqC92gC.js";import{_ as _e}from"./Db66Rsfj.js";import{_ as ye}from"./ZjXNlFkb.js";import{_ as he}from"./B7uuK82m.js";import{f as ve}from"./CWePHsZr.js";import"./C35LJkds.js";import"./DUf0f355.js";import"./DrQVjmDX.js";import"./B9OPrqTh.js";import"./CltqyXO5.js";import"./DWnLv2oh.js";import"./Cyo4VJ6S.js";import"./Dfzca1IN.js";import"./JsQhjNzl.js";import"./CN_jZBEh.js";import"./BoqEl-F1.js";import"./DoIqoxBH.js";import"./C6Y-ieo6.js";import"./BXmijQzM.js";import"./DAQeLqQw.js";import"./88opOQSr.js";import"./CM5aLXsq.js";import"./CE491BHV.js";import"./DvZW6QuM.js";import"./iIxC-lNx.js";import"./C8ut0f5H.js";function ge(){const m=u([]),d=u(!0),p=u(null),g=ae({query:"",chunkType:"all",limit:50});async function b(i){d.value=!0,p.value=null;const e={...g,...i};try{const o={};e.query&&(o.query=e.query),e.chunkType&&e.chunkType!=="all"&&(o.chunkType=e.chunkType),e.projectPath&&(o.projectPath=e.projectPath),e.limit&&(o.limit=String(e.limit));const f=await $fetch("/api/memory/search",{query:o});return m.value=f.data,f.data}catch(o){throw p.value="Failed to load memories",console.error("Failed to load memories:",o),o}finally{d.value=!1}}async function x(i){try{await $fetch(`/api/memory/${i}`,{method:"DELETE"}),m.value=m.value.filter(e=>e.id!==i)}catch(e){throw console.error("Failed to delete memory:",e),e}}const h=ne(()=>{const i=m.value.reduce((e,o)=>(e[o.chunkType]=(e[o.chunkType]||0)+1,e),{});return{total:m.value.length,byType:i}});return{memories:m,loading:d,error:p,filters:g,stats:h,fetchMemories:b,deleteMemory:x}}const be={class:"contents"},xe={class:"p-4"},Te={key:0,class:"space-y-3"},ke={key:1,class:"flex flex-col items-center justify-center h-64 text-neutral-500"},we=["title"],De={class:"flex items-center gap-2"},$e={class:"w-16 h-1.5 bg-neutral-200 dark:bg-neutral-700 rounded-full overflow-hidden"},Ce={class:"text-xs text-muted"},Me={class:"text-sm text-muted"},Ue={class:"text-sm text-muted"},D="__all__",ct=re({__name:"memories",setup(m){const d=le(),{memories:p,loading:g,filters:b,stats:x,fetchMemories:h,deleteMemory:i}=ge(),e=u(!1),o=u(null),f=u(!1),F=[{value:D,label:"All Types"},{value:"decision",label:"Decisions"},{value:"fact",label:"Facts"},{value:"solution",label:"Solutions"},{value:"pattern",label:"Patterns"},{value:"preference",label:"Preferences"},{value:"summary",label:"Summaries"}],T=u(D),v=u("");M(T,n=>{b.chunkType=n===D?"all":n,h()});const V=fe(()=>{b.query=v.value||void 0,h()},300);M(v,V);function A(n){o.value=n,e.value=!0}async function q(){if(o.value){f.value=!0;try{await i(o.value),d.add({title:"Memory deleted",color:"success"}),e.value=!1}catch{d.add({title:"Failed to delete memory",color:"error"})}finally{f.value=!1,o.value=null}}}function N(n){switch(n){case"decision":return"primary";case"fact":return"info";case"solution":return"success";case"pattern":return"warning";case"preference":return"neutral";case"summary":return"neutral";default:return"neutral"}}function B(n){switch(n){case"decision":return"i-lucide-git-branch";case"fact":return"i-lucide-info";case"solution":return"i-lucide-check-circle";case"pattern":return"i-lucide-repeat";case"preference":return"i-lucide-settings";case"summary":return"i-lucide-file-text";default:return"i-lucide-circle"}}function K(n){return ve(new Date(n),{addSuffix:!0})}const L=[{accessorKey:"chunkType",header:"Type"},{accessorKey:"content",header:"Content"},{accessorKey:"relevanceScore",header:"Relevance"},{accessorKey:"accessCount",header:"Accessed"},{accessorKey:"createdAt",header:"Created"},{accessorKey:"actions",header:""}];function P(n){return[[{label:"Delete",icon:"i-lucide-trash-2",color:"error",onSelect:()=>A(n)}]]}return se(()=>{h()}),(n,r)=>{const $=J,j=X,E=Y,z=ee,I=te,R=oe,C=ue,O=me,Q=_e,Z=ye,G=W,H=he;return _(),k("div",be,[l(G,{id:"memories",grow:""},{header:a(()=>[l(j,{title:"Memories"},{leading:a(()=>[c(x).total>0?(_(),U($,{key:0,color:"neutral",variant:"subtle",class:"ml-2"},{default:a(()=>[S(y(c(x).total),1)]),_:1})):pe("",!0)]),_:1}),l(I,null,{left:a(()=>[l(E,{modelValue:c(T),"onUpdate:modelValue":r[0]||(r[0]=t=>w(T)?T.value=t:null),items:F,"value-key":"value",class:"w-40"},null,8,["modelValue"])]),right:a(()=>[l(z,{modelValue:c(v),"onUpdate:modelValue":r[1]||(r[1]=t=>w(v)?v.value=t:null),placeholder:"Search memories...",icon:"i-lucide-search",class:"w-64"},null,8,["modelValue"])]),_:1})]),body:a(()=>[s("div",xe,[c(g)?(_(),k("div",Te,[(_(),k(ce,null,ie(10,t=>l(R,{key:t,class:"h-12 w-full"})),64))])):c(p).length===0?(_(),k("div",ke,[l(C,{name:"i-lucide-brain",class:"w-12 h-12 mb-4"}),r[4]||(r[4]=s("p",{class:"text-lg font-medium"}," No memories yet ",-1)),r[5]||(r[5]=s("p",{class:"text-sm text-center max-w-md mt-2"}," Memories are automatically extracted from your Claude conversations. They will appear here once extraction hooks are triggered. ",-1))])):(_(),U(Z,{key:2,data:c(p),columns:L},{"chunkType-cell":a(({row:t})=>[l($,{color:N(t.original.chunkType),variant:"subtle",size:"sm"},{default:a(()=>[l(C,{name:B(t.original.chunkType),class:"w-3 h-3 mr-1"},null,8,["name"]),S(" "+y(t.original.chunkType),1)]),_:2},1032,["color"])]),"content-cell":a(({row:t})=>[s("span",{class:"text-sm line-clamp-2",title:t.original.content},y(t.original.content),9,we)]),"relevanceScore-cell":a(({row:t})=>[s("div",De,[s("div",$e,[s("div",{class:"h-full bg-primary-500 rounded-full",style:de({width:`${t.original.relevanceScore*100}%`})},null,4)]),s("span",Ce,y((t.original.relevanceScore*100).toFixed(0))+"% ",1)])]),"accessCount-cell":a(({row:t})=>[s("span",Me,y(t.original.accessCount)+"x ",1)]),"createdAt-cell":a(({row:t})=>[s("span",Ue,y(K(t.original.createdAt)),1)]),"actions-cell":a(({row:t})=>[l(Q,{items:P(t.original.id)},{default:a(()=>[l(O,{icon:"i-lucide-more-horizontal",color:"neutral",variant:"ghost",size:"xs"})]),_:1},8,["items"])]),_:1},8,["data"]))])]),_:1}),l(H,{open:c(e),"onUpdate:open":r[2]||(r[2]=t=>w(e)?e.value=t:null),title:"Delete Memory",description:"Are you sure you want to delete this memory? This action cannot be undone.","confirm-label":"Delete","confirm-color":"error",icon:"i-lucide-trash-2",loading:c(f),onConfirm:q,onCancel:r[3]||(r[3]=t=>o.value=null)},null,8,["open","loading"])])}}});export{ct as default};
@@ -1 +1 @@
1
- import{W as l,i as c,M as n,o as p,r as u,$ as i,ap as s}from"./BOCn_SGf.js";const m={base:"list-disc ps-6 my-5 marker:text-(--ui-border-accented)"},_={__name:"ProseUl",props:{class:{type:null,required:!1}},setup(e){const a=e,t=l(),o=c(()=>s({extend:s(m),...t.ui?.prose?.ul||{}}));return(r,d)=>(p(),n("ul",{class:i(o.value({class:a.class}))},[u(r.$slots,"default")],2))}};export{_ as default};
1
+ import{W as l,i as c,M as n,o as p,r as u,$ as i,ap as s}from"./CBqC92gC.js";const m={base:"list-disc ps-6 my-5 marker:text-(--ui-border-accented)"},_={__name:"ProseUl",props:{class:{type:null,required:!1}},setup(e){const a=e,t=l(),o=c(()=>s({extend:s(m),...t.ui?.prose?.ul||{}}));return(r,d)=>(p(),n("ul",{class:i(o.value({class:a.class}))},[u(r.$slots,"default")],2))}};export{_ as default};
@@ -1 +1 @@
1
- import{ax as S,W as k,i as v,ap as b,as as q,e as w,S as B,h as P,R as g,ay as V,c as j,o,w as x,ac as I,$ as i,M as p,aa as h,Z as C,a as n,r as d,ab as f,af as m,P as N,az as W,aA as D,aB as F}from"./BOCn_SGf.js";import{L as K}from"./D3cEeQh7.js";const E={slots:{root:"",wrapper:"",labelWrapper:"flex content-center items-center justify-between gap-1",label:"block font-medium text-default",container:"relative",description:"text-muted",error:"mt-2 text-error",hint:"text-muted",help:"mt-2 text-muted"},variants:{size:{xs:{root:"text-xs"},sm:{root:"text-xs"},md:{root:"text-sm"},lg:{root:"text-sm"},xl:{root:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},orientation:{vertical:{container:"mt-1"},horizontal:{root:"flex justify-between place-items-baseline gap-2"}}},defaultVariants:{size:"md",orientation:"vertical"}},O=["id"],A=["id"],L=["id"],M=["id"],Z={__name:"UFormField",props:{as:{type:null,required:!1},name:{type:String,required:!1},errorPattern:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},help:{type:String,required:!1},error:{type:[Boolean,String],required:!1,default:void 0},hint:{type:String,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},eagerValidation:{type:Boolean,required:!1},validateOnInputDelay:{type:Number,required:!1},orientation:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1}},setup(t){const e=t,l=S(),$=k(),a=v(()=>b({extend:b(E),...$.ui?.formField||{}})({size:e.size,required:e.required,orientation:e.orientation})),z=q(W,null),s=v(()=>e.error||z?.value?.find(r=>r.name===e.name||e.errorPattern&&r.name?.match(e.errorPattern))?.message),u=w(B()),c=u.value,y=q(D,void 0);return P(u,()=>{y&&e.name&&(y.value[e.name]={id:u.value,pattern:e.errorPattern})},{immediate:!0}),g(F,u),g(V,v(()=>({error:s.value,name:e.name,size:e.size,eagerValidation:e.eagerValidation,validateOnInputDelay:e.validateOnInputDelay,errorPattern:e.errorPattern,hint:e.hint,description:e.description,help:e.help,ariaId:c}))),(r,R)=>(o(),j(n(N),{as:t.as,"data-orientation":t.orientation,"data-slot":"root",class:i(a.value.root({class:[e.ui?.root,e.class]}))},{default:x(()=>[I("div",{"data-slot":"wrapper",class:i(a.value.wrapper({class:e.ui?.wrapper}))},[t.label||l.label?(o(),p("div",{key:0,"data-slot":"labelWrapper",class:i(a.value.labelWrapper({class:e.ui?.labelWrapper}))},[C(n(K),{for:u.value,"data-slot":"label",class:i(a.value.label({class:e.ui?.label}))},{default:x(()=>[d(r.$slots,"label",{label:t.label},()=>[f(m(t.label),1)])]),_:3},8,["for","class"]),t.hint||l.hint?(o(),p("span",{key:0,id:`${n(c)}-hint`,"data-slot":"hint",class:i(a.value.hint({class:e.ui?.hint}))},[d(r.$slots,"hint",{hint:t.hint},()=>[f(m(t.hint),1)])],10,O)):h("",!0)],2)):h("",!0),t.description||l.description?(o(),p("p",{key:1,id:`${n(c)}-description`,"data-slot":"description",class:i(a.value.description({class:e.ui?.description}))},[d(r.$slots,"description",{description:t.description},()=>[f(m(t.description),1)])],10,A)):h("",!0)],2),I("div",{class:i([(t.label||!!l.label||t.description||!!l.description)&&a.value.container({class:e.ui?.container})])},[d(r.$slots,"default",{error:s.value}),e.error!==!1&&(typeof s.value=="string"&&s.value||l.error)?(o(),p("div",{key:0,id:`${n(c)}-error`,"data-slot":"error",class:i(a.value.error({class:e.ui?.error}))},[d(r.$slots,"error",{error:s.value},()=>[f(m(s.value),1)])],10,L)):t.help||l.help?(o(),p("div",{key:1,id:`${n(c)}-help`,"data-slot":"help",class:i(a.value.help({class:e.ui?.help}))},[d(r.$slots,"help",{help:t.help},()=>[f(m(t.help),1)])],10,M)):h("",!0)],2)]),_:3},8,["as","data-orientation","class"]))}};export{Z as _};
1
+ import{ax as S,W as k,i as v,ap as b,as as q,e as w,S as B,h as P,R as g,ay as V,c as j,o,w as x,ac as I,$ as i,M as p,aa as h,Z as C,a as n,r as d,ab as f,af as m,P as N,az as W,aA as D,aB as F}from"./CBqC92gC.js";import{L as K}from"./CdIGoC9r.js";const E={slots:{root:"",wrapper:"",labelWrapper:"flex content-center items-center justify-between gap-1",label:"block font-medium text-default",container:"relative",description:"text-muted",error:"mt-2 text-error",hint:"text-muted",help:"mt-2 text-muted"},variants:{size:{xs:{root:"text-xs"},sm:{root:"text-xs"},md:{root:"text-sm"},lg:{root:"text-sm"},xl:{root:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},orientation:{vertical:{container:"mt-1"},horizontal:{root:"flex justify-between place-items-baseline gap-2"}}},defaultVariants:{size:"md",orientation:"vertical"}},O=["id"],A=["id"],L=["id"],M=["id"],Z={__name:"UFormField",props:{as:{type:null,required:!1},name:{type:String,required:!1},errorPattern:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},help:{type:String,required:!1},error:{type:[Boolean,String],required:!1,default:void 0},hint:{type:String,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},eagerValidation:{type:Boolean,required:!1},validateOnInputDelay:{type:Number,required:!1},orientation:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1}},setup(t){const e=t,l=S(),$=k(),a=v(()=>b({extend:b(E),...$.ui?.formField||{}})({size:e.size,required:e.required,orientation:e.orientation})),z=q(W,null),s=v(()=>e.error||z?.value?.find(r=>r.name===e.name||e.errorPattern&&r.name?.match(e.errorPattern))?.message),u=w(B()),c=u.value,y=q(D,void 0);return P(u,()=>{y&&e.name&&(y.value[e.name]={id:u.value,pattern:e.errorPattern})},{immediate:!0}),g(F,u),g(V,v(()=>({error:s.value,name:e.name,size:e.size,eagerValidation:e.eagerValidation,validateOnInputDelay:e.validateOnInputDelay,errorPattern:e.errorPattern,hint:e.hint,description:e.description,help:e.help,ariaId:c}))),(r,R)=>(o(),j(n(N),{as:t.as,"data-orientation":t.orientation,"data-slot":"root",class:i(a.value.root({class:[e.ui?.root,e.class]}))},{default:x(()=>[I("div",{"data-slot":"wrapper",class:i(a.value.wrapper({class:e.ui?.wrapper}))},[t.label||l.label?(o(),p("div",{key:0,"data-slot":"labelWrapper",class:i(a.value.labelWrapper({class:e.ui?.labelWrapper}))},[C(n(K),{for:u.value,"data-slot":"label",class:i(a.value.label({class:e.ui?.label}))},{default:x(()=>[d(r.$slots,"label",{label:t.label},()=>[f(m(t.label),1)])]),_:3},8,["for","class"]),t.hint||l.hint?(o(),p("span",{key:0,id:`${n(c)}-hint`,"data-slot":"hint",class:i(a.value.hint({class:e.ui?.hint}))},[d(r.$slots,"hint",{hint:t.hint},()=>[f(m(t.hint),1)])],10,O)):h("",!0)],2)):h("",!0),t.description||l.description?(o(),p("p",{key:1,id:`${n(c)}-description`,"data-slot":"description",class:i(a.value.description({class:e.ui?.description}))},[d(r.$slots,"description",{description:t.description},()=>[f(m(t.description),1)])],10,A)):h("",!0)],2),I("div",{class:i([(t.label||!!l.label||t.description||!!l.description)&&a.value.container({class:e.ui?.container})])},[d(r.$slots,"default",{error:s.value}),e.error!==!1&&(typeof s.value=="string"&&s.value||l.error)?(o(),p("div",{key:0,id:`${n(c)}-error`,"data-slot":"error",class:i(a.value.error({class:e.ui?.error}))},[d(r.$slots,"error",{error:s.value},()=>[f(m(s.value),1)])],10,L)):t.help||l.help?(o(),p("div",{key:1,id:`${n(c)}-help`,"data-slot":"help",class:i(a.value.help({class:e.ui?.help}))},[d(r.$slots,"help",{help:t.help},()=>[f(m(t.help),1)])],10,M)):h("",!0)],2)]),_:3},8,["as","data-orientation","class"]))}};export{Z as _};
@@ -0,0 +1 @@
1
+ import{S as e}from"./CBqC92gC.js";function a(r,u="reka"){return r||`${u}-${e?.()}`}export{a as u};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CS8SdmH2.js","./rIgg2Arf.js","./BOCn_SGf.js","./entry.ZJxWCrU6.css","./88opOQSr.js","./iik6CYzq.js","./CqkleIqs.js","./CCeM5lW2.js","./BXxZokD_.js"])))=>i.map(i=>d[i]);
2
- import{d as rn,L as j,g as an,i as P,J as un,an as sn,h as N,b$ as cn,c0 as pn,c1 as M,bN as dn,b4 as gn,bD as fn,bV as mn,r as hn,c as yn,aa as vn,o as bn,a as C,$ as Sn}from"./BOCn_SGf.js";import{p as V,k as Cn}from"./88opOQSr.js";import{f as $,n as kn}from"./iik6CYzq.js";import{u as xn}from"./CCeM5lW2.js";class D{constructor(e,o,t){this.normal=o,this.property=e,t&&(this.space=t)}}D.prototype.normal={};D.prototype.property={};D.prototype.space=void 0;function q(n,e){const o={},t={};for(const r of n)Object.assign(o,r.property),Object.assign(t,r.normal);return new D(o,t,e)}function T(n){return n.toLowerCase()}class y{constructor(e,o){this.attribute=o,this.property=e}}y.prototype.attribute="";y.prototype.booleanish=!1;y.prototype.boolean=!1;y.prototype.commaOrSpaceSeparated=!1;y.prototype.commaSeparated=!1;y.prototype.defined=!1;y.prototype.mustUseProperty=!1;y.prototype.number=!1;y.prototype.overloadedBoolean=!1;y.prototype.property="";y.prototype.spaceSeparated=!1;y.prototype.space=void 0;let wn=0;const i=S(),m=S(),A=S(),l=S(),g=S(),k=S(),b=S();function S(){return 2**++wn}const E=Object.freeze(Object.defineProperty({__proto__:null,boolean:i,booleanish:m,commaOrSpaceSeparated:b,commaSeparated:k,number:l,overloadedBoolean:A,spaceSeparated:g},Symbol.toStringTag,{value:"Module"})),R=Object.keys(E);class U extends y{constructor(e,o,t,r){let a=-1;if(super(e,o),H(this,"space",r),typeof t=="number")for(;++a<R.length;){const c=R[a];H(this,R[a],(t&E[c])===E[c])}}}U.prototype.defined=!0;function H(n,e,o){o&&(n[e]=o)}function x(n){const e={},o={};for(const[t,r]of Object.entries(n.properties)){const a=new U(t,n.transform(n.attributes||{},t),r,n.space);n.mustUseProperty&&n.mustUseProperty.includes(t)&&(a.mustUseProperty=!0),e[t]=a,o[T(t)]=t,o[T(a.attribute)]=t}return new D(e,o,n.space)}const K=x({properties:{ariaActiveDescendant:null,ariaAtomic:m,ariaAutoComplete:null,ariaBusy:m,ariaChecked:m,ariaColCount:l,ariaColIndex:l,ariaColSpan:l,ariaControls:g,ariaCurrent:null,ariaDescribedBy:g,ariaDetails:null,ariaDisabled:m,ariaDropEffect:g,ariaErrorMessage:null,ariaExpanded:m,ariaFlowTo:g,ariaGrabbed:m,ariaHasPopup:null,ariaHidden:m,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:g,ariaLevel:l,ariaLive:null,ariaModal:m,ariaMultiLine:m,ariaMultiSelectable:m,ariaOrientation:null,ariaOwns:g,ariaPlaceholder:null,ariaPosInSet:l,ariaPressed:m,ariaReadOnly:m,ariaRelevant:null,ariaRequired:m,ariaRoleDescription:g,ariaRowCount:l,ariaRowIndex:l,ariaRowSpan:l,ariaSelected:m,ariaSetSize:l,ariaSort:null,ariaValueMax:l,ariaValueMin:l,ariaValueNow:l,ariaValueText:null,role:null},transform(n,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function W(n,e){return e in n?n[e]:e}function X(n,e){return W(n,e.toLowerCase())}const On=x({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:k,acceptCharset:g,accessKey:g,action:null,allow:null,allowFullScreen:i,allowPaymentRequest:i,allowUserMedia:i,alt:null,as:null,async:i,autoCapitalize:null,autoComplete:g,autoFocus:i,autoPlay:i,blocking:g,capture:null,charSet:null,checked:i,cite:null,className:g,cols:l,colSpan:null,content:null,contentEditable:m,controls:i,controlsList:g,coords:l|k,crossOrigin:null,data:null,dateTime:null,decoding:null,default:i,defer:i,dir:null,dirName:null,disabled:i,download:A,draggable:m,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:i,formTarget:null,headers:g,height:l,hidden:A,high:l,href:null,hrefLang:null,htmlFor:g,httpEquiv:g,id:null,imageSizes:null,imageSrcSet:null,inert:i,inputMode:null,integrity:null,is:null,isMap:i,itemId:null,itemProp:g,itemRef:g,itemScope:i,itemType:g,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:i,low:l,manifest:null,max:null,maxLength:l,media:null,method:null,min:null,minLength:l,multiple:i,muted:i,name:null,nonce:null,noModule:i,noValidate:i,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:i,optimum:l,pattern:null,ping:g,placeholder:null,playsInline:i,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:i,referrerPolicy:null,rel:g,required:i,reversed:i,rows:l,rowSpan:l,sandbox:g,scope:null,scoped:i,seamless:i,selected:i,shadowRootClonable:i,shadowRootDelegatesFocus:i,shadowRootMode:null,shape:null,size:l,sizes:null,slot:null,span:l,spellCheck:m,src:null,srcDoc:null,srcLang:null,srcSet:null,start:l,step:null,style:null,tabIndex:l,target:null,title:null,translate:null,type:null,typeMustMatch:i,useMap:null,value:m,width:l,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:g,axis:null,background:null,bgColor:null,border:l,borderColor:null,bottomMargin:l,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:i,declare:i,event:null,face:null,frame:null,frameBorder:null,hSpace:l,leftMargin:l,link:null,longDesc:null,lowSrc:null,marginHeight:l,marginWidth:l,noResize:i,noHref:i,noShade:i,noWrap:i,object:null,profile:null,prompt:null,rev:null,rightMargin:l,rules:null,scheme:null,scrolling:m,standby:null,summary:null,text:null,topMargin:l,valueType:null,version:null,vAlign:null,vLink:null,vSpace:l,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:i,disableRemotePlayback:i,prefix:null,property:null,results:l,security:null,unselectable:null},space:"html",transform:X}),Dn=x({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",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:b,accentHeight:l,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:l,amplitude:l,arabicForm:null,ascent:l,attributeName:null,attributeType:null,azimuth:l,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:l,by:null,calcMode:null,capHeight:l,className:g,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:l,diffuseConstant:l,direction:null,display:null,dur:null,divisor:l,dominantBaseline:null,download:i,dx:null,dy:null,edgeMode:null,editable:null,elevation:l,enableBackground:null,end:null,event:null,exponent:l,externalResourcesRequired:null,fill:null,fillOpacity:l,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:k,g2:k,glyphName:k,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:l,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:l,horizOriginX:l,horizOriginY:l,id:null,ideographic:l,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:l,k:l,k1:l,k2:l,k3:l,k4:l,kernelMatrix:b,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:l,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:l,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:l,overlineThickness:l,paintOrder:null,panose1:null,path:null,pathLength:l,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:g,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:l,pointsAtY:l,pointsAtZ:l,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:b,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:b,rev:b,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:b,requiredFeatures:b,requiredFonts:b,requiredFormats:b,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:l,specularExponent:l,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:l,strikethroughThickness:l,string:null,stroke:null,strokeDashArray:b,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:l,strokeOpacity:l,strokeWidth:null,style:null,surfaceScale:l,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:b,tabIndex:l,tableValues:null,target:null,targetX:l,targetY:l,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:b,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:l,underlineThickness:l,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:l,values:null,vAlphabetic:l,vMathematical:l,vectorEffect:null,vHanging:l,vIdeographic:l,version:null,vertAdvY:l,vertOriginX:l,vertOriginY:l,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:l,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:W}),Y=x({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,e){return"xlink:"+e.slice(5).toLowerCase()}}),J=x({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:X}),Z=x({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,e){return"xml:"+e.slice(3).toLowerCase()}}),Pn=/[A-Z]/g,F=/-[a-z]/g,Mn=/^data[-\w.:]+$/i;function Ln(n,e){const o=T(e);let t=e,r=y;if(o in n.normal)return n.property[n.normal[o]];if(o.length>4&&o.slice(0,4)==="data"&&Mn.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(F,Tn);t="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!F.test(a)){let c=a.replace(Pn,Rn);c.charAt(0)!=="-"&&(c="-"+c),e="data"+c}}r=U}return new r(t,e)}function Rn(n){return"-"+n.toLowerCase()}function Tn(n){return n.charAt(1).toUpperCase()}const An=q([K,On,Y,J,Z],"html"),te=q([K,Dn,Y,J,Z],"svg"),En=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]);function _n(n,e){return e.reduce((o,t)=>{const r=Bn(n,t);return r!==void 0&&(o[t]=r),o},{})}function Bn(n,e){return e.split(".").reduce((o,t)=>o&&o[t],n)}const _="default",G=/^@|^v-on:/,Q=/^:|^v-bind:/,Un=/^v-model/,zn=["select","textarea","input"],In=new Set(["math","svg"]),nn=new Set,jn=Object.fromEntries(["p","a","blockquote","code","pre","code","em","h1","h2","h3","h4","h5","h6","hr","img","ul","ol","li","strong","table","thead","tbody","td","th","tr","script"].map(n=>[n,`prose-${n}`])),Hn=["script","base"],Fn=rn({name:"MDCRenderer",props:{body:{type:Object,required:!0},data:{type:Object,default:()=>({})},class:{type:[String,Object],default:void 0},tag:{type:[String,Boolean],default:void 0},prose:{type:Boolean,default:void 0},components:{type:Object,default:()=>({})},unwrap:{type:[Boolean,String],default:!1}},async setup(n){const o=an()?.appContext?.app?.$nuxt,t=o?.$route||o?._route,{mdc:r}=o?.$config?.public||{},a=r?.components?.customElements||r?.components?.custom;a&&a.forEach(u=>nn.add(u));const c=P(()=>({...r?.components?.prose&&n.prose!==!1?jn:{},...r?.components?.map||{},...un(n.data?.mdc?.components||{}),...n.components})),f=P(()=>{const u=(n.body?.children||[]).map(s=>s.tag||s.type).filter(s=>!z(s));return Array.from(new Set(u)).sort().join(".")}),d=sn({...n.data});N(()=>n.data,u=>{Object.assign(d,u)}),await Gn(n.body,{tags:c.value});function p(u,s){const h=u.split(".").length-1;return u.split(".").reduce((v,w,O)=>O==h&&v?(v[w]=s,v[w]):typeof v=="object"?v[w]:void 0,d)}return{tags:c,contentKey:f,route:t,runtimeData:d,updateRuntimeData:p}},render(n){const{tags:e,tag:o,body:t,data:r,contentKey:a,route:c,unwrap:f,runtimeData:d,updateRuntimeData:p}=n;if(!t)return null;const u={...r,tags:e,$route:c,runtimeData:d,updateRuntimeData:p},s=o!==!1?B(o||u.component?.name||u.component||"div"):void 0;return s?j(s,{...u.component?.props,class:n.class,...this.$attrs,key:a},{default:h}):h?.();function h(){const v=en(t,j,{documentMeta:u,parentScope:u,resolveComponent:B});return v?.default?f?$(v.default(),typeof f=="string"?f.split(" "):["*"]):v.default():null}}});function Nn(n,e,o,t){const{documentMeta:r,parentScope:a,resolveComponent:c}=o;if(n.type==="text")return e(M,n.value);if(n.type==="comment")return e(dn,null,n.value);const f=n.tag,d=on(n,r.tags);if(n.tag==="binding")return Vn(n,e,r,a);const p=ln(d)?h=>h:c;if(Hn.includes(d))return e("pre",{class:"mdc-renderer-dangerous-tag"},"<"+d+">"+kn(n)+"</"+d+">");const u=p(d);typeof u=="object"&&(u.tag=f);const s=$n(n,r);return t&&(s.key=t),e(u,s,en(n,e,{documentMeta:r,parentScope:{...a,...s},resolveComponent:p}))}function en(n,e,o){const{documentMeta:t,parentScope:r,resolveComponent:a}=o,f=(n.children||[]).reduce((p,u)=>{if(!Jn(u))return p[_].children.push(u),p;const s=Yn(u);return p[s]=p[s]||{props:{},children:[]},u.type==="element"&&(p[s].props=u.props,p[s].children.push(...u.children||[])),p},{[_]:{props:{},children:[]}});return Object.entries(f).reduce((p,[u,{props:s,children:h}])=>(h.length&&(p[u]=(v={})=>{const w=_n(v,Object.keys(s||{}));let O=h.map((I,tn)=>Nn(I,e,{documentMeta:t,parentScope:{...r,...w},resolveComponent:a},String(I.props?.key||tn)));return s?.unwrap&&(O=$(O,s.unwrap)),Zn(O)}),p),{})}function Vn(n,e,o,t={}){const r={...o.runtimeData,...t,$document:o,$doc:o},a=/\.|\[(\d+)\]/,f=(n.props?.value.trim().split(a).filter(Boolean)).reduce((p,u)=>{if(p&&u in p)return typeof p[u]=="function"?p[u]():p[u]},r),d=n.props?.defaultValue;return e(M,f??d??"")}function $n(n,e){const{tag:o="",props:t={}}=n;return Object.keys(t).reduce(function(r,a){if(a==="__ignoreMap")return r;const c=t[a];if(Un.test(a))return qn(a,c,r,e,{native:zn.includes(o)});if(a==="v-bind")return Kn(a,c,r,e);if(G.test(a))return Wn(a,c,r,e);if(Q.test(a))return Xn(a,c,r,e);const{attribute:f}=Ln(An,a);return Array.isArray(c)&&c.every(d=>typeof d=="string")?(r[f]=c.join(" "),r):(r[f]=c,r)},{})}function qn(n,e,o,t,{native:r}){const a=n.match(/^v-model:([^=]+)/)?.[1]||"modelValue",c=r?"value":a,f=r?"onInput":`onUpdate:${a}`;return o[c]=L(e,t.runtimeData),o[f]=d=>{t.updateRuntimeData(e,r?d.target?.value:d)},o}function Kn(n,e,o,t){const r=L(e,t);return o=Object.assign(o,r),o}function Wn(n,e,o,t){return n=n.replace(G,""),o.on=o.on||{},o.on[n]=()=>L(e,t),o}function Xn(n,e,o,t){return n=n.replace(Q,""),o[n]=L(e,t),o}const B=n=>{if(typeof n=="string"){if(z(n))return n;const e=cn(V(n),!1);return!n||e?.name==="AsyncComponentWrapper"||typeof e=="string"?e:"setup"in e?pn(()=>new Promise(o=>o(e))):e}return n};function L(n,e){const o=n.split(".").reduce((t,r)=>typeof t=="object"?t[r]:void 0,e);return typeof o>"u"?gn(n):o}function Yn(n){let e="";for(const o of Object.keys(n.props||{}))if(!(!o.startsWith("#")&&!o.startsWith("v-slot:"))){e=o.split(/[:#]/,2)[1];break}return e||_}function Jn(n){return n.tag==="template"}function ln(n){return In.has(n)}function Zn(n){const e=[];for(const o of n){const t=e[e.length-1];o.type===M&&t?.type===M?t.children=t.children+o.children:e.push(o)}return e}async function Gn(n,e){if(!n)return;const o=Array.from(new Set(t(n,e)));await Promise.all(o.map(async r=>{if(r?.render||r?.ssrRender||r?.__ssrInlineRender)return;const a=B(r);a?.__asyncLoader&&!a.__asyncResolved&&await a.__asyncLoader()}));function t(r,a){const c=r.tag;if(r.type==="text"||c==="binding"||r.type==="comment")return[];const f=on(r,a.tags);if(ln(f))return[];const d=[];r.type!=="root"&&!z(f)&&d.push(f);for(const p of r.children||[])d.push(...t(p,a));return d}}function on(n,e){const o=n.tag;return!o||typeof n.props?.__ignoreMap<"u"?o:e[o]||e[V(o)]||e[Cn(n.tag)]||o}function z(n){return(typeof n=="string"?nn.has(n):!1)||En.has(n)}const Qn=Object.assign(Fn,{__name:"MDCRenderer"}),re={__name:"MDC",props:{tag:{type:[String,Boolean],default:"div"},value:{type:[String,Object],required:!0},excerpt:{type:Boolean,default:!1},parserOptions:{type:Object,default:()=>({})},class:{type:[String,Array,Object],default:""},unwrap:{type:[Boolean,String],default:!1},cacheKey:{type:String,default:void 0},partial:{type:Boolean,default:!0}},async setup(n){let e,o;const t=n,r=P(()=>t.cacheKey??p(t.value)),{data:a,refresh:c,error:f}=([e,o]=fn(async()=>xn(r.value,async()=>{if(typeof t.value!="string")return t.value;const{parseMarkdown:u}=await mn(async()=>{const{parseMarkdown:s}=await import("./CS8SdmH2.js");return{parseMarkdown:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url);return await u(t.value,{...t.parserOptions,toc:t.partial?!1:t.parserOptions?.toc,contentHeading:t.partial?!1:t.parserOptions?.contentHeading})},"$agjSbxHxP4")),e=await e,o(),e),d=P(()=>t.excerpt?a.value?.excerpt:a.value?.body);N(()=>t.value,()=>{c()});function p(u){typeof u!="string"&&(u=JSON.stringify(u||""));let s=0;for(let h=0;h<u.length;h++){const v=u.charCodeAt(h);s=(s<<6)-s+v,s=s&s}return`mdc-${s===0?"0000":s.toString(36)}-key`}return(u,s)=>{const h=Qn;return hn(u.$slots,"default",{data:C(a)?.data,body:C(a)?.body,toc:C(a)?.toc,excerpt:C(a)?.excerpt,error:C(f)},()=>[d.value?(bn(),yn(h,{key:0,tag:t.tag,class:Sn(t.class),body:d.value,data:C(a)?.data,unwrap:t.unwrap},null,8,["tag","class","body","data","unwrap"])):vn("",!0)])}}};export{re as _,En as a,Ln as f,An as h,T as n,te as s};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BzkqPhn-.js","./BN8XazaH.js","./CBqC92gC.js","./entry.ZJxWCrU6.css","./88opOQSr.js","./iik6CYzq.js","./CqkleIqs.js","./-O86rjFZ.js","./-Q9J9PRu.js"])))=>i.map(i=>d[i]);
2
+ import{d as rn,L as j,g as an,i as P,J as un,an as sn,h as N,b$ as cn,c0 as pn,c1 as M,bN as dn,b4 as gn,bD as fn,bV as mn,r as hn,c as yn,aa as vn,o as bn,a as C,$ as Sn}from"./CBqC92gC.js";import{p as V,k as Cn}from"./88opOQSr.js";import{f as $,n as kn}from"./iik6CYzq.js";import{u as xn}from"./-O86rjFZ.js";class D{constructor(e,o,t){this.normal=o,this.property=e,t&&(this.space=t)}}D.prototype.normal={};D.prototype.property={};D.prototype.space=void 0;function q(n,e){const o={},t={};for(const r of n)Object.assign(o,r.property),Object.assign(t,r.normal);return new D(o,t,e)}function T(n){return n.toLowerCase()}class y{constructor(e,o){this.attribute=o,this.property=e}}y.prototype.attribute="";y.prototype.booleanish=!1;y.prototype.boolean=!1;y.prototype.commaOrSpaceSeparated=!1;y.prototype.commaSeparated=!1;y.prototype.defined=!1;y.prototype.mustUseProperty=!1;y.prototype.number=!1;y.prototype.overloadedBoolean=!1;y.prototype.property="";y.prototype.spaceSeparated=!1;y.prototype.space=void 0;let wn=0;const i=S(),m=S(),A=S(),l=S(),g=S(),k=S(),b=S();function S(){return 2**++wn}const E=Object.freeze(Object.defineProperty({__proto__:null,boolean:i,booleanish:m,commaOrSpaceSeparated:b,commaSeparated:k,number:l,overloadedBoolean:A,spaceSeparated:g},Symbol.toStringTag,{value:"Module"})),R=Object.keys(E);class U extends y{constructor(e,o,t,r){let a=-1;if(super(e,o),H(this,"space",r),typeof t=="number")for(;++a<R.length;){const c=R[a];H(this,R[a],(t&E[c])===E[c])}}}U.prototype.defined=!0;function H(n,e,o){o&&(n[e]=o)}function x(n){const e={},o={};for(const[t,r]of Object.entries(n.properties)){const a=new U(t,n.transform(n.attributes||{},t),r,n.space);n.mustUseProperty&&n.mustUseProperty.includes(t)&&(a.mustUseProperty=!0),e[t]=a,o[T(t)]=t,o[T(a.attribute)]=t}return new D(e,o,n.space)}const K=x({properties:{ariaActiveDescendant:null,ariaAtomic:m,ariaAutoComplete:null,ariaBusy:m,ariaChecked:m,ariaColCount:l,ariaColIndex:l,ariaColSpan:l,ariaControls:g,ariaCurrent:null,ariaDescribedBy:g,ariaDetails:null,ariaDisabled:m,ariaDropEffect:g,ariaErrorMessage:null,ariaExpanded:m,ariaFlowTo:g,ariaGrabbed:m,ariaHasPopup:null,ariaHidden:m,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:g,ariaLevel:l,ariaLive:null,ariaModal:m,ariaMultiLine:m,ariaMultiSelectable:m,ariaOrientation:null,ariaOwns:g,ariaPlaceholder:null,ariaPosInSet:l,ariaPressed:m,ariaReadOnly:m,ariaRelevant:null,ariaRequired:m,ariaRoleDescription:g,ariaRowCount:l,ariaRowIndex:l,ariaRowSpan:l,ariaSelected:m,ariaSetSize:l,ariaSort:null,ariaValueMax:l,ariaValueMin:l,ariaValueNow:l,ariaValueText:null,role:null},transform(n,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function W(n,e){return e in n?n[e]:e}function X(n,e){return W(n,e.toLowerCase())}const On=x({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:k,acceptCharset:g,accessKey:g,action:null,allow:null,allowFullScreen:i,allowPaymentRequest:i,allowUserMedia:i,alt:null,as:null,async:i,autoCapitalize:null,autoComplete:g,autoFocus:i,autoPlay:i,blocking:g,capture:null,charSet:null,checked:i,cite:null,className:g,cols:l,colSpan:null,content:null,contentEditable:m,controls:i,controlsList:g,coords:l|k,crossOrigin:null,data:null,dateTime:null,decoding:null,default:i,defer:i,dir:null,dirName:null,disabled:i,download:A,draggable:m,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:i,formTarget:null,headers:g,height:l,hidden:A,high:l,href:null,hrefLang:null,htmlFor:g,httpEquiv:g,id:null,imageSizes:null,imageSrcSet:null,inert:i,inputMode:null,integrity:null,is:null,isMap:i,itemId:null,itemProp:g,itemRef:g,itemScope:i,itemType:g,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:i,low:l,manifest:null,max:null,maxLength:l,media:null,method:null,min:null,minLength:l,multiple:i,muted:i,name:null,nonce:null,noModule:i,noValidate:i,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:i,optimum:l,pattern:null,ping:g,placeholder:null,playsInline:i,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:i,referrerPolicy:null,rel:g,required:i,reversed:i,rows:l,rowSpan:l,sandbox:g,scope:null,scoped:i,seamless:i,selected:i,shadowRootClonable:i,shadowRootDelegatesFocus:i,shadowRootMode:null,shape:null,size:l,sizes:null,slot:null,span:l,spellCheck:m,src:null,srcDoc:null,srcLang:null,srcSet:null,start:l,step:null,style:null,tabIndex:l,target:null,title:null,translate:null,type:null,typeMustMatch:i,useMap:null,value:m,width:l,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:g,axis:null,background:null,bgColor:null,border:l,borderColor:null,bottomMargin:l,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:i,declare:i,event:null,face:null,frame:null,frameBorder:null,hSpace:l,leftMargin:l,link:null,longDesc:null,lowSrc:null,marginHeight:l,marginWidth:l,noResize:i,noHref:i,noShade:i,noWrap:i,object:null,profile:null,prompt:null,rev:null,rightMargin:l,rules:null,scheme:null,scrolling:m,standby:null,summary:null,text:null,topMargin:l,valueType:null,version:null,vAlign:null,vLink:null,vSpace:l,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:i,disableRemotePlayback:i,prefix:null,property:null,results:l,security:null,unselectable:null},space:"html",transform:X}),Dn=x({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",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:b,accentHeight:l,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:l,amplitude:l,arabicForm:null,ascent:l,attributeName:null,attributeType:null,azimuth:l,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:l,by:null,calcMode:null,capHeight:l,className:g,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:l,diffuseConstant:l,direction:null,display:null,dur:null,divisor:l,dominantBaseline:null,download:i,dx:null,dy:null,edgeMode:null,editable:null,elevation:l,enableBackground:null,end:null,event:null,exponent:l,externalResourcesRequired:null,fill:null,fillOpacity:l,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:k,g2:k,glyphName:k,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:l,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:l,horizOriginX:l,horizOriginY:l,id:null,ideographic:l,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:l,k:l,k1:l,k2:l,k3:l,k4:l,kernelMatrix:b,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:l,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:l,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:l,overlineThickness:l,paintOrder:null,panose1:null,path:null,pathLength:l,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:g,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:l,pointsAtY:l,pointsAtZ:l,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:b,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:b,rev:b,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:b,requiredFeatures:b,requiredFonts:b,requiredFormats:b,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:l,specularExponent:l,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:l,strikethroughThickness:l,string:null,stroke:null,strokeDashArray:b,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:l,strokeOpacity:l,strokeWidth:null,style:null,surfaceScale:l,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:b,tabIndex:l,tableValues:null,target:null,targetX:l,targetY:l,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:b,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:l,underlineThickness:l,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:l,values:null,vAlphabetic:l,vMathematical:l,vectorEffect:null,vHanging:l,vIdeographic:l,version:null,vertAdvY:l,vertOriginX:l,vertOriginY:l,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:l,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:W}),Y=x({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,e){return"xlink:"+e.slice(5).toLowerCase()}}),J=x({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:X}),Z=x({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,e){return"xml:"+e.slice(3).toLowerCase()}}),Pn=/[A-Z]/g,F=/-[a-z]/g,Mn=/^data[-\w.:]+$/i;function Ln(n,e){const o=T(e);let t=e,r=y;if(o in n.normal)return n.property[n.normal[o]];if(o.length>4&&o.slice(0,4)==="data"&&Mn.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(F,Tn);t="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!F.test(a)){let c=a.replace(Pn,Rn);c.charAt(0)!=="-"&&(c="-"+c),e="data"+c}}r=U}return new r(t,e)}function Rn(n){return"-"+n.toLowerCase()}function Tn(n){return n.charAt(1).toUpperCase()}const An=q([K,On,Y,J,Z],"html"),te=q([K,Dn,Y,J,Z],"svg"),En=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]);function _n(n,e){return e.reduce((o,t)=>{const r=Bn(n,t);return r!==void 0&&(o[t]=r),o},{})}function Bn(n,e){return e.split(".").reduce((o,t)=>o&&o[t],n)}const _="default",G=/^@|^v-on:/,Q=/^:|^v-bind:/,Un=/^v-model/,zn=["select","textarea","input"],In=new Set(["math","svg"]),nn=new Set,jn=Object.fromEntries(["p","a","blockquote","code","pre","code","em","h1","h2","h3","h4","h5","h6","hr","img","ul","ol","li","strong","table","thead","tbody","td","th","tr","script"].map(n=>[n,`prose-${n}`])),Hn=["script","base"],Fn=rn({name:"MDCRenderer",props:{body:{type:Object,required:!0},data:{type:Object,default:()=>({})},class:{type:[String,Object],default:void 0},tag:{type:[String,Boolean],default:void 0},prose:{type:Boolean,default:void 0},components:{type:Object,default:()=>({})},unwrap:{type:[Boolean,String],default:!1}},async setup(n){const o=an()?.appContext?.app?.$nuxt,t=o?.$route||o?._route,{mdc:r}=o?.$config?.public||{},a=r?.components?.customElements||r?.components?.custom;a&&a.forEach(u=>nn.add(u));const c=P(()=>({...r?.components?.prose&&n.prose!==!1?jn:{},...r?.components?.map||{},...un(n.data?.mdc?.components||{}),...n.components})),f=P(()=>{const u=(n.body?.children||[]).map(s=>s.tag||s.type).filter(s=>!z(s));return Array.from(new Set(u)).sort().join(".")}),d=sn({...n.data});N(()=>n.data,u=>{Object.assign(d,u)}),await Gn(n.body,{tags:c.value});function p(u,s){const h=u.split(".").length-1;return u.split(".").reduce((v,w,O)=>O==h&&v?(v[w]=s,v[w]):typeof v=="object"?v[w]:void 0,d)}return{tags:c,contentKey:f,route:t,runtimeData:d,updateRuntimeData:p}},render(n){const{tags:e,tag:o,body:t,data:r,contentKey:a,route:c,unwrap:f,runtimeData:d,updateRuntimeData:p}=n;if(!t)return null;const u={...r,tags:e,$route:c,runtimeData:d,updateRuntimeData:p},s=o!==!1?B(o||u.component?.name||u.component||"div"):void 0;return s?j(s,{...u.component?.props,class:n.class,...this.$attrs,key:a},{default:h}):h?.();function h(){const v=en(t,j,{documentMeta:u,parentScope:u,resolveComponent:B});return v?.default?f?$(v.default(),typeof f=="string"?f.split(" "):["*"]):v.default():null}}});function Nn(n,e,o,t){const{documentMeta:r,parentScope:a,resolveComponent:c}=o;if(n.type==="text")return e(M,n.value);if(n.type==="comment")return e(dn,null,n.value);const f=n.tag,d=on(n,r.tags);if(n.tag==="binding")return Vn(n,e,r,a);const p=ln(d)?h=>h:c;if(Hn.includes(d))return e("pre",{class:"mdc-renderer-dangerous-tag"},"<"+d+">"+kn(n)+"</"+d+">");const u=p(d);typeof u=="object"&&(u.tag=f);const s=$n(n,r);return t&&(s.key=t),e(u,s,en(n,e,{documentMeta:r,parentScope:{...a,...s},resolveComponent:p}))}function en(n,e,o){const{documentMeta:t,parentScope:r,resolveComponent:a}=o,f=(n.children||[]).reduce((p,u)=>{if(!Jn(u))return p[_].children.push(u),p;const s=Yn(u);return p[s]=p[s]||{props:{},children:[]},u.type==="element"&&(p[s].props=u.props,p[s].children.push(...u.children||[])),p},{[_]:{props:{},children:[]}});return Object.entries(f).reduce((p,[u,{props:s,children:h}])=>(h.length&&(p[u]=(v={})=>{const w=_n(v,Object.keys(s||{}));let O=h.map((I,tn)=>Nn(I,e,{documentMeta:t,parentScope:{...r,...w},resolveComponent:a},String(I.props?.key||tn)));return s?.unwrap&&(O=$(O,s.unwrap)),Zn(O)}),p),{})}function Vn(n,e,o,t={}){const r={...o.runtimeData,...t,$document:o,$doc:o},a=/\.|\[(\d+)\]/,f=(n.props?.value.trim().split(a).filter(Boolean)).reduce((p,u)=>{if(p&&u in p)return typeof p[u]=="function"?p[u]():p[u]},r),d=n.props?.defaultValue;return e(M,f??d??"")}function $n(n,e){const{tag:o="",props:t={}}=n;return Object.keys(t).reduce(function(r,a){if(a==="__ignoreMap")return r;const c=t[a];if(Un.test(a))return qn(a,c,r,e,{native:zn.includes(o)});if(a==="v-bind")return Kn(a,c,r,e);if(G.test(a))return Wn(a,c,r,e);if(Q.test(a))return Xn(a,c,r,e);const{attribute:f}=Ln(An,a);return Array.isArray(c)&&c.every(d=>typeof d=="string")?(r[f]=c.join(" "),r):(r[f]=c,r)},{})}function qn(n,e,o,t,{native:r}){const a=n.match(/^v-model:([^=]+)/)?.[1]||"modelValue",c=r?"value":a,f=r?"onInput":`onUpdate:${a}`;return o[c]=L(e,t.runtimeData),o[f]=d=>{t.updateRuntimeData(e,r?d.target?.value:d)},o}function Kn(n,e,o,t){const r=L(e,t);return o=Object.assign(o,r),o}function Wn(n,e,o,t){return n=n.replace(G,""),o.on=o.on||{},o.on[n]=()=>L(e,t),o}function Xn(n,e,o,t){return n=n.replace(Q,""),o[n]=L(e,t),o}const B=n=>{if(typeof n=="string"){if(z(n))return n;const e=cn(V(n),!1);return!n||e?.name==="AsyncComponentWrapper"||typeof e=="string"?e:"setup"in e?pn(()=>new Promise(o=>o(e))):e}return n};function L(n,e){const o=n.split(".").reduce((t,r)=>typeof t=="object"?t[r]:void 0,e);return typeof o>"u"?gn(n):o}function Yn(n){let e="";for(const o of Object.keys(n.props||{}))if(!(!o.startsWith("#")&&!o.startsWith("v-slot:"))){e=o.split(/[:#]/,2)[1];break}return e||_}function Jn(n){return n.tag==="template"}function ln(n){return In.has(n)}function Zn(n){const e=[];for(const o of n){const t=e[e.length-1];o.type===M&&t?.type===M?t.children=t.children+o.children:e.push(o)}return e}async function Gn(n,e){if(!n)return;const o=Array.from(new Set(t(n,e)));await Promise.all(o.map(async r=>{if(r?.render||r?.ssrRender||r?.__ssrInlineRender)return;const a=B(r);a?.__asyncLoader&&!a.__asyncResolved&&await a.__asyncLoader()}));function t(r,a){const c=r.tag;if(r.type==="text"||c==="binding"||r.type==="comment")return[];const f=on(r,a.tags);if(ln(f))return[];const d=[];r.type!=="root"&&!z(f)&&d.push(f);for(const p of r.children||[])d.push(...t(p,a));return d}}function on(n,e){const o=n.tag;return!o||typeof n.props?.__ignoreMap<"u"?o:e[o]||e[V(o)]||e[Cn(n.tag)]||o}function z(n){return(typeof n=="string"?nn.has(n):!1)||En.has(n)}const Qn=Object.assign(Fn,{__name:"MDCRenderer"}),re={__name:"MDC",props:{tag:{type:[String,Boolean],default:"div"},value:{type:[String,Object],required:!0},excerpt:{type:Boolean,default:!1},parserOptions:{type:Object,default:()=>({})},class:{type:[String,Array,Object],default:""},unwrap:{type:[Boolean,String],default:!1},cacheKey:{type:String,default:void 0},partial:{type:Boolean,default:!0}},async setup(n){let e,o;const t=n,r=P(()=>t.cacheKey??p(t.value)),{data:a,refresh:c,error:f}=([e,o]=fn(async()=>xn(r.value,async()=>{if(typeof t.value!="string")return t.value;const{parseMarkdown:u}=await mn(async()=>{const{parseMarkdown:s}=await import("./BzkqPhn-.js");return{parseMarkdown:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url);return await u(t.value,{...t.parserOptions,toc:t.partial?!1:t.parserOptions?.toc,contentHeading:t.partial?!1:t.parserOptions?.contentHeading})},"$agjSbxHxP4")),e=await e,o(),e),d=P(()=>t.excerpt?a.value?.excerpt:a.value?.body);N(()=>t.value,()=>{c()});function p(u){typeof u!="string"&&(u=JSON.stringify(u||""));let s=0;for(let h=0;h<u.length;h++){const v=u.charCodeAt(h);s=(s<<6)-s+v,s=s&s}return`mdc-${s===0?"0000":s.toString(36)}-key`}return(u,s)=>{const h=Qn;return hn(u.$slots,"default",{data:C(a)?.data,body:C(a)?.body,toc:C(a)?.toc,excerpt:C(a)?.excerpt,error:C(f)},()=>[d.value?(bn(),yn(h,{key:0,tag:t.tag,class:Sn(t.class),body:d.value,data:C(a)?.data,unwrap:t.unwrap},null,8,["tag","class","body","data","unwrap"])):vn("",!0)])}}};export{re as _,En as a,Ln as f,An as h,T as n,te as s};
@@ -1,4 +1,4 @@
1
- import{k as Lm,b as Dm,s as Im}from"./Vcq4gwWv.js";import{d as Bm,e as Nm,V as Fm,C as Hm,h as or,a5 as Km,M as Jm,o as eg}from"./BOCn_SGf.js";let eo=[],td=[];(()=>{let O="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<O.length;e++)(e%2?td:eo).push(t=t+O[e])})();function tg(O){if(O<768)return!1;for(let e=0,t=eo.length;;){let i=e+t>>1;if(O<eo[i])t=i;else if(O>=td[i])e=i+1;else return!0;if(e==t)return!1}}function zl(O){return O>=127462&&O<=127487}const Ul=8205;function Og(O,e,t=!0,i=!0){return(t?Od:ig)(O,e,i)}function Od(O,e,t){if(e==O.length)return e;e&&id(O.charCodeAt(e))&&rd(O.charCodeAt(e-1))&&e--;let i=Jn(O,e);for(e+=Vl(i);e<O.length;){let r=Jn(O,e);if(i==Ul||r==Ul||t&&tg(r))e+=Vl(r),i=r;else if(zl(r)){let n=0,s=e-2;for(;s>=0&&zl(Jn(O,s));)n++,s-=2;if(n%2==0)break;e+=2}else break}return e}function ig(O,e,t){for(;e>0;){let i=Od(O,e-2,t);if(i<e)return i;e--}return 0}function Jn(O,e){let t=O.charCodeAt(e);if(!rd(t)||e+1==O.length)return t;let i=O.charCodeAt(e+1);return id(i)?(t-55296<<10)+(i-56320)+65536:t}function id(O){return O>=56320&&O<57344}function rd(O){return O>=55296&&O<56320}function Vl(O){return O<65536?1:2}class E{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=WO(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),ft.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=WO(this,e,t);let i=[];return this.decompose(e,t,i,0),ft.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new ui(this),n=new ui(e);for(let s=t,o=t;;){if(r.next(s),n.next(s),s=0,r.lineBreak!=n.lineBreak||r.done!=n.done||r.value!=n.value)return!1;if(o+=r.value.length,r.done||o>=i)return!0}}iter(e=1){return new ui(this,e)}iterRange(e,t=this.length){return new nd(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new sd(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?E.empty:e.length<=32?new ie(e):ft.from(ie.split(e,[]))}}class ie extends E{constructor(e,t=rg(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let n=0;;n++){let s=this.text[n],o=r+s.length;if((t?i:o)>=e)return new ng(r,o,i,s);r=o+1,i++}}decompose(e,t,i,r){let n=e<=0&&t>=this.length?this:new ie(Wl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let s=i.pop(),o=Ur(n.text,s.text.slice(),0,n.length);if(o.length<=32)i.push(new ie(o,s.length+n.length));else{let a=o.length>>1;i.push(new ie(o.slice(0,a)),new ie(o.slice(a)))}}else i.push(n)}replace(e,t,i){if(!(i instanceof ie))return super.replace(e,t,i);[e,t]=WO(this,e,t);let r=Ur(this.text,Ur(i.text,Wl(this.text,0,e)),t),n=this.length+i.length-(t-e);return r.length<=32?new ie(r,n):ft.from(ie.split(r,[]),n)}sliceString(e,t=this.length,i=`
1
+ import{k as Lm,b as Dm,s as Im}from"./Vcq4gwWv.js";import{d as Bm,e as Nm,V as Fm,C as Hm,h as or,a5 as Km,M as Jm,o as eg}from"./CBqC92gC.js";let eo=[],td=[];(()=>{let O="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<O.length;e++)(e%2?td:eo).push(t=t+O[e])})();function tg(O){if(O<768)return!1;for(let e=0,t=eo.length;;){let i=e+t>>1;if(O<eo[i])t=i;else if(O>=td[i])e=i+1;else return!0;if(e==t)return!1}}function zl(O){return O>=127462&&O<=127487}const Ul=8205;function Og(O,e,t=!0,i=!0){return(t?Od:ig)(O,e,i)}function Od(O,e,t){if(e==O.length)return e;e&&id(O.charCodeAt(e))&&rd(O.charCodeAt(e-1))&&e--;let i=Jn(O,e);for(e+=Vl(i);e<O.length;){let r=Jn(O,e);if(i==Ul||r==Ul||t&&tg(r))e+=Vl(r),i=r;else if(zl(r)){let n=0,s=e-2;for(;s>=0&&zl(Jn(O,s));)n++,s-=2;if(n%2==0)break;e+=2}else break}return e}function ig(O,e,t){for(;e>0;){let i=Od(O,e-2,t);if(i<e)return i;e--}return 0}function Jn(O,e){let t=O.charCodeAt(e);if(!rd(t)||e+1==O.length)return t;let i=O.charCodeAt(e+1);return id(i)?(t-55296<<10)+(i-56320)+65536:t}function id(O){return O>=56320&&O<57344}function rd(O){return O>=55296&&O<56320}function Vl(O){return O<65536?1:2}class E{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=WO(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),ft.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=WO(this,e,t);let i=[];return this.decompose(e,t,i,0),ft.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new ui(this),n=new ui(e);for(let s=t,o=t;;){if(r.next(s),n.next(s),s=0,r.lineBreak!=n.lineBreak||r.done!=n.done||r.value!=n.value)return!1;if(o+=r.value.length,r.done||o>=i)return!0}}iter(e=1){return new ui(this,e)}iterRange(e,t=this.length){return new nd(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new sd(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?E.empty:e.length<=32?new ie(e):ft.from(ie.split(e,[]))}}class ie extends E{constructor(e,t=rg(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let n=0;;n++){let s=this.text[n],o=r+s.length;if((t?i:o)>=e)return new ng(r,o,i,s);r=o+1,i++}}decompose(e,t,i,r){let n=e<=0&&t>=this.length?this:new ie(Wl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let s=i.pop(),o=Ur(n.text,s.text.slice(),0,n.length);if(o.length<=32)i.push(new ie(o,s.length+n.length));else{let a=o.length>>1;i.push(new ie(o.slice(0,a)),new ie(o.slice(a)))}}else i.push(n)}replace(e,t,i){if(!(i instanceof ie))return super.replace(e,t,i);[e,t]=WO(this,e,t);let r=Ur(this.text,Ur(i.text,Wl(this.text,0,e)),t),n=this.length+i.length-(t-e);return r.length<=32?new ie(r,n):ft.from(ie.split(r,[]),n)}sliceString(e,t=this.length,i=`
2
2
  `){[e,t]=WO(this,e,t);let r="";for(let n=0,s=0;n<=t&&s<this.text.length;s++){let o=this.text[s],a=n+o.length;n>e&&s&&(r+=i),e<a&&t>n&&(r+=o.slice(Math.max(0,e-n),t-n)),n=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],r=-1;for(let n of e)i.push(n),r+=n.length+1,i.length==32&&(t.push(new ie(i,r)),i=[],r=-1);return r>-1&&t.push(new ie(i,r)),t}}class ft extends E{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,r){for(let n=0;;n++){let s=this.children[n],o=r+s.length,a=i+s.lines-1;if((t?a:o)>=e)return s.lineInner(e,t,i,r);r=o+1,i=a+1}}decompose(e,t,i,r){for(let n=0,s=0;s<=t&&n<this.children.length;n++){let o=this.children[n],a=s+o.length;if(e<=a&&t>=s){let l=r&((s<=e?1:0)|(a>=t?2:0));s>=e&&a<=t&&!l?i.push(o):o.decompose(e-s,t-s,i,l)}s=a+1}}replace(e,t,i){if([e,t]=WO(this,e,t),i.lines<this.lines)for(let r=0,n=0;r<this.children.length;r++){let s=this.children[r],o=n+s.length;if(e>=n&&t<=o){let a=s.replace(e-n,t-n,i),l=this.lines-s.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let h=this.children.slice();return h[r]=a,new ft(h,this.length-(t-e)+i.length)}return super.replace(n,o,a)}n=o+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
3
3
  `){[e,t]=WO(this,e,t);let r="";for(let n=0,s=0;n<this.children.length&&s<=t;n++){let o=this.children[n],a=s+o.length;s>e&&n&&(r+=i),e<a&&t>s&&(r+=o.sliceString(e-s,t-s,i)),s=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof ft))return 0;let i=0,[r,n,s,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,n+=t){if(r==s||n==o)return i;let a=this.children[r],l=e.children[n];if(a!=l)return i+a.scanIdentical(l,t);i+=a.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let u of e)i+=u.lines;if(i<32){let u=[];for(let Q of e)Q.flatten(u);return new ie(u,t)}let r=Math.max(32,i>>5),n=r<<1,s=r>>1,o=[],a=0,l=-1,h=[];function c(u){let Q;if(u.lines>n&&u instanceof ft)for(let p of u.children)c(p);else u.lines>s&&(a>s||!a)?(f(),o.push(u)):u instanceof ie&&a&&(Q=h[h.length-1])instanceof ie&&u.lines+Q.lines<=32?(a+=u.lines,l+=u.length+1,h[h.length-1]=new ie(Q.text.concat(u.text),Q.length+1+u.length)):(a+u.lines>r&&f(),a+=u.lines,l+=u.length+1,h.push(u))}function f(){a!=0&&(o.push(h.length==1?h[0]:ft.from(h,l)),l=-1,a=h.length=0)}for(let u of e)c(u);return f(),o.length==1?o[0]:new ft(o,t)}}E.empty=new ie([""],0);function rg(O){let e=-1;for(let t of O)e+=t.length+1;return e}function Ur(O,e,t=0,i=1e9){for(let r=0,n=0,s=!0;n<O.length&&r<=i;n++){let o=O[n],a=r+o.length;a>=t&&(a>i&&(o=o.slice(0,i-r)),r<t&&(o=o.slice(t-r)),s?(e[e.length-1]+=o,s=!1):e.push(o)),r=a+1}return e}function Wl(O,e,t){return Ur(O,[""],e,t)}class ui{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof ie?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],n=this.offsets[i],s=n>>1,o=r instanceof ie?r.text.length:r.children.length;if(s==(t>0?o:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((n&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
4
4
  `,this;e--}else if(r instanceof ie){let a=r.text[s+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[s+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof ie?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class nd{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ui(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class sd{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=function(){return this.iter()},ui.prototype[Symbol.iterator]=nd.prototype[Symbol.iterator]=sd.prototype[Symbol.iterator]=function(){return this});let ng=class{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}};function WO(O,e,t){return e=Math.max(0,Math.min(O.length,e)),[e,Math.max(e,Math.min(O.length,t))]}function le(O,e,t=!0,i=!0){return Og(O,e,t,i)}function sg(O){return O>=56320&&O<57344}function og(O){return O>=55296&&O<56320}function we(O,e){let t=O.charCodeAt(e);if(!og(t)||e+1==O.length)return t;let i=O.charCodeAt(e+1);return sg(i)?(t-55296<<10)+(i-56320)+65536:t}function Sa(O){return O<=65535?String.fromCharCode(O):(O-=65536,String.fromCharCode((O>>10)+55296,(O&1023)+56320))}function dt(O){return O<65536?1:2}const to=/\r\n?|\n/;var ue=(function(O){return O[O.Simple=0]="Simple",O[O.TrackDel=1]="TrackDel",O[O.TrackBefore=2]="TrackBefore",O[O.TrackAfter=3]="TrackAfter",O})(ue||(ue={}));class gt{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,r=0;t<this.sections.length;){let n=this.sections[t++],s=this.sections[t++];s<0?(e(i,r,n),r+=n):r+=s,i+=n}}iterChangedRanges(e,t=!1){Oo(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];r<0?e.push(i,r):e.push(r,i)}return new gt(e)}composeDesc(e){return this.empty?e:e.empty?this:od(this,e)}mapDesc(e,t=!1){return e.empty?this:io(this,e,t)}mapPos(e,t=-1,i=ue.Simple){let r=0,n=0;for(let s=0;s<this.sections.length;){let o=this.sections[s++],a=this.sections[s++],l=r+o;if(a<0){if(l>e)return n+(e-r);n+=o}else{if(i!=ue.Simple&&l>=e&&(i==ue.TrackDel&&r<e&&l>e||i==ue.TrackBefore&&r<e||i==ue.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!o)return e==r||t<0?n:n+a;n+=a}r=l}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return n}touchesRange(e,t=e){for(let i=0,r=0;i<this.sections.length&&r<=t;){let n=this.sections[i++],s=this.sections[i++],o=r+n;if(s>=0&&r<=t&&o>=e)return r<e&&o>t?"cover":!0;r=o}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new gt(e)}static create(e){return new gt(e)}}class ae extends gt{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Oo(this,(t,i,r,n,s)=>e=e.replace(r,r+(i-t),s),!1),e}mapDesc(e,t=!1){return io(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,n=0;r<t.length;r+=2){let s=t[r],o=t[r+1];if(o>=0){t[r]=o,t[r+1]=s;let a=r>>1;for(;i.length<a;)i.push(E.empty);i.push(s?e.slice(n,n+s):E.empty)}n+=s}return new ae(t,i)}compose(e){return this.empty?e:e.empty?this:od(this,e,!0)}map(e,t=!1){return e.empty?this:io(this,e,t,!0)}iterChanges(e,t=!1){Oo(this,e,t)}get desc(){return gt.create(this.sections)}filter(e){let t=[],i=[],r=[],n=new xi(this);e:for(let s=0,o=0;;){let a=s==e.length?1e9:e[s++];for(;o<a||o==a&&n.len==0;){if(n.done)break e;let h=Math.min(n.len,a-o);pe(r,h,-1);let c=n.ins==-1?-1:n.off==0?n.ins:0;pe(t,h,c),c>0&&At(i,t,n.text),n.forward(h),o+=h}let l=e[s++];for(;o<l;){if(n.done)break e;let h=Math.min(n.len,l-o);pe(t,h,-1),pe(r,h,n.ins==-1?-1:n.off==0?n.ins:0),n.forward(h),o+=h}}return{changes:new ae(t,i),filtered:gt.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],r=this.sections[t+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let r=[],n=[],s=0,o=null;function a(h=!1){if(!h&&!r.length)return;s<t&&pe(r,t-s,-1);let c=new ae(r,n);o=o?o.compose(c.map(o)):c,r=[],n=[],s=0}function l(h){if(Array.isArray(h))for(let c of h)l(c);else if(h instanceof ae){if(h.length!=t)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${t})`);a(),o=o?o.compose(h.map(o)):h}else{let{from:c,to:f=c,insert:u}=h;if(c>f||c<0||f>t)throw new RangeError(`Invalid change range ${c} to ${f} (in doc of length ${t})`);let Q=u?typeof u=="string"?E.of(u.split(i||to)):u:E.empty,p=Q.length;if(c==f&&p==0)return;c<s&&a(),c>s&&pe(r,c-s,-1),pe(r,f-c,p),At(n,r,Q),s=f}}return l(e),a(!o),o}static empty(e){return new ae(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="number")t.push(n,-1);else{if(!Array.isArray(n)||typeof n[0]!="number"||n.some((s,o)=>o&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(n.length==1)t.push(n[0],0);else{for(;i.length<r;)i.push(E.empty);i[r]=E.of(n.slice(1)),t.push(n[0],i[r].length)}}}return new ae(t,i)}static createSet(e,t){return new ae(e,t)}}function pe(O,e,t,i=!1){if(e==0&&t<=0)return;let r=O.length-2;r>=0&&t<=0&&t==O[r+1]?O[r]+=e:r>=0&&e==0&&O[r]==0?O[r+1]+=t:i?(O[r]+=e,O[r+1]+=t):O.push(e,t)}function At(O,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<O.length)O[O.length-1]=O[O.length-1].append(t);else{for(;O.length<i;)O.push(E.empty);O.push(t)}}function Oo(O,e,t){let i=O.inserted;for(let r=0,n=0,s=0;s<O.sections.length;){let o=O.sections[s++],a=O.sections[s++];if(a<0)r+=o,n+=o;else{let l=r,h=n,c=E.empty;for(;l+=o,h+=a,a&&i&&(c=c.append(i[s-2>>1])),!(t||s==O.sections.length||O.sections[s+1]<0);)o=O.sections[s++],a=O.sections[s++];e(r,l,n,h,c),r=l,n=h}}}function io(O,e,t,i=!1){let r=[],n=i?[]:null,s=new xi(O),o=new xi(e);for(let a=-1;;){if(s.done&&o.len||o.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&o.ins==-1){let l=Math.min(s.len,o.len);pe(r,l,-1),s.forward(l),o.forward(l)}else if(o.ins>=0&&(s.ins<0||a==s.i||s.off==0&&(o.len<s.len||o.len==s.len&&!t))){let l=o.len;for(pe(r,o.ins,-1);l;){let h=Math.min(s.len,l);s.ins>=0&&a<s.i&&s.len<=h&&(pe(r,0,s.ins),n&&At(n,r,s.text),a=s.i),s.forward(h),l-=h}o.next()}else if(s.ins>=0){let l=0,h=s.len;for(;h;)if(o.ins==-1){let c=Math.min(h,o.len);l+=c,h-=c,o.forward(c)}else if(o.ins==0&&o.len<h)h-=o.len,o.next();else break;pe(r,l,a<s.i?s.ins:0),n&&a<s.i&&At(n,r,s.text),a=s.i,s.forward(s.len-h)}else{if(s.done&&o.done)return n?ae.createSet(r,n):gt.create(r);throw new Error("Mismatched change set lengths")}}}function od(O,e,t=!1){let i=[],r=t?[]:null,n=new xi(O),s=new xi(e);for(let o=!1;;){if(n.done&&s.done)return r?ae.createSet(i,r):gt.create(i);if(n.ins==0)pe(i,n.len,0,o),n.next();else if(s.len==0&&!s.done)pe(i,0,s.ins,o),r&&At(r,i,s.text),s.next();else{if(n.done||s.done)throw new Error("Mismatched change set lengths");{let a=Math.min(n.len2,s.len),l=i.length;if(n.ins==-1){let h=s.ins==-1?-1:s.off?0:s.ins;pe(i,a,h,o),r&&h&&At(r,i,s.text)}else s.ins==-1?(pe(i,n.off?0:n.len,a,o),r&&At(r,i,n.textBit(a))):(pe(i,n.off?0:n.len,s.off?0:s.ins,o),r&&!s.off&&At(r,i,s.text));o=(n.ins>a||s.ins>=0&&s.len>a)&&(o||i.length>l),n.forward2(a),s.forward(a)}}}}class xi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?E.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?E.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class hO{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new hO(i,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return P.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return P.range(this.anchor,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return P.range(e.anchor,e.head)}static create(e,t,i){return new hO(e,t,i)}}class P{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:P.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new P([this.main],0)}addRange(e,t=!0){return P.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,P.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new P(e.ranges.map(t=>hO.fromJSON(t)),e.main)}static single(e,t=e){return new P([P.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let n=e[r];if(n.empty?n.from<=i:n.from<i)return P.normalized(e.slice(),t);i=n.to}return new P(e,t)}static cursor(e,t=0,i,r){return hO.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(r??16777215)<<6)}static range(e,t,i,r){let n=(i??16777215)<<6|(r==null?7:Math.min(6,r));return t<e?hO.create(t,e,48|n):hO.create(e,t,(t>e?8:0)|n)}static normalized(e,t=0){let i=e[t];e.sort((r,n)=>r.from-n.from),t=e.indexOf(i);for(let r=1;r<e.length;r++){let n=e[r],s=e[r-1];if(n.empty?n.from<=s.to:n.from<s.to){let o=s.from,a=Math.max(n.to,s.to);r<=t&&t--,e.splice(--r,2,n.anchor>n.head?P.range(a,o):P.range(o,a))}}return new P(e,t)}}function ad(O,e){for(let t of O.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Xa=0;class v{constructor(e,t,i,r,n){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=Xa++,this.default=e([]),this.extensions=typeof n=="function"?n(this):n}get reader(){return this}static define(e={}){return new v(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:ba),!!e.static,e.enables)}of(e){return new Vr([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vr(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vr(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function ba(O,e){return O==e||O.length==e.length&&O.every((t,i)=>t===e[i])}class Vr{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=Xa++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,n=this.id,s=e[n]>>1,o=this.type==2,a=!1,l=!1,h=[];for(let c of this.dependencies)c=="doc"?a=!0:c=="selection"?l=!0:(((t=e[c.id])!==null&&t!==void 0?t:1)&1)==0&&h.push(e[c.id]);return{create(c){return c.values[s]=i(c),1},update(c,f){if(a&&f.docChanged||l&&(f.docChanged||f.selection)||ro(c,h)){let u=i(c);if(o?!Cl(u,c.values[s],r):!r(u,c.values[s]))return c.values[s]=u,1}return 0},reconfigure:(c,f)=>{let u,Q=f.config.address[n];if(Q!=null){let p=Kr(f,Q);if(this.dependencies.every(m=>m instanceof v?f.facet(m)===c.facet(m):m instanceof ce?f.field(m,!1)==c.field(m,!1):!0)||(o?Cl(u=i(c),p,r):r(u=i(c),p)))return c.values[s]=p,0}else u=i(c);return c.values[s]=u,1}}}}function Cl(O,e,t){if(O.length!=e.length)return!1;for(let i=0;i<O.length;i++)if(!t(O[i],e[i]))return!1;return!0}function ro(O,e){let t=!1;for(let i of e)Qi(O,i)&1&&(t=!0);return t}function ag(O,e,t){let i=t.map(a=>O[a.id]),r=t.map(a=>a.type),n=i.filter(a=>!(a&1)),s=O[e.id]>>1;function o(a){let l=[];for(let h=0;h<i.length;h++){let c=Kr(a,i[h]);if(r[h]==2)for(let f of c)l.push(f);else l.push(c)}return e.combine(l)}return{create(a){for(let l of i)Qi(a,l);return a.values[s]=o(a),1},update(a,l){if(!ro(a,n))return 0;let h=o(a);return e.compare(h,a.values[s])?0:(a.values[s]=h,1)},reconfigure(a,l){let h=ro(a,i),c=l.config.facets[e.id],f=l.facet(e);if(c&&!h&&ba(t,c))return a.values[s]=f,0;let u=o(a);return e.compare(u,f)?(a.values[s]=f,0):(a.values[s]=u,1)}}}const ar=v.define({static:!0});class ce{constructor(e,t,i,r,n){this.id=e,this.createF=t,this.updateF=i,this.compareF=r,this.spec=n,this.provides=void 0}static define(e){let t=new ce(Xa++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(ar).find(i=>i.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let n=i.values[t],s=this.updateF(n,r);return this.compareF(n,s)?0:(i.values[t]=s,1)},reconfigure:(i,r)=>{let n=i.facet(ar),s=r.facet(ar),o;return(o=n.find(a=>a.field==this))&&o!=s.find(a=>a.field==this)?(i.values[t]=o.create(i),1):r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,ar.of({field:this,create:e})]}get extension(){return this}}const sO={lowest:4,low:3,default:2,high:1,highest:0};function ti(O){return e=>new ld(e,O)}const Ut={highest:ti(sO.highest),high:ti(sO.high),default:ti(sO.default),low:ti(sO.low),lowest:ti(sO.lowest)};class ld{constructor(e,t){this.inner=e,this.prec=t}}class Et{of(e){return new no(this,e)}reconfigure(e){return Et.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class no{constructor(e,t){this.compartment=e,this.inner=t}}class Hr{constructor(e,t,i,r,n,s){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=n,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let r=[],n=Object.create(null),s=new Map;for(let f of lg(e,t,s))f instanceof ce?r.push(f):(n[f.facet.id]||(n[f.facet.id]=[])).push(f);let o=Object.create(null),a=[],l=[];for(let f of r)o[f.id]=l.length<<1,l.push(u=>f.slot(u));let h=i?.config.facets;for(let f in n){let u=n[f],Q=u[0].facet,p=h&&h[f]||[];if(u.every(m=>m.type==0))if(o[Q.id]=a.length<<1|1,ba(p,u))a.push(i.facet(Q));else{let m=Q.combine(u.map(g=>g.value));a.push(i&&Q.compare(m,i.facet(Q))?i.facet(Q):m)}else{for(let m of u)m.type==0?(o[m.id]=a.length<<1|1,a.push(m.value)):(o[m.id]=l.length<<1,l.push(g=>m.dynamicSlot(g)));o[Q.id]=l.length<<1,l.push(m=>ag(m,Q,u))}}let c=l.map(f=>f(o));return new Hr(e,s,c,o,a,n)}}function lg(O,e,t){let i=[[],[],[],[],[]],r=new Map;function n(s,o){let a=r.get(s);if(a!=null){if(a<=o)return;let l=i[a].indexOf(s);l>-1&&i[a].splice(l,1),s instanceof no&&t.delete(s.compartment)}if(r.set(s,o),Array.isArray(s))for(let l of s)n(l,o);else if(s instanceof no){if(t.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let l=e.get(s.compartment)||s.inner;t.set(s.compartment,l),n(l,o)}else if(s instanceof ld)n(s.inner,s.prec);else if(s instanceof ce)i[o].push(s),s.provides&&n(s.provides,o);else if(s instanceof Vr)i[o].push(s),s.facet.extensions&&n(s.facet.extensions,sO.default);else{let l=s.extension;if(!l)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);n(l,o)}}return n(O,sO.default),i.reduce((s,o)=>s.concat(o))}function Qi(O,e){if(e&1)return 2;let t=e>>1,i=O.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;O.status[t]=4;let r=O.computeSlot(O,O.config.dynamicSlots[t]);return O.status[t]=2|r}function Kr(O,e){return e&1?O.config.staticValues[e>>1]:O.values[e>>1]}const hd=v.define(),so=v.define({combine:O=>O.some(e=>e),static:!0}),cd=v.define({combine:O=>O.length?O[0]:void 0,static:!0}),fd=v.define(),dd=v.define(),ud=v.define(),Qd=v.define({combine:O=>O.length?O[0]:!1});class Vt{constructor(e,t){this.type=e,this.value=t}static define(){return new hg}}class hg{of(e){return new Vt(this,e)}}class cg{constructor(e){this.map=e}of(e){return new z(this,e)}}class z{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new z(this.type,t)}is(e){return this.type==e}static define(e={}){return new cg(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let n=r.map(t);n&&i.push(n)}return i}}z.reconfigure=z.define();z.appendConfig=z.define();class re{constructor(e,t,i,r,n,s){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=n,this.scrollIntoView=s,this._doc=null,this._state=null,i&&ad(i,t.newLength),n.some(o=>o.type==re.time)||(this.annotations=n.concat(re.time.of(Date.now())))}static create(e,t,i,r,n,s){return new re(e,t,i,r,n,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(re.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}re.time=Vt.define();re.userEvent=Vt.define();re.addToHistory=Vt.define();re.remote=Vt.define();function fg(O,e){let t=[];for(let i=0,r=0;;){let n,s;if(i<O.length&&(r==e.length||e[r]>=O[i]))n=O[i++],s=O[i++];else if(r<e.length)n=e[r++],s=e[r++];else return t;!t.length||t[t.length-1]<n?t.push(n,s):t[t.length-1]<s&&(t[t.length-1]=s)}}function pd(O,e,t){var i;let r,n,s;return t?(r=e.changes,n=ae.empty(e.changes.length),s=O.changes.compose(e.changes)):(r=e.changes.map(O.changes),n=O.changes.mapDesc(e.changes,!0),s=O.changes.compose(r)),{changes:s,selection:e.selection?e.selection.map(n):(i=O.selection)===null||i===void 0?void 0:i.map(r),effects:z.mapEffects(O.effects,r).concat(z.mapEffects(e.effects,n)),annotations:O.annotations.length?O.annotations.concat(e.annotations):e.annotations,scrollIntoView:O.scrollIntoView||e.scrollIntoView}}function oo(O,e,t){let i=e.selection,r=YO(e.annotations);return e.userEvent&&(r=r.concat(re.userEvent.of(e.userEvent))),{changes:e.changes instanceof ae?e.changes:ae.of(e.changes||[],t,O.facet(cd)),selection:i&&(i instanceof P?i:P.single(i.anchor,i.head)),effects:YO(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function md(O,e,t){let i=oo(O,e.length?e[0]:{},O.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let n=1;n<e.length;n++){e[n].filter===!1&&(t=!1);let s=!!e[n].sequential;i=pd(i,oo(O,e[n],s?i.changes.newLength:O.doc.length),s)}let r=re.create(O,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return ug(t?dg(r):r)}function dg(O){let e=O.startState,t=!0;for(let r of e.facet(fd)){let n=r(O);if(n===!1){t=!1;break}Array.isArray(n)&&(t=t===!0?n:fg(t,n))}if(t!==!0){let r,n;if(t===!1)n=O.changes.invertedDesc,r=ae.empty(e.doc.length);else{let s=O.changes.filter(t);r=s.changes,n=s.filtered.mapDesc(s.changes).invertedDesc}O=re.create(e,r,O.selection&&O.selection.map(n),z.mapEffects(O.effects,n),O.annotations,O.scrollIntoView)}let i=e.facet(dd);for(let r=i.length-1;r>=0;r--){let n=i[r](O);n instanceof re?O=n:Array.isArray(n)&&n.length==1&&n[0]instanceof re?O=n[0]:O=md(e,YO(n),!1)}return O}function ug(O){let e=O.startState,t=e.facet(ud),i=O;for(let r=t.length-1;r>=0;r--){let n=t[r](O);n&&Object.keys(n).length&&(i=pd(i,oo(e,n,O.changes.newLength),!0))}return i==O?O:re.create(e,O.changes,O.selection,i.effects,i.annotations,i.scrollIntoView)}const Qg=[];function YO(O){return O==null?Qg:Array.isArray(O)?O:[O]}var te=(function(O){return O[O.Word=0]="Word",O[O.Space=1]="Space",O[O.Other=2]="Other",O})(te||(te={}));const pg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ao;try{ao=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function mg(O){if(ao)return ao.test(O);for(let e=0;e<O.length;e++){let t=O[e];if(/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||pg.test(t)))return!0}return!1}function gg(O){return e=>{if(!/\S/.test(e))return te.Space;if(mg(e))return te.Word;for(let t=0;t<O.length;t++)if(e.indexOf(O[t])>-1)return te.Word;return te.Other}}class j{constructor(e,t,i,r,n,s){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=n,s&&(s._state=this);for(let o=0;o<this.config.dynamicSlots.length;o++)Qi(this,o<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return Qi(this,i),Kr(this,i)}update(...e){return md(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:r}=t;for(let o of e.effects)o.is(Et.reconfigure)?(t&&(r=new Map,t.compartments.forEach((a,l)=>r.set(l,a)),t=null),r.set(o.value.compartment,o.value.extension)):o.is(z.reconfigure)?(t=null,i=o.value):o.is(z.appendConfig)&&(t=null,i=YO(i).concat(o.value));let n;t?n=e.startState.values.slice():(t=Hr.resolve(i,r,this),n=new j(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,l)=>l.reconfigure(a,this),null).values);let s=e.startState.facet(so)?e.newSelection:e.newSelection.asSingle();new j(t,e.newDoc,s,n,(o,a)=>a.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:P.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),n=[i.range],s=YO(i.effects);for(let o=1;o<t.ranges.length;o++){let a=e(t.ranges[o]),l=this.changes(a.changes),h=l.map(r);for(let f=0;f<o;f++)n[f]=n[f].map(h);let c=r.mapDesc(l,!0);n.push(a.range.map(c)),r=r.compose(h),s=z.mapEffects(s,h).concat(z.mapEffects(YO(a.effects),c))}return{changes:r,selection:P.create(n,t.mainIndex),effects:s}}changes(e=[]){return e instanceof ae?e:ae.of(e,this.doc.length,this.facet(j.lineSeparator))}toText(e){return E.of(e.split(this.facet(j.lineSeparator)||to))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Qi(this,t),Kr(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof ce&&this.config.address[r.id]!=null&&(t[i]=r.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let n in i)if(Object.prototype.hasOwnProperty.call(e,n)){let s=i[n],o=e[n];r.push(s.init(a=>s.spec.fromJSON(o,a)))}}return j.create({doc:e.doc,selection:P.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Hr.resolve(e.extensions||[],new Map),i=e.doc instanceof E?e.doc:E.of((e.doc||"").split(t.staticFacet(j.lineSeparator)||to)),r=e.selection?e.selection instanceof P?e.selection:P.single(e.selection.anchor,e.selection.head):P.single(0);return ad(r,i.length),t.staticFacet(so)||(r=r.asSingle()),new j(t,i,r,t.dynamicSlots.map(()=>null),(n,s)=>s.create(n),null)}get tabSize(){return this.facet(j.tabSize)}get lineBreak(){return this.facet(j.lineSeparator)||`
@@ -1 +1 @@
1
- import{s as D}from"./Gyw_2f6x.js";import{e as s,f as v}from"./BOCn_SGf.js";function b(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const i=new Uint8Array(16);crypto.getRandomValues(i),i[6]=i[6]&15|64,i[8]=i[8]&63|128;const u=Array.from(i,S=>S.toString(16).padStart(2,"0")).join("");return`${u.slice(0,8)}-${u.slice(8,12)}-${u.slice(12,16)}-${u.slice(16,20)}-${u.slice(20)}`}const d=s("disconnected"),f=s("idle"),c=s(null),p=s([]),y=s([]),r=s(""),o=s({}),$=s(0),k=s(!1),n=s(null),w=s(0),T=5;let U=!1,h=null;function W(){function i(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/_ws/chat`}function u(e){switch(e.type){case"chat:session_created":c.value=e.conversationId,I();break;case"chat:stream_start":f.value="streaming",r.value="",o.value={};break;case"chat:text_delta":r.value+=e.delta;break;case"chat:tool_start":o.value={...o.value,[e.toolUseId]:{name:e.toolName}};break;case"chat:tool_end":{const a=o.value[e.toolUseId];a&&(o.value={...o.value,[e.toolUseId]:{...a,result:e.result,isError:e.isError}});break}case"chat:stream_end":{f.value="idle",$.value=e.costUsd;const a=[];r.value&&a.push({type:"text",text:r.value});for(const[t,l]of Object.entries(o.value))a.push({type:"tool_use",id:t,name:l.name,input:{}}),l.result!==void 0&&a.push({type:"tool_result",tool_use_id:t,content:l.result,is_error:l.isError});a.length>0&&p.value.push({id:b(),conversationId:e.conversationId,role:"assistant",content:a,costUsd:e.costUsd,durationMs:e.durationMs,createdAt:new Date}),r.value="",o.value={},I();break}case"chat:error":f.value="error",console.error("[chat] Server error:",e.message);break;case"chat:interrupted":f.value="interrupted",r.value&&(p.value.push({id:b(),conversationId:e.conversationId,role:"assistant",content:[{type:"text",text:r.value}],createdAt:new Date}),r.value="",o.value={});break}}function S(){if(n.value?.readyState===WebSocket.OPEN||U&&d.value==="connecting")return;U=!0,d.value="connecting";const e=new WebSocket(i());n.value=e,e.onopen=()=>{d.value="connected",w.value=0,m()},e.onmessage=a=>{try{const t=JSON.parse(a.data);if(t.type==="chat:connected"||t.type==="pong")return;u(t)}catch(t){console.error("[chat] Failed to parse message:",t)}},e.onclose=()=>{d.value="disconnected",x(),w.value<T&&(w.value++,setTimeout(S,2e3*w.value))},e.onerror=()=>{d.value="error"}}function C(){x(),n.value&&(n.value.close(),n.value=null),d.value="disconnected",U=!1}function m(){h&&clearInterval(h),h=D(()=>{n.value?.readyState===WebSocket.OPEN&&n.value.send(JSON.stringify({type:"ping"}))},3e4)}function x(){h&&(clearInterval(h),h=null)}function A(e,a,t){if(!n.value||n.value.readyState!==WebSocket.OPEN)return;const l=[];if(a?.length)for(const g of a)l.push(g);if(t?.length)for(const g of t)l.push(g);e&&l.push({type:"text",text:e}),p.value.push({id:b(),conversationId:c.value||"",role:"user",content:l,createdAt:new Date}),n.value.send(JSON.stringify({type:"chat:send",message:e,attachments:a?.length?a:void 0,documents:t?.length?t:void 0,conversationId:c.value}))}function E(){!n.value||!c.value||n.value.send(JSON.stringify({type:"chat:interrupt",conversationId:c.value}))}function _(){c.value=null,p.value=[],f.value="idle",r.value="",o.value={}}async function N(e){k.value=!0;try{const a=await $fetch(`/api/conversations/${e}`);c.value=e,p.value=(a.data.messages||[]).map(t=>({...t,createdAt:new Date(t.createdAt)})),f.value="idle"}catch(a){console.error("[chat] Failed to load conversation:",a)}finally{k.value=!1}}async function I(){try{const e=await $fetch("/api/conversations");y.value=e.data}catch(e){console.error("[chat] Failed to load conversations:",e)}}async function O(e){if(!y.value.find(t=>t.id===e)?.isMain)try{await $fetch(`/api/conversations/${e}`,{method:"DELETE"}),y.value=y.value.filter(t=>t.id!==e),c.value===e&&_()}catch(t){console.error("[chat] Failed to delete conversation:",t)}}return{connectionStatus:v(d),sessionStatus:v(f),activeConversationId:v(c),messages:p,conversations:y,streamingText:v(r),streamingToolCalls:v(o),lastCostUsd:v($),loading:v(k),connect:S,disconnect:C,sendMessage:A,interrupt:E,startNewConversation:_,loadConversation:N,loadConversations:I,deleteConversation:O}}export{W as u};
1
+ import{s as D}from"./V5ro_Ide.js";import{e as s,f as v}from"./CBqC92gC.js";function b(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const i=new Uint8Array(16);crypto.getRandomValues(i),i[6]=i[6]&15|64,i[8]=i[8]&63|128;const u=Array.from(i,S=>S.toString(16).padStart(2,"0")).join("");return`${u.slice(0,8)}-${u.slice(8,12)}-${u.slice(12,16)}-${u.slice(16,20)}-${u.slice(20)}`}const d=s("disconnected"),f=s("idle"),c=s(null),p=s([]),y=s([]),r=s(""),o=s({}),$=s(0),k=s(!1),n=s(null),w=s(0),T=5;let U=!1,h=null;function W(){function i(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/_ws/chat`}function u(e){switch(e.type){case"chat:session_created":c.value=e.conversationId,I();break;case"chat:stream_start":f.value="streaming",r.value="",o.value={};break;case"chat:text_delta":r.value+=e.delta;break;case"chat:tool_start":o.value={...o.value,[e.toolUseId]:{name:e.toolName}};break;case"chat:tool_end":{const a=o.value[e.toolUseId];a&&(o.value={...o.value,[e.toolUseId]:{...a,result:e.result,isError:e.isError}});break}case"chat:stream_end":{f.value="idle",$.value=e.costUsd;const a=[];r.value&&a.push({type:"text",text:r.value});for(const[t,l]of Object.entries(o.value))a.push({type:"tool_use",id:t,name:l.name,input:{}}),l.result!==void 0&&a.push({type:"tool_result",tool_use_id:t,content:l.result,is_error:l.isError});a.length>0&&p.value.push({id:b(),conversationId:e.conversationId,role:"assistant",content:a,costUsd:e.costUsd,durationMs:e.durationMs,createdAt:new Date}),r.value="",o.value={},I();break}case"chat:error":f.value="error",console.error("[chat] Server error:",e.message);break;case"chat:interrupted":f.value="interrupted",r.value&&(p.value.push({id:b(),conversationId:e.conversationId,role:"assistant",content:[{type:"text",text:r.value}],createdAt:new Date}),r.value="",o.value={});break}}function S(){if(n.value?.readyState===WebSocket.OPEN||U&&d.value==="connecting")return;U=!0,d.value="connecting";const e=new WebSocket(i());n.value=e,e.onopen=()=>{d.value="connected",w.value=0,m()},e.onmessage=a=>{try{const t=JSON.parse(a.data);if(t.type==="chat:connected"||t.type==="pong")return;u(t)}catch(t){console.error("[chat] Failed to parse message:",t)}},e.onclose=()=>{d.value="disconnected",x(),w.value<T&&(w.value++,setTimeout(S,2e3*w.value))},e.onerror=()=>{d.value="error"}}function C(){x(),n.value&&(n.value.close(),n.value=null),d.value="disconnected",U=!1}function m(){h&&clearInterval(h),h=D(()=>{n.value?.readyState===WebSocket.OPEN&&n.value.send(JSON.stringify({type:"ping"}))},3e4)}function x(){h&&(clearInterval(h),h=null)}function A(e,a,t){if(!n.value||n.value.readyState!==WebSocket.OPEN)return;const l=[];if(a?.length)for(const g of a)l.push(g);if(t?.length)for(const g of t)l.push(g);e&&l.push({type:"text",text:e}),p.value.push({id:b(),conversationId:c.value||"",role:"user",content:l,createdAt:new Date}),n.value.send(JSON.stringify({type:"chat:send",message:e,attachments:a?.length?a:void 0,documents:t?.length?t:void 0,conversationId:c.value}))}function E(){!n.value||!c.value||n.value.send(JSON.stringify({type:"chat:interrupt",conversationId:c.value}))}function _(){c.value=null,p.value=[],f.value="idle",r.value="",o.value={}}async function N(e){k.value=!0;try{const a=await $fetch(`/api/conversations/${e}`);c.value=e,p.value=(a.data.messages||[]).map(t=>({...t,createdAt:new Date(t.createdAt)})),f.value="idle"}catch(a){console.error("[chat] Failed to load conversation:",a)}finally{k.value=!1}}async function I(){try{const e=await $fetch("/api/conversations");y.value=e.data}catch(e){console.error("[chat] Failed to load conversations:",e)}}async function O(e){if(!y.value.find(t=>t.id===e)?.isMain)try{await $fetch(`/api/conversations/${e}`,{method:"DELETE"}),y.value=y.value.filter(t=>t.id!==e),c.value===e&&_()}catch(t){console.error("[chat] Failed to delete conversation:",t)}}return{connectionStatus:v(d),sessionStatus:v(f),activeConversationId:v(c),messages:p,conversations:y,streamingText:v(r),streamingToolCalls:v(o),lastCostUsd:v($),loading:v(k),connect:S,disconnect:C,sendMessage:A,interrupt:E,startNewConversation:_,loadConversation:N,loadConversations:I,deleteConversation:O}}export{W as u};
@@ -1 +1 @@
1
- import{d as w,u as P,c as g,o as n,w as i,r as q,aL as E,aM as R,a as t,aQ as G,bL as F,i as v,aS as U,h as Z,e as S,bM as J,ax as I,bN as Q,C as K,bf as $,Z as B,m as _,aK as X,ab as Y,af as M,ao as ee,bF as te,X as ae,aG as j,aY as re,bg as oe,b6 as le,P as se,aJ as ne,W as ie,aH as ue,aI as de,au as x,aZ as pe,ap as A,aa as O,M as L,$ as H,al as fe,am as ce}from"./BOCn_SGf.js";import{P as ge,a as ye,b as ve,c as be}from"./jTT1R-Vz.js";import{u as me}from"./D41A2mE2.js";import{u as _e}from"./DTR31rjp.js";import{_ as qe}from"./C1oaoi1p.js";var he=w({__name:"TooltipArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(l){const u=l;return P(),(e,d)=>(n(),g(t(ge),E(R(u)),{default:i(()=>[q(e.$slots,"default")]),_:3},16))}}),Ce=he;const z="tooltip.open",[N,Te]=G("TooltipRoot");var we=w({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(l,{emit:u}){const e=l,d=u;P();const a=F(),c=v(()=>e.disableHoverableContent??a.disableHoverableContent.value),f=v(()=>e.disableClosingTrigger??a.disableClosingTrigger.value),p=v(()=>e.disabled??a.disabled.value),y=v(()=>e.delayDuration??a.delayDuration.value),m=v(()=>e.ignoreNonKeyboardFocus??a.ignoreNonKeyboardFocus.value),r=U(e,"open",d,{defaultValue:e.defaultOpen,passive:e.open===void 0});Z(r,k=>{a.onClose&&(k?(a.onOpen(),document.dispatchEvent(new CustomEvent(z))):a.onClose())});const o=S(!1),s=S(),h=v(()=>r.value?o.value?"delayed-open":"instant-open":"closed"),{start:C,stop:T}=J(()=>{o.value=!0,r.value=!0},y,{immediate:!1});function b(){T(),o.value=!1,r.value=!0}function D(){T(),r.value=!1}function W(){C()}return Te({contentId:"",open:r,stateAttribute:h,trigger:s,onTriggerChange(k){s.value=k},onTriggerEnter(){a.isOpenDelayed.value?W():b()},onTriggerLeave(){c.value?D():T()},onOpen:b,onClose:D,disableHoverableContent:c,disableClosingTrigger:f,disabled:p,ignoreNonKeyboardFocus:m}),(k,Fe)=>(n(),g(t(ye),null,{default:i(()=>[q(k.$slots,"default",{open:t(r)})]),_:3}))}}),Pe=we,ke=w({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1,default:0},align:{type:null,required:!1,default:"center"},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:!0},collisionBoundary:{type:null,required:!1,default:()=>[]},collisionPadding:{type:[Number,Object],required:!1,default:0},arrowPadding:{type:Number,required:!1,default:0},sticky:{type:String,required:!1,default:"partial"},hideWhenDetached:{type:Boolean,required:!1,default:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(l,{emit:u}){const e=l,d=u,a=N(),{forwardRef:c}=P(),f=I(),p=v(()=>f.default?.({})),y=v(()=>{if(e.ariaLabel)return e.ariaLabel;let r="";function o(s){typeof s.children=="string"&&s.type!==Q?r+=s.children:Array.isArray(s.children)&&s.children.forEach(h=>o(h))}return p.value?.forEach(s=>o(s)),r}),m=v(()=>{const{ariaLabel:r,...o}=e;return o});return K(()=>{$(window,"scroll",r=>{r.target?.contains(a.trigger.value)&&a.onClose()}),$(window,z,a.onClose)}),(r,o)=>(n(),g(t(te),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:o[0]||(o[0]=s=>d("escapeKeyDown",s)),onPointerDownOutside:o[1]||(o[1]=s=>{t(a).disableClosingTrigger.value&&t(a).trigger.value?.contains(s.target)&&s.preventDefault(),d("pointerDownOutside",s)}),onFocusOutside:o[2]||(o[2]=ee(()=>{},["prevent"])),onDismiss:o[3]||(o[3]=s=>t(a).onClose())},{default:i(()=>[B(t(ve),_({ref:t(c),"data-state":t(a).stateAttribute.value},{...r.$attrs,...m.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:i(()=>[q(r.$slots,"default"),B(t(X),{id:t(a).contentId,role:"tooltip"},{default:i(()=>[Y(M(y.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),V=ke,Be=w({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(l){const e=ae(l),{forwardRef:d,currentElement:a}=P(),{trigger:c,onClose:f}=N(),p=F(),{isPointerInTransit:y,onPointerExit:m}=me(c,a);return p.isPointerInTransitRef=y,m(()=>{f()}),(r,o)=>(n(),g(V,_({ref:t(d)},t(e)),{default:i(()=>[q(r.$slots,"default")]),_:3},16))}}),Oe=Be,Se=w({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(l,{emit:u}){const e=l,d=u,a=N(),c=j(e,d),{forwardRef:f}=P();return(p,y)=>(n(),g(t(oe),{present:p.forceMount||t(a).open.value},{default:i(()=>[(n(),g(re(t(a).disableHoverableContent.value?V:Oe),_({ref:t(f)},t(c)),{default:i(()=>[q(p.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Ne=Se,De=w({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(l){const u=l;return(e,d)=>(n(),g(t(le),E(R(u)),{default:i(()=>[q(e.$slots,"default")]),_:3},16))}}),xe=De,Le=w({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(l){const u=l,e=N(),d=F();e.contentId||=_e(void 0,"reka-tooltip-content");const{forwardRef:a,currentElement:c}=P(),f=S(!1),p=S(!1),y=v(()=>e.disabled.value?{}:{click:T,focus:h,pointermove:o,pointerleave:s,pointerdown:r,blur:C});K(()=>{e.onTriggerChange(c.value)});function m(){setTimeout(()=>{f.value=!1},1)}function r(){e.open&&!e.disableClosingTrigger.value&&e.onClose(),f.value=!0,document.addEventListener("pointerup",m,{once:!0})}function o(b){b.pointerType!=="touch"&&!p.value&&!d.isPointerInTransitRef.value&&(e.onTriggerEnter(),p.value=!0)}function s(){e.onTriggerLeave(),p.value=!1}function h(b){f.value||e.ignoreNonKeyboardFocus.value&&!b.target.matches?.(":focus-visible")||e.onOpen()}function C(){e.onClose()}function T(){e.disableClosingTrigger.value||e.onClose()}return(b,D)=>(n(),g(t(be),{"as-child":"",reference:b.reference},{default:i(()=>[B(t(se),_({ref:t(a),"aria-describedby":t(e).open.value?t(e).contentId:void 0,"data-state":t(e).stateAttribute.value,as:b.as,"as-child":u.asChild,"data-grace-area-trigger":""},ne(y.value)),{default:i(()=>[q(b.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),Ee=Le;const Re={slots:{content:"flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto",arrow:"fill-default",text:"truncate",kbds:"hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['·'] not-first-of-type:before:me-0.5",kbdsSize:"sm"}},Me={__name:"UTooltip",props:{text:{type:String,required:!1},kbds:{type:Array,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},delayDuration:{type:Number,required:!1},disableHoverableContent:{type:Boolean,required:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1}},emits:["update:open"],setup(l,{emit:u}){const e=l,d=u,a=I(),c=ie(),f=j(ue(e,"defaultOpen","open","delayDuration","disableHoverableContent","disableClosingTrigger","ignoreNonKeyboardFocus"),d),p=de(x(()=>e.portal)),y=x(()=>pe(e.content,{side:"bottom",sideOffset:8,collisionPadding:8})),m=x(()=>e.arrow),r=v(()=>A({extend:A(Re),...c.ui?.tooltip||{}})({side:y.value.side}));return(o,s)=>(n(),g(t(Pe),_(t(f),{disabled:!(l.text||l.kbds?.length||a.content)||e.disabled}),{default:i(({open:h})=>[a.default||l.reference?(n(),g(t(Ee),_({key:0},o.$attrs,{"as-child":"",reference:l.reference,class:e.class}),{default:i(()=>[q(o.$slots,"default",{open:h})]),_:2},1040,["reference","class"])):O("",!0),B(t(xe),E(R(t(p))),{default:i(()=>[B(t(Ne),_(y.value,{"data-slot":"content",class:r.value.content({class:[!a.default&&e.class,e.ui?.content]})}),{default:i(()=>[q(o.$slots,"content",{ui:r.value},()=>[l.text?(n(),L("span",{key:0,"data-slot":"text",class:H(r.value.text({class:e.ui?.text}))},M(l.text),3)):O("",!0),l.kbds?.length?(n(),L("span",{key:1,"data-slot":"kbds",class:H(r.value.kbds({class:e.ui?.kbds}))},[(n(!0),L(fe,null,ce(l.kbds,(C,T)=>(n(),g(qe,_({key:T,size:e.ui?.kbdsSize||r.value.kbdsSize()},{ref_for:!0},typeof C=="string"?{value:C}:C),null,16,["size"]))),128))],2)):O("",!0)]),l.arrow?(n(),g(t(Ce),_({key:0},m.value,{"data-slot":"arrow",class:r.value.arrow({class:e.ui?.arrow})}),null,16,["class"])):O("",!0)]),_:3},16,["class"])]),_:3},16)]),_:3},16,["disabled"]))}};export{Me as _};
1
+ import{d as w,u as P,c as g,o as n,w as i,r as q,aL as E,aM as R,a as t,aQ as G,bL as F,i as v,aS as U,h as Z,e as S,bM as J,ax as I,bN as Q,C as K,bf as $,Z as B,m as _,aK as X,ab as Y,af as M,ao as ee,bF as te,X as ae,aG as j,aY as re,bg as oe,b6 as le,P as se,aJ as ne,W as ie,aH as ue,aI as de,au as x,aZ as pe,ap as A,aa as O,M as L,$ as H,al as fe,am as ce}from"./CBqC92gC.js";import{P as ge,a as ye,b as ve,c as be}from"./DWnLv2oh.js";import{u as me}from"./DoIqoxBH.js";import{u as _e}from"./BoqEl-F1.js";import{_ as qe}from"./DAQeLqQw.js";var he=w({__name:"TooltipArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(l){const u=l;return P(),(e,d)=>(n(),g(t(ge),E(R(u)),{default:i(()=>[q(e.$slots,"default")]),_:3},16))}}),Ce=he;const z="tooltip.open",[N,Te]=G("TooltipRoot");var we=w({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(l,{emit:u}){const e=l,d=u;P();const a=F(),c=v(()=>e.disableHoverableContent??a.disableHoverableContent.value),f=v(()=>e.disableClosingTrigger??a.disableClosingTrigger.value),p=v(()=>e.disabled??a.disabled.value),y=v(()=>e.delayDuration??a.delayDuration.value),m=v(()=>e.ignoreNonKeyboardFocus??a.ignoreNonKeyboardFocus.value),r=U(e,"open",d,{defaultValue:e.defaultOpen,passive:e.open===void 0});Z(r,k=>{a.onClose&&(k?(a.onOpen(),document.dispatchEvent(new CustomEvent(z))):a.onClose())});const o=S(!1),s=S(),h=v(()=>r.value?o.value?"delayed-open":"instant-open":"closed"),{start:C,stop:T}=J(()=>{o.value=!0,r.value=!0},y,{immediate:!1});function b(){T(),o.value=!1,r.value=!0}function D(){T(),r.value=!1}function W(){C()}return Te({contentId:"",open:r,stateAttribute:h,trigger:s,onTriggerChange(k){s.value=k},onTriggerEnter(){a.isOpenDelayed.value?W():b()},onTriggerLeave(){c.value?D():T()},onOpen:b,onClose:D,disableHoverableContent:c,disableClosingTrigger:f,disabled:p,ignoreNonKeyboardFocus:m}),(k,Fe)=>(n(),g(t(ye),null,{default:i(()=>[q(k.$slots,"default",{open:t(r)})]),_:3}))}}),Pe=we,ke=w({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1,default:0},align:{type:null,required:!1,default:"center"},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:!0},collisionBoundary:{type:null,required:!1,default:()=>[]},collisionPadding:{type:[Number,Object],required:!1,default:0},arrowPadding:{type:Number,required:!1,default:0},sticky:{type:String,required:!1,default:"partial"},hideWhenDetached:{type:Boolean,required:!1,default:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(l,{emit:u}){const e=l,d=u,a=N(),{forwardRef:c}=P(),f=I(),p=v(()=>f.default?.({})),y=v(()=>{if(e.ariaLabel)return e.ariaLabel;let r="";function o(s){typeof s.children=="string"&&s.type!==Q?r+=s.children:Array.isArray(s.children)&&s.children.forEach(h=>o(h))}return p.value?.forEach(s=>o(s)),r}),m=v(()=>{const{ariaLabel:r,...o}=e;return o});return K(()=>{$(window,"scroll",r=>{r.target?.contains(a.trigger.value)&&a.onClose()}),$(window,z,a.onClose)}),(r,o)=>(n(),g(t(te),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:o[0]||(o[0]=s=>d("escapeKeyDown",s)),onPointerDownOutside:o[1]||(o[1]=s=>{t(a).disableClosingTrigger.value&&t(a).trigger.value?.contains(s.target)&&s.preventDefault(),d("pointerDownOutside",s)}),onFocusOutside:o[2]||(o[2]=ee(()=>{},["prevent"])),onDismiss:o[3]||(o[3]=s=>t(a).onClose())},{default:i(()=>[B(t(ve),_({ref:t(c),"data-state":t(a).stateAttribute.value},{...r.$attrs,...m.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:i(()=>[q(r.$slots,"default"),B(t(X),{id:t(a).contentId,role:"tooltip"},{default:i(()=>[Y(M(y.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),V=ke,Be=w({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(l){const e=ae(l),{forwardRef:d,currentElement:a}=P(),{trigger:c,onClose:f}=N(),p=F(),{isPointerInTransit:y,onPointerExit:m}=me(c,a);return p.isPointerInTransitRef=y,m(()=>{f()}),(r,o)=>(n(),g(V,_({ref:t(d)},t(e)),{default:i(()=>[q(r.$slots,"default")]),_:3},16))}}),Oe=Be,Se=w({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(l,{emit:u}){const e=l,d=u,a=N(),c=j(e,d),{forwardRef:f}=P();return(p,y)=>(n(),g(t(oe),{present:p.forceMount||t(a).open.value},{default:i(()=>[(n(),g(re(t(a).disableHoverableContent.value?V:Oe),_({ref:t(f)},t(c)),{default:i(()=>[q(p.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Ne=Se,De=w({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(l){const u=l;return(e,d)=>(n(),g(t(le),E(R(u)),{default:i(()=>[q(e.$slots,"default")]),_:3},16))}}),xe=De,Le=w({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(l){const u=l,e=N(),d=F();e.contentId||=_e(void 0,"reka-tooltip-content");const{forwardRef:a,currentElement:c}=P(),f=S(!1),p=S(!1),y=v(()=>e.disabled.value?{}:{click:T,focus:h,pointermove:o,pointerleave:s,pointerdown:r,blur:C});K(()=>{e.onTriggerChange(c.value)});function m(){setTimeout(()=>{f.value=!1},1)}function r(){e.open&&!e.disableClosingTrigger.value&&e.onClose(),f.value=!0,document.addEventListener("pointerup",m,{once:!0})}function o(b){b.pointerType!=="touch"&&!p.value&&!d.isPointerInTransitRef.value&&(e.onTriggerEnter(),p.value=!0)}function s(){e.onTriggerLeave(),p.value=!1}function h(b){f.value||e.ignoreNonKeyboardFocus.value&&!b.target.matches?.(":focus-visible")||e.onOpen()}function C(){e.onClose()}function T(){e.disableClosingTrigger.value||e.onClose()}return(b,D)=>(n(),g(t(be),{"as-child":"",reference:b.reference},{default:i(()=>[B(t(se),_({ref:t(a),"aria-describedby":t(e).open.value?t(e).contentId:void 0,"data-state":t(e).stateAttribute.value,as:b.as,"as-child":u.asChild,"data-grace-area-trigger":""},ne(y.value)),{default:i(()=>[q(b.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),Ee=Le;const Re={slots:{content:"flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto",arrow:"fill-default",text:"truncate",kbds:"hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['·'] not-first-of-type:before:me-0.5",kbdsSize:"sm"}},Me={__name:"UTooltip",props:{text:{type:String,required:!1},kbds:{type:Array,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},delayDuration:{type:Number,required:!1},disableHoverableContent:{type:Boolean,required:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1}},emits:["update:open"],setup(l,{emit:u}){const e=l,d=u,a=I(),c=ie(),f=j(ue(e,"defaultOpen","open","delayDuration","disableHoverableContent","disableClosingTrigger","ignoreNonKeyboardFocus"),d),p=de(x(()=>e.portal)),y=x(()=>pe(e.content,{side:"bottom",sideOffset:8,collisionPadding:8})),m=x(()=>e.arrow),r=v(()=>A({extend:A(Re),...c.ui?.tooltip||{}})({side:y.value.side}));return(o,s)=>(n(),g(t(Pe),_(t(f),{disabled:!(l.text||l.kbds?.length||a.content)||e.disabled}),{default:i(({open:h})=>[a.default||l.reference?(n(),g(t(Ee),_({key:0},o.$attrs,{"as-child":"",reference:l.reference,class:e.class}),{default:i(()=>[q(o.$slots,"default",{open:h})]),_:2},1040,["reference","class"])):O("",!0),B(t(xe),E(R(t(p))),{default:i(()=>[B(t(Ne),_(y.value,{"data-slot":"content",class:r.value.content({class:[!a.default&&e.class,e.ui?.content]})}),{default:i(()=>[q(o.$slots,"content",{ui:r.value},()=>[l.text?(n(),L("span",{key:0,"data-slot":"text",class:H(r.value.text({class:e.ui?.text}))},M(l.text),3)):O("",!0),l.kbds?.length?(n(),L("span",{key:1,"data-slot":"kbds",class:H(r.value.kbds({class:e.ui?.kbds}))},[(n(!0),L(fe,null,ce(l.kbds,(C,T)=>(n(),g(qe,_({key:T,size:e.ui?.kbdsSize||r.value.kbdsSize()},{ref_for:!0},typeof C=="string"?{value:C}:C),null,16,["size"]))),128))],2)):O("",!0)]),l.arrow?(n(),g(t(Ce),_({key:0},m.value,{"data-slot":"arrow",class:r.value.arrow({class:e.ui?.arrow})}),null,16,["class"])):O("",!0)]),_:3},16,["class"])]),_:3},16)]),_:3},16,["disabled"]))}};export{Me as _};
@@ -1 +1 @@
1
- import{W as l,i as n,M as p,o as c,r as d,$ as u,ap as e}from"./BOCn_SGf.js";const i={base:"py-3 px-4 font-semibold text-sm text-left border-e border-b first:border-s border-t border-muted"},b={__name:"ProseTh",props:{class:{type:null,required:!1}},setup(s){const t=s,o=l(),r=n(()=>e({extend:e(i),...o.ui?.prose?.th||{}}));return(a,m)=>(c(),p("th",{class:u(r.value({class:t.class}))},[d(a.$slots,"default")],2))}};export{b as default};
1
+ import{W as l,i as n,M as p,o as c,r as d,$ as u,ap as e}from"./CBqC92gC.js";const i={base:"py-3 px-4 font-semibold text-sm text-left border-e border-b first:border-s border-t border-muted"},b={__name:"ProseTh",props:{class:{type:null,required:!1}},setup(s){const t=s,o=l(),r=n(()=>e({extend:e(i),...o.ui?.prose?.th||{}}));return(a,m)=>(c(),p("th",{class:u(r.value({class:t.class}))},[d(a.$slots,"default")],2))}};export{b as default};
@@ -1 +1 @@
1
- import{aZ as _e,s as Ee,y as Te,at as Pe,i as Q,n as Le}from"./BOCn_SGf.js";var Ie={},ie={};const G=Object.create(null),F=e=>Ie||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?G:globalThis),$=new Proxy(G,{get(e,t){return F()[t]??G[t]},has(e,t){return t in F()||t in G},set(e,t,n){const r=F(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;const n=F(!0);return delete n[t],!0},ownKeys(){const e=F(!0);return Object.keys(e)}});function g(e,t){return typeof process<"u"&&ie?ie[e]??t:typeof Deno<"u"?Deno.env.get(e)??t:typeof Bun<"u"?Bun.env[e]??t:t}const B=1,y=4,L=8,S=24,ae={eterm:y,cons25:y,console:y,cygwin:y,dtterm:y,gnome:y,hurd:y,jfbterm:y,konsole:y,kterm:y,mlterm:y,mosh:S,putty:y,st:y,"rxvt-unicode-24bit":S,terminator:S,"xterm-kitty":S},Ae=new Map(Object.entries({APPVEYOR:L,BUILDKITE:L,CIRCLECI:S,DRONE:L,GITEA_ACTIONS:S,GITHUB_ACTIONS:S,GITLAB_CI:L,TRAVIS:L})),xe=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function Ce(){if(g("FORCE_COLOR")!==void 0)switch(g("FORCE_COLOR")){case"":case"1":case"true":return y;case"2":return L;case"3":return S;default:return B}if(g("NODE_DISABLE_COLORS")!==void 0&&g("NODE_DISABLE_COLORS")!==""||g("NO_COLOR")!==void 0&&g("NO_COLOR")!==""||g("TERM")==="dumb")return B;if(g("TMUX"))return S;if("TF_BUILD"in $&&"AGENT_NAME"in $)return y;if("CI"in $){for(const{0:e,1:t}of Ae)if(e in $)return t;return g("CI_NAME")==="codeship"?L:B}if("TEAMCITY_VERSION"in $)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(g("TEAMCITY_VERSION"))!==null?y:B;switch(g("TERM_PROGRAM")){case"iTerm.app":return!g("TERM_PROGRAM_VERSION")||/^[0-2]\./.exec(g("TERM_PROGRAM_VERSION"))!==null?L:S;case"HyperTerm":case"MacTerm":return S;case"Apple_Terminal":return L}if(g("COLORTERM")==="truecolor"||g("COLORTERM")==="24bit")return S;if(g("TERM")){if(/truecolor/.exec(g("TERM"))!==null)return S;if(/^xterm-256/.exec(g("TERM"))!==null)return L;const e=g("TERM").toLowerCase();if(ae[e])return ae[e];if(xe.some(t=>t.exec(e)!==null))return y}return g("COLORTERM")?y:B}const I={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",fg:{red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m"}},ne=["debug","info","success","warn","error"];function Ne(e,t){return ne.indexOf(t)>=ne.indexOf(e)}const Me={info:I.fg.blue,success:I.fg.green,warn:I.fg.yellow,error:I.fg.red,debug:I.fg.magenta},Ue=(e,t,n)=>{const r=new Date().toISOString();return n?`${I.dim}${r}${I.reset} ${Me[e]}${e.toUpperCase()}${I.reset} ${I.bright}[Better Auth]:${I.reset} ${t}`:`${r} ${e.toUpperCase()} [Better Auth]: ${t}`},qe=e=>{const t="error",n=Ce()!==1,r=(s,c,a=[])=>{if(!Ne(t,s))return;const d=Ue(s,c,n);{s==="error"?console.error(d,...a):s==="warn"?console.warn(d,...a):console.log(d,...a);return}};return{...Object.fromEntries(ne.map(s=>[s,(...[c,...a])=>r(s,c,a)])),get level(){return t}}};qe();function Fe(e){return e.charAt(0).toUpperCase()+e.slice(1)}var J=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function $e(e){try{return(new URL(e).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new J(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function Be(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new J(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof J?t:new J(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function ue(e,t="/api/auth"){if(Be(e),$e(e))return e;const n=e.replace(/\/+$/,"");return!t||t==="/"?n:(t=t.startsWith("/")?t:`/${t}`,`${n}${t}`)}function De(e,t,n,r,s){if(e)return ue(e,t);if(typeof window<"u"&&window.location)return ue(window.location.origin,t)}const je={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&typeof window<"u"&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},ke={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},Ve=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,ce={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},We=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function Ge(e){return e instanceof Date&&!isNaN(e.getTime())}function Je(e){const t=We.exec(e);if(!t)return null;const[,n,r,s,c,a,d,o,u,i,f]=t,h=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(s,10),parseInt(c,10),parseInt(a,10),parseInt(d,10),o?parseInt(o.padEnd(3,"0"),10):0));if(u){const m=(parseInt(i,10)*60+parseInt(f,10))*(u==="+"?-1:1);h.setUTCMinutes(h.getUTCMinutes()+m)}return Ge(h)?h:null}function He(e,t={}){const{strict:n=!1,warnings:r=!1,reviver:s,parseDates:c=!0}=t;if(typeof e!="string")return e;const a=e.trim();if(a.length>0&&a[0]==='"'&&a.endsWith('"')&&!a.slice(1,-1).includes('"'))return a.slice(1,-1);const d=a.toLowerCase();if(d.length<=9&&d in ce)return ce[d];if(!Ve.test(a)){if(n)throw new SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(ke).some(([o,u])=>{const i=u.test(a);return i&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${o} pattern`),i})&&n)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(a,(u,i)=>{if(u==="__proto__"||u==="constructor"&&i&&typeof i=="object"&&"prototype"in i){r&&console.warn(`[better-json] Dropping "${u}" key to prevent prototype pollution`);return}if(c&&typeof i=="string"){const f=Je(i);if(f)return f}return s?s(u,i):i})}catch(o){if(n)throw o;return e}}function Ye(e,t={strict:!0}){return He(e,t)}let E=[],U=0;const k=4,me=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},lc:0,listen(r){return n.lc=t.push(r),()=>{for(let c=U+k;c<E.length;)E[c]===r?E.splice(c,k):c+=k;let s=t.indexOf(r);~s&&(t.splice(s,1),--n.lc||n.off())}},notify(r,s){let c=!E.length;for(let a of t)E.push(a,n.value,r,s);if(c){for(U=0;U<E.length;U+=k)E[U](E[U+1],E[U+2],E[U+3]);E.length=0}},off(){},set(r){let s=n.value;s!==r&&(n.value=r,n.notify(s))},subscribe(r){let s=n.listen(r);return r(n.value),s},value:e};return n},Qe=5,V=6,W=10;let ze=(e,t,n,r)=>(e.events=e.events||{},e.events[n+W]||(e.events[n+W]=r(s=>{e.events[n].reduceRight((c,a)=>(a(c),c),{shared:{},...s})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let s=e.events[n],c=s.indexOf(t);s.splice(c,1),s.length||(delete e.events[n],e.events[n+W](),delete e.events[n+W])}),Xe=1e3,ve=(e,t)=>ze(e,r=>{let s=t(r);s&&e.events[V].push(s)},Qe,r=>{let s=e.listen;e.listen=(...a)=>(!e.lc&&!e.active&&(e.active=!0,r()),s(...a));let c=e.off;return e.events[V]=[],e.off=()=>{c(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let a of e.events[V])a();e.events[V]=[]}},Xe)},()=>{e.listen=s,e.off=c}});const Ze=()=>typeof window>"u",Ke=(e,t,n,r)=>{const s=me({data:null,error:null,isPending:!0,isRefetching:!1,refetch:d=>c(d)}),c=async d=>new Promise(o=>{const u=typeof r=="function"?r({data:s.get().data,error:s.get().error,isPending:s.get().isPending}):r;n(t,{...u,query:{...u?.query,...d?.query},async onSuccess(i){s.set({data:i.data,error:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch}),await u?.onSuccess?.(i)},async onError(i){const{request:f}=i,h=typeof f.retry=="number"?f.retry:f.retry?.attempts,m=f.retryAttempt||0;h&&m<h||(s.set({error:i.error,data:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch}),await u?.onError?.(i))},async onRequest(i){const f=s.get();s.set({isPending:f.data===null,data:f.data,error:null,isRefetching:!0,refetch:s.value.refetch}),await u?.onRequest?.(i)}}).catch(i=>{s.set({error:i,data:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch})}).finally(()=>{o(void 0)})});e=Array.isArray(e)?e:[e];let a=!1;for(const d of e)d.subscribe(async()=>{Ze()||(a?await c():ve(s,()=>{const o=setTimeout(async()=>{a||(await c(),a=!0)},0);return()=>{s.off(),d.off(),clearTimeout(o)}}))});return s},z=Symbol.for("better-auth:broadcast-channel"),et=()=>Math.floor(Date.now()/1e3);var tt=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:et()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=t=>{if(t.key!==this.name)return;const n=JSON.parse(t.newValue??"{}");n?.event!=="session"||!n?.data||this.listeners.forEach(r=>r(n))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function X(e="better-auth.message"){return globalThis[z]||(globalThis[z]=new tt(e)),globalThis[z]}const Z=Symbol.for("better-auth:focus-manager");var nt=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function le(){return globalThis[Z]||(globalThis[Z]=new nt),globalThis[Z]}const K=Symbol.for("better-auth:online-manager");var rt=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function ee(){return globalThis[K]||(globalThis[K]=new rt),globalThis[K]}const q=()=>Math.floor(Date.now()/1e3),st=5;function ot(e){const{sessionAtom:t,sessionSignal:n,$fetch:r,options:s={}}=e,c=s.sessionOptions?.refetchInterval??0,a=s.sessionOptions?.refetchOnWindowFocus??!0,d=s.sessionOptions?.refetchWhenOffline??!1,o={lastSync:0,lastSessionRequest:0,cachedSession:void 0},u=()=>d||ee().isOnline,i=v=>{if(!u())return;if(v?.event==="storage"){o.lastSync=q(),n.set(!n.get());return}const O=t.get();if(v?.event==="poll"){o.lastSessionRequest=q(),r("/get-session").then(l=>{l.error?t.set({...O,data:null,error:l.error}):t.set({...O,data:l.data,error:null}),o.lastSync=q(),n.set(!n.get())}).catch(()=>{});return}if(v?.event==="visibilitychange"){if(q()-o.lastSessionRequest<st)return;o.lastSessionRequest=q()}(O?.data===null||O?.data===void 0||v?.event==="visibilitychange")&&(o.lastSync=q(),n.set(!n.get()))},f=v=>{X().post({event:"session",data:{trigger:v},clientId:Math.random().toString(36).substring(7)})},h=()=>{c&&c>0&&(o.pollInterval=setInterval(()=>{t.get()?.data&&i({event:"poll"})},c*1e3))},m=()=>{o.unsubscribeBroadcast=X().subscribe(()=>{i({event:"storage"})})},R=()=>{a&&(o.unsubscribeFocus=le().subscribe(()=>{i({event:"visibilitychange"})}))},A=()=>{o.unsubscribeOnline=ee().subscribe(v=>{v&&i({event:"visibilitychange"})})};return{init:()=>{h(),m(),R(),A(),X().setup(),le().setup(),ee().setup()},cleanup:()=>{o.pollInterval&&(clearInterval(o.pollInterval),o.pollInterval=void 0),o.unsubscribeBroadcast&&(o.unsubscribeBroadcast(),o.unsubscribeBroadcast=void 0),o.unsubscribeFocus&&(o.unsubscribeFocus(),o.unsubscribeFocus=void 0),o.unsubscribeOnline&&(o.unsubscribeOnline(),o.unsubscribeOnline=void 0),o.lastSync=0,o.lastSessionRequest=0,o.cachedSession=void 0},triggerRefetch:i,broadcastSessionUpdate:f}}function it(e,t){const n=me(!1),r=Ke(n,"/get-session",e,{method:"GET"});return ve(r,()=>{const s=ot({sessionAtom:r,sessionSignal:n,$fetch:e,options:t});return s.init(),()=>{s.cleanup()}}),{session:r,$sessionSignal:n}}var at=Object.defineProperty,ut=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable,de=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))lt.call(t,n)&&de(e,n,t[n]);if(fe)for(var n of fe(t))ft.call(t,n)&&de(e,n,t[n]);return e},P=(e,t)=>ut(e,ct(t)),dt=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},ht=async(e,t)=>{var n,r,s,c,a,d;let o=t||{};const u={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:o,hooks:u};for(const i of t?.plugins||[]){if(i.init){const f=await((n=i.init)==null?void 0:n.call(i,e.toString(),t));o=f.options||o,e=f.url}u.onRequest.push((r=i.hooks)==null?void 0:r.onRequest),u.onResponse.push((s=i.hooks)==null?void 0:s.onResponse),u.onSuccess.push((c=i.hooks)==null?void 0:c.onSuccess),u.onError.push((a=i.hooks)==null?void 0:a.onError),u.onRetry.push((d=i.hooks)==null?void 0:d.onRetry)}return{url:e,options:o,hooks:u}},he=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},pt=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function gt(e){if(typeof e=="number")return new he({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new he(e);case"exponential":return new pt(e);default:throw new Error("Invalid retry strategy")}}var yt=async e=>{const t={},n=async r=>typeof r=="function"?await r():r;if(e?.auth){if(e.auth.type==="Bearer"){const r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type==="Basic"){const[r,s]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!s)return t;t.authorization=`Basic ${btoa(`${r}:${s}`)}`}else if(e.auth.type==="Custom"){const[r,s]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!s)return t;t.authorization=`${r??""} ${s}`}}return t},mt=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function vt(e){const t=e.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";const r=t.split(";").shift()||"";return mt.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}function bt(e){try{return JSON.parse(e),!0}catch{return!1}}function re(e){if(e===void 0)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t===null?!0:t!=="object"?!1:Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name==="Object"||typeof e.toJSON=="function"}function pe(e){try{return JSON.parse(e)}catch{return e}}function ge(e){return typeof e=="function"}function wt(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<"u"&&ge(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&ge(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}async function Ot(e){const t=new Headers(e?.headers),n=await yt(e);for(const[r,s]of Object.entries(n||{}))t.set(r,s);if(!t.has("content-type")){const r=Rt(e?.body);r&&t.set("content-type",r)}return t}function Rt(e){return re(e)?"application/json":null}function St(e){if(!e?.body)return null;const t=new Headers(e?.headers);if(re(e.body)&&!t.has("content-type")){for(const[n,r]of Object.entries(e?.body))r instanceof Date&&(e.body[n]=r.toISOString());return JSON.stringify(e.body)}return t.has("content-type")&&t.get("content-type")==="application/x-www-form-urlencoded"&&re(e.body)?new URLSearchParams(e.body).toString():e.body}function _t(e,t){var n;if(t?.method)return t.method.toUpperCase();if(e.startsWith("@")){const r=(n=e.split("@")[1])==null?void 0:n.split("/")[0];return we.includes(r)?r.toUpperCase():t?.body?"POST":"GET"}return t?.body?"POST":"GET"}function Et(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var Tt=class be extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,be.prototype)}};async function H(e,t){const n=await e["~standard"].validate(t);if(n.issues)throw new Tt(n.issues);return n.value}var we=["get","post","put","patch","delete"],Pt=e=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(t,n){var r,s,c,a;const d=((s=(r=e.plugins)==null?void 0:r.find(o=>{var u;return(u=o.schema)!=null&&u.config?t.startsWith(o.schema.config.baseURL||"")||t.startsWith(o.schema.config.prefix||""):!1}))==null?void 0:s.schema)||e.schema;if(d){let o=t;(c=d.config)!=null&&c.prefix&&o.startsWith(d.config.prefix)&&(o=o.replace(d.config.prefix,""),d.config.baseURL&&(t=t.replace(d.config.prefix,d.config.baseURL))),(a=d.config)!=null&&a.baseURL&&o.startsWith(d.config.baseURL)&&(o=o.replace(d.config.baseURL,""));const u=d.schema[o];if(u){let i=P(T({},n),{method:u.method,output:u.output});return n?.disableValidation||(i=P(T({},i),{body:u.input?await H(u.input,n?.body):n?.body,params:u.params?await H(u.params,n?.params):n?.params,query:u.query?await H(u.query,n?.query):n?.query})),{url:t,options:i}}}return{url:t,options:n}}}),Lt=e=>{async function t(n,r){const s=P(T(T({},e),r),{plugins:[...e?.plugins||[],Pt(e||{}),...r?.plugins||[]]});if(e?.catchAllError)try{return await se(n,s)}catch(c){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:c}}}return await se(n,s)}return t};function It(e,t){const{baseURL:n,params:r,query:s}=t||{query:{},params:{},baseURL:""};let c=e.startsWith("http")?e.split("/").slice(0,3).join("/"):n||"";if(e.startsWith("@")){const f=e.toString().split("@")[1].split("/")[0];we.includes(f)&&(e=e.replace(`@${f}/`,"/"))}c.endsWith("/")||(c+="/");let[a,d]=e.replace(c,"").split("?");const o=new URLSearchParams(d);for(const[f,h]of Object.entries(s||{})){if(h==null)continue;let m;if(typeof h=="string")m=h;else if(Array.isArray(h)){for(const R of h)o.append(f,R);continue}else m=JSON.stringify(h);o.set(f,m)}if(r)if(Array.isArray(r)){const f=a.split("/").filter(h=>h.startsWith(":"));for(const[h,m]of f.entries()){const R=r[h];a=a.replace(m,R)}}else for(const[f,h]of Object.entries(r))a=a.replace(`:${f}`,String(h));a=a.split("/").map(encodeURIComponent).join("/"),a.startsWith("/")&&(a=a.slice(1));let u=o.toString();return u=u.length>0?`?${u}`.replace(/\+/g,"%20"):"",c.startsWith("http")?new URL(`${a}${u}`,c):`${c}${a}${u}`}var se=async(e,t)=>{var n,r,s,c,a,d,o,u;const{hooks:i,url:f,options:h}=await ht(e,t),m=wt(h),R=new AbortController,A=(n=h.signal)!=null?n:R.signal,w=It(f,h),M=St(h),v=await Ot(h),O=_t(f,h);let l=P(T({},h),{url:w,headers:v,body:M,method:O,signal:A});for(const _ of i.onRequest)if(_){const b=await _(l);typeof b=="object"&&b!==null&&(l=b)}("pipeTo"in l&&typeof l.pipeTo=="function"||typeof((r=t?.body)==null?void 0:r.pipe)=="function")&&("duplex"in l||(l.duplex="half"));const{clearTimeout:x}=Et(h,R);let p=await m(l.url,l);x();const D={response:p,request:l};for(const _ of i.onResponse)if(_){const b=await _(P(T({},D),{response:(s=t?.hookOptions)!=null&&s.cloneResponse?p.clone():p}));b instanceof Response?p=b:typeof b=="object"&&b!==null&&(p=b.response)}if(p.ok){if(!(l.method!=="HEAD"))return{data:"",error:null};const b=vt(p),C={data:null,response:p,request:l};if(b==="json"||b==="text"){const N=await p.text(),Se=(c=l.jsonParser)!=null?c:pe;C.data=await Se(N)}else C.data=await p[b]();l?.output&&l.output&&!l.disableValidation&&(C.data=await H(l.output,C.data));for(const N of i.onSuccess)N&&await N(P(T({},C),{response:(a=t?.hookOptions)!=null&&a.cloneResponse?p.clone():p}));return t?.throw?C.data:{data:C.data,error:null}}const Oe=(d=t?.jsonParser)!=null?d:pe,j=await p.text(),oe=bt(j),Y=oe?await Oe(j):null,Re={response:p,responseText:j,request:l,error:P(T({},Y),{status:p.status,statusText:p.statusText})};for(const _ of i.onError)_&&await _(P(T({},Re),{response:(o=t?.hookOptions)!=null&&o.cloneResponse?p.clone():p}));if(t?.retry){const _=gt(t.retry),b=(u=t.retryAttempt)!=null?u:0;if(await _.shouldAttemptRetry(b,p)){for(const N of i.onRetry)N&&await N(D);const C=_.getDelay(b);return await new Promise(N=>setTimeout(N,C)),await se(e,P(T({},t),{retryAttempt:b+1}))}}if(t?.throw)throw new dt(p.status,p.statusText,oe?Y:j);return{data:null,error:P(T({},Y),{status:p.status,statusText:p.statusText})}};const At=(e,t)=>{const n="credentials"in Request.prototype,r=De(e?.baseURL,e?.basePath)??"/api/auth",s=e?.plugins?.flatMap(l=>l.fetchPlugins).filter(l=>l!==void 0)||[],c={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:a,onError:d,onRequest:o,onResponse:u,...i}=e?.fetchOptions||{},f=Lt({baseURL:r,...n?{credentials:"include"}:{},method:"GET",jsonParser(l){return l?Ye(l,{strict:!1}):null},customFetchImpl:fetch,...i,plugins:[c,...i.plugins||[],...e?.disableDefaultFetchPlugins?[]:[je],...s]}),{$sessionSignal:h,session:m}=it(f,e),R=e?.plugins||[];let A={};const w={$sessionSignal:h,session:m},M={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},v=[{signal:"$sessionSignal",matcher(l){return l==="/sign-out"||l==="/update-user"||l==="/sign-up/email"||l==="/sign-in/email"||l==="/delete-user"||l==="/verify-email"||l==="/revoke-sessions"||l==="/revoke-session"||l==="/change-email"}}];for(const l of R)l.getAtoms&&Object.assign(w,l.getAtoms?.(f)),l.pathMethods&&Object.assign(M,l.pathMethods),l.atomListeners&&v.push(...l.atomListeners);const O={notify:l=>{w[l].set(!w[l].get())},listen:(l,x)=>{w[l].subscribe(x)},atoms:w};for(const l of R)l.getActions&&(A=_e(l.getActions?.(f,O,e)??{},A));return{get baseURL(){return r},pluginsActions:A,pluginsAtoms:w,pluginPathMethods:M,atomListeners:v,$fetch:f,$store:O}};function xt(e){return typeof e=="object"&&e!==null&&"get"in e&&typeof e.get=="function"&&"lc"in e&&typeof e.lc=="number"}function Ct(e,t,n){const r=t[e],{fetchOptions:s,query:c,...a}=n||{};return r||(s?.method?s.method:a&&Object.keys(a).length>0?"POST":"GET")}function Nt(e,t,n,r,s){function c(a=[]){return new Proxy(function(){},{get(d,o){if(typeof o!="string"||o==="then"||o==="catch"||o==="finally")return;const u=[...a,o];let i=e;for(const f of u)if(i&&typeof i=="object"&&f in i)i=i[f];else{i=void 0;break}return typeof i=="function"||xt(i)?i:c(u)},apply:async(d,o,u)=>{const i="/"+a.map(v=>v.replace(/[A-Z]/g,O=>`-${O.toLowerCase()}`)).join("/"),f=u[0]||{},h=u[1]||{},{query:m,fetchOptions:R,...A}=f,w={...h,...R},M=Ct(i,n,f);return await t(i,{...w,body:M==="GET"?void 0:{...A,...w?.body||{}},query:m||w?.query,method:M,async onSuccess(v){if(await w?.onSuccess?.(v),!s||w.disableSignal)return;const O=s.filter(x=>x.matcher(i));if(!O.length)return;const l=new Set;for(const x of O){const p=r[x.signal];if(!p)return;if(l.has(x.signal))continue;l.add(x.signal);const D=p.get();setTimeout(()=>{p.set(!D)},10)}}})}})}return c()}function ye(e){const t=Ee(),n=e.subscribe(r=>{t.value=r});return Te()&&Pe(n),t}function Mt(e){return`use${Fe(e)}`}function Ut(e){const{baseURL:t,pluginPathMethods:n,pluginsActions:r,pluginsAtoms:s,$fetch:c,$store:a,atomListeners:d}=At(e),o={};for(const[i,f]of Object.entries(s))o[Mt(i)]=()=>ye(f);function u(i){if(i){const f=ye(s.$sessionSignal);return i(`${t}/get-session`,{ref:f}).then(h=>({data:h.data,isPending:!1,error:h.error}))}return o.useSession()}return Nt({...r,...o,useSession:u,$fetch:c,$store:a},c,n,s,d)}let te=null;function qt(){if(!te){const e=window.location.origin;te=Ut({baseURL:e})}return te}function $t(){const e=qt(),t=e.useSession();async function n(o,u){return await e.signIn.email({email:o,password:u})}async function r(){await e.signOut(),Le("/login")}async function s(o,u,i){return await e.signUp.email({email:o,password:u,name:i})}async function c(o){return await e.updateUser(o)}async function a(o){try{return await $fetch("/api/user/email",{method:"PATCH",body:{email:o}}),await e.getSession({fetchOptions:{cache:"no-store"}}),{data:{success:!0},error:null}}catch(u){return{data:null,error:{message:u.data?.message||"Failed to change email"}}}}async function d(o){return await e.changePassword(o)}return{session:t,user:Q(()=>t.value?.data?.user),isAuthenticated:Q(()=>!!t.value?.data?.user),isPending:Q(()=>t.value?.isPending??!0),login:n,logout:r,register:s,updateProfile:c,changeEmail:a,changePassword:d}}export{$t as u};
1
+ import{aZ as _e,s as Ee,y as Te,at as Pe,i as Q,n as Le}from"./CBqC92gC.js";var Ie={},ie={};const G=Object.create(null),F=e=>Ie||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?G:globalThis),$=new Proxy(G,{get(e,t){return F()[t]??G[t]},has(e,t){return t in F()||t in G},set(e,t,n){const r=F(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;const n=F(!0);return delete n[t],!0},ownKeys(){const e=F(!0);return Object.keys(e)}});function g(e,t){return typeof process<"u"&&ie?ie[e]??t:typeof Deno<"u"?Deno.env.get(e)??t:typeof Bun<"u"?Bun.env[e]??t:t}const B=1,y=4,L=8,S=24,ae={eterm:y,cons25:y,console:y,cygwin:y,dtterm:y,gnome:y,hurd:y,jfbterm:y,konsole:y,kterm:y,mlterm:y,mosh:S,putty:y,st:y,"rxvt-unicode-24bit":S,terminator:S,"xterm-kitty":S},Ae=new Map(Object.entries({APPVEYOR:L,BUILDKITE:L,CIRCLECI:S,DRONE:L,GITEA_ACTIONS:S,GITHUB_ACTIONS:S,GITLAB_CI:L,TRAVIS:L})),xe=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function Ce(){if(g("FORCE_COLOR")!==void 0)switch(g("FORCE_COLOR")){case"":case"1":case"true":return y;case"2":return L;case"3":return S;default:return B}if(g("NODE_DISABLE_COLORS")!==void 0&&g("NODE_DISABLE_COLORS")!==""||g("NO_COLOR")!==void 0&&g("NO_COLOR")!==""||g("TERM")==="dumb")return B;if(g("TMUX"))return S;if("TF_BUILD"in $&&"AGENT_NAME"in $)return y;if("CI"in $){for(const{0:e,1:t}of Ae)if(e in $)return t;return g("CI_NAME")==="codeship"?L:B}if("TEAMCITY_VERSION"in $)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(g("TEAMCITY_VERSION"))!==null?y:B;switch(g("TERM_PROGRAM")){case"iTerm.app":return!g("TERM_PROGRAM_VERSION")||/^[0-2]\./.exec(g("TERM_PROGRAM_VERSION"))!==null?L:S;case"HyperTerm":case"MacTerm":return S;case"Apple_Terminal":return L}if(g("COLORTERM")==="truecolor"||g("COLORTERM")==="24bit")return S;if(g("TERM")){if(/truecolor/.exec(g("TERM"))!==null)return S;if(/^xterm-256/.exec(g("TERM"))!==null)return L;const e=g("TERM").toLowerCase();if(ae[e])return ae[e];if(xe.some(t=>t.exec(e)!==null))return y}return g("COLORTERM")?y:B}const I={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",fg:{red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m"}},ne=["debug","info","success","warn","error"];function Ne(e,t){return ne.indexOf(t)>=ne.indexOf(e)}const Me={info:I.fg.blue,success:I.fg.green,warn:I.fg.yellow,error:I.fg.red,debug:I.fg.magenta},Ue=(e,t,n)=>{const r=new Date().toISOString();return n?`${I.dim}${r}${I.reset} ${Me[e]}${e.toUpperCase()}${I.reset} ${I.bright}[Better Auth]:${I.reset} ${t}`:`${r} ${e.toUpperCase()} [Better Auth]: ${t}`},qe=e=>{const t="error",n=Ce()!==1,r=(s,c,a=[])=>{if(!Ne(t,s))return;const d=Ue(s,c,n);{s==="error"?console.error(d,...a):s==="warn"?console.warn(d,...a):console.log(d,...a);return}};return{...Object.fromEntries(ne.map(s=>[s,(...[c,...a])=>r(s,c,a)])),get level(){return t}}};qe();function Fe(e){return e.charAt(0).toUpperCase()+e.slice(1)}var J=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function $e(e){try{return(new URL(e).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new J(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function Be(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new J(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof J?t:new J(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function ue(e,t="/api/auth"){if(Be(e),$e(e))return e;const n=e.replace(/\/+$/,"");return!t||t==="/"?n:(t=t.startsWith("/")?t:`/${t}`,`${n}${t}`)}function De(e,t,n,r,s){if(e)return ue(e,t);if(typeof window<"u"&&window.location)return ue(window.location.origin,t)}const je={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&typeof window<"u"&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},ke={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},Ve=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,ce={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},We=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function Ge(e){return e instanceof Date&&!isNaN(e.getTime())}function Je(e){const t=We.exec(e);if(!t)return null;const[,n,r,s,c,a,d,o,u,i,f]=t,h=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(s,10),parseInt(c,10),parseInt(a,10),parseInt(d,10),o?parseInt(o.padEnd(3,"0"),10):0));if(u){const m=(parseInt(i,10)*60+parseInt(f,10))*(u==="+"?-1:1);h.setUTCMinutes(h.getUTCMinutes()+m)}return Ge(h)?h:null}function He(e,t={}){const{strict:n=!1,warnings:r=!1,reviver:s,parseDates:c=!0}=t;if(typeof e!="string")return e;const a=e.trim();if(a.length>0&&a[0]==='"'&&a.endsWith('"')&&!a.slice(1,-1).includes('"'))return a.slice(1,-1);const d=a.toLowerCase();if(d.length<=9&&d in ce)return ce[d];if(!Ve.test(a)){if(n)throw new SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(ke).some(([o,u])=>{const i=u.test(a);return i&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${o} pattern`),i})&&n)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(a,(u,i)=>{if(u==="__proto__"||u==="constructor"&&i&&typeof i=="object"&&"prototype"in i){r&&console.warn(`[better-json] Dropping "${u}" key to prevent prototype pollution`);return}if(c&&typeof i=="string"){const f=Je(i);if(f)return f}return s?s(u,i):i})}catch(o){if(n)throw o;return e}}function Ye(e,t={strict:!0}){return He(e,t)}let E=[],U=0;const k=4,me=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},lc:0,listen(r){return n.lc=t.push(r),()=>{for(let c=U+k;c<E.length;)E[c]===r?E.splice(c,k):c+=k;let s=t.indexOf(r);~s&&(t.splice(s,1),--n.lc||n.off())}},notify(r,s){let c=!E.length;for(let a of t)E.push(a,n.value,r,s);if(c){for(U=0;U<E.length;U+=k)E[U](E[U+1],E[U+2],E[U+3]);E.length=0}},off(){},set(r){let s=n.value;s!==r&&(n.value=r,n.notify(s))},subscribe(r){let s=n.listen(r);return r(n.value),s},value:e};return n},Qe=5,V=6,W=10;let ze=(e,t,n,r)=>(e.events=e.events||{},e.events[n+W]||(e.events[n+W]=r(s=>{e.events[n].reduceRight((c,a)=>(a(c),c),{shared:{},...s})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let s=e.events[n],c=s.indexOf(t);s.splice(c,1),s.length||(delete e.events[n],e.events[n+W](),delete e.events[n+W])}),Xe=1e3,ve=(e,t)=>ze(e,r=>{let s=t(r);s&&e.events[V].push(s)},Qe,r=>{let s=e.listen;e.listen=(...a)=>(!e.lc&&!e.active&&(e.active=!0,r()),s(...a));let c=e.off;return e.events[V]=[],e.off=()=>{c(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let a of e.events[V])a();e.events[V]=[]}},Xe)},()=>{e.listen=s,e.off=c}});const Ze=()=>typeof window>"u",Ke=(e,t,n,r)=>{const s=me({data:null,error:null,isPending:!0,isRefetching:!1,refetch:d=>c(d)}),c=async d=>new Promise(o=>{const u=typeof r=="function"?r({data:s.get().data,error:s.get().error,isPending:s.get().isPending}):r;n(t,{...u,query:{...u?.query,...d?.query},async onSuccess(i){s.set({data:i.data,error:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch}),await u?.onSuccess?.(i)},async onError(i){const{request:f}=i,h=typeof f.retry=="number"?f.retry:f.retry?.attempts,m=f.retryAttempt||0;h&&m<h||(s.set({error:i.error,data:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch}),await u?.onError?.(i))},async onRequest(i){const f=s.get();s.set({isPending:f.data===null,data:f.data,error:null,isRefetching:!0,refetch:s.value.refetch}),await u?.onRequest?.(i)}}).catch(i=>{s.set({error:i,data:null,isPending:!1,isRefetching:!1,refetch:s.value.refetch})}).finally(()=>{o(void 0)})});e=Array.isArray(e)?e:[e];let a=!1;for(const d of e)d.subscribe(async()=>{Ze()||(a?await c():ve(s,()=>{const o=setTimeout(async()=>{a||(await c(),a=!0)},0);return()=>{s.off(),d.off(),clearTimeout(o)}}))});return s},z=Symbol.for("better-auth:broadcast-channel"),et=()=>Math.floor(Date.now()/1e3);var tt=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:et()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=t=>{if(t.key!==this.name)return;const n=JSON.parse(t.newValue??"{}");n?.event!=="session"||!n?.data||this.listeners.forEach(r=>r(n))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function X(e="better-auth.message"){return globalThis[z]||(globalThis[z]=new tt(e)),globalThis[z]}const Z=Symbol.for("better-auth:focus-manager");var nt=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function le(){return globalThis[Z]||(globalThis[Z]=new nt),globalThis[Z]}const K=Symbol.for("better-auth:online-manager");var rt=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function ee(){return globalThis[K]||(globalThis[K]=new rt),globalThis[K]}const q=()=>Math.floor(Date.now()/1e3),st=5;function ot(e){const{sessionAtom:t,sessionSignal:n,$fetch:r,options:s={}}=e,c=s.sessionOptions?.refetchInterval??0,a=s.sessionOptions?.refetchOnWindowFocus??!0,d=s.sessionOptions?.refetchWhenOffline??!1,o={lastSync:0,lastSessionRequest:0,cachedSession:void 0},u=()=>d||ee().isOnline,i=v=>{if(!u())return;if(v?.event==="storage"){o.lastSync=q(),n.set(!n.get());return}const O=t.get();if(v?.event==="poll"){o.lastSessionRequest=q(),r("/get-session").then(l=>{l.error?t.set({...O,data:null,error:l.error}):t.set({...O,data:l.data,error:null}),o.lastSync=q(),n.set(!n.get())}).catch(()=>{});return}if(v?.event==="visibilitychange"){if(q()-o.lastSessionRequest<st)return;o.lastSessionRequest=q()}(O?.data===null||O?.data===void 0||v?.event==="visibilitychange")&&(o.lastSync=q(),n.set(!n.get()))},f=v=>{X().post({event:"session",data:{trigger:v},clientId:Math.random().toString(36).substring(7)})},h=()=>{c&&c>0&&(o.pollInterval=setInterval(()=>{t.get()?.data&&i({event:"poll"})},c*1e3))},m=()=>{o.unsubscribeBroadcast=X().subscribe(()=>{i({event:"storage"})})},R=()=>{a&&(o.unsubscribeFocus=le().subscribe(()=>{i({event:"visibilitychange"})}))},A=()=>{o.unsubscribeOnline=ee().subscribe(v=>{v&&i({event:"visibilitychange"})})};return{init:()=>{h(),m(),R(),A(),X().setup(),le().setup(),ee().setup()},cleanup:()=>{o.pollInterval&&(clearInterval(o.pollInterval),o.pollInterval=void 0),o.unsubscribeBroadcast&&(o.unsubscribeBroadcast(),o.unsubscribeBroadcast=void 0),o.unsubscribeFocus&&(o.unsubscribeFocus(),o.unsubscribeFocus=void 0),o.unsubscribeOnline&&(o.unsubscribeOnline(),o.unsubscribeOnline=void 0),o.lastSync=0,o.lastSessionRequest=0,o.cachedSession=void 0},triggerRefetch:i,broadcastSessionUpdate:f}}function it(e,t){const n=me(!1),r=Ke(n,"/get-session",e,{method:"GET"});return ve(r,()=>{const s=ot({sessionAtom:r,sessionSignal:n,$fetch:e,options:t});return s.init(),()=>{s.cleanup()}}),{session:r,$sessionSignal:n}}var at=Object.defineProperty,ut=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable,de=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))lt.call(t,n)&&de(e,n,t[n]);if(fe)for(var n of fe(t))ft.call(t,n)&&de(e,n,t[n]);return e},P=(e,t)=>ut(e,ct(t)),dt=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},ht=async(e,t)=>{var n,r,s,c,a,d;let o=t||{};const u={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:o,hooks:u};for(const i of t?.plugins||[]){if(i.init){const f=await((n=i.init)==null?void 0:n.call(i,e.toString(),t));o=f.options||o,e=f.url}u.onRequest.push((r=i.hooks)==null?void 0:r.onRequest),u.onResponse.push((s=i.hooks)==null?void 0:s.onResponse),u.onSuccess.push((c=i.hooks)==null?void 0:c.onSuccess),u.onError.push((a=i.hooks)==null?void 0:a.onError),u.onRetry.push((d=i.hooks)==null?void 0:d.onRetry)}return{url:e,options:o,hooks:u}},he=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},pt=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function gt(e){if(typeof e=="number")return new he({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new he(e);case"exponential":return new pt(e);default:throw new Error("Invalid retry strategy")}}var yt=async e=>{const t={},n=async r=>typeof r=="function"?await r():r;if(e?.auth){if(e.auth.type==="Bearer"){const r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type==="Basic"){const[r,s]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!s)return t;t.authorization=`Basic ${btoa(`${r}:${s}`)}`}else if(e.auth.type==="Custom"){const[r,s]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!s)return t;t.authorization=`${r??""} ${s}`}}return t},mt=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function vt(e){const t=e.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";const r=t.split(";").shift()||"";return mt.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}function bt(e){try{return JSON.parse(e),!0}catch{return!1}}function re(e){if(e===void 0)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t===null?!0:t!=="object"?!1:Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name==="Object"||typeof e.toJSON=="function"}function pe(e){try{return JSON.parse(e)}catch{return e}}function ge(e){return typeof e=="function"}function wt(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<"u"&&ge(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&ge(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}async function Ot(e){const t=new Headers(e?.headers),n=await yt(e);for(const[r,s]of Object.entries(n||{}))t.set(r,s);if(!t.has("content-type")){const r=Rt(e?.body);r&&t.set("content-type",r)}return t}function Rt(e){return re(e)?"application/json":null}function St(e){if(!e?.body)return null;const t=new Headers(e?.headers);if(re(e.body)&&!t.has("content-type")){for(const[n,r]of Object.entries(e?.body))r instanceof Date&&(e.body[n]=r.toISOString());return JSON.stringify(e.body)}return t.has("content-type")&&t.get("content-type")==="application/x-www-form-urlencoded"&&re(e.body)?new URLSearchParams(e.body).toString():e.body}function _t(e,t){var n;if(t?.method)return t.method.toUpperCase();if(e.startsWith("@")){const r=(n=e.split("@")[1])==null?void 0:n.split("/")[0];return we.includes(r)?r.toUpperCase():t?.body?"POST":"GET"}return t?.body?"POST":"GET"}function Et(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var Tt=class be extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,be.prototype)}};async function H(e,t){const n=await e["~standard"].validate(t);if(n.issues)throw new Tt(n.issues);return n.value}var we=["get","post","put","patch","delete"],Pt=e=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(t,n){var r,s,c,a;const d=((s=(r=e.plugins)==null?void 0:r.find(o=>{var u;return(u=o.schema)!=null&&u.config?t.startsWith(o.schema.config.baseURL||"")||t.startsWith(o.schema.config.prefix||""):!1}))==null?void 0:s.schema)||e.schema;if(d){let o=t;(c=d.config)!=null&&c.prefix&&o.startsWith(d.config.prefix)&&(o=o.replace(d.config.prefix,""),d.config.baseURL&&(t=t.replace(d.config.prefix,d.config.baseURL))),(a=d.config)!=null&&a.baseURL&&o.startsWith(d.config.baseURL)&&(o=o.replace(d.config.baseURL,""));const u=d.schema[o];if(u){let i=P(T({},n),{method:u.method,output:u.output});return n?.disableValidation||(i=P(T({},i),{body:u.input?await H(u.input,n?.body):n?.body,params:u.params?await H(u.params,n?.params):n?.params,query:u.query?await H(u.query,n?.query):n?.query})),{url:t,options:i}}}return{url:t,options:n}}}),Lt=e=>{async function t(n,r){const s=P(T(T({},e),r),{plugins:[...e?.plugins||[],Pt(e||{}),...r?.plugins||[]]});if(e?.catchAllError)try{return await se(n,s)}catch(c){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:c}}}return await se(n,s)}return t};function It(e,t){const{baseURL:n,params:r,query:s}=t||{query:{},params:{},baseURL:""};let c=e.startsWith("http")?e.split("/").slice(0,3).join("/"):n||"";if(e.startsWith("@")){const f=e.toString().split("@")[1].split("/")[0];we.includes(f)&&(e=e.replace(`@${f}/`,"/"))}c.endsWith("/")||(c+="/");let[a,d]=e.replace(c,"").split("?");const o=new URLSearchParams(d);for(const[f,h]of Object.entries(s||{})){if(h==null)continue;let m;if(typeof h=="string")m=h;else if(Array.isArray(h)){for(const R of h)o.append(f,R);continue}else m=JSON.stringify(h);o.set(f,m)}if(r)if(Array.isArray(r)){const f=a.split("/").filter(h=>h.startsWith(":"));for(const[h,m]of f.entries()){const R=r[h];a=a.replace(m,R)}}else for(const[f,h]of Object.entries(r))a=a.replace(`:${f}`,String(h));a=a.split("/").map(encodeURIComponent).join("/"),a.startsWith("/")&&(a=a.slice(1));let u=o.toString();return u=u.length>0?`?${u}`.replace(/\+/g,"%20"):"",c.startsWith("http")?new URL(`${a}${u}`,c):`${c}${a}${u}`}var se=async(e,t)=>{var n,r,s,c,a,d,o,u;const{hooks:i,url:f,options:h}=await ht(e,t),m=wt(h),R=new AbortController,A=(n=h.signal)!=null?n:R.signal,w=It(f,h),M=St(h),v=await Ot(h),O=_t(f,h);let l=P(T({},h),{url:w,headers:v,body:M,method:O,signal:A});for(const _ of i.onRequest)if(_){const b=await _(l);typeof b=="object"&&b!==null&&(l=b)}("pipeTo"in l&&typeof l.pipeTo=="function"||typeof((r=t?.body)==null?void 0:r.pipe)=="function")&&("duplex"in l||(l.duplex="half"));const{clearTimeout:x}=Et(h,R);let p=await m(l.url,l);x();const D={response:p,request:l};for(const _ of i.onResponse)if(_){const b=await _(P(T({},D),{response:(s=t?.hookOptions)!=null&&s.cloneResponse?p.clone():p}));b instanceof Response?p=b:typeof b=="object"&&b!==null&&(p=b.response)}if(p.ok){if(!(l.method!=="HEAD"))return{data:"",error:null};const b=vt(p),C={data:null,response:p,request:l};if(b==="json"||b==="text"){const N=await p.text(),Se=(c=l.jsonParser)!=null?c:pe;C.data=await Se(N)}else C.data=await p[b]();l?.output&&l.output&&!l.disableValidation&&(C.data=await H(l.output,C.data));for(const N of i.onSuccess)N&&await N(P(T({},C),{response:(a=t?.hookOptions)!=null&&a.cloneResponse?p.clone():p}));return t?.throw?C.data:{data:C.data,error:null}}const Oe=(d=t?.jsonParser)!=null?d:pe,j=await p.text(),oe=bt(j),Y=oe?await Oe(j):null,Re={response:p,responseText:j,request:l,error:P(T({},Y),{status:p.status,statusText:p.statusText})};for(const _ of i.onError)_&&await _(P(T({},Re),{response:(o=t?.hookOptions)!=null&&o.cloneResponse?p.clone():p}));if(t?.retry){const _=gt(t.retry),b=(u=t.retryAttempt)!=null?u:0;if(await _.shouldAttemptRetry(b,p)){for(const N of i.onRetry)N&&await N(D);const C=_.getDelay(b);return await new Promise(N=>setTimeout(N,C)),await se(e,P(T({},t),{retryAttempt:b+1}))}}if(t?.throw)throw new dt(p.status,p.statusText,oe?Y:j);return{data:null,error:P(T({},Y),{status:p.status,statusText:p.statusText})}};const At=(e,t)=>{const n="credentials"in Request.prototype,r=De(e?.baseURL,e?.basePath)??"/api/auth",s=e?.plugins?.flatMap(l=>l.fetchPlugins).filter(l=>l!==void 0)||[],c={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:a,onError:d,onRequest:o,onResponse:u,...i}=e?.fetchOptions||{},f=Lt({baseURL:r,...n?{credentials:"include"}:{},method:"GET",jsonParser(l){return l?Ye(l,{strict:!1}):null},customFetchImpl:fetch,...i,plugins:[c,...i.plugins||[],...e?.disableDefaultFetchPlugins?[]:[je],...s]}),{$sessionSignal:h,session:m}=it(f,e),R=e?.plugins||[];let A={};const w={$sessionSignal:h,session:m},M={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},v=[{signal:"$sessionSignal",matcher(l){return l==="/sign-out"||l==="/update-user"||l==="/sign-up/email"||l==="/sign-in/email"||l==="/delete-user"||l==="/verify-email"||l==="/revoke-sessions"||l==="/revoke-session"||l==="/change-email"}}];for(const l of R)l.getAtoms&&Object.assign(w,l.getAtoms?.(f)),l.pathMethods&&Object.assign(M,l.pathMethods),l.atomListeners&&v.push(...l.atomListeners);const O={notify:l=>{w[l].set(!w[l].get())},listen:(l,x)=>{w[l].subscribe(x)},atoms:w};for(const l of R)l.getActions&&(A=_e(l.getActions?.(f,O,e)??{},A));return{get baseURL(){return r},pluginsActions:A,pluginsAtoms:w,pluginPathMethods:M,atomListeners:v,$fetch:f,$store:O}};function xt(e){return typeof e=="object"&&e!==null&&"get"in e&&typeof e.get=="function"&&"lc"in e&&typeof e.lc=="number"}function Ct(e,t,n){const r=t[e],{fetchOptions:s,query:c,...a}=n||{};return r||(s?.method?s.method:a&&Object.keys(a).length>0?"POST":"GET")}function Nt(e,t,n,r,s){function c(a=[]){return new Proxy(function(){},{get(d,o){if(typeof o!="string"||o==="then"||o==="catch"||o==="finally")return;const u=[...a,o];let i=e;for(const f of u)if(i&&typeof i=="object"&&f in i)i=i[f];else{i=void 0;break}return typeof i=="function"||xt(i)?i:c(u)},apply:async(d,o,u)=>{const i="/"+a.map(v=>v.replace(/[A-Z]/g,O=>`-${O.toLowerCase()}`)).join("/"),f=u[0]||{},h=u[1]||{},{query:m,fetchOptions:R,...A}=f,w={...h,...R},M=Ct(i,n,f);return await t(i,{...w,body:M==="GET"?void 0:{...A,...w?.body||{}},query:m||w?.query,method:M,async onSuccess(v){if(await w?.onSuccess?.(v),!s||w.disableSignal)return;const O=s.filter(x=>x.matcher(i));if(!O.length)return;const l=new Set;for(const x of O){const p=r[x.signal];if(!p)return;if(l.has(x.signal))continue;l.add(x.signal);const D=p.get();setTimeout(()=>{p.set(!D)},10)}}})}})}return c()}function ye(e){const t=Ee(),n=e.subscribe(r=>{t.value=r});return Te()&&Pe(n),t}function Mt(e){return`use${Fe(e)}`}function Ut(e){const{baseURL:t,pluginPathMethods:n,pluginsActions:r,pluginsAtoms:s,$fetch:c,$store:a,atomListeners:d}=At(e),o={};for(const[i,f]of Object.entries(s))o[Mt(i)]=()=>ye(f);function u(i){if(i){const f=ye(s.$sessionSignal);return i(`${t}/get-session`,{ref:f}).then(h=>({data:h.data,isPending:!1,error:h.error}))}return o.useSession()}return Nt({...r,...o,useSession:u,$fetch:c,$store:a},c,n,s,d)}let te=null;function qt(){if(!te){const e=window.location.origin;te=Ut({baseURL:e})}return te}function $t(){const e=qt(),t=e.useSession();async function n(o,u){return await e.signIn.email({email:o,password:u})}async function r(){await e.signOut(),Le("/login")}async function s(o,u,i){return await e.signUp.email({email:o,password:u,name:i})}async function c(o){return await e.updateUser(o)}async function a(o){try{return await $fetch("/api/user/email",{method:"PATCH",body:{email:o}}),await e.getSession({fetchOptions:{cache:"no-store"}}),{data:{success:!0},error:null}}catch(u){return{data:null,error:{message:u.data?.message||"Failed to change email"}}}}async function d(o){return await e.changePassword(o)}return{session:t,user:Q(()=>t.value?.data?.user),isAuthenticated:Q(()=>!!t.value?.data?.user),isPending:Q(()=>t.value?.isPending??!0),login:n,logout:r,register:s,updateProfile:c,changeEmail:a,changePassword:d}}export{$t as u};
@@ -1 +1 @@
1
- import{ad as c,i as d,M as t,o as n,r,a as p}from"./BOCn_SGf.js";const u=["id"],f=["href"],k={__name:"ProseH5",props:{id:{type:String,required:!1}},setup(a){const e=a,{headings:o}=c().public.mdc,i=d(()=>e.id&&(typeof o?.anchorLinks=="boolean"&&o?.anchorLinks===!0||typeof o?.anchorLinks=="object"&&o?.anchorLinks?.h5));return(s,h)=>(n(),t("h5",{id:e.id},[e.id&&p(i)?(n(),t("a",{key:0,href:`#${e.id}`},[r(s.$slots,"default")],8,f)):r(s.$slots,"default",{key:1})],8,u))}};export{k as default};
1
+ import{ad as c,i as d,M as t,o as n,r,a as p}from"./CBqC92gC.js";const u=["id"],f=["href"],k={__name:"ProseH5",props:{id:{type:String,required:!1}},setup(a){const e=a,{headings:o}=c().public.mdc,i=d(()=>e.id&&(typeof o?.anchorLinks=="boolean"&&o?.anchorLinks===!0||typeof o?.anchorLinks=="object"&&o?.anchorLinks?.h5));return(s,h)=>(n(),t("h5",{id:e.id},[e.id&&p(i)?(n(),t("a",{key:0,href:`#${e.id}`},[r(s.$slots,"default")],8,f)):r(s.$slots,"default",{key:1})],8,u))}};export{k as default};
@@ -1 +1 @@
1
- import{W as n,i as c,M as p,o as l,r as m,$ as u,ap as s}from"./BOCn_SGf.js";const i={base:""},_={__name:"ProseEm",props:{class:{type:String,required:!1}},setup(e){const a=e,o=n(),t=c(()=>s({extend:s(i),...o.ui?.prose?.em||{}}));return(r,f)=>(l(),p("em",{class:u(t.value({class:a.class}))},[m(r.$slots,"default")],2))}};export{_ as default};
1
+ import{W as n,i as c,M as p,o as l,r as m,$ as u,ap as s}from"./CBqC92gC.js";const i={base:""},_={__name:"ProseEm",props:{class:{type:String,required:!1}},setup(e){const a=e,o=n(),t=c(()=>s({extend:s(i),...o.ui?.prose?.em||{}}));return(r,f)=>(l(),p("em",{class:u(t.value({class:a.class}))},[m(r.$slots,"default")],2))}};export{_ as default};
@@ -1 +1 @@
1
- import{W as c,i as l,M as p,o as n,r as u,$ as i,ap as s}from"./BOCn_SGf.js";const d={base:"grid grid-cols-1 sm:grid-cols-2 gap-5 my-5 *:my-0"},g={__name:"ProseCardGroup",props:{class:{type:null,required:!1}},setup(e){const a=e,o=c(),r=l(()=>s({extend:s(d),...o.ui?.prose?.cardGroup||{}}));return(t,m)=>(n(),p("div",{class:i(r.value({class:a.class}))},[u(t.$slots,"default")],2))}};export{g as default};
1
+ import{W as c,i as l,M as p,o as n,r as u,$ as i,ap as s}from"./CBqC92gC.js";const d={base:"grid grid-cols-1 sm:grid-cols-2 gap-5 my-5 *:my-0"},g={__name:"ProseCardGroup",props:{class:{type:null,required:!1}},setup(e){const a=e,o=c(),r=l(()=>s({extend:s(d),...o.ui?.prose?.cardGroup||{}}));return(t,m)=>(n(),p("div",{class:i(r.value({class:a.class}))},[u(t.$slots,"default")],2))}};export{g as default};