cortex-react-components 2.23.1 → 2.24.0

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 (141) hide show
  1. package/dist/{chunk-GZ7FGBTR.mjs → chunk-5EM6P7SU.mjs} +1 -1
  2. package/dist/{chunk-UECG3SCG.mjs → chunk-6DDMDQLX.mjs} +1 -1
  3. package/dist/{chunk-TSFX33PR.mjs → chunk-BGQC6IQK.mjs} +1 -1
  4. package/dist/{chunk-XJKRA2AE.mjs → chunk-CMU5JFUC.mjs} +1 -1
  5. package/dist/chunk-GCIEF545.mjs +4 -0
  6. package/dist/{chunk-INBT5E6T.mjs → chunk-GPFPTU7U.mjs} +1 -1
  7. package/dist/{chunk-LEUI66J6.mjs → chunk-GULRIPMU.mjs} +1 -1
  8. package/dist/{chunk-TKCFCYEQ.mjs → chunk-HSQAHQNP.mjs} +1 -1
  9. package/dist/chunk-ICFBQXVC.mjs +4 -0
  10. package/dist/{chunk-CQAMS7RZ.mjs → chunk-JOG27B7P.mjs} +1 -1
  11. package/dist/chunk-M7KIL6AS.mjs +9 -0
  12. package/dist/{chunk-B7AXSCTN.mjs → chunk-M7ZG6HLI.mjs} +1 -1
  13. package/dist/{chunk-JTMIQ7MK.mjs → chunk-NXAQ6ESJ.mjs} +1 -1
  14. package/dist/{chunk-I4GYQZGM.mjs → chunk-QY3UXH77.mjs} +1 -1
  15. package/dist/{chunk-L5NPH5RX.mjs → chunk-RQLUMNJE.mjs} +1 -1
  16. package/dist/{chunk-IAFKJKBN.mjs → chunk-SDKKYDWS.mjs} +1 -1
  17. package/dist/{chunk-W4OD5UUE.mjs → chunk-UTJZH3X5.mjs} +1 -1
  18. package/dist/{chunk-AF3FLXBA.mjs → chunk-VATGKKXW.mjs} +1 -1
  19. package/dist/chunk-VTFO5GXK.mjs +4 -0
  20. package/dist/{chunk-AHMDJQZI.mjs → chunk-XDW3TPGL.mjs} +1 -1
  21. package/dist/{chunk-OWC4BAX6.mjs → chunk-YJ7XPZWV.mjs} +1 -1
  22. package/dist/components/Blocks/Banner.mjs +1 -1
  23. package/dist/components/Blocks/CallToAction.mjs +1 -1
  24. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  25. package/dist/components/Blocks/Content.mjs +1 -1
  26. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  27. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  28. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  29. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  30. package/dist/components/Blocks/index.mjs +1 -1
  31. package/dist/components/CRM/index.mjs +1 -1
  32. package/dist/components/Cards/ContentCard.mjs +1 -1
  33. package/dist/components/Cards/FeatureCard.mjs +1 -1
  34. package/dist/components/Cards/index.mjs +1 -1
  35. package/dist/components/Chat/ChatInterface.mjs +1 -1
  36. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  37. package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
  38. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  39. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  40. package/dist/components/Chat/demo-tests.mjs +1 -1
  41. package/dist/components/Chat/demo.mjs +1 -1
  42. package/dist/components/Chat/example-usage.mjs +1 -1
  43. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  44. package/dist/components/Chat/index.mjs +1 -1
  45. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  46. package/dist/components/DigitalColleagues/Pages/dashboardpage.js +6 -1
  47. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  48. package/dist/components/DigitalColleagues/Views/index.js +6 -1
  49. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  50. package/dist/components/DigitalColleagues/index.js +6 -1
  51. package/dist/components/DigitalColleagues/index.mjs +1 -1
  52. package/dist/components/Foundary/MainPage.mjs +1 -1
  53. package/dist/components/Foundary/Pages/dashboardpage.js +6 -1
  54. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  55. package/dist/components/Foundary/RichText/index.js +1 -1
  56. package/dist/components/Foundary/RichText/index.mjs +1 -1
  57. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
  58. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  59. package/dist/components/Foundary/Views/KnowledgeView.js +1 -1
  60. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  61. package/dist/components/Foundary/Views/index.js +6 -1
  62. package/dist/components/Foundary/Views/index.mjs +1 -1
  63. package/dist/components/Foundary/document-edit.js +1 -1
  64. package/dist/components/Foundary/document-edit.mjs +1 -1
  65. package/dist/components/Foundary/document-preview-examples.js +3 -3
  66. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  67. package/dist/components/Foundary/document-preview.js +1 -1
  68. package/dist/components/Foundary/document-preview.mjs +1 -1
  69. package/dist/components/Foundary/file-edit.css +1 -0
  70. package/dist/components/Foundary/file-edit.d.ts +9 -0
  71. package/dist/components/Foundary/file-edit.js +9 -0
  72. package/dist/components/Foundary/file-edit.mjs +2 -0
  73. package/dist/components/Foundary/index.js +6 -1
  74. package/dist/components/Foundary/index.mjs +1 -1
  75. package/dist/components/Foundary/knowledge-browser.js +1 -1
  76. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  77. package/dist/components/Foundary/test-data.js +1 -1
  78. package/dist/components/Foundary/test-data.mjs +1 -1
  79. package/dist/components/Foundary/types.d.ts +42 -0
  80. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  81. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  82. package/dist/components/HeaderFooter/index.mjs +1 -1
  83. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  84. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  85. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  86. package/dist/components/Heros/RenderHero.mjs +1 -1
  87. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  88. package/dist/components/Heros/index.mjs +1 -1
  89. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  90. package/dist/components/Layouts/Print.mjs +1 -1
  91. package/dist/components/Layouts/SlideShow.mjs +1 -1
  92. package/dist/components/Layouts/index.mjs +1 -1
  93. package/dist/components/Menus/index.mjs +1 -1
  94. package/dist/components/Other/index.mjs +1 -1
  95. package/dist/components/Payload/RichText/index.mjs +1 -1
  96. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  97. package/dist/components/Payload/index.mjs +1 -1
  98. package/dist/components/Projects/FileView.d.ts +2 -1
  99. package/dist/components/Projects/FileView.js +6 -1
  100. package/dist/components/Projects/FileView.mjs +1 -1
  101. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  102. package/dist/components/Projects/ProjectPage.js +6 -1
  103. package/dist/components/Projects/ProjectPage.mjs +1 -1
  104. package/dist/components/Projects/ProjectView.js +6 -1
  105. package/dist/components/Projects/ProjectView.mjs +1 -1
  106. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  107. package/dist/components/Projects/file-list.d.ts +2 -2
  108. package/dist/components/Projects/file-list.js +6 -1
  109. package/dist/components/Projects/file-list.mjs +1 -1
  110. package/dist/components/Projects/index.mjs +1 -1
  111. package/dist/components/dc-temp/index.js +6 -1
  112. package/dist/components/dc-temp/index.mjs +1 -1
  113. package/dist/components/index.js +25 -20
  114. package/dist/components/index.mjs +1 -1
  115. package/dist/index.js +35 -30
  116. package/dist/index.mjs +1 -1
  117. package/dist/metafile-cjs.json +1 -1
  118. package/dist/metafile-esm.json +1 -1
  119. package/dist/pages/Blog.mjs +1 -1
  120. package/dist/pages/Documentation.mjs +1 -1
  121. package/dist/pages/IndexPage.mjs +1 -1
  122. package/dist/pages/Intranet.mjs +1 -1
  123. package/dist/pages/LandingPage.mjs +1 -1
  124. package/dist/pages/Page.mjs +1 -1
  125. package/dist/pages/Publish.mjs +1 -1
  126. package/dist/pages/Website.mjs +1 -1
  127. package/dist/sections/AboutSection.mjs +1 -1
  128. package/dist/sections/BlogDetail.mjs +1 -1
  129. package/dist/sections/BlogList.mjs +1 -1
  130. package/dist/sections/BlogListSection.mjs +1 -1
  131. package/dist/sections/ContactSection.mjs +1 -1
  132. package/dist/sections/PageSections.mjs +1 -1
  133. package/dist/sections/PricingSection.mjs +1 -1
  134. package/dist/sections/ServiceDetail.mjs +1 -1
  135. package/dist/sections/ServiceDetailSection.mjs +1 -1
  136. package/dist/sections/ServiceSection.mjs +1 -1
  137. package/dist/sections/index.mjs +1 -1
  138. package/package.json +1 -1
  139. package/dist/chunk-JXQRVEQB.mjs +0 -4
  140. package/dist/chunk-NAGBKKTZ.mjs +0 -4
  141. package/dist/chunk-PZFYJ5FS.mjs +0 -4
