cortex-react-components 1.63.0 → 1.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-2IJK3AE7.mjs → chunk-22SIVBWN.mjs} +1 -1
- package/dist/{chunk-PADGOK5C.mjs → chunk-37NBXA5G.mjs} +1 -1
- package/dist/{chunk-7U6VVPQK.mjs → chunk-3HDDBU3J.mjs} +1 -1
- package/dist/{chunk-4FVKNM6C.mjs → chunk-4XO4HI55.mjs} +1 -1
- package/dist/{chunk-4GL57G4E.mjs → chunk-5J244QX4.mjs} +1 -1
- package/dist/{chunk-WI6JBSNW.mjs → chunk-5LF662B4.mjs} +1 -1
- package/dist/chunk-666KIWPS.mjs +1 -0
- package/dist/{chunk-NX6L3JEA.mjs → chunk-6BZPTAOQ.mjs} +1 -1
- package/dist/chunk-6NZJ2VXQ.mjs +1 -0
- package/dist/chunk-6U663VXT.mjs +1 -0
- package/dist/{chunk-Z2U42GC3.mjs → chunk-6XGUOJCN.mjs} +1 -1
- package/dist/{chunk-SKQYQ4SD.mjs → chunk-737CTHXW.mjs} +1 -1
- package/dist/{chunk-N363IQBL.mjs → chunk-ANTK5LAD.mjs} +1 -1
- package/dist/{chunk-I3HJJ3O6.mjs → chunk-B7VQUUH3.mjs} +1 -1
- package/dist/{chunk-YZIXPIYP.mjs → chunk-CXZGSPKM.mjs} +1 -1
- package/dist/{chunk-PBRC3UOA.mjs → chunk-DAJNZDN6.mjs} +1 -1
- package/dist/{chunk-3PVDUJNF.mjs → chunk-DIAK5C43.mjs} +1 -1
- package/dist/{chunk-6HVZ5G3G.mjs → chunk-ELPMUABW.mjs} +1 -1
- package/dist/{chunk-GZP2BSIJ.mjs → chunk-ERUB6LU6.mjs} +1 -1
- package/dist/{chunk-WTQ7QZRC.mjs → chunk-F2D7YJEV.mjs} +1 -1
- package/dist/chunk-FFESN4FM.mjs +1 -0
- package/dist/chunk-G72SIYN7.mjs +4 -0
- package/dist/{chunk-CYEI7ZEM.mjs → chunk-HQTSD5A3.mjs} +1 -1
- package/dist/{chunk-PJ7KGG2L.mjs → chunk-ISYJGX2I.mjs} +1 -1
- package/dist/chunk-K44ECXTN.mjs +1 -0
- package/dist/{chunk-SX5U74MW.mjs → chunk-KETV2XVN.mjs} +1 -1
- package/dist/chunk-L45A6K4C.mjs +1 -0
- package/dist/{chunk-AU5HS6FK.mjs → chunk-MDEYJGAN.mjs} +1 -1
- package/dist/chunk-MEWCJ4MA.mjs +1 -0
- package/dist/{chunk-VNGK6ACI.mjs → chunk-MRJQKF4Z.mjs} +1 -1
- package/dist/{chunk-6XMDC6MI.mjs → chunk-MUZO74UP.mjs} +1 -1
- package/dist/chunk-OIQ6GXBY.mjs +4 -0
- package/dist/{chunk-NXV22G4T.mjs → chunk-OT2LLDV2.mjs} +1 -1
- package/dist/chunk-P3PIMDIR.mjs +1 -0
- package/dist/{chunk-SSV5U7GW.mjs → chunk-PEL6QUMS.mjs} +1 -1
- package/dist/chunk-PFWODHNV.mjs +1 -0
- package/dist/chunk-PPUE5IPA.mjs +1 -0
- package/dist/{chunk-2CVUW74E.mjs → chunk-Q5LSCSF7.mjs} +1 -1
- package/dist/{chunk-BGQKHEB3.mjs → chunk-QUOLG5NC.mjs} +1 -1
- package/dist/{chunk-2BYCSW34.mjs → chunk-QZJGH4W6.mjs} +1 -1
- package/dist/chunk-ROEJPYRW.mjs +1 -0
- package/dist/{chunk-PMXMC5CA.mjs → chunk-RVI4KPBJ.mjs} +1 -1
- package/dist/{chunk-3AUZS6TK.mjs → chunk-RWWF3HBN.mjs} +1 -1
- package/dist/{chunk-ZYYWN6XG.mjs → chunk-SUO6GOJS.mjs} +1 -1
- package/dist/{chunk-YLBXDW77.mjs → chunk-SVYUY3VF.mjs} +1 -1
- package/dist/{chunk-E3HCMSS7.mjs → chunk-TASJS6US.mjs} +1 -1
- package/dist/chunk-TWPRI2XQ.mjs +1 -0
- package/dist/{chunk-R52W36TJ.mjs → chunk-TYROOO53.mjs} +1 -1
- package/dist/{chunk-DXOIGG75.mjs → chunk-UM3WHBE7.mjs} +1 -1
- package/dist/{chunk-FYEE5UWZ.mjs → chunk-UVPODMUO.mjs} +1 -1
- package/dist/{chunk-SN4DCMUU.mjs → chunk-VT6DWUPF.mjs} +1 -1
- package/dist/{chunk-BEOBHG7Z.mjs → chunk-VX4NPEMC.mjs} +1 -1
- package/dist/{chunk-IC57R2EU.mjs → chunk-VXGRJCCM.mjs} +1 -1
- package/dist/{chunk-T6FBWMZR.mjs → chunk-WKFNZUIR.mjs} +1 -1
- package/dist/chunk-WLA5QCBE.mjs +1 -0
- package/dist/{chunk-FQPOVP4A.mjs → chunk-X3MBDMXV.mjs} +1 -1
- package/dist/{chunk-BRNBNHPP.mjs → chunk-X7PHWC2I.mjs} +1 -1
- package/dist/{chunk-QEQ5FQDS.mjs → chunk-XGEMVLT5.mjs} +1 -1
- package/dist/{chunk-JKRLWXXO.mjs → chunk-Y7TUU6BG.mjs} +1 -1
- package/dist/{chunk-N3ZBFP4A.mjs → chunk-YQ2YVQBS.mjs} +1 -1
- package/dist/{chunk-YUZINX2Q.mjs → chunk-Z3YAIJQT.mjs} +1 -1
- package/dist/{chunk-ZY2PDUUB.mjs → chunk-Z6NED523.mjs} +1 -1
- package/dist/chunk-ZEOV7BEN.mjs +1 -0
- package/dist/{chunk-AZHIBMT6.mjs → chunk-ZKU7UP6U.mjs} +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CallToAction.stories.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.stories.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/Content.stories.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.stories.mjs +1 -1
- package/dist/components/Blocks/ImageBlock.mjs +1 -1
- package/dist/components/Blocks/MediaBlock.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/CRM/CogeBoard.css +1 -0
- package/dist/components/CRM/CogeBoard.d.ts +14 -0
- package/dist/components/CRM/CogeBoard.js +4 -0
- package/dist/components/CRM/CogeBoard.mjs +2 -0
- package/dist/components/CRM/CogeBoard.stories.css +1 -0
- package/dist/components/CRM/CogeBoard.stories.js +4 -0
- package/dist/components/CRM/CogeBoard.stories.mjs +1 -0
- package/dist/components/CRM/DealCard.d.ts +2 -1
- package/dist/components/CRM/DealCard.js +1 -1
- package/dist/components/CRM/DealCard.mjs +1 -1
- package/dist/components/CRM/DealCard.stories.js +1 -1
- package/dist/components/CRM/DealCard.stories.mjs +1 -1
- package/dist/components/CRM/DealDetails.js +1 -1
- package/dist/components/CRM/DealDetails.mjs +1 -1
- package/dist/components/CRM/DealDetails.stories.js +1 -1
- package/dist/components/CRM/DealDetails.stories.mjs +1 -1
- package/dist/components/CRM/KanbanBoard.js +1 -1
- package/dist/components/CRM/KanbanBoard.mjs +1 -1
- package/dist/components/CRM/KanbanBoard.stories.js +1 -1
- package/dist/components/CRM/KanbanBoard.stories.mjs +1 -1
- package/dist/components/CRM/KanbanColumn.d.ts +6 -5
- package/dist/components/CRM/KanbanColumn.js +1 -1
- package/dist/components/CRM/KanbanColumn.mjs +1 -1
- package/dist/components/CRM/KanbanColumn.stories.js +1 -1
- package/dist/components/CRM/KanbanColumn.stories.mjs +1 -1
- package/dist/components/CRM/NewCustomerForm.mjs +1 -1
- package/dist/components/CRM/NewCustomerForm.stories.mjs +1 -1
- package/dist/components/CRM/NewDealForm.mjs +1 -1
- package/dist/components/CRM/NewDealForm.stories.mjs +1 -1
- package/dist/components/CRM/index.d.ts +1 -0
- package/dist/components/CRM/index.js +1 -1
- package/dist/components/CRM/index.mjs +1 -1
- package/dist/components/CRM/types.d.ts +1 -0
- package/dist/components/CRM/types.js +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/ContentCard.stories.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.stories.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AddEpicModal.js +1 -1
- package/dist/components/DigitalColleagues/AddEpicModal.mjs +1 -1
- package/dist/components/DigitalColleagues/AddEpicModal.stories.js +67 -67
- package/dist/components/DigitalColleagues/AddEpicModal.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/AddSprintModal.css +1 -0
- package/dist/components/DigitalColleagues/AddSprintModal.d.ts +9 -0
- package/dist/components/DigitalColleagues/AddSprintModal.js +4 -0
- package/dist/components/DigitalColleagues/AddSprintModal.mjs +1 -0
- package/dist/components/DigitalColleagues/AddTaskModal.js +1 -1
- package/dist/components/DigitalColleagues/AddTaskModal.mjs +1 -1
- package/dist/components/DigitalColleagues/AddTaskModal.stories.js +64 -64
- package/dist/components/DigitalColleagues/AddTaskModal.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
- package/dist/components/DigitalColleagues/CommentSection.mjs +1 -1
- package/dist/components/DigitalColleagues/CommentSection.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/DashboardHeader.d.ts +2 -1
- package/dist/components/DigitalColleagues/DashboardHeader.js +1 -1
- package/dist/components/DigitalColleagues/DashboardHeader.mjs +1 -1
- package/dist/components/DigitalColleagues/DashboardHeader.stories.js +15 -15
- package/dist/components/DigitalColleagues/DashboardHeader.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/EditableField.mjs +1 -1
- package/dist/components/DigitalColleagues/EditableField.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/EpicFilter.stories.js +66 -66
- package/dist/components/DigitalColleagues/EpicFilter.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/EpicsView.css +1 -0
- package/dist/components/DigitalColleagues/EpicsView.d.ts +13 -0
- package/dist/components/DigitalColleagues/EpicsView.js +1 -0
- package/dist/components/DigitalColleagues/EpicsView.mjs +1 -0
- package/dist/components/DigitalColleagues/EpicsView.stories.css +1 -0
- package/dist/components/DigitalColleagues/EpicsView.stories.js +218 -0
- package/dist/components/DigitalColleagues/EpicsView.stories.mjs +1 -0
- package/dist/components/DigitalColleagues/KanbanBoard.d.ts +12 -0
- package/dist/components/DigitalColleagues/KanbanBoard.js +2 -2
- package/dist/components/DigitalColleagues/KanbanBoard.mjs +1 -1
- package/dist/components/DigitalColleagues/KanbanBoard.stories.js +3 -3
- package/dist/components/DigitalColleagues/KanbanBoard.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/KanbanColumn.stories.js +1 -1
- package/dist/components/DigitalColleagues/KanbanColumn.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/ManagementSidebar.d.ts +7 -3
- package/dist/components/DigitalColleagues/ManagementSidebar.js +1 -1
- package/dist/components/DigitalColleagues/ManagementSidebar.mjs +1 -1
- package/dist/components/DigitalColleagues/ManagementSidebar.stories.js +63 -63
- package/dist/components/DigitalColleagues/ManagementSidebar.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/PlanningView.d.ts +1 -0
- package/dist/components/DigitalColleagues/PlanningView.js +4 -1
- package/dist/components/DigitalColleagues/PlanningView.mjs +1 -1
- package/dist/components/DigitalColleagues/PlanningView.stories.js +3 -217
- package/dist/components/DigitalColleagues/PlanningView.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskCard.js +1 -1
- package/dist/components/DigitalColleagues/TaskCard.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskCard.stories.js +55 -55
- package/dist/components/DigitalColleagues/TaskCard.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskDetailsModal.js +1 -1
- package/dist/components/DigitalColleagues/TaskDetailsModal.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskDetailsModal.stories.js +1 -218
- package/dist/components/DigitalColleagues/TaskDetailsModal.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskSidebar.js +1 -1
- package/dist/components/DigitalColleagues/TaskSidebar.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskSidebar.stories.js +1 -1
- package/dist/components/DigitalColleagues/TaskSidebar.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/TeamSwitcher.stories.js +1 -218
- package/dist/components/DigitalColleagues/TeamSwitcher.stories.mjs +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/Header.stories.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.stories.mjs +1 -1
- package/dist/components/Holidays/index.mjs +1 -1
- package/dist/components/Layouts/FeatureGrid.stories.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/Print.stories.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/SlideShow.stories.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.stories.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/SidebarRight.stories.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/Payload/Card/index.mjs +1 -1
- package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
- package/dist/components/Payload/Media/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/RichText.stories.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/index.js +9 -9
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/sidebar.mjs +1 -1
- package/dist/globals.css +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.js +13 -13
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Blog.stories.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/Documentation.stories.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/IndexPage.stories.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/Intranet.stories.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/LandingPage.stories.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Page.stories.mjs +1 -1
- package/dist/pages/Printable.stories.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Publish.stories.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/pages/Website.stories.mjs +1 -1
- package/dist/payload-types.d.ts +118 -110
- package/dist/payload-types.js +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/AboutSection.stories.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogDetail.stories.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/BlogList.stories.mjs +1 -1
- package/dist/sections/BlogListSection.mjs +1 -1
- package/dist/sections/BlogListSection.stories.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/ContactSection.stories.mjs +1 -1
- package/dist/sections/ImageSection.stories.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PageSections.stories.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/PricingSection.stories.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceDetailSection.stories.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/ServiceSection.stories.mjs +1 -1
- package/dist/sections/form/index.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-3OLVHVK2.mjs +0 -1
- package/dist/chunk-7LF2QW5F.mjs +0 -1
- package/dist/chunk-A7ZACVB3.mjs +0 -4
- package/dist/chunk-HOQ3CJDL.mjs +0 -1
- package/dist/chunk-IAACGKX2.mjs +0 -1
- package/dist/chunk-OTT43GVL.mjs +0 -1
- package/dist/chunk-QUONAVFG.mjs +0 -1
- package/dist/chunk-QVIJOCZ5.mjs +0 -1
- package/dist/chunk-RWM3YI4H.mjs +0 -1
- package/dist/chunk-VATD3NQA.mjs +0 -1
- package/dist/chunk-XJZCX25R.mjs +0 -1
- package/dist/chunk-XPS3NXF3.mjs +0 -1
- package/dist/chunk-YUSO4OFY.mjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
"use strict";var ft=Object.create;var re=Object.defineProperty;var gt=Object.getOwnPropertyDescriptor;var bt=Object.getOwnPropertyNames;var vt=Object.getPrototypeOf,ht=Object.prototype.hasOwnProperty;var yt=(e,t)=>{for(var o in t)re(e,o,{get:t[o],enumerable:!0})},Te=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of bt(t))!ht.call(e,l)&&l!==o&&re(e,l,{get:()=>t[l],enumerable:!(r=gt(t,l))||r.enumerable});return e};var A=(e,t,o)=>(o=e!=null?ft(vt(e)):{},Te(t||!e||!e.__esModule?re(o,"default",{value:e,enumerable:!0}):o,e)),xt=e=>Te(re({},"__esModule",{value:!0}),e);var po={};yt(po,{Default:()=>ut,WithManyComments:()=>mo,default:()=>lo});module.exports=xt(po);var F=require("react");var q=A(require("react")),S=A(require("@radix-ui/react-dialog")),Ue=require("lucide-react");var We=require("clsx");var ge="-",wt=e=>{let t=Ct(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{let a=d.split(ge);return a[0]===""&&a.length!==1&&a.shift(),Me(a,t)||St(d)},getConflictingClassGroupIds:(d,a)=>{let v=o[d]||[];return a&&r[d]?[...v,...r[d]]:v}}},Me=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),l=r?Me(e.slice(1),r):void 0;if(l)return l;if(t.validators.length===0)return;let n=e.join(ge);return t.validators.find(({validator:d})=>d(n))?.classGroupId},Ie=/^\[(.+)\]$/,St=e=>{if(Ie.test(e)){let t=Ie.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Ct=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return Rt(Object.entries(e.classGroups),o).forEach(([n,d])=>{fe(d,r,n,t)}),r},fe=(e,t,o,r)=>{e.forEach(l=>{if(typeof l=="string"){let n=l===""?t:ze(t,l);n.classGroupId=o;return}if(typeof l=="function"){if(Pt(l)){fe(l(r),t,o,r);return}t.validators.push({validator:l,classGroupId:o});return}Object.entries(l).forEach(([n,d])=>{fe(d,ze(t,n),o,r)})})},ze=(e,t)=>{let o=e;return t.split(ge).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},Pt=e=>e.isThemeGetter,Rt=(e,t)=>t?e.map(([o,r])=>{let l=r.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([d,a])=>[t+d,a])):n);return[o,l]}):e,Nt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,l=(n,d)=>{o.set(n,d),t++,t>e&&(t=0,r=o,o=new Map)};return{get(n){let d=o.get(n);if(d!==void 0)return d;if((d=r.get(n))!==void 0)return l(n,d),d},set(n,d){o.has(n)?o.set(n,d):l(n,d)}}},Le="!",Dt=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,l=t[0],n=t.length,d=a=>{let v=[],x=0,C=0,k;for(let u=0;u<a.length;u++){let P=a[u];if(x===0){if(P===l&&(r||a.slice(u,u+n)===t)){v.push(a.slice(C,u)),C=u+n;continue}if(P==="/"){k=u;continue}}P==="["?x++:P==="]"&&x--}let N=v.length===0?a:a.substring(C),R=N.startsWith(Le),h=R?N.substring(1):N,w=k&&k>C?k-C:void 0;return{modifiers:v,hasImportantModifier:R,baseClassName:h,maybePostfixModifierPosition:w}};return o?a=>o({className:a,parseClassName:d}):d},kt=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},At=e=>({cache:Nt(e.cacheSize),parseClassName:Dt(e),...wt(e)}),Tt=/\s+/,It=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:l}=t,n=[],d=e.trim().split(Tt),a="";for(let v=d.length-1;v>=0;v-=1){let x=d[v],{modifiers:C,hasImportantModifier:k,baseClassName:N,maybePostfixModifierPosition:R}=o(x),h=!!R,w=r(h?N.substring(0,R):N);if(!w){if(!h){a=x+(a.length>0?" "+a:a);continue}if(w=r(N),!w){a=x+(a.length>0?" "+a:a);continue}h=!1}let u=kt(C).join(":"),P=k?u+Le:u,D=P+w;if(n.includes(D))continue;n.push(D);let E=l(w,h);for(let z=0;z<E.length;++z){let s=E[z];n.push(P+s)}a=x+(a.length>0?" "+a:a)}return a};function zt(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Ee(t))&&(r&&(r+=" "),r+=o);return r}var Ee=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=Ee(e[r]))&&(o&&(o+=" "),o+=t);return o};function Mt(e,...t){let o,r,l,n=d;function d(v){let x=t.reduce((C,k)=>k(C),e());return o=At(x),r=o.cache.get,l=o.cache.set,n=a,a(v)}function a(v){let x=r(v);if(x)return x;let C=It(v,o);return l(v,C),C}return function(){return n(zt.apply(null,arguments))}}var g=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Be=/^\[(?:([a-z-]+):)?(.+)\]$/T,Lt=/^\d+\/\d+$/,Et=new Set(["px","full","screen"]),Bt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|T|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Gt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ut=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,L=e=>_(e)||Et.has(e)||Lt.test(e),B=e=>J(e,"length",Zt),_=e=>!!e&&!Number.isNaN(Number(e)),ue=e=>J(e,"number",_),Z=e=>!!e&&Number.isInteger(Number(e)),Ht=e=>e.endsWith("%")&&_(e.slice(0,-1)),c=e=>Be.test(e),V=e=>Bt.test(e),jt=new Set(["length","size","percentage"]),Ft=e=>J(e,jt,Ve),Ot=e=>J(e,"position",Ve),_t=new Set(["image","url"]),Jt=e=>J(e,_t,qt),$t=e=>J(e,"",Qt),Q=()=>!0,J=(e,t,o)=>{let r=Be.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},Zt=e=>Vt.test(e)&&!Gt.test(e),Ve=()=>!1,Qt=e=>Wt.test(e),qt=e=>Ut.test(e);var Xt=()=>{let e=g("colors"),t=g("spacing"),o=g("blur"),r=g("brightness"),l=g("borderColor"),n=g("borderRadius"),d=g("borderSpacing"),a=g("borderWidth"),v=g("contrast"),x=g("grayscale"),C=g("hueRotate"),k=g("invert"),N=g("gap"),R=g("gradientColorStops"),h=g("gradientColorStopPositions"),w=g("inset"),u=g("margin"),P=g("opacity"),D=g("padding"),E=g("saturate"),z=g("scale"),s=g("sepia"),f=g("skew"),O=g("space"),Re=g("translate"),ce=()=>["auto","contain","none"],de=()=>["auto","hidden","clip","visible","scroll"],me=()=>["auto",c,t],b=()=>[c,t],Ne=()=>["",L,B],te=()=>["auto",_,c],De=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],oe=()=>["solid","dashed","dotted","double","none"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",c],Ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[_,c];return{cacheSize:500,separator:":",theme:{colors:[Q],spacing:[L,B],blur:["none","",V,c],brightness:M(),borderColor:[e],borderRadius:["none","","full",V,c],borderSpacing:b(),borderWidth:Ne(),contrast:M(),grayscale:$(),hueRotate:M(),invert:$(),gap:b(),gradientColorStops:[e],gradientColorStopPositions:[Ht,B],inset:me(),margin:me(),opacity:M(),padding:b(),saturate:M(),scale:M(),sepia:$(),skew:M(),space:b(),translate:b()},classGroups:{aspect:[{aspect:["auto","square","video",c]}],container:["container"],columns:[{columns:[V]}],"break-after":[{"break-after":Ae()}],"break-before":[{"break-before":Ae()}],"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:[...De(),c]}],overflow:[{overflow:de()}],"overflow-x":[{"overflow-x":de()}],"overflow-T":[{"overflow-T":de()}],overscroll:[{overscroll:ce()}],"overscroll-x":[{"overscroll-x":ce()}],"overscroll-T":[{"overscroll-T":ce()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-T":[{"inset-T":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Z,c]}],basis:[{basis:me()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",c]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",Z,c]}],"grid-cols":[{"grid-cols":[Q]}],"col-start-end":[{col:["auto",{span:["full",Z,c]},c]}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":[Q]}],"row-start-end":[{row:["auto",{span:[Z,c]},c]}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",c]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",c]}],gap:[{gap:[N]}],"gap-x":[{"gap-x":[N]}],"gap-T":[{"gap-T":[N]}],"justify-content":[{justify:["normal",...pe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...pe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...pe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[D]}],px:[{px:[D]}],py:[{py:[D]}],ps:[{ps:[D]}],pe:[{pe:[D]}],pt:[{pt:[D]}],pr:[{pr:[D]}],pb:[{pb:[D]}],pl:[{pl:[D]}],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":[O]}],"space-x-reverse":["space-x-reverse"],"space-T":[{"space-T":[O]}],"space-T-reverse":["space-T-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",c,t]}],"min-w":[{"min-w":[c,t,"min","max","fit"]}],"max-w":[{"max-w":[c,t,"none","full","min","max","fit","prose",{screen:[V]},V]}],h:[{h:[c,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[c,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[c,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[c,t,"auto","min","max","fit"]}],"font-size":[{text:["base",V,B]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ue]}],"font-family":[{font:[Q]}],"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",c]}],"line-clamp":[{"line-clamp":["none",_,ue]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",L,c]}],"list-image":[{"list-image":["none",c]}],"list-style-type":[{list:["none","disc","decimal",c]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[P]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",L,B]}],"underline-offset":[{"underline-offset":["auto",L,c]}],"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:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",c]}],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",c]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[P]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...De(),Ot]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","T","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ft]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Jt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-T":[{"border-T":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[P]}],"border-style":[{border:[...oe(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-T":[{"divide-T":[a]}],"divide-T-reverse":["divide-T-reverse"],"divide-opacity":[{"divide-opacity":[P]}],"divide-style":[{divide:oe()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-T":[{"border-T":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...oe()]}],"outline-offset":[{"outline-offset":[L,c]}],"outline-w":[{outline:[L,B]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[L,B]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",V,$t]}],"shadow-color":[{shadow:[Q]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[...ke(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ke()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[v]}],"drop-shadow":[{"drop-shadow":["","none",V,c]}],grayscale:[{grayscale:[x]}],"hue-rotate":[{"hue-rotate":[C]}],invert:[{invert:[k]}],saturate:[{saturate:[E]}],sepia:[{sepia:[s]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[v]}],"backdrop-grayscale":[{"backdrop-grayscale":[x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[C]}],"backdrop-invert":[{"backdrop-invert":[k]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[s]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-T":[{"border-spacing-T":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",c]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",c]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",c]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-T":[{"scale-T":[z]}],rotate:[{rotate:[Z,c]}],"translate-x":[{"translate-x":[Re]}],"translate-T":[{"translate-T":[Re]}],"skew-x":[{"skew-x":[f]}],"skew-T":[{"skew-T":[f]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",c]}],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","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","T-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",c]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","T","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","T","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-T":[{"touch-pan":["T","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",c]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[L,B,ue]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-T"],overscroll:["overscroll-x","overscroll-T"],inset:["inset-x","inset-T","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-T":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-T"],p:["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-T"],"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-T":["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-T":["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-p":["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-T","touch-pz"],"touch-x":["touch"],"touch-T":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ge=Mt(Xt);function p(...e){return Ge((0,We.clsx)(e))}var T=require("react/jsx-runtime"),He=S.Root;var Kt=S.Portal;var je=q.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Overlay,{ref:o,className:p("fixed inset-0 z-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}));je.displayName=S.Overlay.displayName;var be=q.forwardRef(({className:e,children:t,...o},r)=>(0,T.jsxs)(Kt,{children:[(0,T.jsx)(je,{}),(0,T.jsxs)(S.Content,{ref:r,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-T-[-50%] gap-4 border bg-background p-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,T.jsxs)(S.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,T.jsx)(Ue.X,{className:"h-4 w-4"}),(0,T.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));be.displayName=S.Content.displayName;var ve=({className:e,...t})=>(0,T.jsx)("div",{className:p("flex flex-col space-T-1.5 text-center sm:text-left",e),...t});ve.displayName="DialogHeader";var Yt=({className:e,...t})=>(0,T.jsx)("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Yt.displayName="DialogFooter";var he=q.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Title,{ref:o,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));he.displayName=S.Title.displayName;var eo=q.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Description,{ref:o,className:p("text-sm text-muted-foreground",e),...t}));eo.displayName=S.Description.displayName;var Fe=require("@radix-ui/react-slot"),Oe=require("class-variance-authority"),_e=A(require("react")),to=(0,Oe.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-foreground",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),X=_e.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...l},n)=>(0,T.jsx)(e?Fe.Slot:"button",{className:p(to({className:t,size:o,variant:r})),ref:n,...l}));X.displayName="Button";var $e=A(require("react"));var K=$e.forwardRef(({className:e,type:t,...o},r)=>(0,T.jsx)("input",{type:t,className:p("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}));K.displayName="Input";var Qe=A(require("react")),ye=A(require("@radix-ui/react-label"));var oo=(0,Oe.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),G=Qe.forwardRef(({className:e,...t},o)=>(0,T.jsx)(ye.Root,{ref:o,className:p(oo(),e),...t}));G.displayName=ye.Root.displayName;var Ke=A(require("react")),xe=Ke.forwardRef(({className:e,...t},o)=>(0,T.jsx)("textarea",{className:p("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}));xe.displayName="Textarea";var m=A(require("@radix-ui/react-select")),W=A(require("react")),we=m.Root;var Se=m.Value,ae=W.forwardRef(({children:e,className:t,...o},r)=>(0,T.jsxs)(m.Trigger,{className:p("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,T.jsx)(m.Icon,{asChild:!0,children:(0,T.jsx)(Ue.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));ae.displayName=m.Trigger.displayName;var et=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.ScrollUpButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,T.jsx)(Ue.ChevronUp,{className:"h-4 w-4"})}));et.displayName=m.ScrollUpButton.displayName;var tt=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.ScrollDownButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,T.jsx)(Ue.ChevronDown,{className:"h-4 w-4"})}));tt.displayName=m.ScrollDownButton.displayName;var ie=W.forwardRef(({children:e,className:t,position:o="popper",...r},l)=>(0,T.jsx)(m.Portal,{children:(0,T.jsxs)(m.Content,{className:p("relative z-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-T-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-T-1",t),position:o,ref:l,...r,children:[(0,T.jsx)(et,{}),(0,T.jsx)(m.Viewport,{className:p("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,T.jsx)(tt,{})]})}));ie.displayName=m.Content.displayName;var ro=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.Label,{className:p("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));ro.displayName=m.Label.displayName;var se=W.forwardRef(({children:e,className:t,...o},r)=>(0,T.jsxs)(m.Item,{className:p("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,T.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,T.jsx)(m.ItemIndicator,{children:(0,T.jsx)(Ue.Check,{className:"h-4 w-4"})})}),(0,T.jsx)(m.ItemText,{children:e})]}));se.displayName=m.Item.displayName;var ao=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.Separator,{className:p("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));ao.displayName=m.Separator.displayName;var Y=A(require("@radix-ui/react-checkbox")),rt=A(require("react")),Ce=rt.forwardRef(({className:e,...t},o)=>(0,T.jsx)(Y.Root,{className:p("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,T.jsx)(Y.Indicator,{className:p("flex items-center justify-center text-current"),children:(0,T.jsx)(Ue.Check,{className:"h-4 w-4"})})}));Ce.displayName=Y.Root.displayName;var io=(0,Oe.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function it({className:e,variant:t,...o}){return(0,T.jsx)("div",{className:p(io({variant:t}),e),...o})}var Pe=A(require("react")),I=A(require("@radix-ui/react-scroll-area"));var le=Pe.forwardRef(({className:e,children:t,...o},r)=>(0,T.jsxs)(I.Root,{ref:r,className:p("relative overflow-hidden",e),...o,children:[(0,T.jsx)(I.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,T.jsx)(nt,{}),(0,T.jsx)(I.Corner,{})]}));le.displayName=I.Root.displayName;var nt=Pe.forwardRef(({className:e,orientation:t="vertical",...o},r)=>(0,T.jsx)(I.ScrollAreaScrollbar,{ref:r,orientation:t,className:p("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,T.jsx)(I.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));nt.displayName=I.ScrollAreaScrollbar.displayName;function lt({deal:e,users:t,customer:o,categories:r,onClose:l,onSave:n,onAddComment:d}){let[a,v]=(0,F.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[x,C]=(0,F.useState)(""),[k,N]=(0,F.useState)(!1),[R,h]=(0,F.useState)(null);(0,F.useEffect)(()=>{N(JSON.stringify(e)!==JSON.stringify(a))},[e,a]);let w=async()=>{try{let s=await n(a);s.success?(N(!1),h(null)):console.error("Failed to save deal:",s.errors)}catch(s){console.error("Failed to save deal:",s)}},u=(s,f)=>{v(O=>({...O,[s]:f}))},P=s=>{let f=(a.categories||[]).includes(s)?(a.categories||[]).filter(O=>O!==s):[...a.categories||[],s];u("categories",f)},D=async()=>{if(x.trim()){let s={text:x,timestamp:new Date().toISOString()};try{let f=await d(s);if(!f.success){console.error("Failed to add comment:",f.errors);return}}catch(f){console.error("Failed to add comment:",f)}v(f=>({...f,comments:[...f.comments||[],s]})),C("")}},E=s=>{switch(s){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},z=s=>t?.find(f=>f.id===Number(s));return(0,T.jsx)(He,{open:!0,children:(0,T.jsxs)(be,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,T.jsxs)(ve,{className:"flex flex-row items-center justify-between",children:[(0,T.jsx)(he,{className:"text-2xl font-bold",children:o?.name}),(0,T.jsxs)("div",{className:"flex space-x-2",children:[(0,T.jsx)(X,{variant:"outline",onClick:l,children:"Close"}),(0,T.jsxs)(X,{onClick:w,disabled:!k,children:[(0,T.jsx)(Ue.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,T.jsxs)(le,{className:"flex-grow pr-4",children:[(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,T.jsx)("div",{className:"grid gap-2 m-1",children:R==="value"?(0,T.jsx)(K,{type:"number",value:a.value,onChange:s=>u("value",Number(s.target.value)),onBlur:()=>h(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,T.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("value"),children:["\xA3",a.value?.toLocaleString()]})}),(0,T.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-accent",children:"Assignee"}),R==="assignee"?(0,T.jsxs)(we,{value:a?.assignee?.id?.toString()||"",onValueChange:s=>u("assignee",z(s)),children:[(0,T.jsx)(ae,{children:(0,T.jsx)(Se,{placeholder:"Select assignee"})}),(0,T.jsx)(ie,{children:t&&t.map(s=>(0,T.jsx)(se,{value:s?.id?.toString()||"",children:s.name},s.id))})]}):(0,T.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("assignee"),children:[(0,T.jsx)(Ue.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,T.jsx)("span",{children:a.assignee.name})]})]}),(0,T.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-accent",children:"Closure Date"}),R==="closureDate"?(0,T.jsx)(K,{type:"date",value:a.closureDate?.split("T")[0]??"",onChange:s=>u("closureDate",s.target.value),onBlur:()=>h(null),className:"mr-2",autoFocus:!0}):(0,T.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("closureDate"),children:[(0,T.jsx)(Ue.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,T.jsx)("span",{children:a.closureDate?new Date(a.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,T.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,T.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-accent",children:"Description"}),R==="description"?(0,T.jsx)(xe,{value:a.description||"",onChange:s=>u("description",s.target.value),onBlur:()=>h(null),className:"min-h-[100px]",autoFocus:!0}):(0,T.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>h("description"),children:a.description})]})}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,T.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-accent",children:"Status"}),R==="status"?(0,T.jsxs)(we,{value:a.status,onValueChange:s=>{u("status",s),h(null)},children:[(0,T.jsx)(ae,{children:(0,T.jsx)(Se,{placeholder:"Select status"})}),(0,T.jsx)(ie,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(s=>(0,T.jsx)(se,{value:s,children:s},s))})]}):(0,T.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("status"),children:a.status})]}),(0,T.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-accent",children:"Categories"}),R==="categories"?(0,T.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:r.map(s=>(0,T.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,T.jsx)(Ce,{id:s.id?.toString()||"",checked:(a.categories||[]).some(f=>f.id===s.id),onCheckedChange:()=>s.id!==void 0&&P(s)}),(0,T.jsx)("label",{htmlFor:(s.id??"").toString(),className:`text-sm font-medium ${E(s.type||"sector")} px-2 py-1 rounded`,children:s.name})]},s.id))}):(0,T.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("categories"),children:a.categories&&a.categories.map(s=>{let f=s;return f?(0,T.jsx)(it,{variant:"outline",className:E(f.type||"sector"),children:f.name},f.id):null})})]})]}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,T.jsx)(le,{className:"h-[200px] overflow-T-auto",children:(0,T.jsx)("div",{className:"space-T-2",children:a.comments&&a.comments.slice().sort((s,f)=>new Date(f.timestamp||"").getTime()-new Date(s.timestamp||"").getTime()).map(s=>(0,T.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,T.jsx)("p",{className:"text-sm text-foreground",children:s.text}),(0,T.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[s?.author?.name," - ",new Date(s.timestamp||"").toLocaleString()]})]},s.id))})}),(0,T.jsxs)("div",{className:"flex mt-2",children:[(0,T.jsx)(K,{value:x,onChange:s=>C(s.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,T.jsxs)(X,{onClick:D,className:"ml-2",children:[(0,T.jsx)(Ue.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,T.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(a.updatedAt||"").toLocaleString()]})]})]})]})})}var so=[{id:1,name:"Acme Corp",intro:"A leading technology company",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"GlobalTech",intro:"Innovative solutions provider",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"InnoSystems",intro:"Cutting-edge software development",active:!1,createdAt:"2023-01-01",updatedAt:"2023-01-01"}],ct=[{id:1,name:"Software",type:"proposition",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"Hardware",type:"proposition",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"Referral",type:"source",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:4,name:"Outbound",type:"source",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:5,name:"Tech",type:"sector",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:6,name:"Finance",type:"sector",createdAt:"2023-01-01",updatedAt:"2023-01-01"}],ee=[{id:1,name:"John Doe",email:"john.doe@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"Jane Smith",email:"jane.smith@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"Bob Johnson",email:"bob.johnson@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:4,name:"Alice Brown",email:"alice.brown@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:5,name:"Charlie Davis",email:"charlie.davis@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"}],Xo=[{id:1,customer:so[0],value:5e4,assignee:ee[2],status:"Qualified",categories:ct.slice(0,3),dateLogged:"2023-01-15",closureDate:"2023-06-30",updatedAt:"2023-05-01T10:00:00Z",createdAt:"2023-01-01",comments:[{id:"1",text:"Initial contact made",author:ee[5],timestamp:"2023-01-15T09:00:00Z"}],description:"Potential software solution for Acme Corp"},{id:2,customer:{id:2,name:"GlobalTech",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},value:75e3,assignee:{id:2,name:"Jane Smith",email:"jane.smith@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},status:"Proposal Made",categories:ct.slice(0,3),dateLogged:"2023-02-01",closureDate:"2023-07-31",updatedAt:"2023-05-10T14:30:00Z",createdAt:"2023-01-01",comments:[{id:"2",text:"Proposal sent",author:ee[1],timestamp:"2023-02-15T09:00:00Z"}],description:"Custom hardware solution for GlobalTech"}];var no={title:"CRM/DealDetails",component:lt,parameters:{layout:"centered"},tags:["autodocs"]},lo=no,co={id:"1",name:"Acme Corp",active:!0},dt=[{id:"1",name:"Software",type:"proposition"},{id:"2",name:"Hardware",type:"proposition"},{id:"3",name:"Referral",type:"source"},{id:"4",name:"Outbound",type:"source"},{id:"5",name:"Tech",type:"sector"},{id:"6",name:"Finance",type:"sector"}],mt=e=>Array.from({length:e},(t,o)=>({id:`comment-${o+1}`,text:`This is comment number ${o+1}. It's a mock comment to test the scrolling behavior of the comments section in the DealDetails component.`,author:["John Doe","Jane Smith","Bob Johnson"][o%3],timestamp:new Date(Date.now()-(e-o)*24*60*60*1e3).toISOString()})),pt={id:1,customer:{id:1,name:"Acme Corp",active:!0},value:1e5,assignee:{id:1,name:"John Doe"},status:"Qualified",categories:dt.slice(0,3),dateLogged:"2023-01-01T00:00:00.000Z",closureDate:"2023-12-31T00:00:00.000Z",updatedAt:"2023-06-15T12:00:00.000Z",comments:mt(50),description:"This is a mock deal for Acme Corp. It involves a large software project with potential for hardware integration."},ut={args:{deal:pt,customer:co,categories:dt,users:ee,onClose:()=>console.log("Close clicked"),onSave:e=>console.log("Save clicked",e),onAddComment:e=>console.log("Comment added",e)}},mo={args:{...ut.args,deal:{...pt,comments:mt(100)}}};0&&(module.exports={Default,WithManyComments});
|
|
4
|
+
"use strict";var ft=Object.create;var se=Object.defineProperty;var gt=Object.getOwnPropertyDescriptor;var bt=Object.getOwnPropertyNames;var vt=Object.getPrototypeOf,ht=Object.prototype.hasOwnProperty;var yt=(e,t)=>{for(var o in t)se(e,o,{get:t[o],enumerable:!0})},Te=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of bt(t))!ht.call(e,l)&&l!==o&&se(e,l,{get:()=>t[l],enumerable:!(i=gt(t,l))||i.enumerable});return e};var A=(e,t,o)=>(o=e!=null?ft(vt(e)):{},Te(t||!e||!e.__esModule?se(o,"default",{value:e,enumerable:!0}):o,e)),xt=e=>Te(se({},"__esModule",{value:!0}),e);var po={};yt(po,{Default:()=>ut,WithManyComments:()=>mo,default:()=>lo});module.exports=xt(po);var F=require("react");var q=A(require("react")),S=A(require("@radix-ui/react-dialog")),Ue=require("lucide-react");var We=require("clsx");var ve="-",wt=e=>{let t=Ct(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:d=>{let r=d.split(ve);return r[0]===""&&r.length!==1&&r.shift(),Le(r,t)||St(d)},getConflictingClassGroupIds:(d,r)=>{let h=o[d]||[];return r&&i[d]?[...h,...i[d]]:h}}},Le=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],i=t.nextPart.get(o),l=i?Le(e.slice(1),i):void 0;if(l)return l;if(t.validators.length===0)return;let n=e.join(ve);return t.validators.find(({validator:d})=>d(n))?.classGroupId},Ie=/^\[(.+)\]$/,St=e=>{if(Ie.test(e)){let t=Ie.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Ct=e=>{let{theme:t,prefix:o}=e,i={nextPart:new Map,validators:[]};return Rt(Object.entries(e.classGroups),o).forEach(([n,d])=>{be(d,i,n,t)}),i},be=(e,t,o,i)=>{e.forEach(l=>{if(typeof l=="string"){let n=l===""?t:ze(t,l);n.classGroupId=o;return}if(typeof l=="function"){if(Pt(l)){be(l(i),t,o,i);return}t.validators.push({validator:l,classGroupId:o});return}Object.entries(l).forEach(([n,d])=>{be(d,ze(t,n),o,i)})})},ze=(e,t)=>{let o=e;return t.split(ve).forEach(i=>{o.nextPart.has(i)||o.nextPart.set(i,{nextPart:new Map,validators:[]}),o=o.nextPart.get(i)}),o},Pt=e=>e.isThemeGetter,Rt=(e,t)=>t?e.map(([o,i])=>{let l=i.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([d,r])=>[t+d,r])):n);return[o,l]}):e,Nt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,i=new Map,l=(n,d)=>{o.set(n,d),t++,t>e&&(t=0,i=o,o=new Map)};return{get(n){let d=o.get(n);if(d!==void 0)return d;if((d=i.get(n))!==void 0)return l(n,d),d},set(n,d){o.has(n)?o.set(n,d):l(n,d)}}},Me="!",kt=e=>{let{separator:t,experimentalParseClassName:o}=e,i=t.length===1,l=t[0],n=t.length,d=r=>{let h=[],x=0,C=0,D;for(let u=0;u<r.length;u++){let P=r[u];if(x===0){if(P===l&&(i||r.slice(u,u+n)===t)){h.push(r.slice(C,u)),C=u+n;continue}if(P==="/"){D=u;continue}}P==="["?x++:P==="]"&&x--}let N=h.length===0?r:r.substring(C),R=N.startsWith(Me),b=R?N.substring(1):N,w=D&&D>C?D-C:void 0;return{modifiers:h,hasImportantModifier:R,baseClassName:b,maybePostfixModifierPosition:w}};return o?r=>o({className:r,parseClassName:d}):d},Dt=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(i=>{i[0]==="["?(t.push(...o.sort(),i),o=[]):o.push(i)}),t.push(...o.sort()),t},At=e=>({cache:Nt(e.cacheSize),parseClassName:kt(e),...wt(e)}),Tt=/\s+/,It=(e,t)=>{let{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:l}=t,n=[],d=e.trim().split(Tt),r="";for(let h=d.length-1;h>=0;h-=1){let x=d[h],{modifiers:C,hasImportantModifier:D,baseClassName:N,maybePostfixModifierPosition:R}=o(x),b=!!R,w=i(b?N.substring(0,R):N);if(!w){if(!b){r=x+(r.length>0?" "+r:r);continue}if(w=i(N),!w){r=x+(r.length>0?" "+r:r);continue}b=!1}let u=Dt(C).join(":"),P=D?u+Me:u,k=P+w;if(n.includes(k))continue;n.push(k);let B=l(w,b);for(let z=0;z<B.length;++z){let s=B[z];n.push(P+s)}r=x+(r.length>0?" "+r:r)}return r};function zt(){let e=0,t,o,i="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Ee(t))&&(i&&(i+=" "),i+=o);return i}var Ee=e=>{if(typeof e=="string")return e;let t,o="";for(let i=0;i<e.length;i++)e[i]&&(t=Ee(e[i]))&&(o&&(o+=" "),o+=t);return o};function Lt(e,...t){let o,i,l,n=d;function d(h){let x=t.reduce((C,D)=>D(C),e());return o=At(x),i=o.cache.get,l=o.cache.set,n=r,r(h)}function r(h){let x=i(h);if(x)return x;let C=It(h,o);return l(h,C),C}return function(){return n(zt.apply(null,arguments))}}var g=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Be=/^\[(?:([T-z-]+):)?(.+)\]$/i,Mt=/^\d+\/\d+$/,Et=new Set(["px","full","screen"]),Bt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vt=/\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$/,Gt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wt=/^(inset_)?-?((\d+)?\.?(\d+)[T-z]+|0)_-?((\d+)?\.?(\d+)[T-z]+|0)/,Ut=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,M=e=>_(e)||Et.has(e)||Mt.test(e),V=e=>J(e,"length",Zt),_=e=>!!e&&!Number.isNaN(Number(e)),ge=e=>J(e,"number",_),Z=e=>!!e&&Number.isInteger(Number(e)),Ht=e=>e.endsWith("%")&&_(e.slice(0,-1)),c=e=>Be.test(e),G=e=>Bt.test(e),jt=new Set(["length","size","percentage"]),Ft=e=>J(e,jt,Ve),Ot=e=>J(e,"position",Ve),_t=new Set(["image","url"]),Jt=e=>J(e,_t,qt),$t=e=>J(e,"",Qt),Q=()=>!0,J=(e,t,o)=>{let i=Be.exec(e);return i?i[1]?typeof t=="string"?i[1]===t:t.has(i[1]):o(i[2]):!1},Zt=e=>Vt.test(e)&&!Gt.test(e),Ve=()=>!1,Qt=e=>Wt.test(e),qt=e=>Ut.test(e);var Xt=()=>{let e=g("colors"),t=g("spacing"),o=g("blur"),i=g("brightness"),l=g("borderColor"),n=g("borderRadius"),d=g("borderSpacing"),r=g("borderWidth"),h=g("contrast"),x=g("grayscale"),C=g("hueRotate"),D=g("invert"),N=g("gap"),R=g("gradientColorStops"),b=g("gradientColorStopPositions"),w=g("inset"),u=g("margin"),P=g("opacity"),k=g("padding"),B=g("saturate"),z=g("scale"),s=g("sepia"),f=g("skew"),O=g("space"),Re=g("translate"),me=()=>["auto","contain","none"],pe=()=>["auto","hidden","clip","visible","scroll"],ue=()=>["auto",c,t],v=()=>[c,t],Ne=()=>["",M,V],ae=()=>["auto",_,c],ke=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ie=()=>["solid","dashed","dotted","double","none"],De=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",c],Ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[_,c];return{cacheSize:500,separator:":",theme:{colors:[Q],spacing:[M,V],blur:["none","",G,c],brightness:L(),borderColor:[e],borderRadius:["none","","full",G,c],borderSpacing:v(),borderWidth:Ne(),contrast:L(),grayscale:$(),hueRotate:L(),invert:$(),gap:v(),gradientColorStops:[e],gradientColorStopPositions:[Ht,V],inset:ue(),margin:ue(),opacity:L(),padding:v(),saturate:L(),scale:L(),sepia:$(),skew:L(),space:v(),translate:v()},classGroups:{aspect:[{aspect:["auto","square","video",c]}],container:["container"],columns:[{columns:[G]}],"break-after":[{"break-after":Ae()}],"break-before":[{"break-before":Ae()}],"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:[...ke(),c]}],overflow:[{overflow:pe()}],"overflow-x":[{"overflow-x":pe()}],"overflow-T":[{"overflow-T":pe()}],overscroll:[{overscroll:me()}],"overscroll-x":[{"overscroll-x":me()}],"overscroll-T":[{"overscroll-T":me()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-T":[{"inset-T":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Z,c]}],basis:[{basis:ue()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",c]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",Z,c]}],"grid-cols":[{"grid-cols":[Q]}],"col-start-end":[{col:["auto",{span:["full",Z,c]},c]}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":[Q]}],"row-start-end":[{row:["auto",{span:[Z,c]},c]}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",c]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",c]}],gap:[{gap:[N]}],"gap-x":[{"gap-x":[N]}],"gap-T":[{"gap-T":[N]}],"justify-content":[{justify:["normal",...fe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...fe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...fe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],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":[O]}],"space-x-reverse":["space-x-reverse"],"space-T":[{"space-T":[O]}],"space-T-reverse":["space-T-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",c,t]}],"min-w":[{"min-w":[c,t,"min","max","fit"]}],"max-w":[{"max-w":[c,t,"none","full","min","max","fit","prose",{screen:[G]},G]}],h:[{h:[c,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[c,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[c,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[c,t,"auto","min","max","fit"]}],"font-size":[{text:["base",G,V]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ge]}],"font-family":[{font:[Q]}],"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",c]}],"line-clamp":[{"line-clamp":["none",_,ge]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",M,c]}],"list-image":[{"list-image":["none",c]}],"list-style-type":[{list:["none","disc","decimal",c]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[P]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",M,V]}],"underline-offset":[{"underline-offset":["auto",M,c]}],"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:v()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",c]}],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",c]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[P]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ke(),Ot]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","T","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ft]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Jt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[r]}],"border-w-x":[{"border-x":[r]}],"border-w-T":[{"border-T":[r]}],"border-w-s":[{"border-s":[r]}],"border-w-e":[{"border-e":[r]}],"border-w-t":[{"border-t":[r]}],"border-w-r":[{"border-r":[r]}],"border-w-b":[{"border-b":[r]}],"border-w-l":[{"border-l":[r]}],"border-opacity":[{"border-opacity":[P]}],"border-style":[{border:[...ie(),"hidden"]}],"divide-x":[{"divide-x":[r]}],"divide-x-reverse":["divide-x-reverse"],"divide-T":[{"divide-T":[r]}],"divide-T-reverse":["divide-T-reverse"],"divide-opacity":[{"divide-opacity":[P]}],"divide-style":[{divide:ie()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-T":[{"border-T":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...ie()]}],"outline-offset":[{"outline-offset":[M,c]}],"outline-w":[{outline:[M,V]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[M,V]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",G,$t]}],"shadow-color":[{shadow:[Q]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[...De(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":De()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[i]}],contrast:[{contrast:[h]}],"drop-shadow":[{"drop-shadow":["","none",G,c]}],grayscale:[{grayscale:[x]}],"hue-rotate":[{"hue-rotate":[C]}],invert:[{invert:[D]}],saturate:[{saturate:[B]}],sepia:[{sepia:[s]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[h]}],"backdrop-grayscale":[{"backdrop-grayscale":[x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[C]}],"backdrop-invert":[{"backdrop-invert":[D]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[B]}],"backdrop-sepia":[{"backdrop-sepia":[s]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-T":[{"border-spacing-T":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",c]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",c]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",c]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-T":[{"scale-T":[z]}],rotate:[{rotate:[Z,c]}],"translate-x":[{"translate-x":[Re]}],"translate-T":[{"translate-T":[Re]}],"skew-x":[{"skew-x":[f]}],"skew-T":[{"skew-T":[f]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",c]}],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","no-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",c]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","T","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":v()}],"scroll-mx":[{"scroll-mx":v()}],"scroll-my":[{"scroll-my":v()}],"scroll-ms":[{"scroll-ms":v()}],"scroll-me":[{"scroll-me":v()}],"scroll-mt":[{"scroll-mt":v()}],"scroll-mr":[{"scroll-mr":v()}],"scroll-mb":[{"scroll-mb":v()}],"scroll-ml":[{"scroll-ml":v()}],"scroll-p":[{"scroll-p":v()}],"scroll-px":[{"scroll-px":v()}],"scroll-py":[{"scroll-py":v()}],"scroll-ps":[{"scroll-ps":v()}],"scroll-pe":[{"scroll-pe":v()}],"scroll-pt":[{"scroll-pt":v()}],"scroll-pr":[{"scroll-pr":v()}],"scroll-pb":[{"scroll-pb":v()}],"scroll-pl":[{"scroll-pl":v()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","T","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-T":[{"touch-pan":["T","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",c]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[M,V,ge]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-T"],overscroll:["overscroll-x","overscroll-T"],inset:["inset-x","inset-T","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-T":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-T"],p:["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-T"],"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-T":["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-T":["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-p":["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-T","touch-pz"],"touch-x":["touch"],"touch-T":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ge=Lt(Xt);function p(...e){return Ge((0,We.clsx)(e))}var T=require("react/jsx-runtime"),He=S.Root;var Kt=S.Portal;var je=q.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Overlay,{ref:o,className:p("fixed inset-0 z-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}));je.displayName=S.Overlay.displayName;var he=q.forwardRef(({className:e,children:t,...o},i)=>(0,T.jsxs)(Kt,{children:[(0,T.jsx)(je,{}),(0,T.jsxs)(S.Content,{ref:i,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-T-[-50%] gap-4 border bg-background p-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,T.jsxs)(S.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,T.jsx)(Ue.X,{className:"h-4 w-4"}),(0,T.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));he.displayName=S.Content.displayName;var ye=({className:e,...t})=>(0,T.jsx)("div",{className:p("flex flex-col space-T-1.5 text-center sm:text-left",e),...t});ye.displayName="DialogHeader";var Yt=({className:e,...t})=>(0,T.jsx)("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Yt.displayName="DialogFooter";var xe=q.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Title,{ref:o,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));xe.displayName=S.Title.displayName;var eo=q.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Description,{ref:o,className:p("text-sm text-muted-foreground",e),...t}));eo.displayName=S.Description.displayName;var Fe=require("@radix-ui/react-slot"),Oe=require("class-variance-authority"),_e=A(require("react")),to=(0,Oe.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-foreground",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),X=_e.forwardRef(({asChild:e=!1,className:t,size:o,variant:i,...l},n)=>(0,T.jsx)(e?Fe.Slot:"button",{className:p(to({className:t,size:o,variant:i})),ref:n,...l}));X.displayName="Button";var $e=A(require("react"));var K=$e.forwardRef(({className:e,type:t,...o},i)=>(0,T.jsx)("input",{type:t,className:p("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:i,...o}));K.displayName="Input";var Qe=A(require("react")),we=A(require("@radix-ui/react-label"));var oo=(0,Oe.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),E=Qe.forwardRef(({className:e,...t},o)=>(0,T.jsx)(we.Root,{ref:o,className:p(oo(),e),...t}));E.displayName=we.Root.displayName;var Ke=A(require("react")),Se=Ke.forwardRef(({className:e,...t},o)=>(0,T.jsx)("textarea",{className:p("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}));Se.displayName="Textarea";var m=A(require("@radix-ui/react-select")),W=A(require("react")),ne=m.Root;var le=m.Value,Y=W.forwardRef(({children:e,className:t,...o},i)=>(0,T.jsxs)(m.Trigger,{className:p("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:i,...o,children:[e,(0,T.jsx)(m.Icon,{asChild:!0,children:(0,T.jsx)(Ue.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Y.displayName=m.Trigger.displayName;var et=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.ScrollUpButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,T.jsx)(Ue.ChevronUp,{className:"h-4 w-4"})}));et.displayName=m.ScrollUpButton.displayName;var tt=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.ScrollDownButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,T.jsx)(Ue.ChevronDown,{className:"h-4 w-4"})}));tt.displayName=m.ScrollDownButton.displayName;var ee=W.forwardRef(({children:e,className:t,position:o="popper",...i},l)=>(0,T.jsx)(m.Portal,{children:(0,T.jsxs)(m.Content,{className:p("relative z-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-T-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-T-1",t),position:o,ref:l,...i,children:[(0,T.jsx)(et,{}),(0,T.jsx)(m.Viewport,{className:p("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,T.jsx)(tt,{})]})}));ee.displayName=m.Content.displayName;var ro=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.Label,{className:p("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));ro.displayName=m.Label.displayName;var te=W.forwardRef(({children:e,className:t,...o},i)=>(0,T.jsxs)(m.Item,{className:p("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:i,...o,children:[(0,T.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,T.jsx)(m.ItemIndicator,{children:(0,T.jsx)(Ue.Check,{className:"h-4 w-4"})})}),(0,T.jsx)(m.ItemText,{children:e})]}));te.displayName=m.Item.displayName;var ao=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.Separator,{className:p("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));ao.displayName=m.Separator.displayName;var oe=A(require("@radix-ui/react-checkbox")),rt=A(require("react")),Ce=rt.forwardRef(({className:e,...t},o)=>(0,T.jsx)(oe.Root,{className:p("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,T.jsx)(oe.Indicator,{className:p("flex items-center justify-center text-current"),children:(0,T.jsx)(Ue.Check,{className:"h-4 w-4"})})}));Ce.displayName=oe.Root.displayName;var io=(0,Oe.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function it({className:e,variant:t,...o}){return(0,T.jsx)("div",{className:p(io({variant:t}),e),...o})}var Pe=A(require("react")),I=A(require("@radix-ui/react-scroll-area"));var de=Pe.forwardRef(({className:e,children:t,...o},i)=>(0,T.jsxs)(I.Root,{ref:i,className:p("relative overflow-hidden",e),...o,children:[(0,T.jsx)(I.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,T.jsx)(nt,{}),(0,T.jsx)(I.Corner,{})]}));de.displayName=I.Root.displayName;var nt=Pe.forwardRef(({className:e,orientation:t="vertical",...o},i)=>(0,T.jsx)(I.ScrollAreaScrollbar,{ref:i,orientation:t,className:p("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,T.jsx)(I.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));nt.displayName=I.ScrollAreaScrollbar.displayName;function lt({deal:e,users:t,customer:o,categories:i,onClose:l,onSave:n,onAddComment:d}){let[r,h]=(0,F.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[x,C]=(0,F.useState)(""),[D,N]=(0,F.useState)(!1),[R,b]=(0,F.useState)(null);(0,F.useEffect)(()=>{N(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);let w=async()=>{try{let s=await n(r);s.success?(N(!1),b(null)):console.error("Failed to save deal:",s.errors)}catch(s){console.error("Failed to save deal:",s)}},u=(s,f)=>{h(O=>({...O,[s]:f}))},P=s=>{let f=(r.categories||[]).includes(s)?(r.categories||[]).filter(O=>O!==s):[...r.categories||[],s];u("categories",f)},k=async()=>{if(x.trim()){let s={text:x,timestamp:new Date().toISOString()};try{let f=await d(s);if(!f.success){console.error("Failed to add comment:",f.errors);return}}catch(f){console.error("Failed to add comment:",f)}h(f=>({...f,comments:[...f.comments||[],s]})),C("")}},B=s=>{switch(s){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},z=s=>t?.find(f=>f.id===Number(s));return(0,T.jsx)(He,{open:!0,children:(0,T.jsxs)(he,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,T.jsxs)(ye,{className:"flex flex-row items-center justify-between",children:[(0,T.jsx)(xe,{className:"text-2xl font-bold",children:o?.name}),(0,T.jsxs)("div",{className:"flex space-x-2",children:[(0,T.jsx)(X,{variant:"outline",onClick:l,children:"Close"}),(0,T.jsxs)(X,{onClick:w,disabled:!D,children:[(0,T.jsx)(Ue.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,T.jsxs)(de,{className:"flex-grow pr-4",children:[(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,T.jsx)("div",{className:"grid gap-2 m-1",children:R==="value"?(0,T.jsx)(K,{type:"number",value:r.value,onChange:s=>u("value",Number(s.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,T.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("value"),children:["\xA3",r.value?.toLocaleString()]})}),(0,T.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,T.jsx)(E,{className:"text-sm font-medium text-accent",children:"Assignee"}),R==="assignee"?(0,T.jsxs)(ne,{value:r?.assignee?.id?.toString()||"",onValueChange:s=>u("assignee",z(s)),children:[(0,T.jsx)(Y,{children:(0,T.jsx)(le,{placeholder:"Select assignee"})}),(0,T.jsx)(ee,{children:t&&t.map(s=>(0,T.jsx)(te,{value:s?.id?.toString()||"",children:s.name},s.id))})]}):(0,T.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("assignee"),children:[(0,T.jsx)(Ue.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,T.jsx)("span",{children:r.assignee.name})]})]}),(0,T.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,T.jsx)(E,{className:"text-sm font-medium text-accent",children:"Closure Date"}),R==="closureDate"?(0,T.jsx)(K,{type:"date",value:r.closureDate?.split("T")[0]??"",onChange:s=>u("closureDate",s.target.value),onBlur:()=>b(null),className:"mr-2",autoFocus:!0}):(0,T.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("closureDate"),children:[(0,T.jsx)(Ue.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,T.jsx)("span",{children:r.closureDate?new Date(r.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,T.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,T.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,T.jsx)(E,{className:"text-sm font-medium text-accent",children:"Description"}),R==="description"?(0,T.jsx)(Se,{value:r.description||"",onChange:s=>u("description",s.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,T.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:r.description})]})}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,T.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,T.jsx)(E,{className:"text-sm font-medium text-accent",children:"Status"}),R==="status"?(0,T.jsxs)(ne,{value:r.status,onValueChange:s=>{u("status",s),b(null)},children:[(0,T.jsx)(Y,{children:(0,T.jsx)(le,{placeholder:"Select status"})}),(0,T.jsx)(ee,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(s=>(0,T.jsx)(te,{value:s,children:s},s))})]}):(0,T.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:r.status})]}),(0,T.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,T.jsx)(E,{className:"text-sm font-medium text-accent",children:"Categories"}),R==="categories"?(0,T.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:i.map(s=>(0,T.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,T.jsx)(Ce,{id:s.id?.toString()||"",checked:(r.categories||[]).some(f=>f.id===s.id),onCheckedChange:()=>s.id!==void 0&&P(s)}),(0,T.jsx)("label",{htmlFor:(s.id??"").toString(),className:`text-sm font-medium ${B(s.type||"sector")} px-2 py-1 rounded`,children:s.name})]},s.id))}):(0,T.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:r.categories&&r.categories.map(s=>{let f=s;return f?(0,T.jsx)(it,{variant:"outline",className:B(f.type||"sector"),children:f.name},f.id):null})})]}),(0,T.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,T.jsx)(E,{className:"text-sm font-medium text-accent",children:"COGE Status"}),R==="gecoStatus"?(0,T.jsxs)(ne,{value:r.gecoStatus??void 0,onValueChange:s=>{u("gecoStatus",s),b(null)},children:[(0,T.jsx)(Y,{children:(0,T.jsx)(le,{placeholder:"Select status"})}),(0,T.jsx)(ee,{children:["firm","forecast","other"].map(s=>(0,T.jsx)(te,{value:s,children:s.charAt(0).toUpperCase()+s.slice(1)},s))})]}):(0,T.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("gecoStatus"),children:r.gecoStatus?r.gecoStatus.charAt(0).toUpperCase()+r.gecoStatus.slice(1):"N/A"})]})]}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(E,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,T.jsx)(de,{className:"h-[200px] overflow-T-auto",children:(0,T.jsx)("div",{className:"space-T-2",children:r.comments&&r.comments.slice().sort((s,f)=>new Date(f.timestamp||"").getTime()-new Date(s.timestamp||"").getTime()).map(s=>(0,T.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,T.jsx)("p",{className:"text-sm text-foreground",children:s.text}),(0,T.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[s?.author?.name," - ",new Date(s.timestamp||"").toLocaleString()]})]},s.id))})}),(0,T.jsxs)("div",{className:"flex mt-2",children:[(0,T.jsx)(K,{value:x,onChange:s=>C(s.target.value),placeholder:"Add T comment...",className:"flex-grow ml-1"}),(0,T.jsxs)(X,{onClick:k,className:"ml-2",children:[(0,T.jsx)(Ue.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,T.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(r.updatedAt||"").toLocaleString()]})]})]})]})})}var so=[{id:1,name:"Acme Corp",intro:"A leading technology company",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"GlobalTech",intro:"Innovative solutions provider",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"InnoSystems",intro:"Cutting-edge software development",active:!1,createdAt:"2023-01-01",updatedAt:"2023-01-01"}],ct=[{id:1,name:"Software",type:"proposition",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"Hardware",type:"proposition",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"Referral",type:"source",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:4,name:"Outbound",type:"source",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:5,name:"Tech",type:"sector",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:6,name:"Finance",type:"sector",createdAt:"2023-01-01",updatedAt:"2023-01-01"}],re=[{id:1,name:"John Doe",email:"john.doe@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"Jane Smith",email:"jane.smith@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"Bob Johnson",email:"bob.johnson@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:4,name:"Alice Brown",email:"alice.brown@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:5,name:"Charlie Davis",email:"charlie.davis@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"}],Xo=[{id:1,customer:so[0],value:5e4,assignee:re[2],status:"Qualified",categories:ct.slice(0,3),dateLogged:"2023-01-15",closureDate:"2023-06-30",updatedAt:"2023-05-01T10:00:00Z",createdAt:"2023-01-01",comments:[{id:"1",text:"Initial contact made",author:re[5],timestamp:"2023-01-15T09:00:00Z"}],description:"Potential software solution for Acme Corp"},{id:2,customer:{id:2,name:"GlobalTech",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},value:75e3,assignee:{id:2,name:"Jane Smith",email:"jane.smith@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},status:"Proposal Made",categories:ct.slice(0,3),dateLogged:"2023-02-01",closureDate:"2023-07-31",updatedAt:"2023-05-10T14:30:00Z",createdAt:"2023-01-01",comments:[{id:"2",text:"Proposal sent",author:re[1],timestamp:"2023-02-15T09:00:00Z"}],description:"Custom hardware solution for GlobalTech"}];var no={title:"CRM/DealDetails",component:lt,parameters:{layout:"centered"},tags:["autodocs"]},lo=no,co={id:"1",name:"Acme Corp",active:!0},dt=[{id:"1",name:"Software",type:"proposition"},{id:"2",name:"Hardware",type:"proposition"},{id:"3",name:"Referral",type:"source"},{id:"4",name:"Outbound",type:"source"},{id:"5",name:"Tech",type:"sector"},{id:"6",name:"Finance",type:"sector"}],mt=e=>Array.from({length:e},(t,o)=>({id:`comment-${o+1}`,text:`This is comment number ${o+1}. It's T mock comment to test the scrolling behavior of the comments section in the DealDetails component.`,author:["John Doe","Jane Smith","Bob Johnson"][o%3],timestamp:new Date(Date.now()-(e-o)*24*60*60*1e3).toISOString()})),pt={id:1,customer:{id:1,name:"Acme Corp",active:!0},value:1e5,assignee:{id:1,name:"John Doe"},status:"Qualified",gecoStatus:"firm",categories:dt.slice(0,3),dateLogged:"2023-01-01T00:00:00.000Z",closureDate:"2023-12-31T00:00:00.000Z",updatedAt:"2023-06-15T12:00:00.000Z",comments:mt(50),description:"This is T mock deal for Acme Corp. It involves T large software project with potential for hardware integration."},ut={args:{deal:pt,customer:co,categories:dt,users:re,onClose:()=>console.log("Close clicked"),onSave:e=>console.log("Save clicked",e),onAddComment:e=>console.log("Comment added",e)}},mo={args:{...ut.args,deal:{...pt,comments:mt(100)}}};0&&(module.exports={Default,WithManyComments});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a}from"../../chunk-TLBLUYXL.mjs";import{a as
|
|
1
|
+
import{c as a}from"../../chunk-TLBLUYXL.mjs";import{a as o}from"../../chunk-MEWCJ4MA.mjs";import"../../chunk-OGZERPA4.mjs";import"../../chunk-6T322YHB.mjs";import"../../chunk-KJIBE57R.mjs";import"../../chunk-CX4XB5W2.mjs";import"../../chunk-EECIYMTX.mjs";import"../../chunk-BUCI7BPM.mjs";import"../../chunk-JPZJET3B.mjs";import"../../chunk-BPSLUO5I.mjs";import"../../chunk-J2IHT57D.mjs";import"../../chunk-HTVHCBXQ.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-ZLSF5YXT.mjs";import"../../chunk-M6LJ4BNZ.mjs";var n={title:"CRM/DealDetails",component:o,parameters:{layout:"centered"},tags:["autodocs"]},u=n,i={id:"1",name:"Acme Corp",active:!0},r=[{id:"1",name:"Software",type:"proposition"},{id:"2",name:"Hardware",type:"proposition"},{id:"3",name:"Referral",type:"source"},{id:"4",name:"Outbound",type:"source"},{id:"5",name:"Tech",type:"sector"},{id:"6",name:"Finance",type:"sector"}],s=e=>Array.from({length:e},(l,t)=>({id:`comment-${t+1}`,text:`This is comment number ${t+1}. It's a mock comment to test the scrolling behavior of the comments section in the DealDetails component.`,author:["John Doe","Jane Smith","Bob Johnson"][t%3],timestamp:new Date(Date.now()-(e-t)*24*60*60*1e3).toISOString()})),m={id:1,customer:{id:1,name:"Acme Corp",active:!0},value:1e5,assignee:{id:1,name:"John Doe"},status:"Qualified",gecoStatus:"firm",categories:r.slice(0,3),dateLogged:"2023-01-01T00:00:00.000Z",closureDate:"2023-12-31T00:00:00.000Z",updatedAt:"2023-06-15T12:00:00.000Z",comments:s(50),description:"This is a mock deal for Acme Corp. It involves a large software project with potential for hardware integration."},c={args:{deal:m,customer:i,categories:r,users:a,onClose:()=>console.log("Close clicked"),onSave:e=>console.log("Save clicked",e),onAddComment:e=>console.log("Comment added",e)}},g={args:{...c.args,deal:{...m,comments:s(100)}}};export{c as Default,g as WithManyComments,u as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
"use strict";"use client";var Mt=Object.create;var we=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty;var Vt=(e,t)=>{for(var r in t)we(e,r,{get:t[r],enumerable:!0})},Ke=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of zt(t))!Ht.call(e,s)&&s!==r&&we(e,s,{get:()=>t[s],enumerable:!(a=Et(t,s))||a.enumerable});return e};var z=(e,t,r)=>(r=e!=null?Mt(Bt(e)):{},Ke(t||!e||!e.__esModule?we(r,"default",{value:e,enumerable:!0}):r,e)),Ft=e=>Ke(we({},"__esModule",{value:!0}),e);var Ar={};Vt(Ar,{CRMKanbanBoard:()=>kr});module.exports=Ft(Ar);var Re=require("react");var he=z(require("react")),L=z(require("@radix-ui/react-dialog")),rt=require("lucide-react");var tt=require("clsx");var Ee="-",Wt=e=>{let t=Gt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:m=>{let o=m.split(Ee);return o[0]===""&&o.length!==1&&o.shift(),Je(o,t)||Ut(m)},getConflictingClassGroupIds:(m,o)=>{let g=r[m]||[];return o&&a[m]?[...g,...a[m]]:g}}},Je=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),s=a?Je(e.slice(1),a):void 0;if(s)return s;if(t.validators.length===0)return;let i=e.join(Ee);return t.validators.find(({validator:m})=>m(i))?.classGroupId},$e=/^\[(.+)\]$/,Ut=e=>{if($e.test(e)){let t=$e.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Gt=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return _t(Object.entries(e.classGroups),r).forEach(([i,m])=>{Me(m,a,i,t)}),a},Me=(e,t,r,a)=>{e.forEach(s=>{if(typeof s=="string"){let i=s===""?t:qe(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(Ot(s)){Me(s(a),t,r,a);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,m])=>{Me(m,qe(t,i),r,a)})})},qe=(e,t)=>{let r=e;return t.split(Ee).forEach(a=>{r.nextPart.has(a)||r.nextPart.set(a,{nextPart:new Map,validators:[]}),r=r.nextPart.get(a)}),r},Ot=e=>e.isThemeGetter,_t=(e,t)=>t?e.map(([r,a])=>{let s=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([m,o])=>[t+m,o])):i);return[r,s]}):e,jt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,a=new Map,s=(i,m)=>{r.set(i,m),t++,t>e&&(t=0,a=r,r=new Map)};return{get(i){let m=r.get(i);if(m!==void 0)return m;if((m=a.get(i))!==void 0)return s(i,m),m},set(i,m){r.has(i)?r.set(i,m):s(i,m)}}},Qe="!",Kt=e=>{let{separator:t,experimentalParseClassName:r}=e,a=t.length===1,s=t[0],i=t.length,m=o=>{let g=[],S=0,N=0,p;for(let y=0;y<o.length;y++){let A=o[y];if(S===0){if(A===s&&(a||o.slice(y,y+i)===t)){g.push(o.slice(N,y)),N=y+i;continue}if(A==="/"){p=y;continue}}A==="["?S++:A==="]"&&S--}let b=g.length===0?o:o.substring(N),x=b.startsWith(Qe),w=x?b.substring(1):b,C=p&&p>N?p-N:void 0;return{modifiers:g,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:C}};return r?o=>r({className:o,parseClassName:m}):m},$t=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(a=>{a[0]==="["?(t.push(...r.sort(),a),r=[]):r.push(a)}),t.push(...r.sort()),t},qt=e=>({cache:jt(e.cacheSize),parseClassName:Kt(e),...Wt(e)}),Jt=/\s+/,Qt=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:s}=t,i=[],m=e.trim().split(Jt),o="";for(let g=m.length-1;g>=0;g-=1){let S=m[g],{modifiers:N,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:x}=r(S),w=!!x,C=a(w?b.substring(0,x):b);if(!C){if(!w){o=S+(o.length>0?" "+o:o);continue}if(C=a(b),!C){o=S+(o.length>0?" "+o:o);continue}w=!1}let y=$t(N).join(":"),A=p?y+Qe:y,E=A+C;if(i.includes(E))continue;i.push(E);let d=s(C,w);for(let h=0;h<d.length;++h){let l=d[h];i.push(A+l)}o=S+(o.length>0?" "+o:o)}return o};function Xt(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Xe(t))&&(a&&(a+=" "),a+=r);return a}var Xe=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=Xe(e[a]))&&(r&&(r+=" "),r+=t);return r};function Zt(e,...t){let r,a,s,i=m;function m(g){let S=t.reduce((N,p)=>p(N),e());return r=qt(S),a=r.cache.get,s=r.cache.set,i=o,o(g)}function o(g){let S=a(g);if(S)return S;let N=Qt(g,r);return s(g,N),N}return function(){return i(Xt.apply(null,arguments))}}var D=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ze=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yt=/^\d+\/\d+$/,er=new Set(["px","full","screen"]),tr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|it|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,or=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ar=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,G=e=>le(e)||er.has(e)||Yt.test(e),O=e=>ce(e,"length",ur),le=e=>!!e&&!Number.isNaN(Number(e)),Ie=e=>ce(e,"number",le),be=e=>!!e&&Number.isInteger(Number(e)),ir=e=>e.endsWith("%")&&le(e.slice(0,-1)),u=e=>Ze.test(e),_=e=>tr.test(e),nr=new Set(["length","size","percentage"]),lr=e=>ce(e,nr,Ye),cr=e=>ce(e,"position",Ye),dr=new Set(["image","url"]),mr=e=>ce(e,dr,gr),pr=e=>ce(e,"",fr),ve=()=>!0,ce=(e,t,r)=>{let a=Ze.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},ur=e=>rr.test(e)&&!or.test(e),Ye=()=>!1,fr=e=>ar.test(e),gr=e=>sr.test(e);var br=()=>{let e=D("colors"),t=D("spacing"),r=D("blur"),a=D("brightness"),s=D("borderColor"),i=D("borderRadius"),m=D("borderSpacing"),o=D("borderWidth"),g=D("contrast"),S=D("grayscale"),N=D("hueRotate"),p=D("invert"),b=D("gap"),x=D("gradientColorStops"),w=D("gradientColorStopPositions"),C=D("inset"),y=D("margin"),A=D("opacity"),E=D("padding"),d=D("saturate"),h=D("scale"),l=D("sepia"),P=D("skew"),ne=D("space"),Ue=D("translate"),ke=()=>["auto","contain","none"],Ae=()=>["auto","hidden","clip","visible","scroll"],Te=()=>["auto",u,t],R=()=>[u,t],Ge=()=>["",G,O],ye=()=>["auto",le,u],Oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ce=()=>["solid","dashed","dotted","double","none"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Le=()=>["start","end","center","between","around","evenly","stretch"],ge=()=>["","0",u],je=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[le,u];return{cacheSize:500,separator:":",theme:{colors:[ve],spacing:[G,O],blur:["none","",_,u],brightness:U(),borderColor:[e],borderRadius:["none","","full",_,u],borderSpacing:R(),borderWidth:Ge(),contrast:U(),grayscale:ge(),hueRotate:U(),invert:ge(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[ir,O],inset:Te(),margin:Te(),opacity:U(),padding:R(),saturate:U(),scale:U(),sepia:ge(),skew:U(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",u]}],container:["container"],columns:[{columns:[_]}],"break-after":[{"break-after":je()}],"break-before":[{"break-before":je()}],"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:[...Oe(),u]}],overflow:[{overflow:Ae()}],"overflow-x":[{"overflow-x":Ae()}],"overflow-y":[{"overflow-y":Ae()}],overscroll:[{overscroll:ke()}],"overscroll-x":[{"overscroll-x":ke()}],"overscroll-y":[{"overscroll-y":ke()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[C]}],"inset-x":[{"inset-x":[C]}],"inset-y":[{"inset-y":[C]}],start:[{start:[C]}],end:[{end:[C]}],top:[{top:[C]}],right:[{right:[C]}],bottom:[{bottom:[C]}],left:[{left:[C]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",be,u]}],basis:[{basis:Te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",u]}],grow:[{grow:ge()}],shrink:[{shrink:ge()}],order:[{order:["first","last","none",be,u]}],"grid-cols":[{"grid-cols":[ve]}],"col-start-end":[{col:["auto",{span:["full",be,u]},u]}],"col-start":[{"col-start":ye()}],"col-end":[{"col-end":ye()}],"grid-rows":[{"grid-rows":[ve]}],"row-start-end":[{row:["auto",{span:[be,u]},u]}],"row-start":[{"row-start":ye()}],"row-end":[{"row-end":ye()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",u]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",u]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...Le()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Le(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Le(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],it:[{it:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"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",u,t]}],"min-w":[{"min-w":[u,t,"min","max","fit"]}],"max-w":[{"max-w":[u,t,"none","full","min","max","fit","prose",{screen:[_]},_]}],h:[{h:[u,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[u,t,"auto","min","max","fit"]}],"font-size":[{text:["base",_,O]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ie]}],"font-family":[{font:[ve]}],"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",u]}],"line-clamp":[{"line-clamp":["none",le,Ie]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",G,u]}],"list-image":[{"list-image":["none",u]}],"list-style-type":[{list:["none","disc","decimal",u]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[A]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",G,O]}],"underline-offset":[{"underline-offset":["auto",G,u]}],"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:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",u]}],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",u]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[A]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Oe(),cr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],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-B":[{"rounded-B":[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:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[A]}],"border-style":[{border:[...Ce(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[A]}],"divide-style":[{divide:Ce()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Ce()]}],"outline-offset":[{"outline-offset":[G,u]}],"outline-w":[{outline:[G,O]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ge()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[A]}],"ring-offset-w":[{"ring-offset":[G,O]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",_,pr]}],"shadow-color":[{shadow:[ve]}],opacity:[{opacity:[A]}],"mix-blend":[{"mix-blend":[..._e(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_e()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",_,u]}],grayscale:[{grayscale:[S]}],"hue-rotate":[{"hue-rotate":[N]}],invert:[{invert:[p]}],saturate:[{saturate:[d]}],sepia:[{sepia:[l]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[S]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[N]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[A]}],"backdrop-saturate":[{"backdrop-saturate":[d]}],"backdrop-sepia":[{"backdrop-sepia":[l]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",u]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",u]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",u]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[h]}],"scale-x":[{"scale-x":[h]}],"scale-y":[{"scale-y":[h]}],rotate:[{rotate:[be,u]}],"translate-x":[{"translate-x":[Ue]}],"translate-y":[{"translate-y":[Ue]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",u]}],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","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","B-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","B-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",u]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-it":[{"scroll-it":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",u]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[G,O,Ie]}],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"],p:["px","py","ps","pe","it","pr","pb","pl"],px:["pr","pl"],py:["it","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-B","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-B","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-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-it","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-it","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var et=Zt(br);function f(...e){return et((0,tt.clsx)(e))}var B=require("react/jsx-runtime"),de=L.Root,ot=L.Trigger,vr=L.Portal;var at=he.forwardRef(({className:e,...t},r)=>(0,B.jsx)(L.Overlay,{ref:r,className:f("fixed inset-0 z-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}));at.displayName=L.Overlay.displayName;var q=he.forwardRef(({className:e,children:t,...r},a)=>(0,B.jsxs)(vr,{children:[(0,B.jsx)(at,{}),(0,B.jsxs)(L.Content,{ref:a,className:f("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-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),...r,children:[t,(0,B.jsxs)(L.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,B.jsx)(rt.X,{className:"h-4 w-4"}),(0,B.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));q.displayName=L.Content.displayName;var J=({className:e,...t})=>(0,B.jsx)("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});J.displayName="DialogHeader";var hr=({className:e,...t})=>(0,B.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});hr.displayName="DialogFooter";var Q=he.forwardRef(({className:e,...t},r)=>(0,B.jsx)(L.Title,{ref:r,className:f("text-lg font-semibold leading-none tracking-tight",e),...t}));Q.displayName=L.Title.displayName;var xr=he.forwardRef(({className:e,...t},r)=>(0,B.jsx)(L.Description,{ref:r,className:f("text-sm text-muted-foreground",e),...t}));xr.displayName=L.Description.displayName;var st=require("@radix-ui/react-slot"),it=require("class-variance-authority"),nt=z(require("react")),yr=(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-foreground",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),V=nt.forwardRef(({asChild:e=!1,className:t,size:r,variant:a,...s},i)=>(0,B.jsx)(e?st.Slot:"button",{className:f(yr({className:t,size:r,variant:a})),ref:i,...s}));V.displayName="Button";var ct=z(require("react"));var W=ct.forwardRef(({className:e,type:t,...r},a)=>(0,B.jsx)("input",{type:t,className:f("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:a,...r}));W.displayName="Input";var mt=z(require("react")),ze=z(require("@radix-ui/react-label"));var Cr=(0,it.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),M=mt.forwardRef(({className:e,...t},r)=>(0,B.jsx)(ze.Root,{ref:r,className:f(Cr(),e),...t}));M.displayName=ze.Root.displayName;var ft=z(require("react")),X=ft.forwardRef(({className:e,...t},r)=>(0,B.jsx)("textarea",{className:f("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:r,...t}));X.displayName="Textarea";var v=z(require("@radix-ui/react-select")),j=z(require("react")),me=v.Root;var pe=v.Value,Y=j.forwardRef(({children:e,className:t,...r},a)=>(0,B.jsxs)(v.Trigger,{className:f("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:a,...r,children:[e,(0,B.jsx)(v.Icon,{asChild:!0,children:(0,B.jsx)(rt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Y.displayName=v.Trigger.displayName;var bt=j.forwardRef(({className:e,...t},r)=>(0,B.jsx)(v.ScrollUpButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,B.jsx)(rt.ChevronUp,{className:"h-4 w-4"})}));bt.displayName=v.ScrollUpButton.displayName;var vt=j.forwardRef(({className:e,...t},r)=>(0,B.jsx)(v.ScrollDownButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,B.jsx)(rt.ChevronDown,{className:"h-4 w-4"})}));vt.displayName=v.ScrollDownButton.displayName;var ee=j.forwardRef(({children:e,className:t,position:r="popper",...a},s)=>(0,B.jsx)(v.Portal,{children:(0,B.jsxs)(v.Content,{className:f("relative z-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",r==="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:r,ref:s,...a,children:[(0,B.jsx)(bt,{}),(0,B.jsx)(v.Viewport,{className:f("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,B.jsx)(vt,{})]})}));ee.displayName=v.Content.displayName;var wr=j.forwardRef(({className:e,...t},r)=>(0,B.jsx)(v.Label,{className:f("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:r,...t}));wr.displayName=v.Label.displayName;var te=j.forwardRef(({children:e,className:t,...r},a)=>(0,B.jsxs)(v.Item,{className:f("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:a,...r,children:[(0,B.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,B.jsx)(v.ItemIndicator,{children:(0,B.jsx)(rt.Check,{className:"h-4 w-4"})})}),(0,B.jsx)(v.ItemText,{children:e})]}));te.displayName=v.Item.displayName;var Sr=j.forwardRef(({className:e,...t},r)=>(0,B.jsx)(v.Separator,{className:f("-mx-1 my-1 h-px bg-muted",e),ref:r,...t}));Sr.displayName=v.Separator.displayName;var xe=z(require("@radix-ui/react-checkbox")),xt=z(require("react")),re=xt.forwardRef(({className:e,...t},r)=>(0,B.jsx)(xe.Root,{className:f("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:r,...t,children:(0,B.jsx)(xe.Indicator,{className:f("flex items-center justify-center text-current"),children:(0,B.jsx)(rt.Check,{className:"h-4 w-4"})})}));re.displayName=xe.Root.displayName;var Nr=(0,it.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ne({className:e,variant:t,...r}){return(0,B.jsx)("div",{className:f(Nr({variant:t}),e),...r})}var Be=z(require("react")),F=z(require("@radix-ui/react-scroll-area"));var ue=Be.forwardRef(({className:e,children:t,...r},a)=>(0,B.jsxs)(F.Root,{ref:a,className:f("relative overflow-hidden",e),...r,children:[(0,B.jsx)(F.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,B.jsx)(wt,{}),(0,B.jsx)(F.Corner,{})]}));ue.displayName=F.Root.displayName;var wt=Be.forwardRef(({className:e,orientation:t="vertical",...r},a)=>(0,B.jsx)(F.ScrollAreaScrollbar,{ref:a,orientation:t,className:f("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:(0,B.jsx)(F.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));wt.displayName=F.ScrollAreaScrollbar.displayName;function St({deal:e,users:t,customer:r,categories:a,onClose:s,onSave:i,onAddComment:m}){let[o,g]=(0,Re.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[S,N]=(0,Re.useState)(""),[p,b]=(0,Re.useState)(!1),[x,w]=(0,Re.useState)(null);(0,Re.useEffect)(()=>{b(JSON.stringify(e)!==JSON.stringify(o))},[e,o]);let C=async()=>{try{let l=await i(o);l.success?(b(!1),w(null)):console.error("Failed to save deal:",l.errors)}catch(l){console.error("Failed to save deal:",l)}},y=(l,P)=>{g(ne=>({...ne,[l]:P}))},A=l=>{let P=(o.categories||[]).includes(l)?(o.categories||[]).filter(ne=>ne!==l):[...o.categories||[],l];y("categories",P)},E=async()=>{if(S.trim()){let l={text:S,timestamp:new Date().toISOString()};try{let P=await m(l);if(!P.success){console.error("Failed to add comment:",P.errors);return}}catch(P){console.error("Failed to add comment:",P)}g(P=>({...P,comments:[...P.comments||[],l]})),N("")}},d=l=>{switch(l){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},h=l=>t?.find(P=>P.id===Number(l));return(0,B.jsx)(de,{open:!0,children:(0,B.jsxs)(q,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,B.jsxs)(J,{className:"flex flex-row items-center justify-between",children:[(0,B.jsx)(Q,{className:"text-2xl font-bold",children:r?.name}),(0,B.jsxs)("div",{className:"flex space-x-2",children:[(0,B.jsx)(V,{variant:"outline",onClick:s,children:"Close"}),(0,B.jsxs)(V,{onClick:C,disabled:!p,children:[(0,B.jsx)($.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,B.jsxs)(ue,{className:"flex-grow pr-4",children:[(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,B.jsx)("div",{className:"grid gap-2 m-1",children:x==="value"?(0,B.jsx)(W,{type:"number",value:o.value,onChange:l=>y("value",Number(l.target.value)),onBlur:()=>w(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,B.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>w("value"),children:["\xA3",o.value?.toLocaleString()]})}),(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Assignee"}),x==="assignee"?(0,B.jsxs)(me,{value:o?.assignee?.id?.toString()||"",onValueChange:l=>y("assignee",h(l)),children:[(0,B.jsx)(Y,{children:(0,B.jsx)(pe,{placeholder:"Select assignee"})}),(0,B.jsx)(ee,{children:t&&t.map(l=>(0,B.jsx)(te,{value:l?.id?.toString()||"",children:l.name},l.id))})]}):(0,B.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>w("assignee"),children:[(0,B.jsx)($.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,B.jsx)("span",{children:o.assignee.name})]})]}),(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Closure Date"}),x==="closureDate"?(0,B.jsx)(W,{type:"date",value:o.closureDate?.split("B")[0]??"",onChange:l=>y("closureDate",l.target.value),onBlur:()=>w(null),className:"mr-2",autoFocus:!0}):(0,B.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>w("closureDate"),children:[(0,B.jsx)($.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,B.jsx)("span",{children:o.closureDate?new Date(o.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,B.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Description"}),x==="description"?(0,B.jsx)(X,{value:o.description||"",onChange:l=>y("description",l.target.value),onBlur:()=>w(null),className:"min-h-[100px]",autoFocus:!0}):(0,B.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>w("description"),children:o.description})]})}),(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 it-2 gap-4",children:[(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Status"}),x==="status"?(0,B.jsxs)(me,{value:o.status,onValueChange:l=>{y("status",l),w(null)},children:[(0,B.jsx)(Y,{children:(0,B.jsx)(pe,{placeholder:"Select status"})}),(0,B.jsx)(ee,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(l=>(0,B.jsx)(te,{value:l,children:l},l))})]}):(0,B.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>w("status"),children:o.status})]}),(0,B.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Categories"}),x==="categories"?(0,B.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:a.map(l=>(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(re,{id:l.id?.toString()||"",checked:(o.categories||[]).some(P=>P.id===l.id),onCheckedChange:()=>l.id!==void 0&&A(l)}),(0,B.jsx)("label",{htmlFor:(l.id??"").toString(),className:`text-sm font-medium ${d(l.type||"sector")} px-2 py-1 rounded`,children:l.name})]},l.id))}):(0,B.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>w("categories"),children:o.categories&&o.categories.map(l=>{let P=l;return P?(0,B.jsx)(Ne,{variant:"outline",className:d(P.type||"sector"),children:P.name},P.id):null})})]})]}),(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 it-4 gap-4",children:[(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,B.jsx)(ue,{className:"h-[200px] overflow-y-auto",children:(0,B.jsx)("div",{className:"space-y-2",children:o.comments&&o.comments.slice().sort((l,P)=>new Date(P.timestamp||"").getTime()-new Date(l.timestamp||"").getTime()).map(l=>(0,B.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,B.jsx)("p",{className:"text-sm text-foreground",children:l.text}),(0,B.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[l?.author?.name," - ",new Date(l.timestamp||"").toLocaleString()]})]},l.id))})}),(0,B.jsxs)("div",{className:"flex mt-2",children:[(0,B.jsx)(W,{value:S,onChange:l=>N(l.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,B.jsxs)(V,{onClick:E,className:"ml-2",children:[(0,B.jsx)($.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,B.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(o.updatedAt||"").toLocaleString()]})]})]})]})})}var ae=z(require("react"));var He=ae.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("rounded-xl border bg-card text-card-foreground shadow",e),...t}));He.displayName="Card";var Ve=ae.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("flex flex-col space-y-1.5 p-6",e),...t}));Ve.displayName="CardHeader";var Fe=ae.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("font-semibold leading-none tracking-tight",e),...t}));Fe.displayName="CardTitle";var Pr=ae.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("text-sm text-muted-foreground",e),...t}));Pr.displayName="CardDescription";var We=ae.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("p-6 it-0",e),...t}));We.displayName="CardContent";var Dr=ae.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("flex items-center p-6 it-0",e),...t}));Dr.displayName="CardFooter";function Nt({deal:e,customer:t,categories:r,onClick:a}){let s=r.find(i=>i.type==="proposition"&&(e.categories??[]).includes(i.id));return(0,B.jsxs)(He,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,B.jsxs)(Ve,{className:"pb-2",children:[(0,B.jsx)("div",{className:"flex justify-between items-center",children:(0,B.jsx)(Fe,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,B.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,B.jsxs)(We,{children:[(0,B.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,B.jsxs)("div",{className:"flex items-center text-sm text-accent",children:[(0,B.jsx)(rt.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,B.jsx)("span",{children:e.assignee.name})]}),(0,B.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,B.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,B.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,B.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,B.jsx)(rt.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,B.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,B.jsx)("div",{className:"flex justify-between items-left",children:s&&(0,B.jsx)(Ne,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:s.name})})]})]})}var De=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Dt({onSubmit:e}){let[t,r]=(0,Re.useState)({name:"",intro:"",active:!1});return(0,B.jsxs)("form",{onSubmit:s=>{s.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),r({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)(M,{htmlFor:"customerName",children:"Customer Name"}),(0,B.jsx)(W,{id:"customerName",value:t.name,onChange:s=>r({...t,name:s.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)(M,{htmlFor:"customerIntro",children:"Intro"}),(0,B.jsx)(X,{id:"customerIntro",value:t.intro??"",onChange:s=>r({...t,intro:s.target.value}),placeholder:"Enter customer intro"})]}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(re,{id:"activeCustomer",checked:!!t.active,onCheckedChange:s=>r({...t,active:s})}),(0,B.jsx)(M,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,B.jsx)(V,{type:"submit",className:"w-full",children:"Add Customer"})]})}function kt({customers:e,users:t,categories:r,onSubmit:a,initialDeal:s,onAddCustomer:i,onClose:m}){let[o,g]=(0,Re.useState)(s||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("B")[0],closureDate:"",comments:[],description:""}),[S,N]=(0,Re.useState)(!1),[p,b]=(0,Re.useState)({});(0,Re.useEffect)(()=>{s&&g(s)},[s]);let x=()=>{let d={};return o.customer||(d.customer="Customer is required"),o.value||(d.value="Value is required"),o.assignee||(d.assignee="Assignee is required"),o.closureDate||(d.closureDate="Closure Date is required"),b(d),Object.keys(d).length===0},w=async d=>{d.preventDefault(),b({});try{if(x()){let h=await a({...o});h.success?(g({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),m?.()):b(h.errors||{})}}catch{b({submit:"An error occurred while submitting the form."})}},C=d=>{g(h=>({...h,categories:(h.categories||[]).includes(d.id)?(h.categories||[]).filter(l=>l!==d.id):[...h.categories||[],d.id]}))},y=async d=>{g({...o,customer:d});try{let h=await i(d);h.success?N(!1):b(h.errors||{})}catch{b({submit:"An error occurred while submitting the form."})}},A=d=>t?.find(h=>h.id===Number(d)),E=d=>e?.find(h=>h.id===Number(d));return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("form",{onSubmit:w,className:"space-y-6",children:[(0,B.jsx)(ue,{className:"h-[60vh] pr-4",children:(0,B.jsxs)("div",{className:"space-y-6 px-4",children:[(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{htmlFor:"customer",children:"Customer"}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsxs)(me,{value:o.customer?.id?.toString(),onValueChange:d=>g({...o,customer:E(d)}),children:[(0,B.jsx)(Y,{children:(0,B.jsx)(pe,{placeholder:"Select customer"})}),(0,B.jsx)(ee,{children:e.map(d=>(0,B.jsx)(te,{value:d.id?.toString()||"",children:d.name},d.id))})]}),(0,B.jsx)(V,{variant:"outline",size:"icon",onClick:()=>N(!0),children:(0,B.jsx)(rt.PlusIcon,{className:"w-5 h-5"})})]}),p.customerId&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.customerId})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{htmlFor:"value",children:"Value"}),(0,B.jsx)(W,{id:"value",type:"number",value:o.value||"",onChange:d=>g({...o,value:Number.parseFloat(d.target.value)}),placeholder:"Enter deal value"}),p.value&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.value})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{htmlFor:"assignee",children:"Assignee"}),(0,B.jsxs)(me,{value:o.assignee?.id?.toString(),onValueChange:d=>g({...o,assignee:A(d)}),children:[(0,B.jsx)(Y,{children:(0,B.jsx)(pe,{placeholder:"Select assignee"})}),(0,B.jsx)(ee,{children:t&&t.map(d=>(0,B.jsx)(te,{value:d.id?.toString()||"",children:d.name},d.id))})]}),p.assignee&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.assignee})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{htmlFor:"description",children:"Description"}),(0,B.jsx)(X,{id:"description",value:o.description||"",onChange:d=>g({...o,description:d.target.value}),placeholder:"Enter deal description"})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{children:"Categories"}),(0,B.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(d=>(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)("h4",{className:"text-sm font-medium",children:d.charAt(0).toUpperCase()+d.slice(1)}),(0,B.jsx)("div",{className:"grid grid-cols-2 gap-2",children:r.filter(h=>h.type===d).map(h=>(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(re,{id:h.id.toString(),checked:o.categories?.includes(h.id),onCheckedChange:()=>C(h)}),(0,B.jsx)("label",{htmlFor:h.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:h.name})]},h.id))})]},d))})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{htmlFor:"closureDate",children:"Closure Date"}),(0,B.jsx)(W,{id:"closureDate",type:"date",value:o.closureDate||"",onChange:d=>g({...o,closureDate:d.target.value})}),p.closureDate&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,B.jsx)(V,{type:"submit",className:"w-full",children:s?"Update Deal":"Add Deal"})]}),(0,B.jsx)(de,{open:S,onOpenChange:N,children:(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:(0,B.jsx)(Q,{children:"Add New Customer"})}),(0,B.jsx)(Dt,{onSubmit:y})]})})]})}function Lt({status:e,deals:t,users:r,customers:a,categories:s,onDealClick:i,calculateColumnValue:m,calculateWeightedValue:o,addNewDeal:g,onAddCustomer:S}){let[N,p]=(0,Re.useState)(!1);return(0,B.jsxs)("div",{className:"flex flex-col w-80",children:[(0,B.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),g&&(0,B.jsxs)(de,{open:N,onOpenChange:p,children:[(0,B.jsx)(ot,{asChild:!0,children:(0,B.jsxs)(V,{className:"mb-4 w-full",children:[(0,B.jsx)(rt.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,B.jsxs)(q,{children:[(0,B.jsx)(J,{children:(0,B.jsx)(Q,{children:"Add New Deal"})}),(0,B.jsx)(kt,{customers:a,users:r,categories:s,onSubmit:g,onAddCustomer:S,onClose:()=>p(!1)})]})]}),(0,B.jsx)(De.Droppable,{droppableId:e,isDropDisabled:!1,children:b=>(0,B.jsxs)("div",{ref:b.innerRef,...b.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((x,w)=>(0,B.jsx)(De.Draggable,{draggableId:x.id.toString(),index:x.id,children:C=>(0,B.jsx)("div",{ref:C.innerRef,...C.draggableProps,...C.dragHandleProps,children:(0,B.jsx)(Nt,{deal:x,customer:x.customer,categories:s,onClick:()=>i(x)})})},x.id.toString())),b.placeholder]})}),(0,B.jsxs)("div",{className:"mt-4 text-sm p-3 rounded-lg shadow",children:[(0,B.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,B.jsxs)("span",{className:"text-green-600",children:["\xA3",m(t).toLocaleString()]})]}),(0,B.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,B.jsxs)("span",{className:"text-blue-600",children:["\xA3",o(t,e).toLocaleString()]})]})]})]})}var Rr=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function kr({initialData:e,addNewDeal:t,updateDeal:r,addComment:a,addNewCustomer:s}){let[i,m]=(0,Re.useState)(null),o=p=>(e.deals??[]).filter(b=>b.status===p),g=p=>p.reduce((b,x)=>b+(x.value||0),0),S=(p,b)=>{let x={Cold:.2,Qualified:.4,"Proposal Made":.6,"SoW Submitted":.7,Won:1,Lost:0};return p.reduce((w,C)=>w+(C.value||0)*x[b],0)},N=(0,Re.useCallback)(p=>{let{source:b,destination:x}=p;if(!x||b.droppableId===x.droppableId&&b.index===x.index)return;let w=b.droppableId,C=x.droppableId,y=e.deals?.filter(E=>E.id===b.index)[0],A=[...e.deals??[]];y&&(y.status=C,r(y))},[r]);return(0,B.jsx)(De.DragDropContext,{onDragEnd:N,children:(0,B.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,B.jsx)("div",{className:"flex space-x-4 pb-4",children:Rr.filter(p=>p!=="Won"&&p!=="Lost").map(p=>{let b=o(p);return(0,B.jsx)(Lt,{status:p,deals:b,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:m,calculateColumnValue:g,calculateWeightedValue:S,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:s},p)})}),i&&(0,B.jsx)(St,{deal:i,users:e.users,customer:i.customer,categories:e.categories??[],onClose:()=>m(null),onSave:r,onAddComment:p=>a(i.id.toString(),p)})]})})}0&&(module.exports={CRMKanbanBoard});
|
|
4
|
+
"use strict";"use client";var Mt=Object.create;var we=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty;var Vt=(e,t)=>{for(var r in t)we(e,r,{get:t[r],enumerable:!0})},Ke=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zt(t))!Ht.call(e,i)&&i!==r&&we(e,i,{get:()=>t[i],enumerable:!(a=Et(t,i))||a.enumerable});return e};var z=(e,t,r)=>(r=e!=null?Mt(Bt(e)):{},Ke(t||!e||!e.__esModule?we(r,"default",{value:e,enumerable:!0}):r,e)),Ft=e=>Ke(we({},"__esModule",{value:!0}),e);var Ar={};Vt(Ar,{CRMKanbanBoard:()=>kr});module.exports=Ft(Ar);var Le=require("react");var he=z(require("react")),I=z(require("@radix-ui/react-dialog")),rt=require("lucide-react");var tt=require("clsx");var Ve="-",Ut=e=>{let t=Gt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:m=>{let o=m.split(Ve);return o[0]===""&&o.length!==1&&o.shift(),Je(o,t)||Wt(m)},getConflictingClassGroupIds:(m,o)=>{let b=r[m]||[];return o&&a[m]?[...b,...a[m]]:b}}},Je=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),i=a?Je(e.slice(1),a):void 0;if(i)return i;if(t.validators.length===0)return;let l=e.join(Ve);return t.validators.find(({validator:m})=>m(l))?.classGroupId},$e=/^\[(.+)\]$/,Wt=e=>{if($e.test(e)){let t=$e.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Gt=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return jt(Object.entries(e.classGroups),r).forEach(([l,m])=>{He(m,a,l,t)}),a},He=(e,t,r,a)=>{e.forEach(i=>{if(typeof i=="string"){let l=i===""?t:qe(t,i);l.classGroupId=r;return}if(typeof i=="function"){if(Ot(i)){He(i(a),t,r,a);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([l,m])=>{He(m,qe(t,l),r,a)})})},qe=(e,t)=>{let r=e;return t.split(Ve).forEach(a=>{r.nextPart.has(a)||r.nextPart.set(a,{nextPart:new Map,validators:[]}),r=r.nextPart.get(a)}),r},Ot=e=>e.isThemeGetter,jt=(e,t)=>t?e.map(([r,a])=>{let i=a.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([m,o])=>[t+m,o])):l);return[r,i]}):e,_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,a=new Map,i=(l,m)=>{r.set(l,m),t++,t>e&&(t=0,a=r,r=new Map)};return{get(l){let m=r.get(l);if(m!==void 0)return m;if((m=a.get(l))!==void 0)return i(l,m),m},set(l,m){r.has(l)?r.set(l,m):i(l,m)}}},Qe="!",Kt=e=>{let{separator:t,experimentalParseClassName:r}=e,a=t.length===1,i=t[0],l=t.length,m=o=>{let b=[],S=0,N=0,p;for(let g=0;g<o.length;g++){let T=o[g];if(S===0){if(T===i&&(a||o.slice(g,g+l)===t)){b.push(o.slice(N,g)),N=g+l;continue}if(T==="/"){p=g;continue}}T==="["?S++:T==="]"&&S--}let v=b.length===0?o:o.substring(N),C=v.startsWith(Qe),h=C?v.substring(1):v,P=p&&p>N?p-N:void 0;return{modifiers:b,hasImportantModifier:C,baseClassName:h,maybePostfixModifierPosition:P}};return r?o=>r({className:o,parseClassName:m}):m},$t=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(a=>{a[0]==="["?(t.push(...r.sort(),a),r=[]):r.push(a)}),t.push(...r.sort()),t},qt=e=>({cache:_t(e.cacheSize),parseClassName:Kt(e),...Ut(e)}),Jt=/\B+/,Qt=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:i}=t,l=[],m=e.trim().split(Jt),o="";for(let b=m.length-1;b>=0;b-=1){let S=m[b],{modifiers:N,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:C}=r(S),h=!!C,P=a(h?v.substring(0,C):v);if(!P){if(!h){o=S+(o.length>0?" "+o:o);continue}if(P=a(v),!P){o=S+(o.length>0?" "+o:o);continue}h=!1}let g=$t(N).join(":"),T=p?g+Qe:g,E=T+P;if(l.includes(E))continue;l.push(E);let d=i(P,h);for(let y=0;y<d.length;++y){let n=d[y];l.push(T+n)}o=S+(o.length>0?" "+o:o)}return o};function Xt(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Xe(t))&&(a&&(a+=" "),a+=r);return a}var Xe=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=Xe(e[a]))&&(r&&(r+=" "),r+=t);return r};function Zt(e,...t){let r,a,i,l=m;function m(b){let S=t.reduce((N,p)=>p(N),e());return r=qt(S),a=r.cache.get,i=r.cache.set,l=o,o(b)}function o(b){let S=a(b);if(S)return S;let N=Qt(b,r);return i(b,N),N}return function(){return l(Xt.apply(null,arguments))}}var R=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ze=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yt=/^\d+\/\d+$/,er=new Set(["px","full","screen"]),tr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|it|pc|in|cm|mm|cap|ch|ex|r?lh|cq(B|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,or=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ar=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,G=e=>de(e)||er.has(e)||Yt.test(e),O=e=>me(e,"length",ur),de=e=>!!e&&!Number.isNaN(Number(e)),Be=e=>me(e,"number",de),be=e=>!!e&&Number.isInteger(Number(e)),ir=e=>e.endsWith("%")&&de(e.slice(0,-1)),u=e=>Ze.test(e),j=e=>tr.test(e),nr=new Set(["length","size","percentage"]),lr=e=>me(e,nr,Ye),cr=e=>me(e,"position",Ye),dr=new Set(["image","url"]),mr=e=>me(e,dr,gr),pr=e=>me(e,"",fr),ve=()=>!0,me=(e,t,r)=>{let a=Ze.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},ur=e=>rr.test(e)&&!or.test(e),Ye=()=>!1,fr=e=>ar.test(e),gr=e=>sr.test(e);var br=()=>{let e=R("colors"),t=R("spacing"),r=R("blur"),a=R("brightness"),i=R("borderColor"),l=R("borderRadius"),m=R("borderSpacing"),o=R("borderWidth"),b=R("contrast"),S=R("grayscale"),N=R("hueRotate"),p=R("invert"),v=R("gap"),C=R("gradientColorStops"),h=R("gradientColorStopPositions"),P=R("inset"),g=R("margin"),T=R("opacity"),E=R("padding"),d=R("saturate"),y=R("scale"),n=R("sepia"),D=R("skew"),ce=R("space"),We=R("translate"),Ie=()=>["auto","contain","none"],Me=()=>["auto","hidden","clip","visible","scroll"],Ee=()=>["auto",u,t],k=()=>[u,t],Ge=()=>["",G,O],ye=()=>["auto",de,u],Oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ce=()=>["solid","dashed","dotted","double","none"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>["start","end","center","between","around","evenly","stretch"],ge=()=>["","0",u],_e=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[de,u];return{cacheSize:500,separator:":",theme:{colors:[ve],spacing:[G,O],blur:["none","",j,u],brightness:W(),borderColor:[e],borderRadius:["none","","full",j,u],borderSpacing:k(),borderWidth:Ge(),contrast:W(),grayscale:ge(),hueRotate:W(),invert:ge(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[ir,O],inset:Ee(),margin:Ee(),opacity:W(),padding:k(),saturate:W(),scale:W(),sepia:ge(),skew:W(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",u]}],container:["container"],columns:[{columns:[j]}],"break-after":[{"break-after":_e()}],"break-before":[{"break-before":_e()}],"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:[...Oe(),u]}],overflow:[{overflow:Me()}],"overflow-x":[{"overflow-x":Me()}],"overflow-y":[{"overflow-y":Me()}],overscroll:[{overscroll:Ie()}],"overscroll-x":[{"overscroll-x":Ie()}],"overscroll-y":[{"overscroll-y":Ie()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[P]}],"inset-x":[{"inset-x":[P]}],"inset-y":[{"inset-y":[P]}],start:[{start:[P]}],end:[{end:[P]}],top:[{top:[P]}],right:[{right:[P]}],bottom:[{bottom:[P]}],left:[{left:[P]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",be,u]}],basis:[{basis:Ee()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",u]}],grow:[{grow:ge()}],shrink:[{shrink:ge()}],order:[{order:["first","last","none",be,u]}],"grid-cols":[{"grid-cols":[ve]}],"col-start-end":[{col:["auto",{span:["full",be,u]},u]}],"col-start":[{"col-start":ye()}],"col-end":[{"col-end":ye()}],"grid-rows":[{"grid-rows":[ve]}],"row-start-end":[{row:["auto",{span:[be,u]},u]}],"row-start":[{"row-start":ye()}],"row-end":[{"row-end":ye()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",u]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",u]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...ze()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ze(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ze(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],it:[{it:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[ce]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ce]}],"space-y-reverse":["space-y-reverse"],B:[{B:["auto","min","max","fit","svw","lvw","dvw",u,t]}],"min-B":[{"min-B":[u,t,"min","max","fit"]}],"max-B":[{"max-B":[u,t,"none","full","min","max","fit","prose",{screen:[j]},j]}],h:[{h:[u,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[u,t,"auto","min","max","fit"]}],"font-size":[{text:["base",j,O]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Be]}],"font-family":[{font:[ve]}],"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",u]}],"line-clamp":[{"line-clamp":["none",de,Be]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",G,u]}],"list-image":[{"list-image":["none",u]}],"list-style-type":[{list:["none","disc","decimal",u]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[T]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[T]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",G,O]}],"underline-offset":[{"underline-offset":["auto",G,u]}],"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:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",u]}],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",u]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[T]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Oe(),cr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],rounded:[{rounded:[l]}],"rounded-B":[{"rounded-B":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-Le":[{"rounded-Le":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-B":[{border:[o]}],"border-B-x":[{"border-x":[o]}],"border-B-y":[{"border-y":[o]}],"border-B-B":[{"border-B":[o]}],"border-B-e":[{"border-e":[o]}],"border-B-t":[{"border-t":[o]}],"border-B-r":[{"border-r":[o]}],"border-B-b":[{"border-b":[o]}],"border-B-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[T]}],"border-style":[{border:[...Ce(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[T]}],"divide-style":[{divide:Ce()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-B":[{"border-B":[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:["",...Ce()]}],"outline-offset":[{"outline-offset":[G,u]}],"outline-B":[{outline:[G,O]}],"outline-color":[{outline:[e]}],"ring-B":[{ring:Ge()}],"ring-B-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[T]}],"ring-offset-B":[{"ring-offset":[G,O]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",j,pr]}],"shadow-color":[{shadow:[ve]}],opacity:[{opacity:[T]}],"mix-blend":[{"mix-blend":[...je(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":je()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[b]}],"drop-shadow":[{"drop-shadow":["","none",j,u]}],grayscale:[{grayscale:[S]}],"hue-rotate":[{"hue-rotate":[N]}],invert:[{invert:[p]}],saturate:[{saturate:[d]}],sepia:[{sepia:[n]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[b]}],"backdrop-grayscale":[{"backdrop-grayscale":[S]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[N]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[T]}],"backdrop-saturate":[{"backdrop-saturate":[d]}],"backdrop-sepia":[{"backdrop-sepia":[n]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",u]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",u]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",u]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[be,u]}],"translate-x":[{"translate-x":[We]}],"translate-y":[{"translate-y":[We]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",u]}],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","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","B-resize","B-resize","B-resize","nw-resize","Le-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",u]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-it":[{"scroll-it":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"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",u]}],fill:[{fill:[e,"none"]}],"stroke-B":[{stroke:[G,O,Be]}],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"],p:["px","py","ps","pe","it","pr","pb","pl"],px:["pr","pl"],py:["it","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["B","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-B","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-Le","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-B":["rounded-ss","rounded-es"],"rounded-e":["rounded-Le","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-B":["border-B-B","border-B-e","border-B-t","border-B-r","border-B-b","border-B-l"],"border-B-x":["border-B-r","border-B-l"],"border-B-y":["border-B-t","border-B-b"],"border-color":["border-color-B","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-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-it","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-it","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var et=Zt(br);function f(...e){return et((0,tt.clsx)(e))}var B=require("react/jsx-runtime"),pe=I.Root,ot=I.Trigger,vr=I.Portal;var at=he.forwardRef(({className:e,...t},r)=>(0,B.jsx)(I.Overlay,{ref:r,className:f("fixed inset-0 z-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}));at.displayName=I.Overlay.displayName;var X=he.forwardRef(({className:e,children:t,...r},a)=>(0,B.jsxs)(vr,{children:[(0,B.jsx)(at,{}),(0,B.jsxs)(I.Content,{ref:a,className:f("fixed left-[50%] top-[50%] z-50 grid B-full max-B-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-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),...r,children:[t,(0,B.jsxs)(I.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,B.jsx)(rt.X,{className:"h-4 B-4"}),(0,B.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));X.displayName=I.Content.displayName;var Z=({className:e,...t})=>(0,B.jsx)("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Z.displayName="DialogHeader";var hr=({className:e,...t})=>(0,B.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});hr.displayName="DialogFooter";var Y=he.forwardRef(({className:e,...t},r)=>(0,B.jsx)(I.Title,{ref:r,className:f("text-lg font-semibold leading-none tracking-tight",e),...t}));Y.displayName=I.Title.displayName;var xr=he.forwardRef(({className:e,...t},r)=>(0,B.jsx)(I.Description,{ref:r,className:f("text-sm text-muted-foreground",e),...t}));xr.displayName=I.Description.displayName;var st=require("@radix-ui/react-slot"),it=require("class-variance-authority"),nt=z(require("react")),yr=(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 B-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-foreground",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),V=nt.forwardRef(({asChild:e=!1,className:t,size:r,variant:a,...i},l)=>(0,B.jsx)(e?st.Slot:"button",{className:f(yr({className:t,size:r,variant:a})),ref:l,...i}));V.displayName="Button";var ct=z(require("react"));var U=ct.forwardRef(({className:e,type:t,...r},a)=>(0,B.jsx)("input",{type:t,className:f("flex h-9 B-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:a,...r}));U.displayName="Input";var mt=z(require("react")),Fe=z(require("@radix-ui/react-label"));var Cr=(0,it.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),M=mt.forwardRef(({className:e,...t},r)=>(0,B.jsx)(Fe.Root,{ref:r,className:f(Cr(),e),...t}));M.displayName=Fe.Root.displayName;var ft=z(require("react")),ee=ft.forwardRef(({className:e,...t},r)=>(0,B.jsx)("textarea",{className:f("flex min-h-[80px] B-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:r,...t}));ee.displayName="Textarea";var x=z(require("@radix-ui/react-select")),_=z(require("react")),re=x.Root;var oe=x.Value,K=_.forwardRef(({children:e,className:t,...r},a)=>(0,B.jsxs)(x.Trigger,{className:f("flex h-10 B-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:a,...r,children:[e,(0,B.jsx)(x.Icon,{asChild:!0,children:(0,B.jsx)(rt.ChevronDown,{className:"h-4 B-4 opacity-50"})})]}));K.displayName=x.Trigger.displayName;var bt=_.forwardRef(({className:e,...t},r)=>(0,B.jsx)(x.ScrollUpButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,B.jsx)(rt.ChevronUp,{className:"h-4 B-4"})}));bt.displayName=x.ScrollUpButton.displayName;var vt=_.forwardRef(({className:e,...t},r)=>(0,B.jsx)(x.ScrollDownButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,B.jsx)(rt.ChevronDown,{className:"h-4 B-4"})}));vt.displayName=x.ScrollDownButton.displayName;var $=_.forwardRef(({children:e,className:t,position:r="popper",...a},i)=>(0,B.jsx)(x.Portal,{children:(0,B.jsxs)(x.Content,{className:f("relative z-50 max-h-96 min-B-[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",r==="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:r,ref:i,...a,children:[(0,B.jsx)(bt,{}),(0,B.jsx)(x.Viewport,{className:f("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] B-full min-B-[var(--radix-select-trigger-width)]"),children:e}),(0,B.jsx)(vt,{})]})}));$.displayName=x.Content.displayName;var wr=_.forwardRef(({className:e,...t},r)=>(0,B.jsx)(x.Label,{className:f("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:r,...t}));wr.displayName=x.Label.displayName;var q=_.forwardRef(({children:e,className:t,...r},a)=>(0,B.jsxs)(x.Item,{className:f("relative flex B-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:a,...r,children:[(0,B.jsx)("span",{className:"absolute left-2 flex h-3.5 B-3.5 items-center justify-center",children:(0,B.jsx)(x.ItemIndicator,{children:(0,B.jsx)(rt.Check,{className:"h-4 B-4"})})}),(0,B.jsx)(x.ItemText,{children:e})]}));q.displayName=x.Item.displayName;var Sr=_.forwardRef(({className:e,...t},r)=>(0,B.jsx)(x.Separator,{className:f("-mx-1 my-1 h-px bg-muted",e),ref:r,...t}));Sr.displayName=x.Separator.displayName;var xe=z(require("@radix-ui/react-checkbox")),xt=z(require("react")),ae=xt.forwardRef(({className:e,...t},r)=>(0,B.jsx)(xe.Root,{className:f("peer h-4 B-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:r,...t,children:(0,B.jsx)(xe.Indicator,{className:f("flex items-center justify-center text-current"),children:(0,B.jsx)(rt.Check,{className:"h-4 B-4"})})}));ae.displayName=xe.Root.displayName;var Nr=(0,it.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ne({className:e,variant:t,...r}){return(0,B.jsx)("div",{className:f(Nr({variant:t}),e),...r})}var Ue=z(require("react")),F=z(require("@radix-ui/react-scroll-area"));var ue=Ue.forwardRef(({className:e,children:t,...r},a)=>(0,B.jsxs)(F.Root,{ref:a,className:f("relative overflow-hidden",e),...r,children:[(0,B.jsx)(F.Viewport,{className:"h-full B-full rounded-[inherit]",children:t}),(0,B.jsx)(wt,{}),(0,B.jsx)(F.Corner,{})]}));ue.displayName=F.Root.displayName;var wt=Ue.forwardRef(({className:e,orientation:t="vertical",...r},a)=>(0,B.jsx)(F.ScrollAreaScrollbar,{ref:a,orientation:t,className:f("flex touch-none select-none transition-colors",t==="vertical"&&"h-full B-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:(0,B.jsx)(F.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));wt.displayName=F.ScrollAreaScrollbar.displayName;function St({deal:e,users:t,customer:r,categories:a,onClose:i,onSave:l,onAddComment:m}){let[o,b]=(0,Le.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[S,N]=(0,Le.useState)(""),[p,v]=(0,Le.useState)(!1),[C,h]=(0,Le.useState)(null);(0,Le.useEffect)(()=>{v(JSON.stringify(e)!==JSON.stringify(o))},[e,o]);let P=async()=>{try{let n=await l(o);n.success?(v(!1),h(null)):console.error("Failed to save deal:",n.errors)}catch(n){console.error("Failed to save deal:",n)}},g=(n,D)=>{b(ce=>({...ce,[n]:D}))},T=n=>{let D=(o.categories||[]).includes(n)?(o.categories||[]).filter(ce=>ce!==n):[...o.categories||[],n];g("categories",D)},E=async()=>{if(S.trim()){let n={text:S,timestamp:new Date().toISOString()};try{let D=await m(n);if(!D.success){console.error("Failed to add comment:",D.errors);return}}catch(D){console.error("Failed to add comment:",D)}b(D=>({...D,comments:[...D.comments||[],n]})),N("")}},d=n=>{switch(n){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},y=n=>t?.find(D=>D.id===Number(n));return(0,B.jsx)(pe,{open:!0,children:(0,B.jsxs)(X,{className:"max-B-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,B.jsxs)(Z,{className:"flex flex-row items-center justify-between",children:[(0,B.jsx)(Y,{className:"text-2xl font-bold",children:r?.name}),(0,B.jsxs)("div",{className:"flex space-x-2",children:[(0,B.jsx)(V,{variant:"outline",onClick:i,children:"Close"}),(0,B.jsxs)(V,{onClick:P,disabled:!p,children:[(0,B.jsx)(rt.SaveIcon,{className:"B-4 h-4 mr-2"}),"Save"]})]})]}),(0,B.jsxs)(ue,{className:"flex-grow pr-4",children:[(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,B.jsx)("div",{className:"grid gap-2 m-1",children:C==="value"?(0,B.jsx)(U,{type:"number",value:o.value,onChange:n=>g("value",Number(n.target.value)),onBlur:()=>h(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,B.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("value"),children:["\xA3",o.value?.toLocaleString()]})}),(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Assignee"}),C==="assignee"?(0,B.jsxs)(re,{value:o?.assignee?.id?.toString()||"",onValueChange:n=>g("assignee",y(n)),children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select assignee"})}),(0,B.jsx)($,{children:t&&t.map(n=>(0,B.jsx)(q,{value:n?.id?.toString()||"",children:n.name},n.id))})]}):(0,B.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("assignee"),children:[(0,B.jsx)(rt.UserIcon,{className:"B-4 h-4 text-gray-400"}),(0,B.jsx)("span",{children:o.assignee.name})]})]}),(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Closure Date"}),C==="closureDate"?(0,B.jsx)(U,{type:"date",value:o.closureDate?.split("T")[0]??"",onChange:n=>g("closureDate",n.target.value),onBlur:()=>h(null),className:"mr-2",autoFocus:!0}):(0,B.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("closureDate"),children:[(0,B.jsx)(rt.CalendarIcon,{className:"B-4 h-4 text-gray-400"}),(0,B.jsx)("span",{children:o.closureDate?new Date(o.closureDate).toLocaleDateString("en-GB"):"N/B"})]})]})]}),(0,B.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Description"}),C==="description"?(0,B.jsx)(ee,{value:o.description||"",onChange:n=>g("description",n.target.value),onBlur:()=>h(null),className:"min-h-[100px]",autoFocus:!0}):(0,B.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>h("description"),children:o.description})]})}),(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 it-2 gap-4",children:[(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Status"}),C==="status"?(0,B.jsxs)(re,{value:o.status,onValueChange:n=>{g("status",n),h(null)},children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select status"})}),(0,B.jsx)($,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(n=>(0,B.jsx)(q,{value:n,children:n},n))})]}):(0,B.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("status"),children:o.status})]}),(0,B.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Categories"}),C==="categories"?(0,B.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:a.map(n=>(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(ae,{id:n.id?.toString()||"",checked:(o.categories||[]).some(D=>D.id===n.id),onCheckedChange:()=>n.id!==void 0&&T(n)}),(0,B.jsx)("label",{htmlFor:(n.id??"").toString(),className:`text-sm font-medium ${d(n.type||"sector")} px-2 py-1 rounded`,children:n.name})]},n.id))}):(0,B.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("categories"),children:o.categories&&o.categories.map(n=>{let D=n;return D?(0,B.jsx)(Ne,{variant:"outline",className:d(D.type||"sector"),children:D.name},D.id):null})})]}),(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"COGE Status"}),C==="gecoStatus"?(0,B.jsxs)(re,{value:o.gecoStatus??void 0,onValueChange:n=>{g("gecoStatus",n),h(null)},children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select status"})}),(0,B.jsx)($,{children:["firm","forecast","other"].map(n=>(0,B.jsx)(q,{value:n,children:n.charAt(0).toUpperCase()+n.slice(1)},n))})]}):(0,B.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("gecoStatus"),children:o.gecoStatus?o.gecoStatus.charAt(0).toUpperCase()+o.gecoStatus.slice(1):"N/B"})]})]}),(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 it-4 gap-4",children:[(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,B.jsx)(ue,{className:"h-[200px] overflow-y-auto",children:(0,B.jsx)("div",{className:"space-y-2",children:o.comments&&o.comments.slice().sort((n,D)=>new Date(D.timestamp||"").getTime()-new Date(n.timestamp||"").getTime()).map(n=>(0,B.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,B.jsx)("p",{className:"text-sm text-foreground",children:n.text}),(0,B.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[n?.author?.name," - ",new Date(n.timestamp||"").toLocaleString()]})]},n.id))})}),(0,B.jsxs)("div",{className:"flex mt-2",children:[(0,B.jsx)(U,{value:S,onChange:n=>N(n.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,B.jsxs)(V,{onClick:E,className:"ml-2",children:[(0,B.jsx)(rt.PlusIcon,{className:"B-4 h-4 mr-2"}),"Add"]})]})]}),(0,B.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(o.updatedAt||"").toLocaleString()]})]})]})]})})}var ie=z(require("react"));var Pe=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Pe.displayName="Card";var De=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("flex flex-col space-y-1.5 p-6",e),...t}));De.displayName="CardHeader";var Re=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("font-semibold leading-none tracking-tight",e),...t}));Re.displayName="CardTitle";var Pr=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("text-sm text-muted-foreground",e),...t}));Pr.displayName="CardDescription";var ke=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("p-6 it-0",e),...t}));ke.displayName="CardContent";var Dr=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("flex items-center p-6 it-0",e),...t}));Dr.displayName="CardFooter";function Nt({deal:e,customer:t,categories:r,onClick:a,compact:i=!1}){let l=r.find(m=>m.type==="proposition"&&(e.categories??[]).includes(m.id));return i?(0,B.jsxs)(Pe,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,B.jsxs)(De,{className:"pb-1 it-2",children:[(0,B.jsx)(Re,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,B.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,B.jsx)(ke,{className:"text-xs text-gray-500 pb-2",children:(0,B.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,B.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,B.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,B.jsxs)(Pe,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,B.jsxs)(De,{className:"pb-2",children:[(0,B.jsx)("div",{className:"flex justify-between items-center",children:(0,B.jsx)(Re,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,B.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,B.jsxs)(ke,{children:[(0,B.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,B.jsxs)("div",{className:"flex items-center text-sm text-accent",children:[(0,B.jsx)(rt.UserIcon,{className:"B-4 h-4 mr-1 text-xs"}),(0,B.jsx)("span",{children:e.assignee.name})]}),(0,B.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,B.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,B.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,B.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,B.jsx)(rt.CalendarIcon,{className:"B-3 h-3 mr-1"}),(0,B.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,B.jsx)("div",{className:"flex justify-between items-left",children:l&&(0,B.jsx)(Ne,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:l.name})})]})]})}var Te=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Dt({onSubmit:e}){let[t,r]=(0,Le.useState)({name:"",intro:"",active:!1});return(0,B.jsxs)("form",{onSubmit:i=>{i.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),r({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)(M,{htmlFor:"customerName",children:"Customer Name"}),(0,B.jsx)(U,{id:"customerName",value:t.name,onChange:i=>r({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)(M,{htmlFor:"customerIntro",children:"Intro"}),(0,B.jsx)(ee,{id:"customerIntro",value:t.intro??"",onChange:i=>r({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(ae,{id:"activeCustomer",checked:!!t.active,onCheckedChange:i=>r({...t,active:i})}),(0,B.jsx)(M,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,B.jsx)(V,{type:"submit",className:"B-full",children:"Add Customer"})]})}function kt({customers:e,users:t,categories:r,onSubmit:a,initialDeal:i,onAddCustomer:l,onClose:m}){let[o,b]=(0,Le.useState)(i||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[S,N]=(0,Le.useState)(!1),[p,v]=(0,Le.useState)({});(0,Le.useEffect)(()=>{i&&b(i)},[i]);let C=()=>{let d={};return o.customer||(d.customer="Customer is required"),o.value||(d.value="Value is required"),o.assignee||(d.assignee="Assignee is required"),o.closureDate||(d.closureDate="Closure Date is required"),v(d),Object.keys(d).length===0},h=async d=>{d.preventDefault(),v({});try{if(C()){let y=await a({...o});y.success?(b({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),m?.()):v(y.errors||{})}}catch{v({submit:"An error occurred while submitting the form."})}},P=d=>{b(y=>({...y,categories:(y.categories||[]).includes(d.id)?(y.categories||[]).filter(n=>n!==d.id):[...y.categories||[],d.id]}))},g=async d=>{b({...o,customer:d});try{let y=await l(d);y.success?N(!1):v(y.errors||{})}catch{v({submit:"An error occurred while submitting the form."})}},T=d=>t?.find(y=>y.id===Number(d)),E=d=>e?.find(y=>y.id===Number(d));return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("form",{onSubmit:h,className:"space-y-6",children:[(0,B.jsx)(ue,{className:"h-[60vh] pr-4",children:(0,B.jsxs)("div",{className:"space-y-6 px-4",children:[(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{htmlFor:"customer",children:"Customer"}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsxs)(re,{value:o.customer?.id?.toString(),onValueChange:d=>b({...o,customer:E(d)}),children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select customer"})}),(0,B.jsx)($,{children:e.map(d=>(0,B.jsx)(q,{value:d.id?.toString()||"",children:d.name},d.id))})]}),(0,B.jsx)(V,{variant:"outline",size:"icon",onClick:()=>N(!0),children:(0,B.jsx)(rt.PlusIcon,{className:"B-5 h-5"})})]}),p.customerId&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.customerId})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{htmlFor:"value",children:"Value"}),(0,B.jsx)(U,{id:"value",type:"number",value:o.value||"",onChange:d=>b({...o,value:Number.parseFloat(d.target.value)}),placeholder:"Enter deal value"}),p.value&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.value})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{htmlFor:"assignee",children:"Assignee"}),(0,B.jsxs)(re,{value:o.assignee?.id?.toString(),onValueChange:d=>b({...o,assignee:T(d)}),children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select assignee"})}),(0,B.jsx)($,{children:t&&t.map(d=>(0,B.jsx)(q,{value:d.id?.toString()||"",children:d.name},d.id))})]}),p.assignee&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.assignee})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{htmlFor:"description",children:"Description"}),(0,B.jsx)(ee,{id:"description",value:o.description||"",onChange:d=>b({...o,description:d.target.value}),placeholder:"Enter deal description"})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{children:"Categories"}),(0,B.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(d=>(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)("h4",{className:"text-sm font-medium",children:d.charAt(0).toUpperCase()+d.slice(1)}),(0,B.jsx)("div",{className:"grid grid-cols-2 gap-2",children:r.filter(y=>y.type===d).map(y=>(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(ae,{id:y.id.toString(),checked:o.categories?.includes(y.id),onCheckedChange:()=>P(y)}),(0,B.jsx)("label",{htmlFor:y.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:y.name})]},y.id))})]},d))})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{htmlFor:"closureDate",children:"Closure Date"}),(0,B.jsx)(U,{id:"closureDate",type:"date",value:o.closureDate||"",onChange:d=>b({...o,closureDate:d.target.value})}),p.closureDate&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,B.jsx)(V,{type:"submit",className:"B-full",children:i?"Update Deal":"Add Deal"})]}),(0,B.jsx)(pe,{open:S,onOpenChange:N,children:(0,B.jsxs)(X,{children:[(0,B.jsx)(Z,{children:(0,B.jsx)(Y,{children:"Add New Customer"})}),(0,B.jsx)(Dt,{onSubmit:g})]})})]})}function Lt({status:e,deals:t,users:r,customers:a,categories:i,onDealClick:l,calculateColumnValue:m,calculateWeightedValue:o,addNewDeal:b,onAddCustomer:S,compact:N=!1}){let[p,v]=(0,Le.useState)(!1);return(0,B.jsxs)("div",{className:"flex flex-col B-80",children:[(0,B.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),b&&(0,B.jsxs)(pe,{open:p,onOpenChange:v,children:[(0,B.jsx)(ot,{asChild:!0,children:(0,B.jsxs)(V,{className:"mb-4 B-full",children:[(0,B.jsx)(rt.PlusCircle,{className:"mr-2 h-4 B-4"}),"Add New Deal"]})}),(0,B.jsxs)(X,{children:[(0,B.jsx)(Z,{children:(0,B.jsx)(Y,{children:"Add New Deal"})}),(0,B.jsx)(kt,{customers:a,users:r,categories:i,onSubmit:b,onAddCustomer:S??(async()=>Promise.resolve({success:!1})),onClose:()=>v(!1)})]})]}),(0,B.jsx)(Te.Droppable,{droppableId:e,isDropDisabled:!1,children:C=>(0,B.jsxs)("div",{ref:C.innerRef,...C.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((h,P)=>(0,B.jsx)(Te.Draggable,{draggableId:h.id.toString(),index:h.id,children:g=>(0,B.jsx)("div",{ref:g.innerRef,...g.draggableProps,...g.dragHandleProps,children:(0,B.jsx)(Nt,{deal:h,customer:h.customer,categories:i,onClick:()=>l(h),compact:N})})},h.id.toString())),C.placeholder]})}),(0,B.jsxs)("div",{className:"mt-4 text-sm p-3 rounded-lg shadow",children:[(0,B.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,B.jsxs)("span",{className:"text-green-600",children:["\xA3",m(t).toLocaleString()]})]}),(0,B.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,B.jsxs)("span",{className:"text-blue-600",children:["\xA3",o(t,e).toLocaleString()]})]})]})]})}var Rr=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function kr({initialData:e,addNewDeal:t,updateDeal:r,addComment:a,addNewCustomer:i}){let[l,m]=(0,Le.useState)(null),o=p=>(e.deals??[]).filter(v=>v.status===p),b=p=>p.reduce((v,C)=>v+(C.value||0),0),S=(p,v)=>{let C={Cold:0,Qualified:.2,"Proposal Made":.5,"SoW Submitted":.8,Won:1,Lost:0};return p.reduce((h,P)=>h+(P.value||0)*C[v],0)},N=(0,Le.useCallback)(p=>{let{source:v,destination:C}=p;if(!C||v.droppableId===C.droppableId&&v.index===C.index)return;let h=v.droppableId,P=C.droppableId,g=e.deals?.filter(E=>E.id===v.index)[0],T=[...e.deals??[]];g&&(g.status=P,r(g))},[r]);return(0,B.jsx)(Te.DragDropContext,{onDragEnd:N,children:(0,B.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,B.jsx)("div",{className:"flex space-x-4 pb-4",children:Rr.filter(p=>p!=="Lost").map(p=>{let v=o(p);return(0,B.jsx)(Lt,{status:p,deals:v,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:m,calculateColumnValue:b,calculateWeightedValue:S,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:i},p)})}),l&&(0,B.jsx)(St,{deal:l,users:e.users,customer:l.customer,categories:e.categories??[],onClose:()=>m(null),onSave:r,onAddComment:p=>a(l.id.toString(),p)})]})})}0&&(module.exports={CRMKanbanBoard});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a}from"../../chunk-
|
|
2
|
+
"use strict";import{a}from"../../chunk-G72SIYN7.mjs";import"../../chunk-PFWODHNV.mjs";import"../../chunk-TASJS6US.mjs";import"../../chunk-ERUB6LU6.mjs";import"../../chunk-FFESN4FM.mjs";import"../../chunk-MEWCJ4MA.mjs";import"../../chunk-OGZERPA4.mjs";import"../../chunk-6T322YHB.mjs";import"../../chunk-KJIBE57R.mjs";import"../../chunk-CX4XB5W2.mjs";import"../../chunk-EECIYMTX.mjs";import"../../chunk-BUCI7BPM.mjs";import"../../chunk-JPZJET3B.mjs";import"../../chunk-BPSLUO5I.mjs";import"../../chunk-J2IHT57D.mjs";import"../../chunk-4YFMDLHL.mjs";import"../../chunk-HTVHCBXQ.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-ZLSF5YXT.mjs";import"../../chunk-M6LJ4BNZ.mjs";export{a as CRMKanbanBoard};
|