@@ -1 +1 @@
1
- import{a as g}from"../../../chunk-2UNIT7NC.mjs";import{a as b}from"../../../chunk-TSFX33PR.mjs";import{a}from"../../../chunk-INBT5E6T.mjs";import"../../../chunk-I6XKBCH4.mjs";import"../../../chunk-WLI2YTOQ.mjs";import"../../../chunk-GAU24H4A.mjs";import"../../../chunk-M2REXGQW.mjs";import"../../../chunk-GZ7FGBTR.mjs";import"../../../chunk-CJ6APTVT.mjs";import"../../../chunk-HB57GPGK.mjs";import"../../../chunk-KKW3FINI.mjs";import"../../../chunk-5HT2KC5I.mjs";import"../../../chunk-FSCDCSVK.mjs";import"../../../chunk-XJKRA2AE.mjs";import"../../../chunk-JTMIQ7MK.mjs";import"../../../chunk-PZFYJ5FS.mjs";import"../../../chunk-LEUI66J6.mjs";import"../../../chunk-HFEN3KJC.mjs";import"../../../chunk-L2UJOICL.mjs";import"../../../chunk-T3F3RQIC.mjs";import"../../../chunk-UP67R64J.mjs";import"../../../chunk-6QERRKM4.mjs";import"../../../chunk-VSU7LYXZ.mjs";import"../../../chunk-RKS7CWAP.mjs";import"../../../chunk-BZEGLKRZ.mjs";import"../../../chunk-K7N3FRGH.mjs";import"../../../chunk-IPRG56MW.mjs";import"../../../chunk-NDZ26EG6.mjs";import{a as e}from"../../../chunk-UECG3SCG.mjs";import"../../../chunk-QOZ2O3FG.mjs";import"../../../chunk-L5NPH5RX.mjs";import"../../../chunk-KZCIHFTM.mjs";import{a as d}from"../../../chunk-2R3MJSQ7.mjs";import{a as f}from"../../../chunk-TKCFCYEQ.mjs";import"../../../chunk-CDVRH3MC.mjs";import"../../../chunk-KPTGYVDM.mjs";import"../../../chunk-UM57PWI7.mjs";import"../../../chunk-ZHBYZ4HE.mjs";import"../../../chunk-AB43AQKL.mjs";import"../../../chunk-NGX2VCHS.mjs";import"../../../chunk-6PS55VJZ.mjs";import"../../../chunk-KG7HG2VO.mjs";import"../../../chunk-L3V5YDPH.mjs";import"../../../chunk-QC2UWZWL.mjs";import"../../../chunk-5RTGHMF3.mjs";import{a as c}from"../../../chunk-NAGBKKTZ.mjs";import"../../../chunk-JXQRVEQB.mjs";import"../../../chunk-DCOFQFVJ.mjs";import"../../../chunk-VGWDYD6Z.mjs";import"../../../chunk-Z22NSJMF.mjs";import"../../../chunk-EZC3YWSQ.mjs";import"../../../chunk-YRMNCHFO.mjs";import"../../../chunk-EOR2BAI2.mjs";import"../../../chunk-Y7H3EUBR.mjs";import"../../../chunk-6SWKEZN6.mjs";import"../../../chunk-DFIXTV2M.mjs";import"../../../chunk-FGEFYI5E.mjs";import"../../../chunk-UVHMI3PU.mjs";import"../../../chunk-Q5Q3DJWU.mjs";import"../../../chunk-U5PBLRRV.mjs";import"../../../chunk-4QRKVSTE.mjs";import"../../../chunk-E4TE4NV6.mjs";import"../../../chunk-JFFTEK6Z.mjs";import"../../../chunk-JHNVX4UB.mjs";import"../../../chunk-7BXIU4ZM.mjs";import"../../../chunk-YFAZQYK4.mjs";import"../../../chunk-INCYANPB.mjs";import"../../../chunk-B4H6T2GP.mjs";import"../../../chunk-TVZOULLL.mjs";import"../../../chunk-RLVKIMGU.mjs";import"../../../chunk-OCPX4QPC.mjs";import"../../../chunk-FT3AE7L2.mjs";import"../../../chunk-76M7JE4D.mjs";import"../../../chunk-3UMMMQEH.mjs";import"../../../chunk-OYZDAMCS.mjs";import"../../../chunk-5NRGSTPV.mjs";import"../../../chunk-ZFUP5NVF.mjs";import"../../../chunk-4UIARERB.mjs";import"../../../chunk-D4IMQTVU.mjs";import"../../../chunk-7GSXNSLD.mjs";import"../../../chunk-YNCJATT7.mjs";import"../../../chunk-L5JPAKPM.mjs";import"../../../chunk-KY7WQYN4.mjs";import"../../../chunk-ZUA4KNIR.mjs";import"../../../chunk-SOLZ4VQH.mjs";import"../../../chunk-CSBGSBEU.mjs";import"../../../chunk-YO3GQYRJ.mjs";import"../../../chunk-QTW33JYG.mjs";import"../../../chunk-MDJREBVI.mjs";import"../../../chunk-ZWHGOTSF.mjs";import"../../../chunk-Q3G5UAAD.mjs";import"../../../chunk-XGRRLABA.mjs";import"../../../chunk-FLHDNCNY.mjs";import"../../../chunk-FRWX5YES.mjs";import"../../../chunk-CV7PH2KH.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{a as ColleaguesView,c as FileView,b as KnowledgeView,d as PlanningView,e as ProjectView,f as ProjectsIndexView,g as TeamsIndexView};
1
+ import{a as g}from"../../../chunk-2UNIT7NC.mjs";import{a as b}from"../../../chunk-BGQC6IQK.mjs";import"../../../chunk-I6XKBCH4.mjs";import"../../../chunk-WLI2YTOQ.mjs";import{a}from"../../../chunk-GPFPTU7U.mjs";import"../../../chunk-GAU24H4A.mjs";import"../../../chunk-NDZ26EG6.mjs";import"../../../chunk-M2REXGQW.mjs";import"../../../chunk-5EM6P7SU.mjs";import"../../../chunk-CJ6APTVT.mjs";import"../../../chunk-HB57GPGK.mjs";import"../../../chunk-KKW3FINI.mjs";import"../../../chunk-5HT2KC5I.mjs";import"../../../chunk-FSCDCSVK.mjs";import"../../../chunk-CMU5JFUC.mjs";import"../../../chunk-NXAQ6ESJ.mjs";import"../../../chunk-VGWDYD6Z.mjs";import{a as f}from"../../../chunk-HSQAHQNP.mjs";import"../../../chunk-KPTGYVDM.mjs";import"../../../chunk-5RTGHMF3.mjs";import"../../../chunk-CDVRH3MC.mjs";import{a as e}from"../../../chunk-6DDMDQLX.mjs";import"../../../chunk-QOZ2O3FG.mjs";import"../../../chunk-6PS55VJZ.mjs";import{a as c}from"../../../chunk-GCIEF545.mjs";import"../../../chunk-ICFBQXVC.mjs";import"../../../chunk-RQLUMNJE.mjs";import"../../../chunk-UM57PWI7.mjs";import"../../../chunk-ZHBYZ4HE.mjs";import"../../../chunk-AB43AQKL.mjs";import"../../../chunk-KG7HG2VO.mjs";import"../../../chunk-KZCIHFTM.mjs";import{a as d}from"../../../chunk-2R3MJSQ7.mjs";import"../../../chunk-L3V5YDPH.mjs";import"../../../chunk-DCOFQFVJ.mjs";import"../../../chunk-NGX2VCHS.mjs";import"../../../chunk-QC2UWZWL.mjs";import"../../../chunk-Z22NSJMF.mjs";import"../../../chunk-M7KIL6AS.mjs";import"../../../chunk-EZC3YWSQ.mjs";import"../../../chunk-VTFO5GXK.mjs";import"../../../chunk-GULRIPMU.mjs";import"../../../chunk-RKS7CWAP.mjs";import"../../../chunk-IPRG56MW.mjs";import"../../../chunk-HFEN3KJC.mjs";import"../../../chunk-L2UJOICL.mjs";import"../../../chunk-T3F3RQIC.mjs";import"../../../chunk-UP67R64J.mjs";import"../../../chunk-6QERRKM4.mjs";import"../../../chunk-VSU7LYXZ.mjs";import"../../../chunk-BZEGLKRZ.mjs";import"../../../chunk-K7N3FRGH.mjs";import"../../../chunk-YRMNCHFO.mjs";import"../../../chunk-EOR2BAI2.mjs";import"../../../chunk-Y7H3EUBR.mjs";import"../../../chunk-6SWKEZN6.mjs";import"../../../chunk-DFIXTV2M.mjs";import"../../../chunk-FGEFYI5E.mjs";import"../../../chunk-UVHMI3PU.mjs";import"../../../chunk-Q5Q3DJWU.mjs";import"../../../chunk-U5PBLRRV.mjs";import"../../../chunk-4QRKVSTE.mjs";import"../../../chunk-E4TE4NV6.mjs";import"../../../chunk-JFFTEK6Z.mjs";import"../../../chunk-JHNVX4UB.mjs";import"../../../chunk-7BXIU4ZM.mjs";import"../../../chunk-YFAZQYK4.mjs";import"../../../chunk-INCYANPB.mjs";import"../../../chunk-B4H6T2GP.mjs";import"../../../chunk-TVZOULLL.mjs";import"../../../chunk-RLVKIMGU.mjs";import"../../../chunk-OCPX4QPC.mjs";import"../../../chunk-FT3AE7L2.mjs";import"../../../chunk-76M7JE4D.mjs";import"../../../chunk-3UMMMQEH.mjs";import"../../../chunk-OYZDAMCS.mjs";import"../../../chunk-5NRGSTPV.mjs";import"../../../chunk-ZFUP5NVF.mjs";import"../../../chunk-4UIARERB.mjs";import"../../../chunk-D4IMQTVU.mjs";import"../../../chunk-7GSXNSLD.mjs";import"../../../chunk-YNCJATT7.mjs";import"../../../chunk-L5JPAKPM.mjs";import"../../../chunk-KY7WQYN4.mjs";import"../../../chunk-ZUA4KNIR.mjs";import"../../../chunk-SOLZ4VQH.mjs";import"../../../chunk-CSBGSBEU.mjs";import"../../../chunk-YO3GQYRJ.mjs";import"../../../chunk-QTW33JYG.mjs";import"../../../chunk-MDJREBVI.mjs";import"../../../chunk-ZWHGOTSF.mjs";import"../../../chunk-Q3G5UAAD.mjs";import"../../../chunk-XGRRLABA.mjs";import"../../../chunk-FLHDNCNY.mjs";import"../../../chunk-FRWX5YES.mjs";import"../../../chunk-CV7PH2KH.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{a as ColleaguesView,c as FileView,b as KnowledgeView,d as PlanningView,e as ProjectView,f as ProjectsIndexView,g as TeamsIndexView};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- "use strict";"use client";var Lo=Object.create;var Oe=Object.defineProperty;var Ao=Object.getOwnPropertyDescriptor;var Vo=Object.getOwnPropertyNames;var _o=Object.getPrototypeOf,Oo=Object.prototype.hasOwnProperty;var zo=(e,t)=>{for(var o in t)Oe(e,o,{get:t[o],enumerable:!0})},wt=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Vo(t))!Oo.call(e,a)&&a!==o&&Oe(e,a,{get:()=>t[a],enumerable:!(r=Ao(t,a))||r.enumerable});return e};var X=(e,t,o)=>(o=e!=null?Lo(_o(e)):{},wt(t||!e||!e.__esModule?Oe(o,"default",{value:e,enumerable:!0}):o,e)),Uo=e=>wt(Oe({},"__esModule",{value:!0}),e);var Xr={};zo(Xr,{DocumentEdit:()=>Jr});module.exports=Uo(Xr);var yt=require("motion/react"),A=require("lucide-react"),Z=require("react");var kt=require("clsx");var qe="-",Bo=e=>{let t=$o(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:n=>{let l=n.split(qe);return l[0]===""&&l.length!==1&&l.shift(),Rt(l,t)||Fo(n)},getConflictingClassGroupIds:(n,l)=>{let v=o[n]||[];return l&&r[n]?[...v,...r[n]]:v}}},Rt=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),a=r?Rt(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;let i=e.join(qe);return t.validators.find(({validator:n})=>n(i))?.classGroupId},Ct=/^\[(.+)\]$/,Fo=e=>{if(Ct.test(e)){let t=Ct.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},$o=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return Go(Object.entries(e.classGroups),o).forEach(([i,n])=>{Xe(n,r,i,t)}),r},Xe=(e,t,o,r)=>{e.forEach(a=>{if(typeof a=="string"){let i=a===""?t:Nt(t,a);i.classGroupId=o;return}if(typeof a=="function"){if(Wo(a)){Xe(a(r),t,o,r);return}t.validators.push({validator:a,classGroupId:o});return}Object.entries(a).forEach(([i,n])=>{Xe(n,Nt(t,i),o,r)})})},Nt=(e,t)=>{let o=e;return t.split(qe).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},Wo=e=>e.isThemeGetter,Go=(e,t)=>t?e.map(([o,r])=>{let a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([n,l])=>[t+n,l])):i);return[o,a]}):e,Ko=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,a=(i,n)=>{o.set(i,n),t++,t>e&&(t=0,r=o,o=new Map)};return{get(i){let n=o.get(i);if(n!==void 0)return n;if((n=r.get(i))!==void 0)return a(i,n),n},set(i,n){o.has(i)?o.set(i,n):a(i,n)}}},Pt="!",jo=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,a=t[0],i=t.length,n=l=>{let v=[],N=0,w=0,V;for(let u=0;u<l.length;u++){let R=l[u];if(N===0){if(R===a&&(r||l.slice(u,u+i)===t)){v.push(l.slice(w,u)),w=u+i;continue}if(R==="/"){V=u;continue}}R==="["?N++:R==="]"&&N--}let P=v.length===0?l:l.substring(w),_=P.startsWith(Pt),M=_?P.substring(1):P,D=V&&V>w?V-w:void 0;return{modifiers:v,hasImportantModifier:_,baseClassName:M,maybePostfixModifierPosition:D}};return o?l=>o({className:l,parseClassName:n}):n},Zo=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(r=>{r[0]==="["?(t.push(...o.sort(),r),o=[]):o.push(r)}),t.push(...o.sort()),t},Jo=e=>({cache:Ko(e.cacheSize),parseClassName:jo(e),...Bo(e)}),Xo=/\s+/,qo=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],n=e.trim().split(Xo),l="";for(let v=n.length-1;v>=0;v-=1){let N=n[v],{modifiers:w,hasImportantModifier:V,baseClassName:P,maybePostfixModifierPosition:_}=o(N),M=!!_,D=r(M?P.substring(0,_):P);if(!D){if(!M){l=N+(l.length>0?" "+l:l);continue}if(D=r(P),!D){l=N+(l.length>0?" "+l:l);continue}M=!1}let u=Zo(w).join(":"),R=V?u+Pt:u,T=R+D;if(i.includes(T))continue;i.push(T);let G=a(D,M);for(let C=0;C<G.length;++C){let j=G[C];i.push(R+j)}l=N+(l.length>0?" "+l:l)}return l};function Yo(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Dt(t))&&(r&&(r+=" "),r+=o);return r}var Dt=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=Dt(e[r]))&&(o&&(o+=" "),o+=t);return o};function Qo(e,...t){let o,r,a,i=n;function n(v){let N=t.reduce((w,V)=>V(w),e());return o=Jo(N),r=o.cache.get,a=o.cache.set,i=l,l(v)}function l(v){let N=r(v);if(N)return N;let w=qo(v,o);return a(v,w),w}return function(){return i(Yo.apply(null,arguments))}}var I=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},St=/^\[(?:([a-Lt-]+):)?(.+)\]$/i,er=/^\d+\/\d+$/,tr=new Set(["px","full","screen"]),or=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ar=/^(inset_)?-?((\d+)?\.?(\d+)[a-Lt]+|0)_-?((\d+)?\.?(\d+)[a-Lt]+|0)/,ir=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ie=e=>we(e)||tr.has(e)||er.test(e),fe=e=>Ce(e,"length",fr),we=e=>!!e&&!Number.isNaN(Number(e)),Je=e=>Ce(e,"number",we),De=e=>!!e&&Number.isInteger(Number(e)),sr=e=>e.endsWith("%")&&we(e.slice(0,-1)),g=e=>St.test(e),ge=e=>or.test(e),lr=new Set(["length","size","percentage"]),cr=e=>Ce(e,lr,Mt),dr=e=>Ce(e,"position",Mt),pr=new Set(["image","url"]),mr=e=>Ce(e,pr,hr),ur=e=>Ce(e,"",gr),Se=()=>!0,Ce=(e,t,o)=>{let r=St.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},fr=e=>rr.test(e)&&!nr.test(e),Mt=()=>!1,gr=e=>ar.test(e),hr=e=>ir.test(e);var br=()=>{let e=I("colors"),t=I("spacing"),o=I("blur"),r=I("brightness"),a=I("borderColor"),i=I("borderRadius"),n=I("borderSpacing"),l=I("borderWidth"),v=I("contrast"),N=I("grayscale"),w=I("hueRotate"),V=I("invert"),P=I("gap"),_=I("gradientColorStops"),M=I("gradientColorStopPositions"),D=I("inset"),u=I("margin"),R=I("opacity"),T=I("padding"),G=I("saturate"),C=I("scale"),j=I("sepia"),re=I("skew"),ne=I("space"),J=I("translate"),pe=()=>["auto","contain","none"],ve=()=>["auto","hidden","clip","visible","scroll"],ae=()=>["auto",g,t],S=()=>[g,t],me=()=>["",ie,fe],ue=()=>["auto",we,g],d=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>["start","end","center","between","around","evenly","stretch"],s=()=>["","0",g],f=()=>["auto","avoid","all","avoid-page","page","left","right","column"],m=()=>[we,g];return{cacheSize:500,separator:":",theme:{colors:[Se],spacing:[ie,fe],blur:["none","",ge,g],brightness:m(),borderColor:[e],borderRadius:["none","","full",ge,g],borderSpacing:S(),borderWidth:me(),contrast:m(),grayscale:s(),hueRotate:m(),invert:s(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[sr,fe],inset:ae(),margin:ae(),opacity:m(),padding:S(),saturate:m(),scale:m(),sepia:s(),skew:m(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",g]}],container:["container"],columns:[{columns:[ge]}],"break-after":[{"break-after":f()}],"break-before":[{"break-before":f()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...d(),g]}],overflow:[{overflow:ve()}],"overflow-x":[{"overflow-x":ve()}],"overflow-y":[{"overflow-y":ve()}],overscroll:[{overscroll:pe()}],"overscroll-x":[{"overscroll-x":pe()}],"overscroll-y":[{"overscroll-y":pe()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[D]}],"inset-x":[{"inset-x":[D]}],"inset-y":[{"inset-y":[D]}],start:[{start:[D]}],end:[{end:[D]}],top:[{top:[D]}],right:[{right:[D]}],bottom:[{bottom:[D]}],left:[{left:[D]}],visibility:["visible","invisible","collapse"],Lt:[{Lt:["auto",De,g]}],basis:[{basis:ae()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",g]}],grow:[{grow:s()}],shrink:[{shrink:s()}],order:[{order:["first","last","none",De,g]}],"grid-cols":[{"grid-cols":[Se]}],"col-start-end":[{col:["auto",{span:["full",De,g]},g]}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":[Se]}],"row-start-end":[{row:["auto",{span:[De,g]},g]}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",g]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",g]}],gap:[{gap:[P]}],"gap-x":[{"gap-x":[P]}],"gap-y":[{"gap-y":[P]}],"justify-content":[{justify:["normal",...ee()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ee(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ee(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],Lt:[{Lt:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],me:[{me:[u]}],Lt:[{Lt:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[ne]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ne]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",g,t]}],"min-w":[{"min-w":[g,t,"min","max","fit"]}],"max-w":[{"max-w":[g,t,"none","full","min","max","fit","prose",{screen:[ge]},ge]}],h:[{h:[g,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[g,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[g,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[g,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ge,fe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Je]}],"font-family":[{font:[Se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",g]}],"line-clamp":[{"line-clamp":["none",we,Je]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ie,g]}],"list-image":[{"list-image":["none",g]}],"list-style-type":[{list:["none","disc","decimal",g]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[R]}],"text-decoration":["underline","overline","line-through","wo-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ie,fe]}],"underline-offset":[{"underline-offset":["auto",ie,g]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",g]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",g]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[R]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...d(),dr]}],"bg-repeat":[{bg:["wo-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[M]}],"gradient-via-pos":[{via:[M]}],"gradient-to-pos":[{to:[M]}],"gradient-from":[{from:[_]}],"gradient-via":[{via:[_]}],"gradient-to":[{to:[_]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[R]}],"border-style":[{border:[...k(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[R]}],"divide-style":[{divide:k()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...k()]}],"outline-offset":[{"outline-offset":[ie,g]}],"outline-w":[{outline:[ie,fe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[ie,fe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ge,ur]}],"shadow-color":[{shadow:[Se]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[...O(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[v]}],"drop-shadow":[{"drop-shadow":["","none",ge,g]}],grayscale:[{grayscale:[N]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[V]}],saturate:[{saturate:[G]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[v]}],"backdrop-grayscale":[{"backdrop-grayscale":[N]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[V]}],"backdrop-opacity":[{"backdrop-opacity":[R]}],"backdrop-saturate":[{"backdrop-saturate":[G]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",g]}],duration:[{duration:m()}],ease:[{ease:["linear","in","out","in-out",g]}],delay:[{delay:m()}],animate:[{animate:["none","spin","ping","pulse","bounce",g]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[De,g]}],"translate-x":[{"translate-x":[J]}],"translate-y":[{"translate-y":[J]}],"skew-x":[{"skew-x":[re]}],"skew-y":[{"skew-y":[re]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",g]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","wo-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",g]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-Lt":[{"scroll-Lt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-Lt":[{"scroll-Lt":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",g]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ie,fe,Je]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],Lt:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","Lt","mr","mb","ml"],mx:["mr","ml"],my:["Lt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-Lt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-Lt","scroll-mb"],"scroll-Lt":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Tt=Qo(br);function b(...e){return Tt((0,kt.clsx)(e))}var It=require("@radix-ui/react-slot"),Et=require("class-variance-authority"),Ht=X(require("react")),Lt=require("react/jsx-runtime"),vr=(0,Et.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),se=Ht.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...a},i)=>(0,Lt.jsx)(e?It.Slot:"button",{className:b(vr({className:t,size:o,variant:r})),ref:i,...a}));se.displayName="Button";var At=X(require("react")),Me=At.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)("textarea",{className:b("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));Me.displayName="Textarea";var _t=X(require("react"));var le=_t.forwardRef(({className:e,type:t,...o},r)=>(0,Lt.jsx)("input",{type:t,className:b("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...o}));le.displayName="Input";var x=X(require("@radix-ui/react-select")),he=X(require("react")),zt=x.Root;var Ut=x.Value,Ye=he.forwardRef(({children:e,className:t,...o},r)=>(0,Lt.jsxs)(x.Trigger,{className:b("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:r,...o,children:[e,(0,Lt.jsx)(x.Icon,{asChild:!0,children:(0,Lt.jsx)(A.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Ye.displayName=x.Trigger.displayName;var Bt=he.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(x.ScrollUpButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Lt.jsx)(A.ChevronUp,{className:"h-4 w-4"})}));Bt.displayName=x.ScrollUpButton.displayName;var Ft=he.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(x.ScrollDownButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Lt.jsx)(A.ChevronDown,{className:"h-4 w-4"})}));Ft.displayName=x.ScrollDownButton.displayName;var Qe=he.forwardRef(({children:e,className:t,position:o="popper",...r},a)=>(0,Lt.jsx)(x.Portal,{children:(0,Lt.jsxs)(x.Content,{className:b("relative Lt-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:a,...r,children:[(0,Lt.jsx)(Bt,{}),(0,Lt.jsx)(x.Viewport,{className:b("Lt-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Lt.jsx)(Ft,{})]})}));Qe.displayName=x.Content.displayName;var xr=he.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(x.Label,{className:b("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));xr.displayName=x.Label.displayName;var ze=he.forwardRef(({children:e,className:t,...o},r)=>(0,Lt.jsxs)(x.Item,{className:b("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:r,...o,children:[(0,Lt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Lt.jsx)(x.ItemIndicator,{children:(0,Lt.jsx)(A.Check,{className:"h-4 w-4"})})}),(0,Lt.jsx)(x.ItemText,{children:e})]}));ze.displayName=x.Item.displayName;var yr=he.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(x.Separator,{className:b("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));yr.displayName=x.Separator.displayName;var $t=X(require("react")),et=X(require("@radix-ui/react-label"));var wr=(0,Et.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),tt=$t.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(et.Root,{ref:o,className:b(wr(),e),...t}));tt.displayName=et.Root.displayName;var rt=({fieldName:e,value:t,label:o,multiline:r=!1,onSave:a,className:i="",disabled:n=!1})=>{let[l,v]=(0,Z.useState)(!1),[N,w]=(0,Z.useState)(""),V=()=>{n||(v(!0),w(t))},P=async()=>{N!==t&&await a(e,N),v(!1)},_=M=>{M.key==="Enter"&&!r||M.key==="Enter"&&M.ctrlKey&&r?P():M.key==="Escape"&&(v(!1),w(""))};return(0,Lt.jsxs)("div",{className:`space-y-2 ${i}`,children:[(0,Lt.jsx)(tt,{children:o}),l?r?(0,Lt.jsx)(Me,{value:N,onChange:M=>w(M.target.value),onBlur:P,onKeyDown:_,autoFocus:!0,rows:4,className:"resize-none"}):(0,Lt.jsx)(le,{value:N,onChange:M=>w(M.target.value),onBlur:P,onKeyPress:_,autoFocus:!0,className:"text-lg font-medium"}):(0,Lt.jsxs)("div",{onClick:V,className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 Lt-2 rounded border border-transparent hover:border-border transition-colors group ${r?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,Lt.jsx)("span",{className:r?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!n&&(0,Lt.jsx)(A.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var No=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),Ro=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Po=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Do=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),So=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),Mo=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),To=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),je=require("@payloadcms/richtext-lexical/lexical/list"),ko=require("@payloadcms/richtext-lexical/lexical/rich-text"),Io=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var wo=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Ve=require("@payloadcms/richtext-lexical/lexical/utils"),h=require("@payloadcms/richtext-lexical/lexical"),bt=require("@payloadcms/richtext-lexical/lexical/selection");var Te=X(require("react")),F=X(require("@radix-ui/react-dialog"));var Zt=F.Root;var Cr=F.Portal;var Jt=Te.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(F.Overlay,{ref:o,className:b("fixed inset-0 Lt-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Jt.displayName=F.Overlay.displayName;var nt=Te.forwardRef(({className:e,children:t,...o},r)=>(0,Lt.jsxs)(Cr,{children:[(0,Lt.jsx)(Jt,{}),(0,Lt.jsxs)(F.Content,{ref:r,className:b("fixed left-[50%] top-[50%] Lt-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background Lt-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,Lt.jsxs)(F.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,Lt.jsx)(A.X,{className:"h-4 w-4"}),(0,Lt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));nt.displayName=F.Content.displayName;var at=({className:e,...t})=>(0,Lt.jsx)("div",{className:b("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});at.displayName="DialogHeader";var Nr=({className:e,...t})=>(0,Lt.jsx)("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Nr.displayName="DialogFooter";var it=Te.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(F.Title,{ref:o,className:b("text-lg font-semibold leading-none tracking-tight",e),...t}));it.displayName=F.Title.displayName;var Rr=Te.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(F.Description,{ref:o,className:b("text-sm text-muted-foreground",e),...t}));Rr.displayName=F.Description.displayName;var io=require("@radix-ui/react-dialog"),$e=require("@payloadcms/richtext-lexical/client");var lt=X(require("bson-objectid"));var qt=require("@payloadcms/ui");var Xt=X(require("react")),te=X(require("@radix-ui/react-tooltip"));var Ue=te.Provider,Be=te.Root,Fe=te.Trigger,ke=Xt.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,Lt.jsx)(te.Portal,{children:(0,Lt.jsx)(te.Content,{ref:r,sideOffset:t,className:b("Lt-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));ke.displayName=te.Content.displayName;var Pr=e=>{let{data:{relationTo:t,value:o},nodeKey:r}=e,[a]=(0,wo.useLexicalComposerContext)(),[i,n]=(0,Z.useState)(""),[l,v]=(0,Z.useState)(""),[N,w]=(0,Z.useState)(""),V=async u=>{console.log("fetchMedia",u)};(0,Z.useEffect)(()=>{typeof o=="string"?o.length===24?V(o):(n(o||""),w(D(M())),v(_()||"")):typeof o=="object"&&(n(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),w(D(o.filesize)),v(o.mimeType?.split("/")[1]||""))},[]);let P=(0,Z.useCallback)(()=>{a.update(()=>{(0,h.$getNodeByKey)(r)?.remove()})},[a,r]),_=()=>{let u=e.data.value;return typeof u=="string"?u.split(";base64")[0]?.split("image/")[1]:""},M=()=>{let u=e.data.value;if(typeof u=="string"){let R=u.split(",")[1]?.length||0;return 4*Math.ceil(R/3)*.5624896334383812/1e3}return 0};function D(u){if(u>=1e6){let T=u/1e6;return`${T>=10?Math.round(T).toString():T.toFixed(1)} MB`}return`${Math.floor(u/1e3)} KB`}return(0,$.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,$.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,$.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,$.jsx)("div",{className:"flex-1",children:e.data.value?(0,$.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":o,"data-lexical-upload-relation-to":t,src:i}):(0,$.jsx)(qt.File,{})}),(0,$.jsx)(Ue,{children:(0,$.jsxs)(Be,{children:[(0,$.jsxs)(Fe,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,$.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,$.jsx)("button",{onClick:u=>{u.preventDefault(),P()},className:"flex-1 flex justify-center items-center",children:(0,$.jsx)(A.X,{width:24,height:24,strokeWidth:1})})]}),(0,$.jsx)(ke,{children:(0,$.jsx)("span",{children:"Remove image"})})]})})]}),(0,$.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,$.jsx)("span",{className:"",children:l?.toLocaleUpperCase()}),(0,$.jsx)("span",{children:N})]})]})})},to=Pr;function Dr(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let o=e.getAttribute("data-lexical-upload-id");if(o)return{node:Ne({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var Ie=class extends $e.UploadNode{static importDOM(){return{img:()=>({conversion:Dr,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new lt.default().toHexString(),t.version=3);let o={id:t.id??new lt.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},r=Ne(o);return r.setFormat?.(t.format),r}decorate(){return(0,Lt.jsx)(to,{data:this.__data,nodeKey:this.getKey()})}};function Ne(e){return new Ie({data:e})}var Sr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Mr=e=>Sr?(e||window).getSelection():null,zn=(0,h.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),ct=(0,h.createCommand)("INSERT_UPLOAD_COMMAND");function so({activeEditor:e,onClose:t,isOpen:o=!1}){let r=(0,Z.useRef)(!1),[a,i]=(0,Z.useState)(!0),[n,l]=(0,Z.useState)(""),[v,N]=(0,Z.useState)(""),[w,V]=(0,Z.useState)(!1),[P,_]=(0,Z.useState)("left"),M=n==="",D=C=>{V(C.target.checked)},u=C=>{_(C.target.value)},R=C=>{let j=new FileReader;j.onload=function(){return typeof j.result=="string"&&l(j.result),""},C!==null&&C[0]&&j.readAsDataURL(C[0])};(0,Z.useEffect)(()=>{r.current=!1;let C=j=>{r.current=j.altKey};return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C)}},[e]),(0,Z.useEffect)(()=>{a||t()},[a]),(0,Z.useEffect)(()=>{i(o)},[o]);let T=({editor:C,relationTo:j,replaceNodeKey:re,value:ne})=>{if(re)C.update(()=>{let J=(0,h.$getNodeByKey)(re);J&&J.replace(Ne({id:"",fields:{},relationTo:"media",value:ne}))});else{let J=C.dispatchCommand(ct,{fields:null,relationTo:"media",value:ne})}},G=()=>{T({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:v,src:n,showCaption:w,position:P}.src}),i(!1),t()};return(0,Lt.jsx)(Zt,{open:a,onOpenChange:C=>i(C),children:(0,Lt.jsxs)(nt,{children:[(0,Lt.jsxs)(at,{children:[(0,Lt.jsx)(it,{children:"Upload Image"}),(0,Lt.jsx)(io.DialogDescription,{children:"Description"})]}),(0,Lt.jsxs)("div",{className:"",children:[(0,Lt.jsx)("div",{style:{marginBottom:"1em"},children:(0,Lt.jsx)(le,{type:"file",onChange:C=>R(C.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,Lt.jsx)("div",{style:{marginBottom:"1em"},children:(0,Lt.jsx)(le,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:C=>N(C.currentTarget.value),value:v,"data-test-id":"image-modal-alt-text-input"})}),(0,Lt.jsx)(se,{"data-test-id":"image-modal-file-upload-btn",disabled:M,onClick:()=>G(),children:"Confirm"})]})]})})}function dt({captionsEnabled:e}){let[t]=(0,wo.useLexicalComposerContext)();return(0,Z.useEffect)(()=>{if(!t.hasNodes([$e.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,Ve.mergeRegister)(t.registerCommand(h.DRAGSTART_COMMAND,o=>Tr(o),h.COMMAND_PRIORITY_HIGH),t.registerCommand(h.DRAGOVER_COMMAND,o=>kr(o),h.COMMAND_PRIORITY_LOW),t.registerCommand(h.DROP_COMMAND,o=>Ir(o,t),h.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Tr(e){if(!pt())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","_"),!0):!1}function kr(e){return pt()?(lo(e)||e.preventDefault(),!0):!1}function Ir(e,t){let o=pt();if(!o)return!1;if(e.preventDefault(),lo(e)){let r=Er(e);o.remove();let a=(0,h.$createRangeSelection)();r!=null&&a.applyDOMRange(r),(0,h.$setSelection)(a)}return!0}function pt(){let e=(0,h.$getSelection)();if(!(0,h.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,$e.$isUploadNode)(o)?o:null}function lo(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function Er(e){let t,o=e.target,r=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,a=Mr(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&a!==null)a.collapse(e.rangeParent,e.rangeOffset||0),t=a.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var Hr=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),co=Hr;var Lr=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),po=Lr;var Ar=()=>(0,Lt.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Lt.jsx)("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,Lt.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),mo=Ar;var Vr=()=>(0,Lt.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Lt.jsx)("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,Lt.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),uo=Vr;var _r=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),fo=_r;var Or=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),go=Or;var ho=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),bo=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),vo=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),xo=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),yo=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var de=X(require("react")),y=X(require("@radix-ui/react-dropdown-menu")),Re=require("@radix-ui/react-icons");var We=y.Root,Ge=y.Trigger;var zr=de.forwardRef(({className:e,inset:t,children:o,...r},a)=>(0,Lt.jsxs)(y.SubTrigger,{ref:a,className:b("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[o,(0,Lt.jsx)(Re.ChevronRightIcon,{className:"ml-auto"})]}));zr.displayName=y.SubTrigger.displayName;var Ur=de.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(y.SubContent,{ref:o,className:b("Lt-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Lt-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Ur.displayName=y.SubContent.displayName;var Le=de.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,Lt.jsx)(y.Portal,{children:(0,Lt.jsx)(y.Content,{ref:r,sideOffset:t,className:b("Lt-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Lt-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Le.displayName=y.Content.displayName;var Ae=de.forwardRef(({className:e,inset:t,...o},r)=>(0,Lt.jsx)(y.Item,{ref:r,className:b("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...o}));Ae.displayName=y.Item.displayName;var Br=de.forwardRef(({className:e,children:t,checked:o,...r},a)=>(0,Lt.jsxs)(y.CheckboxItem,{ref:a,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...r,children:[(0,Lt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Lt.jsx)(y.ItemIndicator,{children:(0,Lt.jsx)(Re.CheckIcon,{className:"h-4 w-4"})})}),t]}));Br.displayName=y.CheckboxItem.displayName;var Fr=de.forwardRef(({className:e,children:t,...o},r)=>(0,Lt.jsxs)(y.RadioItem,{ref:r,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,Lt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Lt.jsx)(y.ItemIndicator,{children:(0,Lt.jsx)(Re.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Fr.displayName=y.RadioItem.displayName;var $r=de.forwardRef(({className:e,inset:t,...o},r)=>(0,Lt.jsx)(y.Label,{ref:r,className:b("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));$r.displayName=y.Label.displayName;var Wr=de.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(y.Separator,{ref:o,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));Wr.displayName=y.Separator.displayName;var Gr=({className:e,...t})=>(0,Lt.jsx)("span",{className:b("ml-auto text-xs tracking-widest opacity-60",e),...t});Gr.displayName="DropdownMenuShortcut";var ht=1;function Kr(){return(0,Lt.jsx)("span",{className:"border border-[#222222]"})}function vt(){let[e]=(0,wo.useLexicalComposerContext)(),t=(0,Z.useRef)(null),[o,r]=(0,Z.useState)(!1),[a,i]=(0,Z.useState)(!1),[n,l]=(0,Z.useState)(!1),[v,N]=(0,Z.useState)(!1),[w,V]=(0,Z.useState)(!1),[P,_]=(0,Z.useState)(!1),[M,D]=(0,Z.useState)(!1),[u,R]=(0,Z.useState)(!1),[T,G]=(0,Z.useState)(!1),[C,j]=(0,Z.useState)("left"),[re,ne]=(0,Z.useState)("Lt"),J=d=>{e.update(()=>{let k=(0,h.$getSelection)();(0,h.$isRangeSelection)(k)&&(d==="Lt"?(0,bt.$setBlocksType)(k,()=>(0,h.$createParagraphNode)()):(0,bt.$setBlocksType)(k,()=>(0,ko.$createHeadingNode)(d)))})},pe=(0,Z.useCallback)(()=>{let d=(0,h.$getSelection)();if((0,h.$isRangeSelection)(d)){l(d.hasFormat("bold")),N(d.hasFormat("italic")),V(d.hasFormat("underline")),_(d.hasFormat("strikethrough")),D(d.hasFormat("subscript")),R(d.hasFormat("superscript"));let k=d.anchor.getNode(),O=k;for(;O&&!(0,h.$isParagraphNode)(O)&&O!==(0,h.$getRoot)();){let s=O.getParent();s&&(O=s)}if(O){let s=O.getFormatType();j(s||"left")}let ee=k.getTopLevelElement()?.__tag;ne(ee||"Lt")}},[]);(0,Z.useEffect)(()=>(0,Ve.mergeRegister)(e.registerUpdateListener(({editorState:d})=>{d.read(()=>{pe()})}),e.registerCommand(h.SELECTION_CHANGE_COMMAND,(d,k)=>(pe(),!1),ht),e.registerCommand(h.CAN_UNDO_COMMAND,d=>(r(d),!1),ht),e.registerCommand(h.CAN_REDO_COMMAND,d=>(i(d),!1),ht),(0,Ve.mergeRegister)(e.registerCommand(ct,d=>(e.update(()=>{let k=(0,h.$getSelection)()||(0,h.$getPreviousSelection)();if((0,h.$isRangeSelection)(k)){let O=Ne({id:d.id,fields:d.fields,relationTo:d.relationTo,value:d.value}),{focus:ee}=k,s=ee.getNode();(0,Ve.$insertNodeToNearestRoot)(O),(0,h.$isParagraphNode)(s)&&!s.__first&&s.remove()}}),!0),h.COMMAND_PRIORITY_EDITOR))),[e,pe]);let ve=[[{label:"Undo",icon:(0,Lt.jsx)(A.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(h.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,Lt.jsx)(A.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(h.UNDO_COMMAND,void 0)},disabled:!a}],[{label:"Bold",icon:(0,Lt.jsx)(co,{}),onClick:()=>{e.dispatchCommand(h.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:n},{label:"Italic",icon:(0,Lt.jsx)(po,{}),onClick:()=>{e.dispatchCommand(h.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:v},{label:"Underline",icon:(0,Lt.jsx)(mo,{}),onClick:()=>{e.dispatchCommand(h.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:w},{label:"Strikethrough",icon:(0,Lt.jsx)(uo,{}),onClick:()=>{e.dispatchCommand(h.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:P},{label:"Subscript",icon:(0,Lt.jsx)(fo,{}),onClick:()=>{e.dispatchCommand(h.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:M},{label:"Superscript",icon:(0,Lt.jsx)(go,{}),onClick:()=>{e.dispatchCommand(h.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:u}]],ae=[{label:"Left Align",direction:"left",icon:(0,Lt.jsx)(A.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(h.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Lt.jsx)(A.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(h.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Lt.jsx)(A.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(h.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Lt.jsx)(A.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(h.FORMAT_ELEMENT_COMMAND,"justify")}}],me=[{label:"Normal Text",value:"Lt",icon:(0,Lt.jsx)(ho,{}),onClick:()=>J("Lt")},{label:"Heading 1",value:"h1",icon:(0,Lt.jsx)(bo,{}),onClick:()=>J("h1")},{label:"Heading 2",value:"h2",icon:(0,Lt.jsx)(vo,{}),onClick:()=>J("h2")},{label:"Heading 3",value:"h3",icon:(0,Lt.jsx)(xo,{}),onClick:()=>J("h3")},{label:"Heading 4",value:"h4",icon:(0,Lt.jsx)(yo,{}),onClick:()=>J("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Lt.jsx)(A.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(je.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,Lt.jsx)(A.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(je.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],ue=[{label:"Insert Image",icon:(0,Lt.jsx)(A.ImageUp,{width:15,height:15}),onClick:()=>{G(!0)},disabled:!1}];return(0,Lt.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black Lt-50",children:(0,Lt.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[ve.map((d,k)=>(0,Lt.jsxs)(Z.Fragment,{children:[(0,Lt.jsx)("div",{className:"flex items-center gap-2",children:d.map((O,ee)=>(0,Lt.jsx)("div",{role:"button","aria-disabled":O.disabled||!1,onClick:O.onClick,className:b("Lt-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",O.active&&"bg-[#3c3c3c]"),"aria-label":O.label,children:(0,Lt.jsx)(Ue,{children:(0,Lt.jsxs)(Be,{children:[(0,Lt.jsx)(Fe,{className:"text-[#b5b5b5]",children:O.icon}),(0,Lt.jsx)(ke,{children:(0,Lt.jsx)("Lt",{children:O.label})})]})})},ee))}),(0,Lt.jsx)(Kr,{})]},`toolbar-option-${d.length}-${k}`)),(0,Lt.jsxs)(We,{children:[(0,Lt.jsxs)(Ge,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[ae.find(d=>d.direction===C)?.icon,ae.find(d=>d.direction===C)?.label,(0,Lt.jsx)(A.ChevronDown,{width:15,height:15})]}),(0,Lt.jsx)(Le,{className:"bg-black hover:bg-black",children:ae.map((d,k)=>(0,Lt.jsxs)(Ae,{onClick:d.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Lt.jsx)("span",{children:d.icon}),(0,Lt.jsx)("span",{children:d.label})]},`${d.label}-${k}`))})]}),(0,Lt.jsxs)(We,{children:[(0,Lt.jsxs)(Ge,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[me.find(d=>d.value===re)?.icon,me.find(d=>d.value===re)?.label,(0,Lt.jsx)(A.ChevronDown,{width:15,height:15})]}),(0,Lt.jsx)(Le,{className:"bg-black hover:bg-black",children:me.map((d,k)=>(0,Lt.jsxs)(Ae,{onClick:d.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Lt.jsx)("span",{children:d.icon}),(0,Lt.jsx)("span",{children:d.label})]},`heading-option-${d.label}-${k}`))})]}),(0,Lt.jsxs)(We,{children:[(0,Lt.jsxs)(Ge,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[(0,Lt.jsx)(A.Plus,{width:15,height:15}),(0,Lt.jsx)(A.ChevronDown,{width:15,height:15})]}),(0,Lt.jsx)(Le,{className:"bg-black hover:bg-black",children:ue.map((d,k)=>(0,Lt.jsxs)(Ae,{onClick:d.onClick,disabled:d.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Lt.jsx)("span",{children:d.icon}),(0,Lt.jsx)("span",{children:d.label})]},k))})]}),T&&(0,Lt.jsx)(so,{activeEditor:e,onClose:()=>{G(!1)},isOpen:T})]})})}var jr=({setValue:e,value:t,name:o,editable:r=!0})=>{let[a]=(0,wo.useLexicalComposerContext)(),i=n=>{n.read(()=>{let l=n.toJSON();e?.(()=>l)})};return(0,Z.useEffect)(()=>{a.setEditable(r)},[r]),(0,Z.useEffect)(()=>{t&&a.update(()=>{a.setEditorState(a.parseEditorState(t))})},[]),(0,Lt.jsx)("div",{className:"w-full",children:(0,Lt.jsxs)("div",{className:" ",children:[r&&(0,Lt.jsx)(vt,{}),(0,Lt.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,Lt.jsx)(Mo.RichTextPlugin,{contentEditable:(0,Lt.jsx)(Po.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Do.LexicalErrorBoundary}),r&&(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsx)(So.HistoryPlugin,{}),(0,Lt.jsx)(No.AutoFocusPlugin,{}),(0,Lt.jsx)(To.ListPlugin,{}),(0,Lt.jsx)(Io.OnChangePlugin,{onChange:i}),(0,Lt.jsx)(dt,{})]})]})]})})},Zr=({setValue:e,value:t,name:o,editable:r=!0})=>(0,Lt.jsx)(Ro.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[je.ListNode,je.ListItemNode,ko.HeadingNode,Ie],onError(i){throw console.error("Lexical error:",i),i},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,Lt.jsx)(jr,{value:t,setValue:e,name:o,editable:r})}),Ho=Zr;function Jr({document:e,onSave:t,mode:o="edit",onCancel:r,availableDocuments:a=[],knowledgeContexts:i=[]}){let[n,l]=(0,Z.useState)({...e,updatedAt:new Date}),[v,N]=(0,Z.useState)(!1),[w,V]=(0,Z.useState)(n.richTextContent),[P,_]=(0,Z.useState)(!1),M=(0,Z.useRef)(null),D=(0,Z.useRef)(""),u=(0,Z.useRef)(null),R=(0,Z.useRef)(null),T=s=>{let f=new WeakSet,m=L=>L&&typeof L=="object"?f.has(L)?null:(f.add(L),Array.isArray(L)?L.map(m):Object.keys(L).sort().reduce((B,xe)=>(B[xe]=m(L[xe]),B),{})):L;return JSON.stringify(m(s))},G=s=>s?s.replace(/\s+/g," ").trim():"",C=()=>n.format==="richText"?T(w):G(n.content),j=()=>{let s={title:G(n.title),description:G(n.description),format:n.format,content:C()},f=T(s),m=5381;for(let L=0;L<f.length;L++)m=m*33^f.charCodeAt(L);return(m>>>0).toString(16)},re=(s,f)=>{if(s===f)return!1;if(n.format!=="richText"){let m=J(s),L=C();if(m==null)return!0;let B=m.length,xe=L.length,Pe=Math.abs(xe-B),_e=B===0?1:Pe/B;return G(m)===G(L)&&Pe<3?!1:Pe>=10||_e>=.02}return!0},ne=(0,Z.useRef)(new Map),J=s=>{let f=ne.current.get(s);return f==null?null:"x".repeat(f)};(0,Z.useEffect)(()=>(R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{let s=j(),f=D.current;if(re(f,s)&&(_(!0),t({...n,richTextContent:w},"autosave"),D.current=s,n.format!=="richText")){let m=C();ne.current.set(s,m.length)}},800),()=>{R.current&&clearTimeout(R.current)}),[n.title,n.description,n.format,n.content,n.metadata,w]),(0,Z.useEffect)(()=>{let s=()=>{let f=j();f!==D.current&&(t({...n,richTextContent:w},"autosave"),D.current=f)};return window.addEventListener("pagehide",s),window.addEventListener("beforeunload",s),()=>{window.removeEventListener("pagehide",s),window.removeEventListener("beforeunload",s)}},[n,w]),(0,Z.useEffect)(()=>(P&&(u.current=setTimeout(()=>{_(!1)},2e3)),()=>{u.current&&clearTimeout(u.current)}),[P]),(0,Z.useEffect)(()=>{l(e)},[e]);let pe=s=>{switch(s){case"markdown":case"mdx":return(0,Lt.jsx)(A.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Lt.jsx)(A.File,{className:"h-6 w-6 text-success"});case"text":return(0,Lt.jsx)(A.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Lt.jsx)(A.File,{className:"h-6 w-6 text-muted-foreground"})}},ve=s=>{switch(s){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},ae=()=>{let s=new Set,f=new Set;return i.forEach(m=>{m.menuConfig.groupBy.forEach(L=>s.add(L))}),a.forEach(m=>{m.metadata&&Object.keys(m.metadata).forEach(L=>f.add(L))}),{contextKeys:Array.from(s).sort(),documentKeys:Array.from(f).sort(),allKeys:Array.from(new Set([...s,...f])).sort()}},S=s=>{let f=new Set;return a.forEach(m=>{m.metadata?.[s]&&f.add(String(m.metadata[s]))}),Array.from(f).sort()},me=ae(),ue=()=>{t({...n,richTextContent:w},"autosave")},d=(s,f)=>{l(m=>({...m,metadata:{...m.metadata,[s]:f}}))},k=(s,f)=>{f==="__custom__"?d(s,""):d(s,f)},O=()=>{d("","")},ee=s=>{l(f=>{let m={...f.metadata};return delete m[s],{...f,metadata:m}})};return(0,Lt.jsxs)(yt.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Lt.jsxs)("div",{className:"border-b border-border bg-card Lt-8 pb-6",children:[(0,Lt.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Lt.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Lt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Lt.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,Lt.jsx)("div",{className:"flex-1 min-w-0",children:(0,Lt.jsx)(rt,{fieldName:"title",value:n.title,label:"",onSave:(s,f)=>l(m=>({...m,title:f})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:Lt-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Lt.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${ve(n.format)} flex-shrink-0 Lt-1`,children:n.format.toUpperCase()})]}),(0,Lt.jsx)("div",{className:"Lt-2",children:(0,Lt.jsx)(rt,{fieldName:"description",value:n.description||"Click to add description...",label:"",multiline:!0,onSave:(s,f)=>l(m=>({...m,description:f})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:Lt-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,Lt.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Lt.jsxs)(se,{variant:"ghost",size:"sm",onClick:()=>N(!v),className:"gap-2",children:[(0,Lt.jsx)(A.Info,{className:"h-4 w-4"}),"Metadata",n.metadata&&Object.keys(n.metadata).length>0&&(0,Lt.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 text-xs font-medium bg-primary/10 text-primary rounded-full",children:Object.keys(n.metadata).length}),v?(0,Lt.jsx)(A.ChevronDown,{className:"h-4 w-4"}):(0,Lt.jsx)(A.ChevronRight,{className:"h-4 w-4"})]}),(0,Lt.jsxs)(se,{variant:"outline",size:"sm",onClick:r,className:"gap-2",children:[(0,Lt.jsx)(A.X,{className:"h-4 w-4"}),"Close"]}),(0,Lt.jsxs)(se,{size:"sm",onClick:ue,className:"gap-2",disabled:P,children:[P?(0,Lt.jsx)(A.Loader2,{className:"h-4 w-4 animate-spin"}):(0,Lt.jsx)(A.Save,{className:"h-4 w-4"}),P?"Auto-saving...":"Save"]})]})]}),(0,Lt.jsx)(yt.motion.div,{initial:!1,animate:{height:v?"auto":0,opacity:v?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:(0,Lt.jsxs)("div",{className:"pt-4 border-t border-border Lt-4 max-h-full flex gap-2",children:[(0,Lt.jsx)("div",{className:"flex items-center justify-between mb-3",children:(0,Lt.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,Lt.jsx)(A.Info,{className:"h-4 w-4"}),"Document Metadata"]})}),(0,Lt.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Lt.jsx)("div",{className:"bg-muted rounded-lg Lt-4 border border-border",children:n.metadata&&Object.keys(n.metadata).length>0?(0,Lt.jsx)("div",{className:"space-y-2",children:Object.entries(n.metadata).map(([s,f],m)=>{let L=S(s);return(0,Lt.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Lt.jsx)(le,{value:s,onChange:B=>{let xe=B.target.value||"",Pe=n.metadata?.[s];l(_e=>{let Ze={..._e.metadata};return delete Ze[s],xe&&(Ze[xe]=Pe||""),{..._e,metadata:Ze}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${s}`}),(0,Lt.jsx)("datalist",{id:`metadata-keys-${s}`,children:me.allKeys.map(B=>(0,Lt.jsx)("option",{value:B},B))}),(0,Lt.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),L.length>0?(0,Lt.jsxs)(zt,{value:String(f||""),onValueChange:B=>k(s,B),children:[(0,Lt.jsx)(Ye,{className:"flex-1 h-8 text-sm",children:(0,Lt.jsx)(Ut,{placeholder:"Value"})}),(0,Lt.jsxs)(Qe,{children:[L.map(B=>(0,Lt.jsx)(ze,{value:B,children:B},B)),(0,Lt.jsx)(ze,{value:"__custom__",children:(0,Lt.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,Lt.jsx)(le,{value:String(f||""),onChange:B=>d(s,B.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Lt.jsx)(se,{type:"button",variant:"ghost",size:"sm",onClick:()=>ee(s),className:"h-8 w-8 Lt-0 text-muted-foreground hover:text-destructive",children:(0,Lt.jsx)(A.X,{className:"h-3 w-3"})})]},`metadata-key-${m}`)})}):(0,Lt.jsxs)("div",{className:"text-center py-4",children:[(0,Lt.jsx)("Lt",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),(0,Lt.jsx)("Lt",{className:"text-xs text-muted-foreground",children:'Click "Add Field" to create metadata'})]})}),(0,Lt.jsxs)(se,{type:"button",variant:"outline",size:"sm",onClick:O,className:"gap-1 h-8",children:[(0,Lt.jsx)(A.Plus,{className:"h-3 w-3"}),"Add Field"]})]})]})})]}),(0,Lt.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Lt.jsx)("div",{className:"Lt-8 pt-0 h-full max-h-full overflow-auto",children:n.format==="richText"?(0,Lt.jsx)(Ho,{setValue:V,value:w,name:"richTextContent"}):(0,Lt.jsx)(Me,{value:n.content||"",onChange:s=>l(f=>({...f,content:s.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}0&&(module.exports={DocumentEdit});
4
+ "use strict";"use client";var Lo=Object.create;var ze=Object.defineProperty;var Ao=Object.getOwnPropertyDescriptor;var Vo=Object.getOwnPropertyNames;var Oo=Object.getPrototypeOf,_o=Object.prototype.hasOwnProperty;var zo=(e,t)=>{for(var o in t)ze(e,o,{get:t[o],enumerable:!0})},wt=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Vo(t))!_o.call(e,i)&&i!==o&&ze(e,i,{get:()=>t[i],enumerable:!(r=Ao(t,i))||r.enumerable});return e};var X=(e,t,o)=>(o=e!=null?Lo(Oo(e)):{},wt(t||!e||!e.__esModule?ze(o,"default",{value:e,enumerable:!0}):o,e)),Uo=e=>wt(ze({},"__esModule",{value:!0}),e);var Xr={};zo(Xr,{DocumentEdit:()=>Jr});module.exports=Uo(Xr);var yt=require("motion/react"),A=require("lucide-react"),Z=require("react");var kt=require("clsx");var Ye="-",Bo=e=>{let t=$o(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:n=>{let s=n.split(Ye);return s[0]===""&&s.length!==1&&s.shift(),Rt(s,t)||Fo(n)},getConflictingClassGroupIds:(n,s)=>{let g=o[n]||[];return s&&r[n]?[...g,...r[n]]:g}}},Rt=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),i=r?Rt(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(Ye);return t.validators.find(({validator:n})=>n(a))?.classGroupId},Ct=/^\[(.+)\]$/,Fo=e=>{if(Ct.test(e)){let t=Ct.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},$o=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return Go(Object.entries(e.classGroups),o).forEach(([a,n])=>{qe(n,r,a,t)}),r},qe=(e,t,o,r)=>{e.forEach(i=>{if(typeof i=="string"){let a=i===""?t:Nt(t,i);a.classGroupId=o;return}if(typeof i=="function"){if(Wo(i)){qe(i(r),t,o,r);return}t.validators.push({validator:i,classGroupId:o});return}Object.entries(i).forEach(([a,n])=>{qe(n,Nt(t,a),o,r)})})},Nt=(e,t)=>{let o=e;return t.split(Ye).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},Wo=e=>e.isThemeGetter,Go=(e,t)=>t?e.map(([o,r])=>{let i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([n,s])=>[t+n,s])):a);return[o,i]}):e,Ko=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,i=(a,n)=>{o.set(a,n),t++,t>e&&(t=0,r=o,o=new Map)};return{get(a){let n=o.get(a);if(n!==void 0)return n;if((n=r.get(a))!==void 0)return i(a,n),n},set(a,n){o.has(a)?o.set(a,n):i(a,n)}}},Pt="!",jo=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,i=t[0],a=t.length,n=s=>{let g=[],N=0,w=0,V;for(let u=0;u<s.length;u++){let R=s[u];if(N===0){if(R===i&&(r||s.slice(u,u+a)===t)){g.push(s.slice(w,u)),w=u+a;continue}if(R==="/"){V=u;continue}}R==="["?N++:R==="]"&&N--}let P=g.length===0?s:s.substring(w),O=P.startsWith(Pt),M=O?P.substring(1):P,S=V&&V>w?V-w:void 0;return{modifiers:g,hasImportantModifier:O,baseClassName:M,maybePostfixModifierPosition:S}};return o?s=>o({className:s,parseClassName:n}):n},Zo=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(r=>{r[0]==="["?(t.push(...o.sort(),r),o=[]):o.push(r)}),t.push(...o.sort()),t},Jo=e=>({cache:Ko(e.cacheSize),parseClassName:jo(e),...Bo(e)}),Xo=/\s+/,qo=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],n=e.trim().split(Xo),s="";for(let g=n.length-1;g>=0;g-=1){let N=n[g],{modifiers:w,hasImportantModifier:V,baseClassName:P,maybePostfixModifierPosition:O}=o(N),M=!!O,S=r(M?P.substring(0,O):P);if(!S){if(!M){s=N+(s.length>0?" "+s:s);continue}if(S=r(P),!S){s=N+(s.length>0?" "+s:s);continue}M=!1}let u=Zo(w).join(":"),R=V?u+Pt:u,T=R+S;if(a.includes(T))continue;a.push(T);let G=i(S,M);for(let C=0;C<G.length;++C){let j=G[C];a.push(R+j)}s=N+(s.length>0?" "+s:s)}return s};function Yo(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=St(t))&&(r&&(r+=" "),r+=o);return r}var St=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=St(e[r]))&&(o&&(o+=" "),o+=t);return o};function Qo(e,...t){let o,r,i,a=n;function n(g){let N=t.reduce((w,V)=>V(w),e());return o=Jo(N),r=o.cache.get,i=o.cache.set,a=s,s(g)}function s(g){let N=r(g);if(N)return N;let w=qo(g,o);return i(g,w),w}return function(){return a(Yo.apply(null,arguments))}}var E=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Dt=/^\[(?:([a-Lt-]+):)?(.+)\]$/i,er=/^\d+\/\d+$/,tr=new Set(["px","full","screen"]),or=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ir=/^(inset_)?-?((\d+)?\.?(\d+)[a-Lt]+|0)_-?((\d+)?\.?(\d+)[a-Lt]+|0)/,ar=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ae=e=>we(e)||tr.has(e)||er.test(e),fe=e=>Ce(e,"length",fr),we=e=>!!e&&!Number.isNaN(Number(e)),Xe=e=>Ce(e,"number",we),Se=e=>!!e&&Number.isInteger(Number(e)),sr=e=>e.endsWith("%")&&we(e.slice(0,-1)),h=e=>Dt.test(e),ge=e=>or.test(e),lr=new Set(["length","size","percentage"]),cr=e=>Ce(e,lr,Mt),dr=e=>Ce(e,"position",Mt),pr=new Set(["image","url"]),mr=e=>Ce(e,pr,hr),ur=e=>Ce(e,"",gr),De=()=>!0,Ce=(e,t,o)=>{let r=Dt.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},fr=e=>rr.test(e)&&!nr.test(e),Mt=()=>!1,gr=e=>ir.test(e),hr=e=>ar.test(e);var br=()=>{let e=E("colors"),t=E("spacing"),o=E("blur"),r=E("brightness"),i=E("borderColor"),a=E("borderRadius"),n=E("borderSpacing"),s=E("borderWidth"),g=E("contrast"),N=E("grayscale"),w=E("hueRotate"),V=E("invert"),P=E("gap"),O=E("gradientColorStops"),M=E("gradientColorStopPositions"),S=E("inset"),u=E("margin"),R=E("opacity"),T=E("padding"),G=E("saturate"),C=E("scale"),j=E("sepia"),re=E("skew"),ne=E("space"),J=E("translate"),pe=()=>["auto","contain","none"],ve=()=>["auto","hidden","clip","visible","scroll"],ie=()=>["auto",h,t],D=()=>[h,t],me=()=>["",ae,fe],ue=()=>["auto",we,h],d=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["solid","dashed","dotted","double","none"],_=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>["start","end","center","between","around","evenly","stretch"],l=()=>["","0",h],f=()=>["auto","avoid","all","avoid-page","page","left","right","column"],m=()=>[we,h];return{cacheSize:500,separator:":",theme:{colors:[De],spacing:[ae,fe],blur:["none","",ge,h],brightness:m(),borderColor:[e],borderRadius:["none","","full",ge,h],borderSpacing:D(),borderWidth:me(),contrast:m(),grayscale:l(),hueRotate:m(),invert:l(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[sr,fe],inset:ie(),margin:ie(),opacity:m(),padding:D(),saturate:m(),scale:m(),sepia:l(),skew:m(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",h]}],container:["container"],columns:[{columns:[ge]}],"break-after":[{"break-after":f()}],"break-before":[{"break-before":f()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...d(),h]}],overflow:[{overflow:ve()}],"overflow-x":[{"overflow-x":ve()}],"overflow-y":[{"overflow-y":ve()}],overscroll:[{overscroll:pe()}],"overscroll-x":[{"overscroll-x":pe()}],"overscroll-y":[{"overscroll-y":pe()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],Lt:[{Lt:["auto",Se,h]}],basis:[{basis:ie()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",h]}],grow:[{grow:l()}],shrink:[{shrink:l()}],order:[{order:["first","last","none",Se,h]}],"grid-cols":[{"grid-cols":[De]}],"col-start-end":[{col:["auto",{span:["full",Se,h]},h]}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":[De]}],"row-start-end":[{row:["auto",{span:[Se,h]},h]}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",h]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",h]}],gap:[{gap:[P]}],"gap-x":[{"gap-x":[P]}],"gap-y":[{"gap-y":[P]}],"justify-content":[{justify:["normal",...ee()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ee(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ee(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],Lt:[{Lt:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],me:[{me:[u]}],mt:[{mt:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[ne]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ne]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",h,t]}],"min-w":[{"min-w":[h,t,"min","max","fit"]}],"max-w":[{"max-w":[h,t,"none","full","min","max","fit","prose",{screen:[ge]},ge]}],h:[{h:[h,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[h,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ge,fe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xe]}],"font-family":[{font:[De]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",h]}],"line-clamp":[{"line-clamp":["none",we,Xe]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ae,h]}],"list-image":[{"list-image":["none",h]}],"list-style-type":[{list:["none","disc","decimal",h]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[R]}],"text-decoration":["underline","overline","line-through","wo-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ae,fe]}],"underline-offset":[{"underline-offset":["auto",ae,h]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[R]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...d(),dr]}],"bg-repeat":[{bg:["wo-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[M]}],"gradient-via-pos":[{via:[M]}],"gradient-to-pos":[{to:[M]}],"gradient-from":[{from:[O]}],"gradient-via":[{via:[O]}],"gradient-to":[{to:[O]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[R]}],"border-style":[{border:[...k(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[R]}],"divide-style":[{divide:k()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...k()]}],"outline-offset":[{"outline-offset":[ae,h]}],"outline-w":[{outline:[ae,fe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[ae,fe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ge,ur]}],"shadow-color":[{shadow:[De]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[..._(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",ge,h]}],grayscale:[{grayscale:[N]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[V]}],saturate:[{saturate:[G]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[N]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[V]}],"backdrop-opacity":[{"backdrop-opacity":[R]}],"backdrop-saturate":[{"backdrop-saturate":[G]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",h]}],duration:[{duration:m()}],ease:[{ease:["linear","in","out","in-out",h]}],delay:[{delay:m()}],animate:[{animate:["none","spin","ping","pulse","bounce",h]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Se,h]}],"translate-x":[{"translate-x":[J]}],"translate-y":[{"translate-y":[J]}],"skew-x":[{"skew-x":[re]}],"skew-y":[{"skew-y":[re]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",h]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","wo-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-Lt":[{"scroll-Lt":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ae,fe,Xe]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],Lt:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-Lt":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Tt=Qo(br);function v(...e){return Tt((0,kt.clsx)(e))}var Et=require("@radix-ui/react-slot"),It=require("class-variance-authority"),Ht=X(require("react")),Lt=require("react/jsx-runtime"),vr=(0,It.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),se=Ht.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...i},a)=>(0,Lt.jsx)(e?Et.Slot:"button",{className:v(vr({className:t,size:o,variant:r})),ref:a,...i}));se.displayName="Button";var At=X(require("react")),Me=At.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)("textarea",{className:v("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));Me.displayName="Textarea";var Ot=X(require("react"));var le=Ot.forwardRef(({className:e,type:t,...o},r)=>(0,Lt.jsx)("input",{type:t,className:v("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...o}));le.displayName="Input";var x=X(require("@radix-ui/react-select")),he=X(require("react")),zt=x.Root;var Ut=x.Value,Qe=he.forwardRef(({children:e,className:t,...o},r)=>(0,Lt.jsxs)(x.Trigger,{className:v("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:r,...o,children:[e,(0,Lt.jsx)(x.Icon,{asChild:!0,children:(0,Lt.jsx)(A.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Qe.displayName=x.Trigger.displayName;var Bt=he.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(x.ScrollUpButton,{className:v("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Lt.jsx)(A.ChevronUp,{className:"h-4 w-4"})}));Bt.displayName=x.ScrollUpButton.displayName;var Ft=he.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(x.ScrollDownButton,{className:v("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Lt.jsx)(A.ChevronDown,{className:"h-4 w-4"})}));Ft.displayName=x.ScrollDownButton.displayName;var et=he.forwardRef(({children:e,className:t,position:o="popper",...r},i)=>(0,Lt.jsx)(x.Portal,{children:(0,Lt.jsxs)(x.Content,{className:v("relative Lt-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:i,...r,children:[(0,Lt.jsx)(Bt,{}),(0,Lt.jsx)(x.Viewport,{className:v("Lt-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Lt.jsx)(Ft,{})]})}));et.displayName=x.Content.displayName;var xr=he.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(x.Label,{className:v("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));xr.displayName=x.Label.displayName;var Ue=he.forwardRef(({children:e,className:t,...o},r)=>(0,Lt.jsxs)(x.Item,{className:v("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:r,...o,children:[(0,Lt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Lt.jsx)(x.ItemIndicator,{children:(0,Lt.jsx)(A.Check,{className:"h-4 w-4"})})}),(0,Lt.jsx)(x.ItemText,{children:e})]}));Ue.displayName=x.Item.displayName;var yr=he.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(x.Separator,{className:v("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));yr.displayName=x.Separator.displayName;var $t=X(require("react")),tt=X(require("@radix-ui/react-label"));var wr=(0,It.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ot=$t.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(tt.Root,{ref:o,className:v(wr(),e),...t}));ot.displayName=tt.Root.displayName;var nt=({fieldName:e,value:t,label:o,multiline:r=!1,onSave:i,className:a="",disabled:n=!1})=>{let[s,g]=(0,Z.useState)(!1),[N,w]=(0,Z.useState)(""),V=()=>{n||(g(!0),w(t))},P=async()=>{N!==t&&await i(e,N),g(!1)},O=M=>{M.key==="Enter"&&!r||M.key==="Enter"&&M.ctrlKey&&r?P():M.key==="Escape"&&(g(!1),w(""))};return(0,Lt.jsxs)("div",{className:`space-y-2 ${a}`,children:[(0,Lt.jsx)(ot,{children:o}),s?r?(0,Lt.jsx)(Me,{value:N,onChange:M=>w(M.target.value),onBlur:P,onKeyDown:O,autoFocus:!0,rows:4,className:"resize-none"}):(0,Lt.jsx)(le,{value:N,onChange:M=>w(M.target.value),onBlur:P,onKeyPress:O,autoFocus:!0,className:"text-lg font-medium"}):(0,Lt.jsxs)("div",{onClick:V,className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 Lt-2 rounded border border-transparent hover:border-border transition-colors group ${r?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,Lt.jsx)("span",{className:r?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!n&&(0,Lt.jsx)(A.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var No=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),Ro=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Po=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),So=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),Do=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),Mo=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),To=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Ze=require("@payloadcms/richtext-lexical/lexical/list"),ko=require("@payloadcms/richtext-lexical/lexical/rich-text"),Eo=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var wo=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Ve=require("@payloadcms/richtext-lexical/lexical/utils"),b=require("@payloadcms/richtext-lexical/lexical"),vt=require("@payloadcms/richtext-lexical/lexical/selection");var Te=X(require("react")),F=X(require("@radix-ui/react-dialog"));var Zt=F.Root;var Cr=F.Portal;var Jt=Te.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(F.Overlay,{ref:o,className:v("fixed inset-0 Lt-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Jt.displayName=F.Overlay.displayName;var it=Te.forwardRef(({className:e,children:t,...o},r)=>(0,Lt.jsxs)(Cr,{children:[(0,Lt.jsx)(Jt,{}),(0,Lt.jsxs)(F.Content,{ref:r,className:v("fixed left-[50%] top-[50%] Lt-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background Lt-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,Lt.jsxs)(F.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,Lt.jsx)(A.X,{className:"h-4 w-4"}),(0,Lt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));it.displayName=F.Content.displayName;var at=({className:e,...t})=>(0,Lt.jsx)("div",{className:v("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});at.displayName="DialogHeader";var Nr=({className:e,...t})=>(0,Lt.jsx)("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Nr.displayName="DialogFooter";var st=Te.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(F.Title,{ref:o,className:v("text-lg font-semibold leading-none tracking-tight",e),...t}));st.displayName=F.Title.displayName;var Rr=Te.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(F.Description,{ref:o,className:v("text-sm text-muted-foreground",e),...t}));Rr.displayName=F.Description.displayName;var ao=require("@radix-ui/react-dialog"),We=require("@payloadcms/richtext-lexical/client");var ct=X(require("bson-objectid"));var qt=require("@payloadcms/ui");var Xt=X(require("react")),te=X(require("@radix-ui/react-tooltip"));var Be=te.Provider,Fe=te.Root,$e=te.Trigger,ke=Xt.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,Lt.jsx)(te.Portal,{children:(0,Lt.jsx)(te.Content,{ref:r,sideOffset:t,className:v("Lt-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));ke.displayName=te.Content.displayName;var Pr=e=>{let{data:{relationTo:t,value:o},nodeKey:r}=e,[i]=(0,wo.useLexicalComposerContext)(),[a,n]=(0,Z.useState)(""),[s,g]=(0,Z.useState)(""),[N,w]=(0,Z.useState)(""),V=async u=>{console.log("fetchMedia",u)};(0,Z.useEffect)(()=>{typeof o=="string"?o.length===24?V(o):(n(o||""),w(S(M())),g(O()||"")):typeof o=="object"&&(n(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),w(S(o.filesize)),g(o.mimeType?.split("/")[1]||""))},[]);let P=(0,Z.useCallback)(()=>{i.update(()=>{(0,b.$getNodeByKey)(r)?.remove()})},[i,r]),O=()=>{let u=e.data.value;return typeof u=="string"?u.split(";base64")[0]?.split("image/")[1]:""},M=()=>{let u=e.data.value;if(typeof u=="string"){let R=u.split(",")[1]?.length||0;return 4*Math.ceil(R/3)*.5624896334383812/1e3}return 0};function S(u){if(u>=1e6){let T=u/1e6;return`${T>=10?Math.round(T).toString():T.toFixed(1)} MB`}return`${Math.floor(u/1e3)} KB`}return(0,$.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,$.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,$.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,$.jsx)("div",{className:"flex-1",children:e.data.value?(0,$.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":o,"data-lexical-upload-relation-to":t,src:a}):(0,$.jsx)(qt.File,{})}),(0,$.jsx)(Be,{children:(0,$.jsxs)(Fe,{children:[(0,$.jsxs)($e,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,$.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,$.jsx)("button",{onClick:u=>{u.preventDefault(),P()},className:"flex-1 flex justify-center items-center",children:(0,$.jsx)(A.X,{width:24,height:24,strokeWidth:1})})]}),(0,$.jsx)(ke,{children:(0,$.jsx)("span",{children:"Remove image"})})]})})]}),(0,$.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,$.jsx)("span",{className:"",children:s?.toLocaleUpperCase()}),(0,$.jsx)("span",{children:N})]})]})})},to=Pr;function Sr(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let o=e.getAttribute("data-lexical-upload-id");if(o)return{node:Ne({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var Ee=class extends We.UploadNode{static importDOM(){return{img:()=>({conversion:Sr,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new ct.default().toHexString(),t.version=3);let o={id:t.id??new ct.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},r=Ne(o);return r.setFormat?.(t.format),r}decorate(){return(0,Lt.jsx)(to,{data:this.__data,nodeKey:this.getKey()})}};function Ne(e){return new Ee({data:e})}var Dr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Mr=e=>Dr?(e||window).getSelection():null,zn=(0,b.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),dt=(0,b.createCommand)("INSERT_UPLOAD_COMMAND");function so({activeEditor:e,onClose:t,isOpen:o=!1}){let r=(0,Z.useRef)(!1),[i,a]=(0,Z.useState)(!0),[n,s]=(0,Z.useState)(""),[g,N]=(0,Z.useState)(""),[w,V]=(0,Z.useState)(!1),[P,O]=(0,Z.useState)("left"),M=n==="",S=C=>{V(C.target.checked)},u=C=>{O(C.target.value)},R=C=>{let j=new FileReader;j.onload=function(){return typeof j.result=="string"&&s(j.result),""},C!==null&&C[0]&&j.readAsDataURL(C[0])};(0,Z.useEffect)(()=>{r.current=!1;let C=j=>{r.current=j.altKey};return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C)}},[e]),(0,Z.useEffect)(()=>{i||t()},[i]),(0,Z.useEffect)(()=>{a(o)},[o]);let T=({editor:C,relationTo:j,replaceNodeKey:re,value:ne})=>{if(re)C.update(()=>{let J=(0,b.$getNodeByKey)(re);J&&J.replace(Ne({id:"",fields:{},relationTo:"media",value:ne}))});else{let J=C.dispatchCommand(dt,{fields:null,relationTo:"media",value:ne})}},G=()=>{T({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:g,src:n,showCaption:w,position:P}.src}),a(!1),t()};return(0,Lt.jsx)(Zt,{open:i,onOpenChange:C=>a(C),children:(0,Lt.jsxs)(it,{children:[(0,Lt.jsxs)(at,{children:[(0,Lt.jsx)(st,{children:"Upload Image"}),(0,Lt.jsx)(ao.DialogDescription,{children:"Description"})]}),(0,Lt.jsxs)("div",{className:"",children:[(0,Lt.jsx)("div",{style:{marginBottom:"1em"},children:(0,Lt.jsx)(le,{type:"file",onChange:C=>R(C.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,Lt.jsx)("div",{style:{marginBottom:"1em"},children:(0,Lt.jsx)(le,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:C=>N(C.currentTarget.value),value:g,"data-test-id":"image-modal-alt-text-input"})}),(0,Lt.jsx)(se,{"data-test-id":"image-modal-file-upload-btn",disabled:M,onClick:()=>G(),children:"Confirm"})]})]})})}function pt({captionsEnabled:e}){let[t]=(0,wo.useLexicalComposerContext)();return(0,Z.useEffect)(()=>{if(!t.hasNodes([We.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,Ve.mergeRegister)(t.registerCommand(b.DRAGSTART_COMMAND,o=>Tr(o),b.COMMAND_PRIORITY_HIGH),t.registerCommand(b.DRAGOVER_COMMAND,o=>kr(o),b.COMMAND_PRIORITY_LOW),t.registerCommand(b.DROP_COMMAND,o=>Er(o,t),b.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Tr(e){if(!mt())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","_"),!0):!1}function kr(e){return mt()?(lo(e)||e.preventDefault(),!0):!1}function Er(e,t){let o=mt();if(!o)return!1;if(e.preventDefault(),lo(e)){let r=Ir(e);o.remove();let i=(0,b.$createRangeSelection)();r!=null&&i.applyDOMRange(r),(0,b.$setSelection)(i)}return!0}function mt(){let e=(0,b.$getSelection)();if(!(0,b.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,We.$isUploadNode)(o)?o:null}function lo(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function Ir(e){let t,o=e.target,r=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,i=Mr(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&i!==null)i.collapse(e.rangeParent,e.rangeOffset||0),t=i.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var Hr=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),co=Hr;var Lr=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),po=Lr;var Ar=()=>(0,Lt.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Lt.jsx)("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,Lt.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),mo=Ar;var Vr=()=>(0,Lt.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Lt.jsx)("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,Lt.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),uo=Vr;var Or=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),fo=Or;var _r=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),go=_r;var ho=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),bo=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),vo=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),xo=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),yo=()=>(0,Lt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Lt.jsx)("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var de=X(require("react")),y=X(require("@radix-ui/react-dropdown-menu")),Re=require("@radix-ui/react-icons");var Ge=y.Root,Ke=y.Trigger;var zr=de.forwardRef(({className:e,inset:t,children:o,...r},i)=>(0,Lt.jsxs)(y.SubTrigger,{ref:i,className:v("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[o,(0,Lt.jsx)(Re.ChevronRightIcon,{className:"ml-auto"})]}));zr.displayName=y.SubTrigger.displayName;var Ur=de.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(y.SubContent,{ref:o,className:v("Lt-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Lt-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Ur.displayName=y.SubContent.displayName;var Le=de.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,Lt.jsx)(y.Portal,{children:(0,Lt.jsx)(y.Content,{ref:r,sideOffset:t,className:v("Lt-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Lt-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Le.displayName=y.Content.displayName;var Ae=de.forwardRef(({className:e,inset:t,...o},r)=>(0,Lt.jsx)(y.Item,{ref:r,className:v("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...o}));Ae.displayName=y.Item.displayName;var Br=de.forwardRef(({className:e,children:t,checked:o,...r},i)=>(0,Lt.jsxs)(y.CheckboxItem,{ref:i,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...r,children:[(0,Lt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Lt.jsx)(y.ItemIndicator,{children:(0,Lt.jsx)(Re.CheckIcon,{className:"h-4 w-4"})})}),t]}));Br.displayName=y.CheckboxItem.displayName;var Fr=de.forwardRef(({className:e,children:t,...o},r)=>(0,Lt.jsxs)(y.RadioItem,{ref:r,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,Lt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Lt.jsx)(y.ItemIndicator,{children:(0,Lt.jsx)(Re.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Fr.displayName=y.RadioItem.displayName;var $r=de.forwardRef(({className:e,inset:t,...o},r)=>(0,Lt.jsx)(y.Label,{ref:r,className:v("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));$r.displayName=y.Label.displayName;var Wr=de.forwardRef(({className:e,...t},o)=>(0,Lt.jsx)(y.Separator,{ref:o,className:v("-mx-1 my-1 h-px bg-muted",e),...t}));Wr.displayName=y.Separator.displayName;var Gr=({className:e,...t})=>(0,Lt.jsx)("span",{className:v("ml-auto text-xs tracking-widest opacity-60",e),...t});Gr.displayName="DropdownMenuShortcut";var bt=1;function Kr(){return(0,Lt.jsx)("span",{className:"border border-[#222222]"})}function xt(){let[e]=(0,wo.useLexicalComposerContext)(),t=(0,Z.useRef)(null),[o,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(!1),[n,s]=(0,Z.useState)(!1),[g,N]=(0,Z.useState)(!1),[w,V]=(0,Z.useState)(!1),[P,O]=(0,Z.useState)(!1),[M,S]=(0,Z.useState)(!1),[u,R]=(0,Z.useState)(!1),[T,G]=(0,Z.useState)(!1),[C,j]=(0,Z.useState)("left"),[re,ne]=(0,Z.useState)("Lt"),J=d=>{e.update(()=>{let k=(0,b.$getSelection)();(0,b.$isRangeSelection)(k)&&(d==="Lt"?(0,vt.$setBlocksType)(k,()=>(0,b.$createParagraphNode)()):(0,vt.$setBlocksType)(k,()=>(0,ko.$createHeadingNode)(d)))})},pe=(0,Z.useCallback)(()=>{let d=(0,b.$getSelection)();if((0,b.$isRangeSelection)(d)){s(d.hasFormat("bold")),N(d.hasFormat("italic")),V(d.hasFormat("underline")),O(d.hasFormat("strikethrough")),S(d.hasFormat("subscript")),R(d.hasFormat("superscript"));let k=d.anchor.getNode(),_=k;for(;_&&!(0,b.$isParagraphNode)(_)&&_!==(0,b.$getRoot)();){let l=_.getParent();l&&(_=l)}if(_){let l=_.getFormatType();j(l||"left")}let ee=k.getTopLevelElement()?.__tag;ne(ee||"Lt")}},[]);(0,Z.useEffect)(()=>(0,Ve.mergeRegister)(e.registerUpdateListener(({editorState:d})=>{d.read(()=>{pe()})}),e.registerCommand(b.SELECTION_CHANGE_COMMAND,(d,k)=>(pe(),!1),bt),e.registerCommand(b.CAN_UNDO_COMMAND,d=>(r(d),!1),bt),e.registerCommand(b.CAN_REDO_COMMAND,d=>(a(d),!1),bt),(0,Ve.mergeRegister)(e.registerCommand(dt,d=>(e.update(()=>{let k=(0,b.$getSelection)()||(0,b.$getPreviousSelection)();if((0,b.$isRangeSelection)(k)){let _=Ne({id:d.id,fields:d.fields,relationTo:d.relationTo,value:d.value}),{focus:ee}=k,l=ee.getNode();(0,Ve.$insertNodeToNearestRoot)(_),(0,b.$isParagraphNode)(l)&&!l.__first&&l.remove()}}),!0),b.COMMAND_PRIORITY_EDITOR))),[e,pe]);let ve=[[{label:"Undo",icon:(0,Lt.jsx)(A.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(b.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,Lt.jsx)(A.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(b.UNDO_COMMAND,void 0)},disabled:!i}],[{label:"Bold",icon:(0,Lt.jsx)(co,{}),onClick:()=>{e.dispatchCommand(b.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:n},{label:"Italic",icon:(0,Lt.jsx)(po,{}),onClick:()=>{e.dispatchCommand(b.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:g},{label:"Underline",icon:(0,Lt.jsx)(mo,{}),onClick:()=>{e.dispatchCommand(b.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:w},{label:"Strikethrough",icon:(0,Lt.jsx)(uo,{}),onClick:()=>{e.dispatchCommand(b.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:P},{label:"Subscript",icon:(0,Lt.jsx)(fo,{}),onClick:()=>{e.dispatchCommand(b.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:M},{label:"Superscript",icon:(0,Lt.jsx)(go,{}),onClick:()=>{e.dispatchCommand(b.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:u}]],ie=[{label:"Left Align",direction:"left",icon:(0,Lt.jsx)(A.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(b.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Lt.jsx)(A.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(b.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Lt.jsx)(A.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(b.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Lt.jsx)(A.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(b.FORMAT_ELEMENT_COMMAND,"justify")}}],me=[{label:"Normal Text",value:"Lt",icon:(0,Lt.jsx)(ho,{}),onClick:()=>J("Lt")},{label:"Heading 1",value:"h1",icon:(0,Lt.jsx)(bo,{}),onClick:()=>J("h1")},{label:"Heading 2",value:"h2",icon:(0,Lt.jsx)(vo,{}),onClick:()=>J("h2")},{label:"Heading 3",value:"h3",icon:(0,Lt.jsx)(xo,{}),onClick:()=>J("h3")},{label:"Heading 4",value:"h4",icon:(0,Lt.jsx)(yo,{}),onClick:()=>J("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Lt.jsx)(A.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,Lt.jsx)(A.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],ue=[{label:"Insert Image",icon:(0,Lt.jsx)(A.ImageUp,{width:15,height:15}),onClick:()=>{G(!0)},disabled:!1}];return(0,Lt.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black Lt-50",children:(0,Lt.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[ve.map((d,k)=>(0,Lt.jsxs)(Z.Fragment,{children:[(0,Lt.jsx)("div",{className:"flex items-center gap-2",children:d.map((_,ee)=>(0,Lt.jsx)("div",{role:"button","aria-disabled":_.disabled||!1,onClick:_.onClick,className:v("Lt-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",_.active&&"bg-[#3c3c3c]"),"aria-label":_.label,children:(0,Lt.jsx)(Be,{children:(0,Lt.jsxs)(Fe,{children:[(0,Lt.jsx)($e,{className:"text-[#b5b5b5]",children:_.icon}),(0,Lt.jsx)(ke,{children:(0,Lt.jsx)("Lt",{children:_.label})})]})})},ee))}),(0,Lt.jsx)(Kr,{})]},`toolbar-option-${d.length}-${k}`)),(0,Lt.jsxs)(Ge,{children:[(0,Lt.jsxs)(Ke,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[ie.find(d=>d.direction===C)?.icon,ie.find(d=>d.direction===C)?.label,(0,Lt.jsx)(A.ChevronDown,{width:15,height:15})]}),(0,Lt.jsx)(Le,{className:"bg-black hover:bg-black",children:ie.map((d,k)=>(0,Lt.jsxs)(Ae,{onClick:d.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Lt.jsx)("span",{children:d.icon}),(0,Lt.jsx)("span",{children:d.label})]},`${d.label}-${k}`))})]}),(0,Lt.jsxs)(Ge,{children:[(0,Lt.jsxs)(Ke,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[me.find(d=>d.value===re)?.icon,me.find(d=>d.value===re)?.label,(0,Lt.jsx)(A.ChevronDown,{width:15,height:15})]}),(0,Lt.jsx)(Le,{className:"bg-black hover:bg-black",children:me.map((d,k)=>(0,Lt.jsxs)(Ae,{onClick:d.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Lt.jsx)("span",{children:d.icon}),(0,Lt.jsx)("span",{children:d.label})]},`heading-option-${d.label}-${k}`))})]}),(0,Lt.jsxs)(Ge,{children:[(0,Lt.jsxs)(Ke,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[(0,Lt.jsx)(A.Plus,{width:15,height:15}),(0,Lt.jsx)(A.ChevronDown,{width:15,height:15})]}),(0,Lt.jsx)(Le,{className:"bg-black hover:bg-black",children:ue.map((d,k)=>(0,Lt.jsxs)(Ae,{onClick:d.onClick,disabled:d.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Lt.jsx)("span",{children:d.icon}),(0,Lt.jsx)("span",{children:d.label})]},k))})]}),T&&(0,Lt.jsx)(so,{activeEditor:e,onClose:()=>{G(!1)},isOpen:T})]})})}var jr=({setValue:e,value:t,name:o,editable:r=!0})=>{let[i]=(0,wo.useLexicalComposerContext)(),a=(0,Z.useRef)(null),n=s=>{s.read(()=>{let g=s.toJSON();JSON.stringify(g)!==JSON.stringify(a.current)&&(a.current=g,e?.(()=>g))})};return(0,Z.useEffect)(()=>{i.setEditable(r)},[r,i]),(0,Z.useEffect)(()=>{t&&JSON.stringify(t)!==JSON.stringify(a.current)&&i.update(()=>{try{let s=i.parseEditorState(t);i.setEditorState(s),a.current=t}catch(s){console.error("Error parsing editor state:",s)}},{discrete:!0})},[t,i]),(0,Lt.jsx)("div",{className:"w-full",children:(0,Lt.jsxs)("div",{className:" ",children:[r&&(0,Lt.jsx)(xt,{}),(0,Lt.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,Lt.jsx)(Mo.RichTextPlugin,{contentEditable:(0,Lt.jsx)(Po.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:So.LexicalErrorBoundary}),r&&(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsx)(Do.HistoryPlugin,{}),(0,Lt.jsx)(No.AutoFocusPlugin,{}),(0,Lt.jsx)(To.ListPlugin,{}),(0,Lt.jsx)(Eo.OnChangePlugin,{onChange:n}),(0,Lt.jsx)(pt,{})]})]})]})})},Zr=({setValue:e,value:t,name:o,editable:r=!0})=>(0,Lt.jsx)(Ro.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Ze.ListNode,Ze.ListItemNode,ko.HeadingNode,Ee],onError(a){throw console.error("Lexical error:",a),a},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,Lt.jsx)(jr,{value:t,setValue:e,name:o,editable:r})}),Ho=Zr;function Jr({document:e,onSave:t,mode:o="edit",onCancel:r,availableDocuments:i=[],knowledgeContexts:a=[]}){let[n,s]=(0,Z.useState)({...e,updatedAt:new Date}),[g,N]=(0,Z.useState)(!1),[w,V]=(0,Z.useState)(n.richTextContent),[P,O]=(0,Z.useState)(!1),M=(0,Z.useRef)(null),S=(0,Z.useRef)(""),u=(0,Z.useRef)(null),R=(0,Z.useRef)(null),T=l=>{let f=new WeakSet,m=L=>L&&typeof L=="object"?f.has(L)?null:(f.add(L),Array.isArray(L)?L.map(m):Object.keys(L).sort().reduce((B,xe)=>(B[xe]=m(L[xe]),B),{})):L;return JSON.stringify(m(l))},G=l=>l?l.replace(/\s+/g," ").trim():"",C=()=>n.format==="richText"?T(w):G(n.content),j=()=>{let l={title:G(n.title),description:G(n.description),format:n.format,content:C()},f=T(l),m=5381;for(let L=0;L<f.length;L++)m=m*33^f.charCodeAt(L);return(m>>>0).toString(16)},re=(l,f)=>{if(l===f)return!1;if(n.format!=="richText"){let m=J(l),L=C();if(m==null)return!0;let B=m.length,xe=L.length,Pe=Math.abs(xe-B),_e=B===0?1:Pe/B;return G(m)===G(L)&&Pe<3?!1:Pe>=10||_e>=.02}return!0},ne=(0,Z.useRef)(new Map),J=l=>{let f=ne.current.get(l);return f==null?null:"x".repeat(f)};(0,Z.useEffect)(()=>(R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{let l=j(),f=S.current;if(re(f,l)&&(O(!0),t({...n,richTextContent:w},"autosave"),S.current=l,n.format!=="richText")){let m=C();ne.current.set(l,m.length)}},800),()=>{R.current&&clearTimeout(R.current)}),[n.title,n.description,n.format,n.content,n.metadata,w]),(0,Z.useEffect)(()=>{let l=()=>{let f=j();f!==S.current&&(t({...n,richTextContent:w},"autosave"),S.current=f)};return window.addEventListener("pagehide",l),window.addEventListener("beforeunload",l),()=>{window.removeEventListener("pagehide",l),window.removeEventListener("beforeunload",l)}},[n,w]),(0,Z.useEffect)(()=>(P&&(u.current=setTimeout(()=>{O(!1)},2e3)),()=>{u.current&&clearTimeout(u.current)}),[P]),(0,Z.useEffect)(()=>{s(e)},[e]);let pe=l=>{switch(l){case"markdown":case"mdx":return(0,Lt.jsx)(A.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Lt.jsx)(A.File,{className:"h-6 w-6 text-success"});case"text":return(0,Lt.jsx)(A.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Lt.jsx)(A.File,{className:"h-6 w-6 text-muted-foreground"})}},ve=l=>{switch(l){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},ie=()=>{let l=new Set,f=new Set;return a.forEach(m=>{m.menuConfig.groupBy.forEach(L=>l.add(L))}),i.forEach(m=>{m.metadata&&Object.keys(m.metadata).forEach(L=>f.add(L))}),{contextKeys:Array.from(l).sort(),documentKeys:Array.from(f).sort(),allKeys:Array.from(new Set([...l,...f])).sort()}},D=l=>{let f=new Set;return i.forEach(m=>{m.metadata?.[l]&&f.add(String(m.metadata[l]))}),Array.from(f).sort()},me=ie(),ue=()=>{t({...n,richTextContent:w},"autosave")},d=(l,f)=>{s(m=>({...m,metadata:{...m.metadata,[l]:f}}))},k=(l,f)=>{f==="__custom__"?d(l,""):d(l,f)},_=()=>{d("","")},ee=l=>{s(f=>{let m={...f.metadata};return delete m[l],{...f,metadata:m}})};return(0,Lt.jsxs)(yt.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Lt.jsxs)("div",{className:"border-b border-border bg-card Lt-8 pb-6",children:[(0,Lt.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Lt.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Lt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Lt.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,Lt.jsx)("div",{className:"flex-1 min-w-0",children:(0,Lt.jsx)(nt,{fieldName:"title",value:n.title,label:"",onSave:(l,f)=>s(m=>({...m,title:f})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:Lt-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Lt.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${ve(n.format)} flex-shrink-0 mt-1`,children:n.format.toUpperCase()})]}),(0,Lt.jsx)("div",{className:"mt-2",children:(0,Lt.jsx)(nt,{fieldName:"description",value:n.description||"Click to add description...",label:"",multiline:!0,onSave:(l,f)=>s(m=>({...m,description:f})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:Lt-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,Lt.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Lt.jsxs)(se,{variant:"ghost",size:"sm",onClick:()=>N(!g),className:"gap-2",children:[(0,Lt.jsx)(A.Info,{className:"h-4 w-4"}),"Metadata",n.metadata&&Object.keys(n.metadata).length>0&&(0,Lt.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 text-xs font-medium bg-primary/10 text-primary rounded-full",children:Object.keys(n.metadata).length}),g?(0,Lt.jsx)(A.ChevronDown,{className:"h-4 w-4"}):(0,Lt.jsx)(A.ChevronRight,{className:"h-4 w-4"})]}),(0,Lt.jsxs)(se,{variant:"outline",size:"sm",onClick:r,className:"gap-2",children:[(0,Lt.jsx)(A.X,{className:"h-4 w-4"}),"Close"]}),(0,Lt.jsxs)(se,{size:"sm",onClick:ue,className:"gap-2",disabled:P,children:[P?(0,Lt.jsx)(A.Loader2,{className:"h-4 w-4 animate-spin"}):(0,Lt.jsx)(A.Save,{className:"h-4 w-4"}),P?"Auto-saving...":"Save"]})]})]}),(0,Lt.jsx)(yt.motion.div,{initial:!1,animate:{height:g?"auto":0,opacity:g?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:(0,Lt.jsxs)("div",{className:"pt-4 border-t border-border mt-4 max-h-full flex gap-2",children:[(0,Lt.jsx)("div",{className:"flex items-center justify-between mb-3",children:(0,Lt.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,Lt.jsx)(A.Info,{className:"h-4 w-4"}),"Document Metadata"]})}),(0,Lt.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Lt.jsx)("div",{className:"bg-muted rounded-lg Lt-4 border border-border",children:n.metadata&&Object.keys(n.metadata).length>0?(0,Lt.jsx)("div",{className:"space-y-2",children:Object.entries(n.metadata).map(([l,f],m)=>{let L=D(l);return(0,Lt.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Lt.jsx)(le,{value:l,onChange:B=>{let xe=B.target.value||"",Pe=n.metadata?.[l];s(_e=>{let Je={..._e.metadata};return delete Je[l],xe&&(Je[xe]=Pe||""),{..._e,metadata:Je}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${l}`}),(0,Lt.jsx)("datalist",{id:`metadata-keys-${l}`,children:me.allKeys.map(B=>(0,Lt.jsx)("option",{value:B},B))}),(0,Lt.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),L.length>0?(0,Lt.jsxs)(zt,{value:String(f||""),onValueChange:B=>k(l,B),children:[(0,Lt.jsx)(Qe,{className:"flex-1 h-8 text-sm",children:(0,Lt.jsx)(Ut,{placeholder:"Value"})}),(0,Lt.jsxs)(et,{children:[L.map(B=>(0,Lt.jsx)(Ue,{value:B,children:B},B)),(0,Lt.jsx)(Ue,{value:"__custom__",children:(0,Lt.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,Lt.jsx)(le,{value:String(f||""),onChange:B=>d(l,B.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Lt.jsx)(se,{type:"button",variant:"ghost",size:"sm",onClick:()=>ee(l),className:"h-8 w-8 Lt-0 text-muted-foreground hover:text-destructive",children:(0,Lt.jsx)(A.X,{className:"h-3 w-3"})})]},`metadata-key-${m}`)})}):(0,Lt.jsxs)("div",{className:"text-center py-4",children:[(0,Lt.jsx)("Lt",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),(0,Lt.jsx)("Lt",{className:"text-xs text-muted-foreground",children:'Click "Add Field" to create metadata'})]})}),(0,Lt.jsxs)(se,{type:"button",variant:"outline",size:"sm",onClick:_,className:"gap-1 h-8",children:[(0,Lt.jsx)(A.Plus,{className:"h-3 w-3"}),"Add Field"]})]})]})})]}),(0,Lt.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Lt.jsx)("div",{className:"Lt-8 pt-0 h-full max-h-full overflow-auto",children:n.format==="richText"?(0,Lt.jsx)(Ho,{setValue:V,value:w,name:"richTextContent"}):(0,Lt.jsx)(Me,{value:n.content||"",onChange:l=>s(f=>({...f,content:l.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}0&&(module.exports={DocumentEdit});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";import{a}from"../../chunk-JTMIQ7MK.mjs";import"../../chunk-PZFYJ5FS.mjs";import"../../chunk-LEUI66J6.mjs";import"../../chunk-HFEN3KJC.mjs";import"../../chunk-L2UJOICL.mjs";import"../../chunk-T3F3RQIC.mjs";import"../../chunk-UP67R64J.mjs";import"../../chunk-6QERRKM4.mjs";import"../../chunk-VSU7LYXZ.mjs";import"../../chunk-RKS7CWAP.mjs";import"../../chunk-BZEGLKRZ.mjs";import"../../chunk-K7N3FRGH.mjs";import"../../chunk-IPRG56MW.mjs";import"../../chunk-DFIXTV2M.mjs";import"../../chunk-YFAZQYK4.mjs";import"../../chunk-B4H6T2GP.mjs";import"../../chunk-TVZOULLL.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-QTW33JYG.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as DocumentEdit};
2
+ "use strict";import{a}from"../../chunk-NXAQ6ESJ.mjs";import"../../chunk-VTFO5GXK.mjs";import"../../chunk-GULRIPMU.mjs";import"../../chunk-RKS7CWAP.mjs";import"../../chunk-IPRG56MW.mjs";import"../../chunk-HFEN3KJC.mjs";import"../../chunk-L2UJOICL.mjs";import"../../chunk-T3F3RQIC.mjs";import"../../chunk-UP67R64J.mjs";import"../../chunk-6QERRKM4.mjs";import"../../chunk-VSU7LYXZ.mjs";import"../../chunk-BZEGLKRZ.mjs";import"../../chunk-K7N3FRGH.mjs";import"../../chunk-DFIXTV2M.mjs";import"../../chunk-YFAZQYK4.mjs";import"../../chunk-B4H6T2GP.mjs";import"../../chunk-TVZOULLL.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-QTW33JYG.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as DocumentEdit};