cortex-react-components 1.43.0 → 1.43.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/{chunk-WKMUGV4J.mjs → chunk-3EKJWIKR.mjs} +1 -1
  2. package/dist/{chunk-UDX5Y4SA.mjs → chunk-3M5Y3HO4.mjs} +1 -1
  3. package/dist/{chunk-5PW2VQWX.mjs → chunk-3TPMGKTR.mjs} +1 -1
  4. package/dist/{chunk-CNXWMJKB.mjs → chunk-4KGFHVYD.mjs} +1 -1
  5. package/dist/{chunk-QMTTXYES.mjs → chunk-4L4RAUPG.mjs} +1 -1
  6. package/dist/{chunk-VBYWMFIP.mjs → chunk-5ETXG7S3.mjs} +1 -1
  7. package/dist/{chunk-FHDQXXOE.mjs → chunk-6SBOCJ4N.mjs} +1 -1
  8. package/dist/chunk-72SXYDHA.mjs +1 -0
  9. package/dist/{chunk-5T46XIHN.mjs → chunk-A2YLYBNZ.mjs} +1 -1
  10. package/dist/{chunk-V2PS7NPM.mjs → chunk-AEDBEVEE.mjs} +1 -1
  11. package/dist/{chunk-VOUBXGYO.mjs → chunk-AEPYNOEK.mjs} +1 -1
  12. package/dist/{chunk-NUZIMEN5.mjs → chunk-EW2X7RMJ.mjs} +1 -1
  13. package/dist/{chunk-PWVWKURI.mjs → chunk-FKJWUROB.mjs} +1 -1
  14. package/dist/{chunk-66ZAIUUI.mjs → chunk-FNCXXX4V.mjs} +1 -1
  15. package/dist/{chunk-T6LPMF7A.mjs → chunk-FUF6ALNT.mjs} +1 -1
  16. package/dist/{chunk-CZ5I5OTN.mjs → chunk-HZ5QHCGZ.mjs} +1 -1
  17. package/dist/{chunk-EWNKVLW7.mjs → chunk-HZUQC3RL.mjs} +1 -1
  18. package/dist/{chunk-Z2XTCVEL.mjs → chunk-LEUWPWHH.mjs} +1 -1
  19. package/dist/{chunk-TQCGX4Y6.mjs → chunk-LHPVQIQZ.mjs} +1 -1
  20. package/dist/{chunk-DQZTKWPG.mjs → chunk-PBAL3B6N.mjs} +1 -1
  21. package/dist/{chunk-ETINBEVD.mjs → chunk-REHZTVVN.mjs} +1 -1
  22. package/dist/{chunk-SBHCQ2HK.mjs → chunk-TZK3YZ47.mjs} +1 -1
  23. package/dist/{chunk-L3PITDTZ.mjs → chunk-V3B64LRA.mjs} +1 -1
  24. package/dist/{chunk-EI7PFWFS.mjs → chunk-VPVXJCL6.mjs} +1 -1
  25. package/dist/{chunk-GFV75XSU.mjs → chunk-VX3ASFKY.mjs} +1 -1
  26. package/dist/{chunk-3PC5BLK7.mjs → chunk-W7S4W2O6.mjs} +1 -1
  27. package/dist/{chunk-B4HRNOHQ.mjs → chunk-WPTEMDOP.mjs} +1 -1
  28. package/dist/{chunk-WC776HFE.mjs → chunk-XBBQGSYP.mjs} +1 -1
  29. package/dist/{chunk-4ZT572BM.mjs → chunk-YDGF5GEU.mjs} +1 -1
  30. package/dist/{chunk-HCN2JMCH.mjs → chunk-YDQUZWFZ.mjs} +1 -1
  31. package/dist/{chunk-NGNSCVVW.mjs → chunk-Z5RPB3HR.mjs} +1 -1
  32. package/dist/components/Blocks/Banner.mjs +1 -1
  33. package/dist/components/Blocks/CallToAction.mjs +1 -1
  34. package/dist/components/Blocks/Content.mjs +1 -1
  35. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  36. package/dist/components/Blocks/FeaturesBlock.stories.mjs +1 -1
  37. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  38. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  39. package/dist/components/Blocks/index.mjs +1 -1
  40. package/dist/components/CRM/DealDetails.mjs +1 -1
  41. package/dist/components/CRM/DealDetails.stories.mjs +1 -1
  42. package/dist/components/CRM/KanbanBoard.js +1 -1
  43. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  44. package/dist/components/CRM/KanbanBoard.stories.js +1 -1
  45. package/dist/components/CRM/KanbanBoard.stories.mjs +1 -1
  46. package/dist/components/CRM/KanbanColumn.js +1 -1
  47. package/dist/components/CRM/KanbanColumn.mjs +1 -1
  48. package/dist/components/CRM/KanbanColumn.stories.js +1 -1
  49. package/dist/components/CRM/KanbanColumn.stories.mjs +1 -1
  50. package/dist/components/CRM/index.js +1 -1
  51. package/dist/components/CRM/index.mjs +1 -1
  52. package/dist/components/Cards/PricingCard.mjs +1 -1
  53. package/dist/components/Cards/PricingCard.stories.mjs +1 -1
  54. package/dist/components/Cards/ServiceCard.mjs +1 -1
  55. package/dist/components/Cards/ServiceCard.stories.mjs +1 -1
  56. package/dist/components/Cards/index.mjs +1 -1
  57. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  58. package/dist/components/HeaderFooter/index.mjs +1 -1
  59. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  60. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  61. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  62. package/dist/components/Heros/PostHero/index.mjs +1 -1
  63. package/dist/components/Heros/RenderHero.mjs +1 -1
  64. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  65. package/dist/components/Heros/index.mjs +1 -1
  66. package/dist/components/Layouts/BlogList.mjs +1 -1
  67. package/dist/components/Layouts/BlogList.stories.mjs +1 -1
  68. package/dist/components/Layouts/SlideShow.mjs +1 -1
  69. package/dist/components/Layouts/SlideShow.stories.mjs +1 -1
  70. package/dist/components/Layouts/index.mjs +1 -1
  71. package/dist/components/Menus/SidebarLeft.stories.mjs +1 -1
  72. package/dist/components/Menus/SidebarRight.mjs +1 -1
  73. package/dist/components/Menus/SidebarRight.stories.mjs +1 -1
  74. package/dist/components/Menus/index.mjs +1 -1
  75. package/dist/components/Payload/RichText/index.mjs +1 -1
  76. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  77. package/dist/components/Payload/RichText.stories.mjs +1 -1
  78. package/dist/components/Payload/index.mjs +1 -1
  79. package/dist/components/index.js +3 -3
  80. package/dist/components/index.mjs +1 -1
  81. package/dist/components/ui/index.mjs +1 -1
  82. package/dist/index.js +3 -3
  83. package/dist/index.mjs +1 -1
  84. package/dist/metafile-cjs.json +1 -1
  85. package/dist/metafile-esm.json +1 -1
  86. package/dist/pages/Blog.mjs +1 -1
  87. package/dist/pages/Blog.stories.mjs +1 -1
  88. package/dist/pages/Documentation.mjs +1 -1
  89. package/dist/pages/Documentation.stories.mjs +1 -1
  90. package/dist/pages/IndexPage.mjs +1 -1
  91. package/dist/pages/IndexPage.stories.mjs +1 -1
  92. package/dist/pages/Intranet.mjs +1 -1
  93. package/dist/pages/Intranet.stories.mjs +1 -1
  94. package/dist/pages/LandingPage.mjs +1 -1
  95. package/dist/pages/LandingPage.stories.mjs +1 -1
  96. package/dist/pages/Page.mjs +1 -1
  97. package/dist/pages/Page.stories.mjs +1 -1
  98. package/dist/pages/Publish.mjs +1 -1
  99. package/dist/pages/Publish.stories.mjs +1 -1
  100. package/dist/pages/Website.mjs +1 -1
  101. package/dist/pages/Website.stories.mjs +1 -1
  102. package/dist/sections/AboutSection.mjs +1 -1
  103. package/dist/sections/AboutSection.stories.mjs +1 -1
  104. package/dist/sections/BlogDetail.mjs +1 -1
  105. package/dist/sections/BlogDetail.stories.mjs +1 -1
  106. package/dist/sections/BlogListSection.mjs +1 -1
  107. package/dist/sections/BlogListSection.stories.mjs +1 -1
  108. package/dist/sections/ContactSection.mjs +1 -1
  109. package/dist/sections/ContactSection.stories.mjs +1 -1
  110. package/dist/sections/MainPageSection.mjs +1 -1
  111. package/dist/sections/PricingSection.mjs +1 -1
  112. package/dist/sections/PricingSection.stories.mjs +1 -1
  113. package/dist/sections/ServiceSection.mjs +1 -1
  114. package/dist/sections/ServiceSection.stories.mjs +1 -1
  115. package/dist/sections/form/index.mjs +1 -1
  116. package/dist/sections/index.mjs +1 -1
  117. package/package.json +2 -1
  118. package/dist/chunk-YDCEDTRV.mjs +0 -1
@@ -2,4 +2,4 @@
2
2
  "use strict";
3
3
  'use client'
4
4
 
5
- "use strict";var Qt=Object.create;var Pe=Object.defineProperty;var Zt=Object.getOwnPropertyDescriptor;var Xt=Object.getOwnPropertyNames;var Yt=Object.getPrototypeOf,eo=Object.prototype.hasOwnProperty;var to=(e,t)=>{for(var o in t)Pe(e,o,{get:t[o],enumerable:!0})},Qe=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Xt(t))!eo.call(e,n)&&n!==o&&Pe(e,n,{get:()=>t[n],enumerable:!(a=Zt(t,n))||a.enumerable});return e};var B=(e,t,o)=>(o=e!=null?Qt(Yt(e)):{},Qe(t||!e||!e.__esModule?Pe(o,"default",{value:e,enumerable:!0}):o,e)),oo=e=>Qe(Pe({},"__esModule",{value:!0}),e);var qo={};to(qo,{Default:()=>ye,NoDeals:()=>$o,default:()=>Jo});module.exports=oo(qo);var Le=require("react");var Se=B(require("react")),T=B(require("@radix-ui/react-dialog")),st=require("lucide-react");var it=require("clsx");var He="-",ro=e=>{let t=io(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{let r=d.split(He);return r[0]===""&&r.length!==1&&r.shift(),Ye(r,t)||ao(d)},getConflictingClassGroupIds:(d,r)=>{let f=o[d]||[];return r&&a[d]?[...f,...a[d]]:f}}},Ye=(e,t)=>{var d;if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),n=a?Ye(e.slice(1),a):void 0;if(n)return n;if(t.validators.length===0)return;let i=e.join(He);return(d=t.validators.find(({validator:r})=>r(i)))==null?void 0:d.classGroupId},Ze=/^\[(.+)\]$/,ao=e=>{if(Ze.test(e)){let t=Ze.exec(e)[1],o=t==null?void 0:t.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},io=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return no(Object.entries(e.classGroups),o).forEach(([i,d])=>{ze(d,a,i,t)}),a},ze=(e,t,o,a)=>{e.forEach(n=>{if(typeof n=="string"){let i=n===""?t:Xe(t,n);i.classGroupId=o;return}if(typeof n=="function"){if(so(n)){ze(n(a),t,o,a);return}t.validators.push({validator:n,classGroupId:o});return}Object.entries(n).forEach(([i,d])=>{ze(d,Xe(t,i),o,a)})})},Xe=(e,t)=>{let o=e;return t.split(He).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},so=e=>e.isThemeGetter,no=(e,t)=>t?e.map(([o,a])=>{let n=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([d,r])=>[t+d,r])):i);return[o,n]}):e,lo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,n=(i,d)=>{o.set(i,d),t++,t>e&&(t=0,a=o,o=new Map)};return{get(i){let d=o.get(i);if(d!==void 0)return d;if((d=a.get(i))!==void 0)return n(i,d),d},set(i,d){o.has(i)?o.set(i,d):n(i,d)}}},et="!",co=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,n=t[0],i=t.length,d=r=>{let f=[],w=0,S=0,p;for(let b=0;b<r.length;b++){let R=r[b];if(w===0){if(R===n&&(a||r.slice(b,b+i)===t)){f.push(r.slice(S,b)),S=b+i;continue}if(R==="/"){p=b;continue}}R==="["?w++:R==="]"&&w--}let y=f.length===0?r:r.substring(S),h=y.startsWith(et),x=h?y.substring(1):y,C=p&&p>S?p-S:void 0;return{modifiers:f,hasImportantModifier:h,baseClassName:x,maybePostfixModifierPosition:C}};return o?r=>o({className:r,parseClassName:d}):d},mo=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},po=e=>({cache:lo(e.cacheSize),parseClassName:co(e),...ro(e)}),uo=/\z+/,go=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:n}=t,i=[],d=e.trim().split(uo),r="";for(let f=d.length-1;f>=0;f-=1){let w=d[f],{modifiers:S,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:h}=o(w),x=!!h,C=a(x?y.substring(0,h):y);if(!C){if(!x){r=w+(r.length>0?" "+r:r);continue}if(C=a(y),!C){r=w+(r.length>0?" "+r:r);continue}x=!1}let b=mo(S).join(":"),R=p?b+et:b,E=R+C;if(i.includes(E))continue;i.push(E);let W=n(C,x);for(let G=0;G<W.length;++G){let m=W[G];i.push(R+m)}r=w+(r.length>0?" "+r:r)}return r};function fo(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=tt(t))&&(a&&(a+=" "),a+=o);return a}var tt=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=tt(e[a]))&&(o&&(o+=" "),o+=t);return o};function bo(e,...t){let o,a,n,i=d;function d(f){let w=t.reduce((S,p)=>p(S),e());return o=po(w),a=o.cache.get,n=o.cache.set,i=r,r(f)}function r(f){let w=a(f);if(w)return w;let S=go(f,o);return n(f,S),S}return function(){return i(fo.apply(null,arguments))}}var P=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},ot=/^\[(?:([a-z-]+):)?(.+)\]$/i,vo=/^\d+\/\d+$/,ho=new Set(["px","full","screen"]),yo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|z|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Co=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,wo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)st-?((\d+)?\.?(\d+)[a-z]+|0)/,So=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,J=e=>pe(e)||ho.has(e)||vo.test(e),$=e=>ue(e,"length",To),pe=e=>!!e&&!Number.isNaN(Number(e)),Be=e=>ue(e,"number",pe),Ce=e=>!!e&&Number.isInteger(Number(e)),No=e=>e.endsWith("%")&&pe(e.slice(0,-1)),u=e=>ot.test(e),q=e=>yo.test(e),Ro=new Set(["length","size","percentage"]),Do=e=>ue(e,Ro,rt),Po=e=>ue(e,"position",rt),ko=new Set(["image","url"]),Ao=e=>ue(e,ko,Io),Mo=e=>ue(e,"",Lo),we=()=>!0,ue=(e,t,o)=>{let a=ot.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},To=e=>xo.test(e)&&!Co.test(e),rt=()=>!1,Lo=e=>wo.test(e),Io=e=>So.test(e);var Eo=()=>{let e=P("colors"),t=P("spacing"),o=P("blur"),a=P("brightness"),n=P("borderColor"),i=P("borderRadius"),d=P("borderSpacing"),r=P("borderWidth"),f=P("contrast"),w=P("grayscale"),S=P("hueRotate"),p=P("invert"),y=P("gap"),h=P("gradientColorStops"),x=P("gradientColorStopPositions"),C=P("inset"),b=P("margin"),R=P("opacity"),E=P("padding"),W=P("saturate"),G=P("scale"),m=P("sepia"),D=P("skew"),O=P("space"),l=P("translate"),k=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],me=()=>["auto",u,t],N=()=>[u,t],Ke=()=>["",J,$],Re=()=>["auto",pe,u],Je=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],De=()=>["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"],Ee=()=>["start","end","center","between","around","evenly","stretch"],xe=()=>["","0",u],qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[pe,u];return{cacheSize:500,separator:":",theme:{colors:[we],spacing:[J,$],blur:["none","",q,u],brightness:K(),borderColor:[e],borderRadius:["none","","full",q,u],borderSpacing:N(),borderWidth:Ke(),contrast:K(),grayscale:xe(),hueRotate:K(),invert:xe(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[No,$],inset:me(),margin:me(),opacity:K(),padding:N(),saturate:K(),scale:K(),sepia:xe(),skew:K(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",u]}],container:["container"],columns:[{columns:[q]}],"break-after":[{"break-after":qe()}],"break-before":[{"break-before":qe()}],"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:[...Je(),u]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],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",Ce,u]}],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",u]}],grow:[{grow:xe()}],shrink:[{shrink:xe()}],order:[{order:["first","last","none",Ce,u]}],"grid-cols":[{"grid-cols":[we]}],"col-start-end":[{col:["auto",{span:["full",Ce,u]},u]}],"col-start":[{"col-start":Re()}],"col-end":[{"col-end":Re()}],"grid-rows":[{"grid-rows":[we]}],"row-start-end":[{row:["auto",{span:[Ce,u]},u]}],"row-start":[{"row-start":Re()}],"row-end":[{"row-end":Re()}],"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:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...Ee()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ee(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ee(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],z:[{z:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"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:[q]},q]}],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",q,$]}],"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:[we]}],"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",pe,Be]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",J,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":[R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[R]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...De(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",J,$]}],"underline-offset":[{"underline-offset":["auto",J,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:N()}],"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":[R]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Je(),Po]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Do]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ao]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-z":[{"rounded-z":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[r]}],"border-w-x":[{"border-x":[r]}],"border-w-y":[{"border-y":[r]}],"border-w-z":[{"border-z":[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":[R]}],"border-style":[{border:[...De(),"hidden"]}],"divide-x":[{"divide-x":[r]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[r]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[R]}],"divide-style":[{divide:De()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-z":[{"border-z":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...De()]}],"outline-offset":[{"outline-offset":[J,u]}],"outline-w":[{outline:[J,$]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ke()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[J,$]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",q,Mo]}],"shadow-color":[{shadow:[we]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[...$e(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$e()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",q,u]}],grayscale:[{grayscale:[w]}],"hue-rotate":[{"hue-rotate":[S]}],invert:[{invert:[p]}],saturate:[{saturate:[W]}],sepia:[{sepia:[m]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[w]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[S]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[R]}],"backdrop-saturate":[{"backdrop-saturate":[W]}],"backdrop-sepia":[{"backdrop-sepia":[m]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",u]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",u]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",u]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[G]}],"scale-x":[{"scale-x":[G]}],"scale-y":[{"scale-y":[G]}],rotate:[{rotate:[Ce,u]}],"translate-x":[{"translate-x":[l]}],"translate-y":[{"translate-y":[l]}],"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","z-resize","w-resize","Le-resize","nw-resize","se-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":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-z":[{"scroll-z":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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:[J,$,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","z","pr","pb","pl"],px:["pr","pl"],py:["z","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-z","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-z":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-z","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-z","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-z","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-z","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var at=bo(Eo);function g(...e){return at((0,it.clsx)(e))}var z=require("react/jsx-runtime"),ge=T.Root,nt=T.Trigger,Bo=T.Portal;var lt=Se.forwardRef(({className:e,...t},o)=>(0,z.jsx)(T.Overlay,{ref:o,className:g("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}));lt.displayName=T.Overlay.displayName;var X=Se.forwardRef(({className:e,children:t,...o},a)=>(0,z.jsxs)(Bo,{children:[(0,z.jsx)(lt,{}),(0,z.jsxs)(T.Content,{ref:a,className:g("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),...o,children:[t,(0,z.jsxs)(T.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,z.jsx)(st.X,{className:"h-4 w-4"}),(0,z.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));X.displayName=T.Content.displayName;var Y=({className:e,...t})=>(0,z.jsx)("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Y.displayName="DialogHeader";var zo=({className:e,...t})=>(0,z.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});zo.displayName="DialogFooter";var ee=Se.forwardRef(({className:e,...t},o)=>(0,z.jsx)(T.Title,{ref:o,className:g("text-lg font-semibold leading-none tracking-tight",e),...t}));ee.displayName=T.Title.displayName;var Ho=Se.forwardRef(({className:e,...t},o)=>(0,z.jsx)(T.Description,{ref:o,className:g("text-sm text-muted-foreground",e),...t}));Ho.displayName=T.Description.displayName;var ct=require("@radix-ui/react-slot"),dt=require("class-variance-authority"),mt=B(require("react")),Vo=(0,dt.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-primary text-primary-foreground hover:bg-primary-ON_HOVER",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-secondary/80"}}}),H=mt.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...n},i)=>(0,z.jsx)(e?ct.Slot:"button",{className:g(Vo({className:t,size:o,variant:a})),ref:i,...n}));H.displayName="Button";var ut=B(require("react"));var j=ut.forwardRef(({className:e,type:t,...o},a)=>(0,z.jsx)("input",{type:t,className:g("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,...o}));j.displayName="Input";var ft=B(require("react")),Ve=B(require("@radix-ui/react-label"));var Fo=(0,dt.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),L=ft.forwardRef(({className:e,...t},o)=>(0,z.jsx)(Ve.Root,{ref:o,className:g(Fo(),e),...t}));L.displayName=Ve.Root.displayName;var ht=B(require("react")),te=ht.forwardRef(({className:e,...t},o)=>(0,z.jsx)("textarea",{className:g("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}));te.displayName="Textarea";var v=B(require("@radix-ui/react-select")),Q=B(require("react")),fe=v.Root;var be=v.Value,re=Q.forwardRef(({children:e,className:t,...o},a)=>(0,z.jsxs)(v.Trigger,{className:g("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,...o,children:[e,(0,z.jsx)(v.Icon,{asChild:!0,children:(0,z.jsx)(st.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));re.displayName=v.Trigger.displayName;var xt=Q.forwardRef(({className:e,...t},o)=>(0,z.jsx)(v.ScrollUpButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,z.jsx)(st.ChevronUp,{className:"h-4 w-4"})}));xt.displayName=v.ScrollUpButton.displayName;var Ct=Q.forwardRef(({className:e,...t},o)=>(0,z.jsx)(v.ScrollDownButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,z.jsx)(st.ChevronDown,{className:"h-4 w-4"})}));Ct.displayName=v.ScrollDownButton.displayName;var ae=Q.forwardRef(({children:e,className:t,position:o="popper",...a},n)=>(0,z.jsx)(v.Portal,{children:(0,z.jsxs)(v.Content,{className:g("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-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:n,...a,children:[(0,z.jsx)(xt,{}),(0,z.jsx)(v.Viewport,{className:g("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,z.jsx)(Ct,{})]})}));ae.displayName=v.Content.displayName;var Wo=Q.forwardRef(({className:e,...t},o)=>(0,z.jsx)(v.Label,{className:g("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));Wo.displayName=v.Label.displayName;var ie=Q.forwardRef(({children:e,className:t,...o},a)=>(0,z.jsxs)(v.Item,{className:g("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,...o,children:[(0,z.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,z.jsx)(v.ItemIndicator,{children:(0,z.jsx)(st.Check,{className:"h-4 w-4"})})}),(0,z.jsx)(v.ItemText,{children:e})]}));ie.displayName=v.Item.displayName;var Go=Q.forwardRef(({className:e,...t},o)=>(0,z.jsx)(v.Separator,{className:g("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));Go.displayName=v.Separator.displayName;var Ne=B(require("@radix-ui/react-checkbox")),St=B(require("react")),se=St.forwardRef(({className:e,...t},o)=>(0,z.jsx)(Ne.Root,{className:g("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,z.jsx)(Ne.Indicator,{className:g("flex items-center justify-center text-current"),children:(0,z.jsx)(st.Check,{className:"h-4 w-4"})})}));se.displayName=Ne.Root.displayName;var Oo=(0,dt.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 Ae({className:e,variant:t,...o}){return(0,z.jsx)("div",{className:g(Oo({variant:t}),e),...o})}var Fe=B(require("react")),F=B(require("@radix-ui/react-scroll-area"));var ve=Fe.forwardRef(({className:e,children:t,...o},a)=>(0,z.jsxs)(F.Root,{ref:a,className:g("relative overflow-hidden",e),...o,children:[(0,z.jsx)(F.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,z.jsx)(Dt,{}),(0,z.jsx)(F.Corner,{})]}));ve.displayName=F.Root.displayName;var Dt=Fe.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,z.jsx)(F.ScrollAreaScrollbar,{ref:a,orientation:t,className:g("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,z.jsx)(F.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Dt.displayName=F.ScrollAreaScrollbar.displayName;function Pt({deal:e,users:t,customer:o,categories:a,onClose:n,onSave:i,onAddComment:d}){var m,D,O;let[r,f]=(0,Le.useState)({...e,value:e.value||0}),[w,S]=(0,Le.useState)(""),[p,y]=(0,Le.useState)(!1),[h,x]=(0,Le.useState)(null);(0,Le.useEffect)(()=>{y(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);let C=()=>{i(r),y(!1),x(null)},b=(l,k)=>{f(U=>({...U,[l]:k}))},R=l=>{let k=r.categories.includes(l)?r.categories.filter(U=>U!==l):[...r.categories,l];b("categories",k)},E=()=>{w.trim()&&(d({id:Date.now().toString(),text:w,timestamp:new Date().toISOString()}),f(l=>({...l,comments:[...l.comments,{id:"0",text:w,timestamp:new Date().toISOString()}]})),S(""))},W=l=>{switch(l){case"proposition":return"bg-blue-100 text-blue-800";case"source":return"bg-green-100 text-green-800";case"sector":return"bg-purple-100 text-purple-800";default:return"bg-gray-100 text-gray-800"}},G=(l,k,U)=>{let me=h===l;return(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:k}),(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[U,me?(0,z.jsx)(j,{value:r[l],onChange:N=>b(l,N.target.value),onBlur:()=>x(null),autoFocus:!0}):(0,z.jsx)("div",{className:"flex-grow cursor-pointer hover:bg-gray-100 p-2 rounded",onClick:()=>x(l),children:r[l]}),!me&&(0,z.jsx)(H,{variant:"ghost",size:"sm",onClick:()=>x(l),children:(0,z.jsx)(st.Edit2Icon,{className:"w-4 h-4"})})]})]})};return(0,z.jsx)(ge,{open:!0,children:(0,z.jsxs)(X,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,z.jsxs)(Y,{className:"flex flex-row items-center justify-between",children:[(0,z.jsx)(ee,{className:"text-2xl font-bold",children:o==null?void 0:o.name}),(0,z.jsxs)("div",{className:"flex space-x-2",children:[(0,z.jsx)(H,{variant:"outline",onClick:n,children:"Close"}),(0,z.jsxs)(H,{onClick:C,disabled:!p,children:[(0,z.jsx)(st.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,z.jsxs)(ve,{className:"flex-grow pr-4",children:[(0,z.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,z.jsx)("div",{className:"grid gap-2",children:h==="value"?(0,z.jsx)(j,{type:"number",value:r.value,onChange:l=>b("value",Number(l.target.value)),onBlur:()=>x(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,z.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("value"),children:["\xA3",(m=r.value)==null?void 0:m.toLocaleString()]})}),(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Assignee"}),h==="assignee"?(0,z.jsxs)(fe,{value:((O=(D=r==null?void 0:r.assignee)==null?void 0:D.id)==null?void 0:O.toString())||"",onValueChange:l=>b("assignee",l),children:[(0,z.jsx)(re,{children:(0,z.jsx)(be,{placeholder:"Select assignee"})}),(0,z.jsx)(ae,{children:t&&t.map(l=>{var k;return(0,z.jsx)(ie,{value:((k=l==null?void 0:l.id)==null?void 0:k.toString())||"",children:l.name},l.id)})})]}):(0,z.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("assignee"),children:[(0,z.jsx)(st.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,z.jsx)("span",{children:r.assignee.name})]})]}),(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Closure Date"}),h==="closureDate"?(0,z.jsx)(j,{type:"date",value:r.closureDate.split("T")[0],onChange:l=>b("closureDate",l.target.value),onBlur:()=>x(null),autoFocus:!0}):(0,z.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("closureDate"),children:[(0,z.jsx)(st.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,z.jsx)("span",{children:new Date(r.closureDate).toLocaleDateString("en-GB")})]})]})]}),(0,z.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Description"}),h==="description"?(0,z.jsx)(te,{value:r.description,onChange:l=>b("description",l.target.value),onBlur:()=>x(null),className:"min-h-[100px]",autoFocus:!0}):(0,z.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 pb-5 rounded",onClick:()=>x("description"),children:r.description})]})}),(0,z.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 z-2 gap-4",children:[(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Status"}),h==="status"?(0,z.jsxs)(fe,{value:r.status,onValueChange:l=>{b("status",l),x(null)},children:[(0,z.jsx)(re,{children:(0,z.jsx)(be,{placeholder:"Select status"})}),(0,z.jsx)(ae,{children:["Cold","Qualified","Proposal Made","Won","Lost"].map(l=>(0,z.jsx)(ie,{value:l,children:l},l))})]}):(0,z.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("status"),children:r.status})]}),(0,z.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Categories"}),h==="categories"?(0,z.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.map(l=>(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsx)(se,{id:l.id,checked:r.categories.includes(l.id),onCheckedChange:()=>R(l.id)}),(0,z.jsx)("label",{htmlFor:l.id,className:`text-sm font-medium ${W(l.type)} px-2 py-1 rounded`,children:l.name})]},l.id))}):(0,z.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("categories"),children:r.categories.map(l=>{let k=a.find(U=>U.id===l);return k?(0,z.jsx)(Ae,{variant:"secondary",className:W(k.type),children:k.name},k.id):null})})]})]}),(0,z.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 z-4 gap-4",children:[(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Comments"}),(0,z.jsx)(ve,{className:"h-[200px] overflow-y-auto",children:(0,z.jsx)("div",{className:"space-y-2",children:r.comments.slice().sort((l,k)=>new Date(k.timestamp).getTime()-new Date(l.timestamp).getTime()).map(l=>{var k;return(0,z.jsxs)("div",{className:"bg-gray-50 p-3 rounded-lg",children:[(0,z.jsx)("p",{className:"text-sm text-gray-700",children:l.text}),(0,z.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[(k=l==null?void 0:l.author)==null?void 0:k.name," - ",new Date(l.timestamp).toLocaleString()]})]},l.id)})})}),(0,z.jsxs)("div",{className:"flex mt-2",children:[(0,z.jsx)(j,{value:w,onChange:l=>S(l.target.value),placeholder:"Add a comment...",className:"flex-grow"}),(0,z.jsxs)(H,{onClick:E,className:"ml-2",children:[(0,z.jsx)(st.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,z.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(r.updatedAt).toLocaleString()]})]})]})]})})}var le=B(require("react"));var We=le.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("rounded-xl border bg-card text-card-foreground shadow",e),...t}));We.displayName="Card";var Ge=le.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("flex flex-col space-y-1.5 p-6",e),...t}));Ge.displayName="CardHeader";var Oe=le.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("font-semibold leading-none tracking-tight",e),...t}));Oe.displayName="CardTitle";var Uo=le.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("text-sm text-muted-foreground",e),...t}));Uo.displayName="CardDescription";var Ue=le.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("p-6 z-0",e),...t}));Ue.displayName="CardContent";var jo=le.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("flex items-center p-6 z-0",e),...t}));jo.displayName="CardFooter";function kt({deal:e,customer:t,categories:o,onClick:a}){let n=o.find(i=>i.type==="proposition"&&e.categories.includes(i.id));return(0,z.jsxs)(We,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,z.jsxs)(Ge,{className:"pb-2",children:[(0,z.jsx)("div",{className:"flex justify-between items-center",children:(0,z.jsx)(Oe,{className:"text-lg font-semibold text-gray-800",children:t==null?void 0:t.name})}),(0,z.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,z.jsxs)(Ue,{children:[(0,z.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,z.jsxs)("div",{className:"flex items-center text-sm text-gray-600",children:[(0,z.jsx)(st.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,z.jsx)("span",{children:e.assignee.name})]}),(0,z.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,z.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,z.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,z.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,z.jsx)(st.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,z.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,z.jsx)("div",{className:"flex justify-between items-left",children:n&&(0,z.jsx)(Ae,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:n.name})})]})]})}var Te=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Mt({onSubmit:e}){var n;let[t,o]=(0,Le.useState)({name:"",intro:"",active:!0});return(0,z.jsxs)("form",{onSubmit:i=>{i.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),o({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,z.jsxs)("div",{className:"space-y-2",children:[(0,z.jsx)(L,{htmlFor:"customerName",children:"Customer Name"}),(0,z.jsx)(j,{id:"customerName",value:t.name,onChange:i=>o({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,z.jsxs)("div",{className:"space-y-2",children:[(0,z.jsx)(L,{htmlFor:"customerIntro",children:"Intro"}),(0,z.jsx)(te,{id:"customerIntro",value:(n=t.intro)!=null?n:"",onChange:i=>o({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsx)(se,{id:"activeCustomer",checked:!!t.active,onCheckedChange:i=>o({...t,active:i})}),(0,z.jsx)(L,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,z.jsx)(H,{type:"submit",className:"w-full",children:"Add Customer"})]})}function Lt({customers:e,users:t,categories:o,onSubmit:a,initialDeal:n,onAddCustomer:i,onClose:d}){var R,E,W,G;let[r,f]=(0,Le.useState)(n||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[w,S]=(0,Le.useState)(!1),[p,y]=(0,Le.useState)({});(0,Le.useEffect)(()=>{n&&f(n)},[n]);let h=()=>{let m={};return r.customer||(m.customer="Customer is required"),r.value||(m.value="Value is required"),r.assignee||(m.assignee="Assignee is required"),r.closureDate||(m.closureDate="Closure Date is required"),y(m),Object.keys(m).length===0},x=m=>{m.preventDefault(),h()&&(a({...r}),f({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),y({}),d==null||d())},C=m=>{f(D=>{var O;return{...D,categories:(O=D.categories)!=null&&O.includes(m)?D.categories.filter(l=>l!==m):[...D.categories||[],m]}})},b=m=>{e.push(m),f({...r,customer:m}),S(!1),i(m)};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("form",{onSubmit:x,className:"space-y-6",children:[(0,z.jsx)(ve,{className:"h-[60vh] pr-4",children:(0,z.jsxs)("div",{className:"space-y-6 px-4",children:[(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(L,{htmlFor:"customer",children:"Customer"}),(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsxs)(fe,{value:(E=(R=r.customer)==null?void 0:R.id)==null?void 0:E.toString(),onValueChange:m=>f({...r,customer:{id:Number(m)}}),children:[(0,z.jsx)(re,{children:(0,z.jsx)(be,{placeholder:"Select customer"})}),(0,z.jsx)(ae,{children:e.map(m=>{var D;return(0,z.jsx)(ie,{value:((D=m.id)==null?void 0:D.toString())||"",children:m.name},m.id)})})]}),(0,z.jsx)(H,{variant:"outline",size:"icon",onClick:()=>S(!0),children:(0,z.jsx)(st.PlusIcon,{className:"w-5 h-5"})})]}),p.customerId&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:p.customerId})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(L,{htmlFor:"value",children:"Value"}),(0,z.jsx)(j,{id:"value",type:"number",value:r.value||"",onChange:m=>f({...r,value:Number.parseFloat(m.target.value)}),placeholder:"Enter deal value"}),p.value&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:p.value})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(L,{htmlFor:"assignee",children:"Assignee"}),(0,z.jsxs)(fe,{value:(G=(W=r.assignee)==null?void 0:W.id)==null?void 0:G.toString(),onValueChange:m=>f({...r,assignee:{id:Number(m)}}),children:[(0,z.jsx)(re,{children:(0,z.jsx)(be,{placeholder:"Select assignee"})}),(0,z.jsx)(ae,{children:t&&t.map(m=>{var D;return(0,z.jsx)(ie,{value:((D=m.id)==null?void 0:D.toString())||"",children:m.name},m.id)})})]}),p.assignee&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:p.assignee})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(L,{htmlFor:"description",children:"Description"}),(0,z.jsx)(te,{id:"description",value:r.description||"",onChange:m=>f({...r,description:m.target.value}),placeholder:"Enter deal description"})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(L,{children:"Categories"}),(0,z.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(m=>(0,z.jsxs)("div",{className:"space-y-2",children:[(0,z.jsx)("h4",{className:"text-sm font-medium",children:m.charAt(0).toUpperCase()+m.slice(1)}),(0,z.jsx)("div",{className:"grid grid-cols-2 gap-2",children:o.filter(D=>D.type===m).map(D=>{var O;return(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsx)(se,{id:D.id,checked:(O=r.categories)==null?void 0:O.includes(D.id),onCheckedChange:()=>C(D.id)}),(0,z.jsx)("label",{htmlFor:D.id,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:D.name})]},D.id)})})]},m))})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(L,{htmlFor:"closureDate",children:"Closure Date"}),(0,z.jsx)(j,{id:"closureDate",type:"date",value:r.closureDate,onChange:m=>f({...r,closureDate:m.target.value})}),p.closureDate&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,z.jsx)(H,{type:"submit",className:"w-full",children:n?"Update Deal":"Add Deal"})]}),(0,z.jsx)(ge,{open:w,onOpenChange:S,children:(0,z.jsxs)(X,{children:[(0,z.jsx)(Y,{children:(0,z.jsx)(ee,{children:"Add New Customer"})}),(0,z.jsx)(Mt,{onSubmit:b})]})})]})}function Bt({status:e,deals:t,users:o,customers:a,categories:n,onDealClick:i,calculateColumnValue:d,calculateWeightedValue:r,addNewDeal:f,onAddCustomer:w}){let[S,p]=(0,Le.useState)(!1);return(0,z.jsxs)("div",{className:"flex flex-col w-80",children:[(0,z.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),f&&(0,z.jsxs)(ge,{open:S,onOpenChange:p,children:[(0,z.jsx)(nt,{asChild:!0,children:(0,z.jsxs)(H,{className:"mb-4 w-full bg-green-500 hover:bg-green-600 text-white",children:[(0,z.jsx)(st.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,z.jsxs)(X,{children:[(0,z.jsx)(Y,{children:(0,z.jsx)(ee,{children:"Add New Deal"})}),(0,z.jsx)(Lt,{customers:a,users:o,categories:n,onSubmit:f,onAddCustomer:w,onClose:()=>p(!1)})]})]}),(0,z.jsx)(Te.Droppable,{droppableId:e,children:y=>(0,z.jsxs)("div",{ref:y.innerRef,...y.droppableProps,className:"bg-gray-100 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((h,x)=>(0,z.jsx)(Te.Draggable,{draggableId:h.id.toString(),index:x,children:C=>(0,z.jsx)("div",{ref:C.innerRef,...C.draggableProps,...C.dragHandleProps,children:(0,z.jsx)(kt,{deal:h,customer:a.find(b=>b.id===h.customer.id),categories:n,onClick:()=>i(h)})})},h.id)),y.placeholder]})}),(0,z.jsxs)("div",{className:"mt-4 text-sm bg-white p-3 rounded-lg shadow",children:[(0,z.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,z.jsxs)("span",{className:"text-green-600",children:["\xA3",d(t).toLocaleString()]})]}),(0,z.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,z.jsxs)("span",{className:"text-blue-600",children:["\xA3",r(t,e).toLocaleString()]})]})]})]})}var _o=["Cold","Qualified","Proposal","SoW","Won","Lost"];function Ht({initialData:e,addNewDeal:t,updateDeal:o,addComment:a,addNewCustomer:n}){let[i,d]=(0,Le.useState)(null),r=p=>e.deals.filter(y=>y.status===p),f=p=>p.reduce((y,h)=>y+(h.value||0),0),w=(p,y)=>{let h={Cold:.2,Qualified:.4,Proposal:.6,SoW:.7,Won:1,Lost:0};return p.reduce((x,C)=>x+(C.value||0)*h[y],0)},S=(0,Le.useCallback)(p=>{let{source:y,destination:h}=p;if(!h||y.droppableId===h.droppableId&&y.index===h.index)return;let x=y.droppableId,C=h.droppableId;console.log("Moving from ",x,"to",C);let b=[...e.deals],[R]=b.splice(y.index,1);R.status=C,b.splice(h.index,0,R),o(R)},[o]);return(0,z.jsx)(Te.DragDropContext,{onDragEnd:S,children:(0,z.jsxs)("div",{className:"p-4",children:[(0,z.jsx)("div",{className:"flex space-x-4 overflow-x-auto pb-4",children:_o.filter(p=>p!=="Won"&&p!=="Lost").map(p=>{let y=r(p);return(0,z.jsx)(Bt,{status:p,deals:y,customers:e.customers,users:e.users,categories:e.categories,onDealClick:d,calculateColumnValue:f,calculateWeightedValue:w,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:n},p)})}),i&&(0,z.jsx)(Pt,{deal:i,users:e.users,customer:e.customers.find(p=>p.id===i.customer.id),categories:e.categories,onClose:()=>d(null),onSave:o,onAddComment:p=>a(i.id.toString(),p)})]})})}var je=[{id:1,name:"Acme Corp",intro:"z leading technology company",active:!0},{id:2,name:"GlobalTech",intro:"Innovative solutions provider",active:!0},{id:3,name:"InnoSystems",intro:"Cutting-edge software development",active:!1}],_e=[{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"}];var Ie=[{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"}];var Ko={title:"CRM/KanbanBoard",component:Ht,parameters:{layout:"fullscreen"}},Jo=Ko,ye={args:{initialData:{deals:Array.from({length:20},(e,t)=>({id:t+1,customer:je[t%je.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:Ie[Math.floor(Math.random()*Ie.length)].name,status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],categories:[_e[t%_e.length].id],dateLogged:new Date(Date.now()-Math.floor(Math.random()*30)*24*60*60*1e3).toISOString(),closureDate:new Date(Date.now()+Math.floor(Math.random()*90)*24*60*60*1e3).toISOString(),comments:[],updatedAt:new Date().toISOString(),description:`This is a mock description for deal ${t+1}. Le'z a ${["small","medium","large"][t%3]} deal with high potential.`})),customers:[{id:"1",name:"Acme Corp",active:!0},{id:"2",name:"GlobalTech",active:!0},{id:"3",name:"InnoSystems",active:!0}],users:Ie,categories:[{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"}]},addNewDeal:async e=>(console.log("Adding deal:",e),{...e,id:"new-deal-id"}),updateDeal:async e=>(console.log("Updating deal:",e),e),addNewCustomer:async e=>(console.log("Adding customer:",e),{...e,id:"new-customer-id"}),addComment:async(e,t)=>(console.log("Adding comment to deal:",e,t),{...t,id:"new-comment-id"})}},Vt,Ft,Wt,Gt,Ot,Ut,jt,_t,Kt,Jt,$t,qt,$o={args:{...(Vt=ye.args)!=null?Vt:{},initialData:{...(Wt=(Ft=ye.args)==null?void 0:Ft.initialData)!=null?Wt:{},deals:[],users:(Ut=(Ot=(Gt=ye.args)==null?void 0:Gt.initialData)==null?void 0:Ot.users)!=null?Ut:[],customers:(Kt=(_t=(jt=ye.args)==null?void 0:jt.initialData)==null?void 0:_t.customers)!=null?Kt:[],categories:(qt=($t=(Jt=ye.args)==null?void 0:Jt.initialData)==null?void 0:$t.categories)!=null?qt:[]}}};0&&(module.exports={Default,NoDeals});
5
+ "use strict";var Ot=Object.create;var De=Object.defineProperty;var Ut=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var jt=Object.getPrototypeOf,Kt=Object.prototype.hasOwnProperty;var Jt=(e,t)=>{for(var o in t)De(e,o,{get:t[o],enumerable:!0})},Ze=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of _t(t))!Kt.call(e,n)&&n!==o&&De(e,n,{get:()=>t[n],enumerable:!(a=Ut(t,n))||a.enumerable});return e};var B=(e,t,o)=>(o=e!=null?Ot(jt(e)):{},Ze(t||!e||!e.__esModule?De(o,"default",{value:e,enumerable:!0}):o,e)),$t=e=>Ze(De({},"__esModule",{value:!0}),e);var Wo={};Jt(Wo,{Default:()=>Be,NoDeals:()=>Wt,default:()=>Fo});module.exports=$t(Wo);var Vt=require("react");var we=B(require("react")),T=B(require("@radix-ui/react-dialog")),nt=require("lucide-react");var st=require("clsx");var Fe="-",qt=e=>{let t=Zt(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{let r=c.split(Fe);return r[0]===""&&r.length!==1&&r.shift(),et(r,t)||Qt(c)},getConflictingClassGroupIds:(c,r)=>{let f=o[c]||[];return r&&a[c]?[...f,...a[c]]:f}}},et=(e,t)=>{var c;if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),n=a?et(e.slice(1),a):void 0;if(n)return n;if(t.validators.length===0)return;let i=e.join(Fe);return(c=t.validators.find(({validator:r})=>r(i)))==null?void 0:c.classGroupId},Xe=/^\[(.+)\]$/,Qt=e=>{if(Xe.test(e)){let t=Xe.exec(e)[1],o=t==null?void 0:t.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Zt=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return Yt(Object.entries(e.classGroups),o).forEach(([i,c])=>{Ve(c,a,i,t)}),a},Ve=(e,t,o,a)=>{e.forEach(n=>{if(typeof n=="string"){let i=n===""?t:Ye(t,n);i.classGroupId=o;return}if(typeof n=="function"){if(Xt(n)){Ve(n(a),t,o,a);return}t.validators.push({validator:n,classGroupId:o});return}Object.entries(n).forEach(([i,c])=>{Ve(c,Ye(t,i),o,a)})})},Ye=(e,t)=>{let o=e;return t.split(Fe).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},Xt=e=>e.isThemeGetter,Yt=(e,t)=>t?e.map(([o,a])=>{let n=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([c,r])=>[t+c,r])):i);return[o,n]}):e,eo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,n=(i,c)=>{o.set(i,c),t++,t>e&&(t=0,a=o,o=new Map)};return{get(i){let c=o.get(i);if(c!==void 0)return c;if((c=a.get(i))!==void 0)return n(i,c),c},set(i,c){o.has(i)?o.set(i,c):n(i,c)}}},tt="!",to=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,n=t[0],i=t.length,c=r=>{let f=[],w=0,S=0,p;for(let v=0;v<r.length;v++){let R=r[v];if(w===0){if(R===n&&(a||r.slice(v,v+i)===t)){f.push(r.slice(S,v)),S=v+i;continue}if(R==="/"){p=v;continue}}R==="["?w++:R==="]"&&w--}let y=f.length===0?r:r.substring(S),b=y.startsWith(tt),x=b?y.substring(1):y,C=p&&p>S?p-S:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:x,maybePostfixModifierPosition:C}};return o?r=>o({className:r,parseClassName:c}):c},oo=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},ro=e=>({cache:eo(e.cacheSize),parseClassName:to(e),...qt(e)}),ao=/\z+/,io=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:n}=t,i=[],c=e.trim().split(ao),r="";for(let f=c.length-1;f>=0;f-=1){let w=c[f],{modifiers:S,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:b}=o(w),x=!!b,C=a(x?y.substring(0,b):y);if(!C){if(!x){r=w+(r.length>0?" "+r:r);continue}if(C=a(y),!C){r=w+(r.length>0?" "+r:r);continue}x=!1}let v=oo(S).join(":"),R=p?v+tt:v,E=R+C;if(i.includes(E))continue;i.push(E);let W=n(C,x);for(let G=0;G<W.length;++G){let m=W[G];i.push(R+m)}r=w+(r.length>0?" "+r:r)}return r};function so(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=ot(t))&&(a&&(a+=" "),a+=o);return a}var ot=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=ot(e[a]))&&(o&&(o+=" "),o+=t);return o};function no(e,...t){let o,a,n,i=c;function c(f){let w=t.reduce((S,p)=>p(S),e());return o=ro(w),a=o.cache.get,n=o.cache.set,i=r,r(f)}function r(f){let w=a(f);if(w)return w;let S=io(f,o);return n(f,S),S}return function(){return i(so.apply(null,arguments))}}var P=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},rt=/^\[(?:([a-z-]+):)?(.+)\]$/i,lo=/^\z+\/\z+$/,co=new Set(["px","full","screen"]),mo=/^(\z+(\.\z+)?)?(xs|sm|md|lg|xl)$/,po=/\z+(%|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$/,uo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,go=/^(inset_)?-?((\z+)?\.?(\z+)[a-z]+|0)_-?((\z+)?\.?(\z+)[a-z]+|0)/,fo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,J=e=>pe(e)||co.has(e)||lo.test(e),$=e=>ue(e,"length",So),pe=e=>!!e&&!Number.isNaN(Number(e)),He=e=>ue(e,"number",pe),xe=e=>!!e&&Number.isInteger(Number(e)),bo=e=>e.endsWith("%")&&pe(e.slice(0,-1)),u=e=>rt.test(e),q=e=>mo.test(e),vo=new Set(["length","size","percentage"]),ho=e=>ue(e,vo,at),yo=e=>ue(e,"position",at),xo=new Set(["image","url"]),Co=e=>ue(e,xo,Ro),wo=e=>ue(e,"",No),Ce=()=>!0,ue=(e,t,o)=>{let a=rt.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},So=e=>po.test(e)&&!uo.test(e),at=()=>!1,No=e=>go.test(e),Ro=e=>fo.test(e);var Do=()=>{let e=P("colors"),t=P("spacing"),o=P("blur"),a=P("brightness"),n=P("borderColor"),i=P("borderRadius"),c=P("borderSpacing"),r=P("borderWidth"),f=P("contrast"),w=P("grayscale"),S=P("hueRotate"),p=P("invert"),y=P("gap"),b=P("gradientColorStops"),x=P("gradientColorStopPositions"),C=P("inset"),v=P("margin"),R=P("opacity"),E=P("padding"),W=P("saturate"),G=P("scale"),m=P("sepia"),D=P("skew"),O=P("space"),l=P("translate"),k=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],me=()=>["auto",u,t],N=()=>[u,t],Je=()=>["",J,$],Ne=()=>["auto",pe,u],$e=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Re=()=>["solid","dashed","dotted","double","none"],qe=()=>["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"],ye=()=>["","0",u],Qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[pe,u];return{cacheSize:500,separator:":",theme:{colors:[Ce],spacing:[J,$],blur:["none","",q,u],brightness:K(),borderColor:[e],borderRadius:["none","","full",q,u],borderSpacing:N(),borderWidth:Je(),contrast:K(),grayscale:ye(),hueRotate:K(),invert:ye(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[bo,$],inset:me(),margin:me(),opacity:K(),padding:N(),saturate:K(),scale:K(),sepia:ye(),skew:K(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",u]}],container:["container"],columns:[{columns:[q]}],"break-after":[{"break-after":Qe()}],"break-before":[{"break-before":Qe()}],"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:[...$e(),u]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],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",xe,u]}],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",u]}],grow:[{grow:ye()}],shrink:[{shrink:ye()}],order:[{order:["first","last","none",xe,u]}],"grid-cols":[{"grid-cols":[Ce]}],"col-start-end":[{col:["auto",{span:["full",xe,u]},u]}],"col-start":[{"col-start":Ne()}],"col-end":[{"col-end":Ne()}],"grid-rows":[{"grid-rows":[Ce]}],"row-start-end":[{row:["auto",{span:[xe,u]},u]}],"row-start":[{"row-start":Ne()}],"row-end":[{"row-end":Ne()}],"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:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"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]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"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:[q]},q]}],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",q,$]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",He]}],"font-family":[{font:[Ce]}],"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",pe,He]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",J,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":[R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[R]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",J,$]}],"underline-offset":[{"underline-offset":["auto",J,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:N()}],"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":[R]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$e(),yo]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ho]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Co]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[i]}],"rounded-z":[{"rounded-z":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[r]}],"border-w-x":[{"border-x":[r]}],"border-w-y":[{"border-y":[r]}],"border-w-z":[{"border-z":[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":[R]}],"border-style":[{border:[...Re(),"hidden"]}],"divide-x":[{"divide-x":[r]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[r]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[R]}],"divide-style":[{divide:Re()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-z":[{"border-z":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...Re()]}],"outline-offset":[{"outline-offset":[J,u]}],"outline-w":[{outline:[J,$]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Je()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[J,$]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",q,wo]}],"shadow-color":[{shadow:[Ce]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[...qe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":qe()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",q,u]}],grayscale:[{grayscale:[w]}],"hue-rotate":[{"hue-rotate":[S]}],invert:[{invert:[p]}],saturate:[{saturate:[W]}],sepia:[{sepia:[m]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[w]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[S]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[R]}],"backdrop-saturate":[{"backdrop-saturate":[W]}],"backdrop-sepia":[{"backdrop-sepia":[m]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",u]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",u]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",u]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[G]}],"scale-x":[{"scale-x":[G]}],"scale-y":[{"scale-y":[G]}],rotate:[{rotate:[xe,u]}],"translate-x":[{"translate-x":[l]}],"translate-y":[{"translate-y":[l]}],"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","z-resize","w-resize","Vt-resize","nw-resize","se-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":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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:[J,$,He]}],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","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-z","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-z":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-z","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-z","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-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var it=no(Do);function g(...e){return it((0,st.clsx)(e))}var z=require("react/jsx-runtime"),ge=T.Root,lt=T.Trigger,Po=T.Portal;var ct=we.forwardRef(({className:e,...t},o)=>(0,z.jsx)(T.Overlay,{ref:o,className:g("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}));ct.displayName=T.Overlay.displayName;var X=we.forwardRef(({className:e,children:t,...o},a)=>(0,z.jsxs)(Po,{children:[(0,z.jsx)(ct,{}),(0,z.jsxs)(T.Content,{ref:a,className:g("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),...o,children:[t,(0,z.jsxs)(T.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,z.jsx)(nt.X,{className:"h-4 w-4"}),(0,z.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));X.displayName=T.Content.displayName;var Y=({className:e,...t})=>(0,z.jsx)("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Y.displayName="DialogHeader";var ko=({className:e,...t})=>(0,z.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ko.displayName="DialogFooter";var ee=we.forwardRef(({className:e,...t},o)=>(0,z.jsx)(T.Title,{ref:o,className:g("text-lg font-semibold leading-none tracking-tight",e),...t}));ee.displayName=T.Title.displayName;var Ao=we.forwardRef(({className:e,...t},o)=>(0,z.jsx)(T.Description,{ref:o,className:g("text-sm text-muted-foreground",e),...t}));Ao.displayName=T.Description.displayName;var dt=require("@radix-ui/react-slot"),mt=require("class-variance-authority"),pt=B(require("react")),Mo=(0,mt.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-primary text-primary-foreground hover:bg-primary-ON_HOVER",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-secondary/80"}}}),H=pt.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...n},i)=>(0,z.jsx)(e?dt.Slot:"button",{className:g(Mo({className:t,size:o,variant:a})),ref:i,...n}));H.displayName="Button";var gt=B(require("react"));var _=gt.forwardRef(({className:e,type:t,...o},a)=>(0,z.jsx)("input",{type:t,className:g("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,...o}));_.displayName="Input";var bt=B(require("react")),We=B(require("@radix-ui/react-label"));var To=(0,mt.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),L=bt.forwardRef(({className:e,...t},o)=>(0,z.jsx)(We.Root,{ref:o,className:g(To(),e),...t}));L.displayName=We.Root.displayName;var yt=B(require("react")),te=yt.forwardRef(({className:e,...t},o)=>(0,z.jsx)("textarea",{className:g("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}));te.displayName="Textarea";var h=B(require("@radix-ui/react-select")),Q=B(require("react")),fe=h.Root;var be=h.Value,re=Q.forwardRef(({children:e,className:t,...o},a)=>(0,z.jsxs)(h.Trigger,{className:g("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,...o,children:[e,(0,z.jsx)(h.Icon,{asChild:!0,children:(0,z.jsx)(nt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));re.displayName=h.Trigger.displayName;var Ct=Q.forwardRef(({className:e,...t},o)=>(0,z.jsx)(h.ScrollUpButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,z.jsx)(nt.ChevronUp,{className:"h-4 w-4"})}));Ct.displayName=h.ScrollUpButton.displayName;var wt=Q.forwardRef(({className:e,...t},o)=>(0,z.jsx)(h.ScrollDownButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,z.jsx)(nt.ChevronDown,{className:"h-4 w-4"})}));wt.displayName=h.ScrollDownButton.displayName;var ae=Q.forwardRef(({children:e,className:t,position:o="popper",...a},n)=>(0,z.jsx)(h.Portal,{children:(0,z.jsxs)(h.Content,{className:g("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-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:n,...a,children:[(0,z.jsx)(Ct,{}),(0,z.jsx)(h.Viewport,{className:g("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,z.jsx)(wt,{})]})}));ae.displayName=h.Content.displayName;var Lo=Q.forwardRef(({className:e,...t},o)=>(0,z.jsx)(h.Label,{className:g("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));Lo.displayName=h.Label.displayName;var ie=Q.forwardRef(({children:e,className:t,...o},a)=>(0,z.jsxs)(h.Item,{className:g("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,...o,children:[(0,z.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,z.jsx)(h.ItemIndicator,{children:(0,z.jsx)(nt.Check,{className:"h-4 w-4"})})}),(0,z.jsx)(h.ItemText,{children:e})]}));ie.displayName=h.Item.displayName;var Io=Q.forwardRef(({className:e,...t},o)=>(0,z.jsx)(h.Separator,{className:g("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));Io.displayName=h.Separator.displayName;var Se=B(require("@radix-ui/react-checkbox")),Nt=B(require("react")),se=Nt.forwardRef(({className:e,...t},o)=>(0,z.jsx)(Se.Root,{className:g("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,z.jsx)(Se.Indicator,{className:g("flex items-center justify-center text-current"),children:(0,z.jsx)(nt.Check,{className:"h-4 w-4"})})}));se.displayName=Se.Root.displayName;var Eo=(0,mt.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 ke({className:e,variant:t,...o}){return(0,z.jsx)("div",{className:g(Eo({variant:t}),e),...o})}var Ge=B(require("react")),F=B(require("@radix-ui/react-scroll-area"));var ve=Ge.forwardRef(({className:e,children:t,...o},a)=>(0,z.jsxs)(F.Root,{ref:a,className:g("relative overflow-hidden",e),...o,children:[(0,z.jsx)(F.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,z.jsx)(Pt,{}),(0,z.jsx)(F.Corner,{})]}));ve.displayName=F.Root.displayName;var Pt=Ge.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,z.jsx)(F.ScrollAreaScrollbar,{ref:a,orientation:t,className:g("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,z.jsx)(F.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Pt.displayName=F.ScrollAreaScrollbar.displayName;function kt({deal:e,users:t,customer:o,categories:a,onClose:n,onSave:i,onAddComment:c}){var m,D,O;let[r,f]=(0,Vt.useState)({...e,value:e.value||0}),[w,S]=(0,Vt.useState)(""),[p,y]=(0,Vt.useState)(!1),[b,x]=(0,Vt.useState)(null);(0,Vt.useEffect)(()=>{y(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);let C=()=>{i(r),y(!1),x(null)},v=(l,k)=>{f(U=>({...U,[l]:k}))},R=l=>{let k=r.categories.includes(l)?r.categories.filter(U=>U!==l):[...r.categories,l];v("categories",k)},E=()=>{w.trim()&&(c({id:Date.now().toString(),text:w,timestamp:new Date().toISOString()}),f(l=>({...l,comments:[...l.comments,{id:"0",text:w,timestamp:new Date().toISOString()}]})),S(""))},W=l=>{switch(l){case"proposition":return"bg-blue-100 text-blue-800";case"source":return"bg-green-100 text-green-800";case"sector":return"bg-purple-100 text-purple-800";default:return"bg-gray-100 text-gray-800"}},G=(l,k,U)=>{let me=b===l;return(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:k}),(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[U,me?(0,z.jsx)(_,{value:r[l],onChange:N=>v(l,N.target.value),onBlur:()=>x(null),autoFocus:!0}):(0,z.jsx)("div",{className:"flex-grow cursor-pointer hover:bg-gray-100 p-2 rounded",onClick:()=>x(l),children:r[l]}),!me&&(0,z.jsx)(H,{variant:"ghost",size:"sm",onClick:()=>x(l),children:(0,z.jsx)(nt.Edit2Icon,{className:"w-4 h-4"})})]})]})};return(0,z.jsx)(ge,{open:!0,children:(0,z.jsxs)(X,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,z.jsxs)(Y,{className:"flex flex-row items-center justify-between",children:[(0,z.jsx)(ee,{className:"text-2xl font-bold",children:o==null?void 0:o.name}),(0,z.jsxs)("div",{className:"flex space-x-2",children:[(0,z.jsx)(H,{variant:"outline",onClick:n,children:"Close"}),(0,z.jsxs)(H,{onClick:C,disabled:!p,children:[(0,z.jsx)(nt.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,z.jsxs)(ve,{className:"flex-grow pr-4",children:[(0,z.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,z.jsx)("div",{className:"grid gap-2",children:b==="value"?(0,z.jsx)(_,{type:"number",value:r.value,onChange:l=>v("value",Number(l.target.value)),onBlur:()=>x(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,z.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("value"),children:["\xA3",(m=r.value)==null?void 0:m.toLocaleString()]})}),(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Assignee"}),b==="assignee"?(0,z.jsxs)(fe,{value:((O=(D=r==null?void 0:r.assignee)==null?void 0:D.id)==null?void 0:O.toString())||"",onValueChange:l=>v("assignee",l),children:[(0,z.jsx)(re,{children:(0,z.jsx)(be,{placeholder:"Select assignee"})}),(0,z.jsx)(ae,{children:t&&t.map(l=>{var k;return(0,z.jsx)(ie,{value:((k=l==null?void 0:l.id)==null?void 0:k.toString())||"",children:l.name},l.id)})})]}):(0,z.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("assignee"),children:[(0,z.jsx)(nt.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,z.jsx)("span",{children:r.assignee.name})]})]}),(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Closure Date"}),b==="closureDate"?(0,z.jsx)(_,{type:"date",value:r.closureDate.split("T")[0],onChange:l=>v("closureDate",l.target.value),onBlur:()=>x(null),autoFocus:!0}):(0,z.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("closureDate"),children:[(0,z.jsx)(nt.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,z.jsx)("span",{children:new Date(r.closureDate).toLocaleDateString("en-GB")})]})]})]}),(0,z.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Description"}),b==="description"?(0,z.jsx)(te,{value:r.description,onChange:l=>v("description",l.target.value),onBlur:()=>x(null),className:"min-h-[100px]",autoFocus:!0}):(0,z.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 pb-5 rounded",onClick:()=>x("description"),children:r.description})]})}),(0,z.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Status"}),b==="status"?(0,z.jsxs)(fe,{value:r.status,onValueChange:l=>{v("status",l),x(null)},children:[(0,z.jsx)(re,{children:(0,z.jsx)(be,{placeholder:"Select status"})}),(0,z.jsx)(ae,{children:["Cold","Qualified","Proposal Made","Won","Lost"].map(l=>(0,z.jsx)(ie,{value:l,children:l},l))})]}):(0,z.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("status"),children:r.status})]}),(0,z.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Categories"}),b==="categories"?(0,z.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.map(l=>(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsx)(se,{id:l.id,checked:r.categories.includes(l.id),onCheckedChange:()=>R(l.id)}),(0,z.jsx)("label",{htmlFor:l.id,className:`text-sm font-medium ${W(l.type)} px-2 py-1 rounded`,children:l.name})]},l.id))}):(0,z.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("categories"),children:r.categories.map(l=>{let k=a.find(U=>U.id===l);return k?(0,z.jsx)(ke,{variant:"secondary",className:W(k.type),children:k.name},k.id):null})})]})]}),(0,z.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Comments"}),(0,z.jsx)(ve,{className:"h-[200px] overflow-y-auto",children:(0,z.jsx)("div",{className:"space-y-2",children:r.comments.slice().sort((l,k)=>new Date(k.timestamp).getTime()-new Date(l.timestamp).getTime()).map(l=>{var k;return(0,z.jsxs)("div",{className:"bg-gray-50 p-3 rounded-lg",children:[(0,z.jsx)("p",{className:"text-sm text-gray-700",children:l.text}),(0,z.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[(k=l==null?void 0:l.author)==null?void 0:k.name," - ",new Date(l.timestamp).toLocaleString()]})]},l.id)})})}),(0,z.jsxs)("div",{className:"flex mt-2",children:[(0,z.jsx)(_,{value:w,onChange:l=>S(l.target.value),placeholder:"Add a comment...",className:"flex-grow"}),(0,z.jsxs)(H,{onClick:E,className:"ml-2",children:[(0,z.jsx)(nt.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,z.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(r.updatedAt).toLocaleString()]})]})]})]})})}var le=B(require("react"));var Oe=le.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Oe.displayName="Card";var Ue=le.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("flex flex-col space-y-1.5 p-6",e),...t}));Ue.displayName="CardHeader";var _e=le.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("font-semibold leading-none tracking-tight",e),...t}));_e.displayName="CardTitle";var Bo=le.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("text-sm text-muted-foreground",e),...t}));Bo.displayName="CardDescription";var je=le.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("p-6 pt-0",e),...t}));je.displayName="CardContent";var zo=le.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("flex items-center p-6 pt-0",e),...t}));zo.displayName="CardFooter";function At({deal:e,customer:t,categories:o,onClick:a}){let n=o.find(i=>i.type==="proposition"&&e.categories.includes(i.id));return(0,z.jsxs)(Oe,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,z.jsxs)(Ue,{className:"pb-2",children:[(0,z.jsx)("div",{className:"flex justify-between items-center",children:(0,z.jsx)(_e,{className:"text-lg font-semibold text-gray-800",children:t==null?void 0:t.name})}),(0,z.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,z.jsxs)(je,{children:[(0,z.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,z.jsxs)("div",{className:"flex items-center text-sm text-gray-600",children:[(0,z.jsx)(nt.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,z.jsx)("span",{children:e.assignee.name})]}),(0,z.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,z.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,z.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,z.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,z.jsx)(nt.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,z.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,z.jsx)("div",{className:"flex justify-between items-left",children:n&&(0,z.jsx)(ke,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:n.name})})]})]})}var Me=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Tt({onSubmit:e}){var n;let[t,o]=(0,Vt.useState)({name:"",intro:"",active:!0});return(0,z.jsxs)("form",{onSubmit:i=>{i.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),o({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,z.jsxs)("div",{className:"space-y-2",children:[(0,z.jsx)(L,{htmlFor:"customerName",children:"Customer Name"}),(0,z.jsx)(_,{id:"customerName",value:t.name,onChange:i=>o({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,z.jsxs)("div",{className:"space-y-2",children:[(0,z.jsx)(L,{htmlFor:"customerIntro",children:"Intro"}),(0,z.jsx)(te,{id:"customerIntro",value:(n=t.intro)!=null?n:"",onChange:i=>o({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsx)(se,{id:"activeCustomer",checked:!!t.active,onCheckedChange:i=>o({...t,active:i})}),(0,z.jsx)(L,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,z.jsx)(H,{type:"submit",className:"w-full",children:"Add Customer"})]})}function It({customers:e,users:t,categories:o,onSubmit:a,initialDeal:n,onAddCustomer:i,onClose:c}){var R,E,W,G;let[r,f]=(0,Vt.useState)(n||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[w,S]=(0,Vt.useState)(!1),[p,y]=(0,Vt.useState)({});(0,Vt.useEffect)(()=>{n&&f(n)},[n]);let b=()=>{let m={};return r.customer||(m.customer="Customer is required"),r.value||(m.value="Value is required"),r.assignee||(m.assignee="Assignee is required"),r.closureDate||(m.closureDate="Closure Date is required"),y(m),Object.keys(m).length===0},x=m=>{m.preventDefault(),b()&&(a({...r}),f({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),y({}),c==null||c())},C=m=>{f(D=>{var O;return{...D,categories:(O=D.categories)!=null&&O.includes(m)?D.categories.filter(l=>l!==m):[...D.categories||[],m]}})},v=m=>{e.push(m),f({...r,customer:m}),S(!1),i(m)};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("form",{onSubmit:x,className:"space-y-6",children:[(0,z.jsx)(ve,{className:"h-[60vh] pr-4",children:(0,z.jsxs)("div",{className:"space-y-6 px-4",children:[(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(L,{htmlFor:"customer",children:"Customer"}),(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsxs)(fe,{value:(E=(R=r.customer)==null?void 0:R.id)==null?void 0:E.toString(),onValueChange:m=>f({...r,customer:{id:Number(m)}}),children:[(0,z.jsx)(re,{children:(0,z.jsx)(be,{placeholder:"Select customer"})}),(0,z.jsx)(ae,{children:e.map(m=>{var D;return(0,z.jsx)(ie,{value:((D=m.id)==null?void 0:D.toString())||"",children:m.name},m.id)})})]}),(0,z.jsx)(H,{variant:"outline",size:"icon",onClick:()=>S(!0),children:(0,z.jsx)(nt.PlusIcon,{className:"w-5 h-5"})})]}),p.customerId&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:p.customerId})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(L,{htmlFor:"value",children:"Value"}),(0,z.jsx)(_,{id:"value",type:"number",value:r.value||"",onChange:m=>f({...r,value:Number.parseFloat(m.target.value)}),placeholder:"Enter deal value"}),p.value&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:p.value})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(L,{htmlFor:"assignee",children:"Assignee"}),(0,z.jsxs)(fe,{value:(G=(W=r.assignee)==null?void 0:W.id)==null?void 0:G.toString(),onValueChange:m=>f({...r,assignee:{id:Number(m)}}),children:[(0,z.jsx)(re,{children:(0,z.jsx)(be,{placeholder:"Select assignee"})}),(0,z.jsx)(ae,{children:t&&t.map(m=>{var D;return(0,z.jsx)(ie,{value:((D=m.id)==null?void 0:D.toString())||"",children:m.name},m.id)})})]}),p.assignee&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:p.assignee})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(L,{htmlFor:"description",children:"Description"}),(0,z.jsx)(te,{id:"description",value:r.description||"",onChange:m=>f({...r,description:m.target.value}),placeholder:"Enter deal description"})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(L,{children:"Categories"}),(0,z.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(m=>(0,z.jsxs)("div",{className:"space-y-2",children:[(0,z.jsx)("h4",{className:"text-sm font-medium",children:m.charAt(0).toUpperCase()+m.slice(1)}),(0,z.jsx)("div",{className:"grid grid-cols-2 gap-2",children:o.filter(D=>D.type===m).map(D=>{var O;return(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsx)(se,{id:D.id,checked:(O=r.categories)==null?void 0:O.includes(D.id),onCheckedChange:()=>C(D.id)}),(0,z.jsx)("label",{htmlFor:D.id,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:D.name})]},D.id)})})]},m))})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(L,{htmlFor:"closureDate",children:"Closure Date"}),(0,z.jsx)(_,{id:"closureDate",type:"date",value:r.closureDate,onChange:m=>f({...r,closureDate:m.target.value})}),p.closureDate&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,z.jsx)(H,{type:"submit",className:"w-full",children:n?"Update Deal":"Add Deal"})]}),(0,z.jsx)(ge,{open:w,onOpenChange:S,children:(0,z.jsxs)(X,{children:[(0,z.jsx)(Y,{children:(0,z.jsx)(ee,{children:"Add New Customer"})}),(0,z.jsx)(Tt,{onSubmit:v})]})})]})}function zt({status:e,deals:t,users:o,customers:a,categories:n,onDealClick:i,calculateColumnValue:c,calculateWeightedValue:r,addNewDeal:f,onAddCustomer:w}){let[S,p]=(0,Vt.useState)(!1);return(0,z.jsxs)("div",{className:"flex flex-col w-80",children:[(0,z.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),f&&(0,z.jsxs)(ge,{open:S,onOpenChange:p,children:[(0,z.jsx)(lt,{asChild:!0,children:(0,z.jsxs)(H,{className:"mb-4 w-full bg-green-500 hover:bg-green-600 text-white",children:[(0,z.jsx)(nt.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,z.jsxs)(X,{children:[(0,z.jsx)(Y,{children:(0,z.jsx)(ee,{children:"Add New Deal"})}),(0,z.jsx)(It,{customers:a,users:o,categories:n,onSubmit:f,onAddCustomer:w,onClose:()=>p(!1)})]})]}),(0,z.jsx)(Me.Droppable,{droppableId:e,isDropDisabled:!1,children:y=>(0,z.jsxs)("div",{ref:y.innerRef,...y.droppableProps,className:"bg-gray-100 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((b,x)=>(0,z.jsx)(Me.Draggable,{draggableId:b.id.toString(),index:b.id,children:C=>(0,z.jsx)("div",{ref:C.innerRef,...C.draggableProps,...C.dragHandleProps,children:(0,z.jsx)(At,{deal:b,customer:a.find(v=>v.id===b.customer.id),categories:n,onClick:()=>i(b)})})},b.id.toString())),y.placeholder]})}),(0,z.jsxs)("div",{className:"mt-4 text-sm bg-white p-3 rounded-lg shadow",children:[(0,z.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,z.jsxs)("span",{className:"text-green-600",children:["\xA3",c(t).toLocaleString()]})]}),(0,z.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,z.jsxs)("span",{className:"text-blue-600",children:["\xA3",r(t,e).toLocaleString()]})]})]})]})}var Ho=["Cold","Qualified","Proposal","SoW","Won","Lost"];function Ke({initialData:e,addNewDeal:t,updateDeal:o,addComment:a,addNewCustomer:n}){let[i,c]=(0,Vt.useState)(null),r=p=>e.deals.filter(y=>y.status===p),f=p=>p.reduce((y,b)=>y+(b.value||0),0),w=(p,y)=>{let b={Cold:.2,Qualified:.4,Proposal:.6,SoW:.7,Won:1,Lost:0};return p.reduce((x,C)=>x+(C.value||0)*b[y],0)},S=(0,Vt.useCallback)(p=>{let{source:y,destination:b}=p;if(!b||y.droppableId===b.droppableId&&y.index===b.index)return;let x=y.droppableId,C=b.droppableId;console.log("Moving from ",x,"to",C);let v=[...e.deals],[R]=v.splice(y.index,1);R.status=C,v.splice(b.index,0,R),o(R)},[o]);return(0,z.jsx)(Me.DragDropContext,{onDragEnd:S,children:(0,z.jsxs)("div",{className:"p-4",children:[(0,z.jsx)("div",{className:"flex space-x-4 overflow-x-auto pb-4",children:Ho.filter(p=>p!=="Won"&&p!=="Lost").map(p=>{let y=r(p);return(0,z.jsx)(zt,{status:p,deals:y,customers:e.customers,users:e.users,categories:e.categories,onDealClick:c,calculateColumnValue:f,calculateWeightedValue:w,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:n},p)})}),i&&(0,z.jsx)(kt,{deal:i,users:e.users,customer:e.customers.find(p=>p.id===i.customer.id),categories:e.categories,onClose:()=>c(null),onSave:o,onAddComment:p=>a(i.id.toString(),p)})]})})}var Le=[{id:1,name:"Acme Corp",intro:"z leading technology company",active:!0},{id:2,name:"GlobalTech",intro:"Innovative solutions provider",active:!0},{id:3,name:"InnoSystems",intro:"Cutting-edge software development",active:!1}],Ie=[{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"}];var 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"}];var Vo={title:"CRM/KanbanBoard",component:Ke},Fo=Vo,Ft=e=>{let[t,o]=(0,Vt.useState)(e.initialData);return(0,z.jsx)(Ke,{...e,initialData:t,updateDeal:async n=>(console.log("Updating deal:",n),o(i=>({...i,deals:i.deals.map(c=>c.id===n.id?n:c)})),n)})},Be=Ft.bind({});Be.args={initialData:{deals:Array.from({length:20},(e,t)=>({id:(t+1).toString(),customer:Le[t%Le.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:Ee[Math.floor(Math.random()*Ee.length)].name,status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],categories:[Ie[t%Ie.length].id],dateLogged:new Date(Date.now()-Math.floor(Math.random()*30)*24*60*60*1e3).toISOString(),closureDate:new Date(Date.now()+Math.floor(Math.random()*90)*24*60*60*1e3).toISOString(),comments:[],lastModified:new Date().toISOString(),description:`This is a mock description for deal ${t+1}. It'z a ${["small","medium","large"][t%3]} deal with high potential.`})),customers:Le,users:Ee,categories:Ie},addNewDeal:async e=>(console.log("Adding deal:",e),{...e,id:"new-deal-id"}),addNewCustomer:async e=>(console.log("Adding customer:",e),{...e,id:"new-customer-id"}),addComment:async(e,t)=>(console.log("Adding comment to deal:",e,t),{...t,id:"new-comment-id"})};var Wt=Ft.bind({});Wt.args={...Be.args,initialData:{...Be.args.initialData,deals:[]}};0&&(module.exports={Default,NoDeals});
@@ -1 +1 @@
1
- import{a as r,b as n,d as o}from"../../chunk-AHLX3GTH.mjs";import{a as s}from"../../chunk-L3PITDTZ.mjs";import"../../chunk-YDCEDTRV.mjs";import"../../chunk-ZXPDKKGX.mjs";import"../../chunk-3FW5YDNM.mjs";import"../../chunk-QH3BNFVD.mjs";import"../../chunk-5PW2VQWX.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-Q6SEVCRG.mjs";import"../../chunk-GLEWUUGS.mjs";import"../../chunk-D76EO57Z.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-6K2R3OAD.mjs";import"../../chunk-S7OK7D5I.mjs";var D={title:"CRM/KanbanBoard",component:s,parameters:{layout:"fullscreen"}},C=D,a={args:{initialData:{deals:Array.from({length:20},(e,t)=>({id:t+1,customer:r[t%r.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:o[Math.floor(Math.random()*o.length)].name,status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],categories:[n[t%n.length].id],dateLogged:new Date(Date.now()-Math.floor(Math.random()*30)*24*60*60*1e3).toISOString(),closureDate:new Date(Date.now()+Math.floor(Math.random()*90)*24*60*60*1e3).toISOString(),comments:[],updatedAt:new Date().toISOString(),description:`This is a mock description for deal ${t+1}. It's a ${["small","medium","large"][t%3]} deal with high potential.`})),customers:[{id:"1",name:"Acme Corp",active:!0},{id:"2",name:"GlobalTech",active:!0},{id:"3",name:"InnoSystems",active:!0}],users:o,categories:[{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"}]},addNewDeal:async e=>(console.log("Adding deal:",e),{...e,id:"new-deal-id"}),updateDeal:async e=>(console.log("Updating deal:",e),e),addNewCustomer:async e=>(console.log("Adding customer:",e),{...e,id:"new-customer-id"}),addComment:async(e,t)=>(console.log("Adding comment to deal:",e,t),{...t,id:"new-comment-id"})}},i,d,l,m,c,u,p,g,y,h,f,M,b={args:{...(i=a.args)!=null?i:{},initialData:{...(l=(d=a.args)==null?void 0:d.initialData)!=null?l:{},deals:[],users:(u=(c=(m=a.args)==null?void 0:m.initialData)==null?void 0:c.users)!=null?u:[],customers:(y=(g=(p=a.args)==null?void 0:p.initialData)==null?void 0:g.customers)!=null?y:[],categories:(M=(f=(h=a.args)==null?void 0:h.initialData)==null?void 0:f.categories)!=null?M:[]}}};export{a as Default,b as NoDeals,C as default};
1
+ import{a as e,b as n,d as r}from"../../chunk-AHLX3GTH.mjs";import{a as d}from"../../chunk-V3B64LRA.mjs";import"../../chunk-72SXYDHA.mjs";import"../../chunk-ZXPDKKGX.mjs";import"../../chunk-3FW5YDNM.mjs";import"../../chunk-QH3BNFVD.mjs";import"../../chunk-3TPMGKTR.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-Q6SEVCRG.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-D76EO57Z.mjs";import"../../chunk-GLEWUUGS.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-6K2R3OAD.mjs";import"../../chunk-S7OK7D5I.mjs";import{useState as g}from"react";import{jsx as u}from"react/jsx-runtime";var h={title:"CRM/KanbanBoard",component:d},C=h,m=a=>{let[t,c]=g(a.initialData);return u(d,{...a,initialData:t,updateDeal:async o=>(console.log("Updating deal:",o),c(i=>({...i,deals:i.deals.map(l=>l.id===o.id?o:l)})),o)})},s=m.bind({});s.args={initialData:{deals:Array.from({length:20},(a,t)=>({id:(t+1).toString(),customer:e[t%e.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:r[Math.floor(Math.random()*r.length)].name,status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],categories:[n[t%n.length].id],dateLogged:new Date(Date.now()-Math.floor(Math.random()*30)*24*60*60*1e3).toISOString(),closureDate:new Date(Date.now()+Math.floor(Math.random()*90)*24*60*60*1e3).toISOString(),comments:[],lastModified:new Date().toISOString(),description:`This is a mock description for deal ${t+1}. It's a ${["small","medium","large"][t%3]} deal with high potential.`})),customers:e,users:r,categories:n},addNewDeal:async a=>(console.log("Adding deal:",a),{...a,id:"new-deal-id"}),addNewCustomer:async a=>(console.log("Adding customer:",a),{...a,id:"new-customer-id"}),addComment:async(a,t)=>(console.log("Adding comment to deal:",a,t),{...t,id:"new-comment-id"})};var M=m.bind({});M.args={...s.args,initialData:{...s.args.initialData,deals:[]}};export{s as Default,M as NoDeals,C as default};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- "use strict";var Pt=Object.create;var pe=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var Dt=Object.getOwnPropertyNames;var kt=Object.getPrototypeOf,Tt=Object.prototype.hasOwnProperty;var At=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Dt(t))!Tt.call(e,s)&&s!==r&&pe(e,s,{get:()=>t[s],enumerable:!(o=Nt(t,s))||o.enumerable});return e};var M=(e,t,r)=>(r=e!=null?Pt(kt(e)):{},Ge(t||!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),Mt=e=>Ge(pe({},"__esModule",{value:!0}),e);var xr={};At(xr,{KanbanColumn:()=>yr});module.exports=Mt(xr);var Rt=require("react");var Xe=require("clsx");var Ne="-",Lt=e=>{let t=Et(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{let a=l.split(Ne);return a[0]===""&&a.length!==1&&a.shift(),Ue(a,t)||It(l)},getConflictingClassGroupIds:(l,a)=>{let u=r[l]||[];return a&&o[l]?[...u,...o[l]]:u}}},Ue=(e,t)=>{var l;if(e.length===0)return t.classGroupId;let r=e[0],o=t.nextPart.get(r),s=o?Ue(e.slice(1),o):void 0;if(s)return s;if(t.validators.length===0)return;let i=e.join(Ne);return(l=t.validators.find(({validator:a})=>a(i)))==null?void 0:l.classGroupId},We=/^\[(.+)\]$/,It=e=>{if(We.test(e)){let t=We.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Et=e=>{let{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return Ht(Object.entries(e.classGroups),r).forEach(([i,l])=>{Pe(l,o,i,t)}),o},Pe=(e,t,r,o)=>{e.forEach(s=>{if(typeof s=="string"){let i=s===""?t:Oe(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(zt(s)){Pe(s(o),t,r,o);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,l])=>{Pe(l,Oe(t,i),r,o)})})},Oe=(e,t)=>{let r=e;return t.split(Ne).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},zt=e=>e.isThemeGetter,Ht=(e,t)=>t?e.map(([r,o])=>{let s=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,a])=>[t+l,a])):i);return[r,s]}):e,Vt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map,s=(i,l)=>{r.set(i,l),t++,t>e&&(t=0,o=r,r=new Map)};return{get(i){let l=r.get(i);if(l!==void 0)return l;if((l=o.get(i))!==void 0)return s(i,l),l},set(i,l){r.has(i)?r.set(i,l):s(i,l)}}},_e="!",Bt=e=>{let{separator:t,experimentalParseClassName:r}=e,o=t.length===1,s=t[0],i=t.length,l=a=>{let u=[],R=0,w=0,v;for(let f=0;f<a.length;f++){let N=a[f];if(R===0){if(N===s&&(o||a.slice(f,f+i)===t)){u.push(a.slice(w,f)),w=f+i;continue}if(N==="/"){v=f;continue}}N==="["?R++:N==="]"&&R--}let D=u.length===0?a:a.substring(w),k=D.startsWith(_e),A=k?D.substring(1):D,h=v&&v>w?v-w:void 0;return{modifiers:u,hasImportantModifier:k,baseClassName:A,maybePostfixModifierPosition:h}};return r?a=>r({className:a,parseClassName:l}):l},Ft=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(o=>{o[0]==="["?(t.push(...r.sort(),o),r=[]):r.push(o)}),t.push(...r.sort()),t},Gt=e=>({cache:Vt(e.cacheSize),parseClassName:Bt(e),...Lt(e)}),Wt=/\s+/,Ot=(e,t)=>{let{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:s}=t,i=[],l=e.trim().split(Wt),a="";for(let u=l.length-1;u>=0;u-=1){let R=l[u],{modifiers:w,hasImportantModifier:v,baseClassName:D,maybePostfixModifierPosition:k}=r(R),A=!!k,h=o(A?D.substring(0,k):D);if(!h){if(!A){a=R+(a.length>0?" "+a:a);continue}if(h=o(D),!h){a=R+(a.length>0?" "+a:a);continue}A=!1}let f=Ft(w).join(":"),N=v?f+_e:f,T=N+h;if(i.includes(T))continue;i.push(T);let F=s(h,A);for(let H=0;H<F.length;++H){let c=F[H];i.push(N+c)}a=R+(a.length>0?" "+a:a)}return a};function Ut(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=je(t))&&(o&&(o+=" "),o+=r);return o}var je=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=je(e[o]))&&(r&&(r+=" "),r+=t);return r};function _t(e,...t){let r,o,s,i=l;function l(u){let R=t.reduce((w,v)=>v(w),e());return r=Gt(R),o=r.cache.get,s=r.cache.set,i=a,a(u)}function a(u){let R=o(u);if(R)return R;let w=Ot(u,r);return s(u,w),w}return function(){return i(Ut.apply(null,arguments))}}var g=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},qe=/^\[(?:([a-z-]+):)?(.+)\]$/i,jt=/^\d+\/\d+$/,qt=new Set(["px","full","screen"]),$t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Kt=/\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$/,Xt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Jt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>X(e)||qt.has(e)||jt.test(e),W=e=>J(e,"length",ir),X=e=>!!e&&!Number.isNaN(Number(e)),Se=e=>J(e,"number",X),ee=e=>!!e&&Number.isInteger(Number(e)),Qt=e=>e.endsWith("%")&&X(e.slice(0,-1)),d=e=>qe.test(e),O=e=>$t.test(e),Yt=new Set(["length","size","percentage"]),er=e=>J(e,Yt,$e),tr=e=>J(e,"position",$e),rr=new Set(["image","url"]),or=e=>J(e,rr,nr),ar=e=>J(e,"",sr),te=()=>!0,J=(e,t,r)=>{let o=qe.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):r(o[2]):!1},ir=e=>Kt.test(e)&&!Xt.test(e),$e=()=>!1,sr=e=>Jt.test(e),nr=e=>Zt.test(e);var lr=()=>{let e=g("colors"),t=g("spacing"),r=g("blur"),o=g("brightness"),s=g("borderColor"),i=g("borderRadius"),l=g("borderSpacing"),a=g("borderWidth"),u=g("contrast"),R=g("grayscale"),w=g("hueRotate"),v=g("invert"),D=g("gap"),k=g("gradientColorStops"),A=g("gradientColorStopPositions"),h=g("inset"),f=g("margin"),N=g("opacity"),T=g("padding"),F=g("saturate"),H=g("scale"),c=g("sepia"),y=g("skew"),G=g("space"),ce=g("translate"),xe=()=>["auto","contain","none"],we=()=>["auto","hidden","clip","visible","scroll"],Ce=()=>["auto",d,t],b=()=>[d,t],He=()=>["",B,W],de=()=>["auto",X,d],Ve=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],me=()=>["solid","dashed","dotted","double","none"],Be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Re=()=>["start","end","center","between","around","evenly","stretch"],Y=()=>["","0",d],Fe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[X,d];return{cacheSize:500,separator:":",theme:{colors:[te],spacing:[B,W],blur:["none","",O,d],brightness:V(),borderColor:[e],borderRadius:["none","","full",O,d],borderSpacing:b(),borderWidth:He(),contrast:V(),grayscale:Y(),hueRotate:V(),invert:Y(),gap:b(),gradientColorStops:[e],gradientColorStopPositions:[Qt,W],inset:Ce(),margin:Ce(),opacity:V(),padding:b(),saturate:V(),scale:V(),sepia:Y(),skew:V(),space:b(),translate:b()},classGroups:{aspect:[{aspect:["auto","square","video",d]}],container:["container"],columns:[{columns:[O]}],"break-after":[{"break-after":Fe()}],"break-before":[{"break-before":Fe()}],"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:[...Ve(),d]}],overflow:[{overflow:we()}],"overflow-Ye":[{"overflow-Ye":we()}],"overflow-y":[{"overflow-y":we()}],overscroll:[{overscroll:xe()}],"overscroll-Ye":[{"overscroll-Ye":xe()}],"overscroll-y":[{"overscroll-y":xe()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-Ye":[{"inset-Ye":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ee,d]}],basis:[{basis:Ce()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",d]}],grow:[{grow:Y()}],shrink:[{shrink:Y()}],order:[{order:["first","last","none",ee,d]}],"grid-cols":[{"grid-cols":[te]}],"col-start-end":[{col:["auto",{span:["full",ee,d]},d]}],"col-start":[{"col-start":de()}],"col-end":[{"col-end":de()}],"grid-rows":[{"grid-rows":[te]}],"row-start-end":[{row:["auto",{span:[ee,d]},d]}],"row-start":[{"row-start":de()}],"row-end":[{"row-end":de()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",d]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",d]}],gap:[{gap:[D]}],"gap-Ye":[{"gap-Ye":[D]}],"gap-y":[{"gap-y":[D]}],"justify-content":[{justify:["normal",...Re()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Re(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Re(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],Ye:[{Ye:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-Ye":[{"space-Ye":[G]}],"space-Ye-reverse":["space-Ye-reverse"],"space-y":[{"space-y":[G]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",d,t]}],"min-w":[{"min-w":[d,t,"min","max","fit"]}],"max-w":[{"max-w":[d,t,"none","full","min","max","fit","prose",{screen:[O]},O]}],h:[{h:[d,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[d,t,"auto","min","max","fit"]}],"font-size":[{text:["base",O,W]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Se]}],"font-family":[{font:[te]}],"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",d]}],"line-clamp":[{"line-clamp":["none",X,Se]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",B,d]}],"list-image":[{"list-image":["none",d]}],"list-style-type":[{list:["none","disc","decimal",d]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",B,W]}],"underline-offset":[{"underline-offset":["auto",B,d]}],"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",d]}],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",d]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ve(),tr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","Ye","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",er]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},or]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[A]}],"gradient-via-pos":[{via:[A]}],"gradient-to-pos":[{to:[A]}],"gradient-from":[{from:[k]}],"gradient-via":[{via:[k]}],"gradient-to":[{to:[k]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-Ye":[{"border-Ye":[a]}],"border-w-y":[{"border-y":[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":[N]}],"border-style":[{border:[...me(),"hidden"]}],"divide-Ye":[{"divide-Ye":[a]}],"divide-Ye-reverse":["divide-Ye-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:me()}],"border-color":[{border:[s]}],"border-color-Ye":[{"border-Ye":[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:["",...me()]}],"outline-offset":[{"outline-offset":[B,d]}],"outline-w":[{outline:[B,W]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:He()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[B,W]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",O,ar]}],"shadow-color":[{shadow:[te]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...Be(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Be()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",O,d]}],grayscale:[{grayscale:[R]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[v]}],saturate:[{saturate:[F]}],sepia:[{sepia:[c]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[R]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[F]}],"backdrop-sepia":[{"backdrop-sepia":[c]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-Ye":[{"border-spacing-Ye":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",d]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",d]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",d]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[H]}],"scale-Ye":[{"scale-Ye":[H]}],"scale-y":[{"scale-y":[H]}],rotate:[{rotate:[ee,d]}],"translate-Ye":[{"translate-Ye":[ce]}],"translate-y":[{"translate-y":[ce]}],"skew-Ye":[{"skew-Ye":[y]}],"skew-y":[{"skew-y":[y]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",d]}],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","Ye-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",d]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","Ye",""]}],"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-Ye":[{"scroll-Ye":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","Ye","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-Ye":[{"touch-pan":["Ye","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",d]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[B,W,Se]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-Ye","overflow-y"],overscroll:["overscroll-Ye","overscroll-y"],inset:["inset-Ye","inset-y","start","end","top","right","bottom","left"],"inset-Ye":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-Ye","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","Ye","mr","mb","ml"],mx:["mr","ml"],my:["Ye","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-Ye","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-Ye":["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-Ye":["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-Ye","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-Ye","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-Ye","touch-y","touch-pz"],"touch-Ye":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ke=_t(lr);function m(...e){return Ke((0,Xe.clsx)(e))}var Je=require("@radix-ui/react-slot"),Ze=require("class-variance-authority"),Qe=M(require("react")),Ye=require("react/jsx-runtime"),cr=(0,Ze.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-primary text-primary-foreground hover:bg-primary-ON_HOVER",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-secondary/80"}}}),U=Qe.forwardRef(({asChild:e=!1,className:t,size:r,variant:o,...s},i)=>(0,Ye.jsx)(e?Je.Slot:"button",{className:m(cr({className:t,size:r,variant:o})),ref:i,...s}));U.displayName="Button";var re=M(require("react")),S=M(require("@radix-ui/react-dialog")),et=require("lucide-react");var ue=S.Root,tt=S.Trigger,dr=S.Portal;var rt=re.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(S.Overlay,{ref:r,className:m("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}));rt.displayName=S.Overlay.displayName;var oe=re.forwardRef(({className:e,children:t,...r},o)=>(0,Ye.jsxs)(dr,{children:[(0,Ye.jsx)(rt,{}),(0,Ye.jsxs)(S.Content,{ref:o,className:m("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-Ye-[-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,Ye.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,Ye.jsx)(et.X,{className:"h-4 w-4"}),(0,Ye.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));oe.displayName=S.Content.displayName;var ae=({className:e,...t})=>(0,Ye.jsx)("div",{className:m("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ae.displayName="DialogHeader";var mr=({className:e,...t})=>(0,Ye.jsx)("div",{className:m("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-Ye-2",e),...t});mr.displayName="DialogFooter";var ie=re.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(S.Title,{ref:r,className:m("text-lg font-semibold leading-none tracking-tight",e),...t}));ie.displayName=S.Title.displayName;var pr=re.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(S.Description,{ref:r,className:m("text-sm text-muted-foreground",e),...t}));pr.displayName=S.Description.displayName;var q=M(require("react"));var De=q.forwardRef(({className:e,...t},r)=>(0,$.jsx)("div",{ref:r,className:m("rounded-xl border bg-card text-card-foreground shadow",e),...t}));De.displayName="Card";var ke=q.forwardRef(({className:e,...t},r)=>(0,$.jsx)("div",{ref:r,className:m("flex flex-col space-y-1.5 p-6",e),...t}));ke.displayName="CardHeader";var Te=q.forwardRef(({className:e,...t},r)=>(0,$.jsx)("div",{ref:r,className:m("font-semibold leading-none tracking-tight",e),...t}));Te.displayName="CardTitle";var ur=q.forwardRef(({className:e,...t},r)=>(0,$.jsx)("div",{ref:r,className:m("text-sm text-muted-foreground",e),...t}));ur.displayName="CardDescription";var Ae=q.forwardRef(({className:e,...t},r)=>(0,$.jsx)("div",{ref:r,className:m("p-6 pt-0",e),...t}));Ae.displayName="CardContent";var fr=q.forwardRef(({className:e,...t},r)=>(0,$.jsx)("div",{ref:r,className:m("flex items-center p-6 pt-0",e),...t}));fr.displayName="CardFooter";var gr=(0,Ze.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 at({className:e,variant:t,...r}){return(0,Ye.jsx)("div",{className:m(gr({variant:t}),e),...r})}function st({deal:e,customer:t,categories:r,onClick:o}){let s=r.find(i=>i.type==="proposition"&&e.categories.includes(i.id));return(0,Ye.jsxs)(De,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Ye.jsxs)(ke,{className:"pb-2",children:[(0,Ye.jsx)("div",{className:"flex justify-between items-center",children:(0,Ye.jsx)(Te,{className:"text-lg font-semibold text-gray-800",children:t==null?void 0:t.name})}),(0,Ye.jsx)("p",{className:"text-sm text-gray-500 Ye-1",children:e.description})]}),(0,Ye.jsxs)(Ae,{children:[(0,Ye.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,Ye.jsxs)("div",{className:"flex items-center text-sm text-gray-600",children:[(0,Ye.jsx)(et.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,Ye.jsx)("span",{children:e.assignee.name})]}),(0,Ye.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Ye.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,Ye.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,Ye.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Ye.jsx)(et.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,Ye.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,Ye.jsx)("div",{className:"flex justify-between items-left",children:s&&(0,Ye.jsx)(at,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:s.name})})]})]})}var ye=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");var nt=M(require("react"));var Z=nt.forwardRef(({className:e,type:t,...r},o)=>(0,Ye.jsx)("input",{type:t,className:m("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:o,...r}));Z.displayName="Input";var ct=M(require("react")),Me=M(require("@radix-ui/react-label"));var br=(0,Ze.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),E=ct.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(Me.Root,{ref:r,className:m(br(),e),...t}));E.displayName=Me.Root.displayName;var p=M(require("@radix-ui/react-select")),_=M(require("react")),Le=p.Root;var Ie=p.Value,ge=_.forwardRef(({children:e,className:t,...r},o)=>(0,Ye.jsxs)(p.Trigger,{className:m("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:o,...r,children:[e,(0,Ye.jsx)(p.Icon,{asChild:!0,children:(0,Ye.jsx)(et.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));ge.displayName=p.Trigger.displayName;var pt=_.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(p.ScrollUpButton,{className:m("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,Ye.jsx)(et.ChevronUp,{className:"h-4 w-4"})}));pt.displayName=p.ScrollUpButton.displayName;var ut=_.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(p.ScrollDownButton,{className:m("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,Ye.jsx)(et.ChevronDown,{className:"h-4 w-4"})}));ut.displayName=p.ScrollDownButton.displayName;var be=_.forwardRef(({children:e,className:t,position:r="popper",...o},s)=>(0,Ye.jsx)(p.Portal,{children:(0,Ye.jsxs)(p.Content,{className:m("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-Ye-1 data-[side=right]:translate-Ye-1 data-[side=top]:-translate-y-1",t),position:r,ref:s,...o,children:[(0,Ye.jsx)(pt,{}),(0,Ye.jsx)(p.Viewport,{className:m("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Ye.jsx)(ut,{})]})}));be.displayName=p.Content.displayName;var vr=_.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(p.Label,{className:m("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:r,...t}));vr.displayName=p.Label.displayName;var ve=_.forwardRef(({children:e,className:t,...r},o)=>(0,Ye.jsxs)(p.Item,{className:m("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:o,...r,children:[(0,Ye.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Ye.jsx)(p.ItemIndicator,{children:(0,Ye.jsx)(et.Check,{className:"h-4 w-4"})})}),(0,Ye.jsx)(p.ItemText,{children:e})]}));ve.displayName=p.Item.displayName;var hr=_.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(p.Separator,{className:m("-mx-1 my-1 h-px bg-muted",e),ref:r,...t}));hr.displayName=p.Separator.displayName;var se=M(require("@radix-ui/react-checkbox")),gt=M(require("react")),ne=gt.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(se.Root,{className:m("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,Ye.jsx)(se.Indicator,{className:m("flex items-center justify-center text-current"),children:(0,Ye.jsx)(et.Check,{className:"h-4 w-4"})})}));ne.displayName=se.Root.displayName;var bt=M(require("react")),le=bt.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)("textarea",{className:m("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}));le.displayName="Textarea";var Ee=M(require("react")),z=M(require("@radix-ui/react-scroll-area"));var ze=Ee.forwardRef(({className:e,children:t,...r},o)=>(0,Ye.jsxs)(z.Root,{ref:o,className:m("relative overflow-hidden",e),...r,children:[(0,Ye.jsx)(z.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Ye.jsx)(ht,{}),(0,Ye.jsx)(z.Corner,{})]}));ze.displayName=z.Root.displayName;var ht=Ee.forwardRef(({className:e,orientation:t="vertical",...r},o)=>(0,Ye.jsx)(z.ScrollAreaScrollbar,{ref:o,orientation:t,className:m("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,Ye.jsx)(z.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));ht.displayName=z.ScrollAreaScrollbar.displayName;function xt({onSubmit:e}){var s;let[t,r]=(0,Rt.useState)({name:"",intro:"",active:!0});return(0,Ye.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,Ye.jsxs)("div",{className:"space-y-2",children:[(0,Ye.jsx)(E,{htmlFor:"customerName",children:"Customer Name"}),(0,Ye.jsx)(Z,{id:"customerName",value:t.name,onChange:i=>r({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,Ye.jsxs)("div",{className:"space-y-2",children:[(0,Ye.jsx)(E,{htmlFor:"customerIntro",children:"Intro"}),(0,Ye.jsx)(le,{id:"customerIntro",value:(s=t.intro)!=null?s:"",onChange:i=>r({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,Ye.jsxs)("div",{className:"flex items-center space-Ye-2",children:[(0,Ye.jsx)(ne,{id:"activeCustomer",checked:!!t.active,onCheckedChange:i=>r({...t,active:i})}),(0,Ye.jsx)(E,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,Ye.jsx)(U,{type:"submit",className:"w-full",children:"Add Customer"})]})}function Ct({customers:e,users:t,categories:r,onSubmit:o,initialDeal:s,onAddCustomer:i,onClose:l}){var N,T,F,H;let[a,u]=(0,Rt.useState)(s||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[R,w]=(0,Rt.useState)(!1),[v,D]=(0,Rt.useState)({});(0,Rt.useEffect)(()=>{s&&u(s)},[s]);let k=()=>{let c={};return a.customer||(c.customer="Customer is required"),a.value||(c.value="Value is required"),a.assignee||(c.assignee="Assignee is required"),a.closureDate||(c.closureDate="Closure Date is required"),D(c),Object.keys(c).length===0},A=c=>{c.preventDefault(),k()&&(o({...a}),u({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),D({}),l==null||l())},h=c=>{u(y=>{var G;return{...y,categories:(G=y.categories)!=null&&G.includes(c)?y.categories.filter(ce=>ce!==c):[...y.categories||[],c]}})},f=c=>{e.push(c),u({...a,customer:c}),w(!1),i(c)};return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsxs)("form",{onSubmit:A,className:"space-y-6",children:[(0,Ye.jsx)(ze,{className:"h-[60vh] pr-4",children:(0,Ye.jsxs)("div",{className:"space-y-6 px-4",children:[(0,Ye.jsxs)("div",{className:"space-y-2 space-Ye-2",children:[(0,Ye.jsx)(E,{htmlFor:"customer",children:"Customer"}),(0,Ye.jsxs)("div",{className:"flex items-center space-Ye-2",children:[(0,Ye.jsxs)(Le,{value:(T=(N=a.customer)==null?void 0:N.id)==null?void 0:T.toString(),onValueChange:c=>u({...a,customer:{id:Number(c)}}),children:[(0,Ye.jsx)(ge,{children:(0,Ye.jsx)(Ie,{placeholder:"Select customer"})}),(0,Ye.jsx)(be,{children:e.map(c=>{var y;return(0,Ye.jsx)(ve,{value:((y=c.id)==null?void 0:y.toString())||"",children:c.name},c.id)})})]}),(0,Ye.jsx)(U,{variant:"outline",size:"icon",onClick:()=>w(!0),children:(0,Ye.jsx)(et.PlusIcon,{className:"w-5 h-5"})})]}),v.customerId&&(0,Ye.jsx)("p",{className:"text-red-500 text-sm",children:v.customerId})]}),(0,Ye.jsxs)("div",{className:"space-y-2 space-Ye-2",children:[(0,Ye.jsx)(E,{htmlFor:"value",children:"Value"}),(0,Ye.jsx)(Z,{id:"value",type:"number",value:a.value||"",onChange:c=>u({...a,value:Number.parseFloat(c.target.value)}),placeholder:"Enter deal value"}),v.value&&(0,Ye.jsx)("p",{className:"text-red-500 text-sm",children:v.value})]}),(0,Ye.jsxs)("div",{className:"space-y-2 space-Ye-2",children:[(0,Ye.jsx)(E,{htmlFor:"assignee",children:"Assignee"}),(0,Ye.jsxs)(Le,{value:(H=(F=a.assignee)==null?void 0:F.id)==null?void 0:H.toString(),onValueChange:c=>u({...a,assignee:{id:Number(c)}}),children:[(0,Ye.jsx)(ge,{children:(0,Ye.jsx)(Ie,{placeholder:"Select assignee"})}),(0,Ye.jsx)(be,{children:t&&t.map(c=>{var y;return(0,Ye.jsx)(ve,{value:((y=c.id)==null?void 0:y.toString())||"",children:c.name},c.id)})})]}),v.assignee&&(0,Ye.jsx)("p",{className:"text-red-500 text-sm",children:v.assignee})]}),(0,Ye.jsxs)("div",{className:"space-y-2 space-Ye-2",children:[(0,Ye.jsx)(E,{htmlFor:"description",children:"Description"}),(0,Ye.jsx)(le,{id:"description",value:a.description||"",onChange:c=>u({...a,description:c.target.value}),placeholder:"Enter deal description"})]}),(0,Ye.jsxs)("div",{className:"space-y-2 space-Ye-2",children:[(0,Ye.jsx)(E,{children:"Categories"}),(0,Ye.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(c=>(0,Ye.jsxs)("div",{className:"space-y-2",children:[(0,Ye.jsx)("h4",{className:"text-sm font-medium",children:c.charAt(0).toUpperCase()+c.slice(1)}),(0,Ye.jsx)("div",{className:"grid grid-cols-2 gap-2",children:r.filter(y=>y.type===c).map(y=>{var G;return(0,Ye.jsxs)("div",{className:"flex items-center space-Ye-2",children:[(0,Ye.jsx)(ne,{id:y.id,checked:(G=a.categories)==null?void 0:G.includes(y.id),onCheckedChange:()=>h(y.id)}),(0,Ye.jsx)("label",{htmlFor:y.id,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:y.name})]},y.id)})})]},c))})]}),(0,Ye.jsxs)("div",{className:"space-y-2 space-Ye-2",children:[(0,Ye.jsx)(E,{htmlFor:"closureDate",children:"Closure Date"}),(0,Ye.jsx)(Z,{id:"closureDate",type:"date",value:a.closureDate,onChange:c=>u({...a,closureDate:c.target.value})}),v.closureDate&&(0,Ye.jsx)("p",{className:"text-red-500 text-sm",children:v.closureDate})]})]})}),(0,Ye.jsx)(U,{type:"submit",className:"w-full",children:s?"Update Deal":"Add Deal"})]}),(0,Ye.jsx)(ue,{open:R,onOpenChange:w,children:(0,Ye.jsxs)(oe,{children:[(0,Ye.jsx)(ae,{children:(0,Ye.jsx)(ie,{children:"Add New Customer"})}),(0,Ye.jsx)(xt,{onSubmit:f})]})})]})}function yr({status:e,deals:t,users:r,customers:o,categories:s,onDealClick:i,calculateColumnValue:l,calculateWeightedValue:a,addNewDeal:u,onAddCustomer:R}){let[w,v]=(0,Rt.useState)(!1);return(0,Ye.jsxs)("div",{className:"flex flex-col w-80",children:[(0,Ye.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),u&&(0,Ye.jsxs)(ue,{open:w,onOpenChange:v,children:[(0,Ye.jsx)(tt,{asChild:!0,children:(0,Ye.jsxs)(U,{className:"mb-4 w-full bg-green-500 hover:bg-green-600 text-white",children:[(0,Ye.jsx)(et.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,Ye.jsxs)(oe,{children:[(0,Ye.jsx)(ae,{children:(0,Ye.jsx)(ie,{children:"Add New Deal"})}),(0,Ye.jsx)(Ct,{customers:o,users:r,categories:s,onSubmit:u,onAddCustomer:R,onClose:()=>v(!1)})]})]}),(0,Ye.jsx)(ye.Droppable,{droppableId:e,children:D=>(0,Ye.jsxs)("div",{ref:D.innerRef,...D.droppableProps,className:"bg-gray-100 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((k,A)=>(0,Ye.jsx)(ye.Draggable,{draggableId:k.id.toString(),index:A,children:h=>(0,Ye.jsx)("div",{ref:h.innerRef,...h.draggableProps,...h.dragHandleProps,children:(0,Ye.jsx)(st,{deal:k,customer:o.find(f=>f.id===k.customer.id),categories:s,onClick:()=>i(k)})})},k.id)),D.placeholder]})}),(0,Ye.jsxs)("div",{className:"Ye-4 text-sm bg-white p-3 rounded-lg shadow",children:[(0,Ye.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,Ye.jsxs)("span",{className:"text-green-600",children:["\xA3",l(t).toLocaleString()]})]}),(0,Ye.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,Ye.jsxs)("span",{className:"text-blue-600",children:["\xA3",a(t,e).toLocaleString()]})]})]})]})}0&&(module.exports={KanbanColumn});
4
+ "use strict";var Pt=Object.create;var pe=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var Dt=Object.getOwnPropertyNames;var kt=Object.getPrototypeOf,Tt=Object.prototype.hasOwnProperty;var At=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Dt(t))!Tt.call(e,s)&&s!==r&&pe(e,s,{get:()=>t[s],enumerable:!(o=Nt(t,s))||o.enumerable});return e};var A=(e,t,r)=>(r=e!=null?Pt(kt(e)):{},Ge(t||!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),Mt=e=>Ge(pe({},"__esModule",{value:!0}),e);var xr={};At(xr,{KanbanColumn:()=>yr});module.exports=Mt(xr);var Rt=require("react");var Xe=require("clsx");var Ne="-",Lt=e=>{let t=Et(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{let a=l.split(Ne);return a[0]===""&&a.length!==1&&a.shift(),Ue(a,t)||It(l)},getConflictingClassGroupIds:(l,a)=>{let u=r[l]||[];return a&&o[l]?[...u,...o[l]]:u}}},Ue=(e,t)=>{var l;if(e.length===0)return t.classGroupId;let r=e[0],o=t.nextPart.get(r),s=o?Ue(e.slice(1),o):void 0;if(s)return s;if(t.validators.length===0)return;let i=e.join(Ne);return(l=t.validators.find(({validator:a})=>a(i)))==null?void 0:l.classGroupId},We=/^\[(.+)\]$/,It=e=>{if(We.test(e)){let t=We.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Et=e=>{let{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return Ht(Object.entries(e.classGroups),r).forEach(([i,l])=>{Pe(l,o,i,t)}),o},Pe=(e,t,r,o)=>{e.forEach(s=>{if(typeof s=="string"){let i=s===""?t:Oe(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(zt(s)){Pe(s(o),t,r,o);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,l])=>{Pe(l,Oe(t,i),r,o)})})},Oe=(e,t)=>{let r=e;return t.split(Ne).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},zt=e=>e.isThemeGetter,Ht=(e,t)=>t?e.map(([r,o])=>{let s=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,a])=>[t+l,a])):i);return[r,s]}):e,Vt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map,s=(i,l)=>{r.set(i,l),t++,t>e&&(t=0,o=r,r=new Map)};return{get(i){let l=r.get(i);if(l!==void 0)return l;if((l=o.get(i))!==void 0)return s(i,l),l},set(i,l){r.has(i)?r.set(i,l):s(i,l)}}},_e="!",Bt=e=>{let{separator:t,experimentalParseClassName:r}=e,o=t.length===1,s=t[0],i=t.length,l=a=>{let u=[],R=0,w=0,v;for(let f=0;f<a.length;f++){let N=a[f];if(R===0){if(N===s&&(o||a.slice(f,f+i)===t)){u.push(a.slice(w,f)),w=f+i;continue}if(N==="/"){v=f;continue}}N==="["?R++:N==="]"&&R--}let D=u.length===0?a:a.substring(w),k=D.startsWith(_e),M=k?D.substring(1):D,h=v&&v>w?v-w:void 0;return{modifiers:u,hasImportantModifier:k,baseClassName:M,maybePostfixModifierPosition:h}};return r?a=>r({className:a,parseClassName:l}):l},Ft=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(o=>{o[0]==="["?(t.push(...r.sort(),o),r=[]):r.push(o)}),t.push(...r.sort()),t},Gt=e=>({cache:Vt(e.cacheSize),parseClassName:Bt(e),...Lt(e)}),Wt=/\s+/,Ot=(e,t)=>{let{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:s}=t,i=[],l=e.trim().split(Wt),a="";for(let u=l.length-1;u>=0;u-=1){let R=l[u],{modifiers:w,hasImportantModifier:v,baseClassName:D,maybePostfixModifierPosition:k}=r(R),M=!!k,h=o(M?D.substring(0,k):D);if(!h){if(!M){a=R+(a.length>0?" "+a:a);continue}if(h=o(D),!h){a=R+(a.length>0?" "+a:a);continue}M=!1}let f=Ft(w).join(":"),N=v?f+_e:f,T=N+h;if(i.includes(T))continue;i.push(T);let F=s(h,M);for(let H=0;H<F.length;++H){let c=F[H];i.push(N+c)}a=R+(a.length>0?" "+a:a)}return a};function Ut(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=je(t))&&(o&&(o+=" "),o+=r);return o}var je=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=je(e[o]))&&(r&&(r+=" "),r+=t);return r};function _t(e,...t){let r,o,s,i=l;function l(u){let R=t.reduce((w,v)=>v(w),e());return r=Gt(R),o=r.cache.get,s=r.cache.set,i=a,a(u)}function a(u){let R=o(u);if(R)return R;let w=Ot(u,r);return s(u,w),w}return function(){return i(Ut.apply(null,arguments))}}var g=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},qe=/^\[(?:([a-z-]+):)?(.+)\]$/i,jt=/^\d+\/\d+$/,qt=new Set(["px","full","screen"]),$t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Kt=/\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$/,Xt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Jt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>X(e)||qt.has(e)||jt.test(e),W=e=>J(e,"length",ir),X=e=>!!e&&!Number.isNaN(Number(e)),Se=e=>J(e,"number",X),ee=e=>!!e&&Number.isInteger(Number(e)),Qt=e=>e.endsWith("%")&&X(e.slice(0,-1)),d=e=>qe.test(e),O=e=>$t.test(e),Yt=new Set(["length","size","percentage"]),er=e=>J(e,Yt,$e),tr=e=>J(e,"position",$e),rr=new Set(["image","url"]),or=e=>J(e,rr,nr),ar=e=>J(e,"",sr),te=()=>!0,J=(e,t,r)=>{let o=qe.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):r(o[2]):!1},ir=e=>Kt.test(e)&&!Xt.test(e),$e=()=>!1,sr=e=>Jt.test(e),nr=e=>Zt.test(e);var lr=()=>{let e=g("colors"),t=g("spacing"),r=g("blur"),o=g("brightness"),s=g("borderColor"),i=g("borderRadius"),l=g("borderSpacing"),a=g("borderWidth"),u=g("contrast"),R=g("grayscale"),w=g("hueRotate"),v=g("invert"),D=g("gap"),k=g("gradientColorStops"),M=g("gradientColorStopPositions"),h=g("inset"),f=g("margin"),N=g("opacity"),T=g("padding"),F=g("saturate"),H=g("scale"),c=g("sepia"),y=g("skew"),G=g("space"),ce=g("translate"),xe=()=>["auto","contain","none"],we=()=>["auto","hidden","clip","visible","scroll"],Ce=()=>["auto",d,t],b=()=>[d,t],He=()=>["",B,W],de=()=>["auto",X,d],Ve=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],me=()=>["solid","dashed","dotted","double","none"],Be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Re=()=>["start","end","center","between","around","evenly","stretch"],Y=()=>["","0",d],Fe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[X,d];return{cacheSize:500,separator:":",theme:{colors:[te],spacing:[B,W],blur:["none","",O,d],brightness:V(),borderColor:[e],borderRadius:["none","","full",O,d],borderSpacing:b(),borderWidth:He(),contrast:V(),grayscale:Y(),hueRotate:V(),invert:Y(),gap:b(),gradientColorStops:[e],gradientColorStopPositions:[Qt,W],inset:Ce(),margin:Ce(),opacity:V(),padding:b(),saturate:V(),scale:V(),sepia:Y(),skew:V(),space:b(),translate:b()},classGroups:{aspect:[{aspect:["auto","square","video",d]}],container:["container"],columns:[{columns:[O]}],"break-after":[{"break-after":Fe()}],"break-before":[{"break-before":Fe()}],"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:[...Ve(),d]}],overflow:[{overflow:we()}],"overflow-Ye":[{"overflow-Ye":we()}],"overflow-y":[{"overflow-y":we()}],overscroll:[{overscroll:xe()}],"overscroll-Ye":[{"overscroll-Ye":xe()}],"overscroll-y":[{"overscroll-y":xe()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-Ye":[{"inset-Ye":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ee,d]}],basis:[{basis:Ce()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",d]}],grow:[{grow:Y()}],shrink:[{shrink:Y()}],order:[{order:["first","last","none",ee,d]}],"grid-cols":[{"grid-cols":[te]}],"col-start-end":[{col:["auto",{span:["full",ee,d]},d]}],"col-start":[{"col-start":de()}],"col-end":[{"col-end":de()}],"grid-rows":[{"grid-rows":[te]}],"row-start-end":[{row:["auto",{span:[ee,d]},d]}],"row-start":[{"row-start":de()}],"row-end":[{"row-end":de()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",d]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",d]}],gap:[{gap:[D]}],"gap-Ye":[{"gap-Ye":[D]}],"gap-y":[{"gap-y":[D]}],"justify-content":[{justify:["normal",...Re()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Re(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Re(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],Ye:[{Ye:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-Ye":[{"space-Ye":[G]}],"space-Ye-reverse":["space-Ye-reverse"],"space-y":[{"space-y":[G]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",d,t]}],"min-w":[{"min-w":[d,t,"min","max","fit"]}],"max-w":[{"max-w":[d,t,"none","full","min","max","fit","prose",{screen:[O]},O]}],h:[{h:[d,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[d,t,"auto","min","max","fit"]}],"font-size":[{text:["base",O,W]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Se]}],"font-family":[{font:[te]}],"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",d]}],"line-clamp":[{"line-clamp":["none",X,Se]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",B,d]}],"list-image":[{"list-image":["none",d]}],"list-style-type":[{list:["none","disc","decimal",d]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",B,W]}],"underline-offset":[{"underline-offset":["auto",B,d]}],"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",d]}],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",d]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ve(),tr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","Ye","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",er]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},or]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[M]}],"gradient-via-pos":[{via:[M]}],"gradient-to-pos":[{to:[M]}],"gradient-from":[{from:[k]}],"gradient-via":[{via:[k]}],"gradient-to":[{to:[k]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-Ye":[{"border-Ye":[a]}],"border-w-y":[{"border-y":[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":[N]}],"border-style":[{border:[...me(),"hidden"]}],"divide-Ye":[{"divide-Ye":[a]}],"divide-Ye-reverse":["divide-Ye-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:me()}],"border-color":[{border:[s]}],"border-color-Ye":[{"border-Ye":[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:["",...me()]}],"outline-offset":[{"outline-offset":[B,d]}],"outline-w":[{outline:[B,W]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:He()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[B,W]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",O,ar]}],"shadow-color":[{shadow:[te]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...Be(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Be()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",O,d]}],grayscale:[{grayscale:[R]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[v]}],saturate:[{saturate:[F]}],sepia:[{sepia:[c]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[R]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[F]}],"backdrop-sepia":[{"backdrop-sepia":[c]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-Ye":[{"border-spacing-Ye":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",d]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",d]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",d]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[H]}],"scale-Ye":[{"scale-Ye":[H]}],"scale-y":[{"scale-y":[H]}],rotate:[{rotate:[ee,d]}],"translate-Ye":[{"translate-Ye":[ce]}],"translate-y":[{"translate-y":[ce]}],"skew-Ye":[{"skew-Ye":[y]}],"skew-y":[{"skew-y":[y]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",d]}],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","Ye-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",d]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","Ye",""]}],"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-Ye":[{"scroll-Ye":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","Ye","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-Ye":[{"touch-pan":["Ye","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",d]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[B,W,Se]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-Ye","overflow-y"],overscroll:["overscroll-Ye","overscroll-y"],inset:["inset-Ye","inset-y","start","end","top","right","bottom","left"],"inset-Ye":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-Ye","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","Ye","mr","mb","ml"],mx:["mr","ml"],my:["Ye","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-Ye","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-Ye":["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-Ye":["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-Ye","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-Ye","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-Ye","touch-y","touch-pz"],"touch-Ye":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ke=_t(lr);function m(...e){return Ke((0,Xe.clsx)(e))}var Je=require("@radix-ui/react-slot"),Ze=require("class-variance-authority"),Qe=A(require("react")),Ye=require("react/jsx-runtime"),cr=(0,Ze.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-primary text-primary-foreground hover:bg-primary-ON_HOVER",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-secondary/80"}}}),U=Qe.forwardRef(({asChild:e=!1,className:t,size:r,variant:o,...s},i)=>(0,Ye.jsx)(e?Je.Slot:"button",{className:m(cr({className:t,size:r,variant:o})),ref:i,...s}));U.displayName="Button";var re=A(require("react")),S=A(require("@radix-ui/react-dialog")),et=require("lucide-react");var ue=S.Root,tt=S.Trigger,dr=S.Portal;var rt=re.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(S.Overlay,{ref:r,className:m("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}));rt.displayName=S.Overlay.displayName;var oe=re.forwardRef(({className:e,children:t,...r},o)=>(0,Ye.jsxs)(dr,{children:[(0,Ye.jsx)(rt,{}),(0,Ye.jsxs)(S.Content,{ref:o,className:m("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-Ye-[-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,Ye.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,Ye.jsx)(et.X,{className:"h-4 w-4"}),(0,Ye.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));oe.displayName=S.Content.displayName;var ae=({className:e,...t})=>(0,Ye.jsx)("div",{className:m("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ae.displayName="DialogHeader";var mr=({className:e,...t})=>(0,Ye.jsx)("div",{className:m("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-Ye-2",e),...t});mr.displayName="DialogFooter";var ie=re.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(S.Title,{ref:r,className:m("text-lg font-semibold leading-none tracking-tight",e),...t}));ie.displayName=S.Title.displayName;var pr=re.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(S.Description,{ref:r,className:m("text-sm text-muted-foreground",e),...t}));pr.displayName=S.Description.displayName;var q=A(require("react"));var De=q.forwardRef(({className:e,...t},r)=>(0,$.jsx)("div",{ref:r,className:m("rounded-xl border bg-card text-card-foreground shadow",e),...t}));De.displayName="Card";var ke=q.forwardRef(({className:e,...t},r)=>(0,$.jsx)("div",{ref:r,className:m("flex flex-col space-y-1.5 p-6",e),...t}));ke.displayName="CardHeader";var Te=q.forwardRef(({className:e,...t},r)=>(0,$.jsx)("div",{ref:r,className:m("font-semibold leading-none tracking-tight",e),...t}));Te.displayName="CardTitle";var ur=q.forwardRef(({className:e,...t},r)=>(0,$.jsx)("div",{ref:r,className:m("text-sm text-muted-foreground",e),...t}));ur.displayName="CardDescription";var Ae=q.forwardRef(({className:e,...t},r)=>(0,$.jsx)("div",{ref:r,className:m("p-6 pt-0",e),...t}));Ae.displayName="CardContent";var fr=q.forwardRef(({className:e,...t},r)=>(0,$.jsx)("div",{ref:r,className:m("flex items-center p-6 pt-0",e),...t}));fr.displayName="CardFooter";var gr=(0,Ze.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 at({className:e,variant:t,...r}){return(0,Ye.jsx)("div",{className:m(gr({variant:t}),e),...r})}function st({deal:e,customer:t,categories:r,onClick:o}){let s=r.find(i=>i.type==="proposition"&&e.categories.includes(i.id));return(0,Ye.jsxs)(De,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Ye.jsxs)(ke,{className:"pb-2",children:[(0,Ye.jsx)("div",{className:"flex justify-between items-center",children:(0,Ye.jsx)(Te,{className:"text-lg font-semibold text-gray-800",children:t==null?void 0:t.name})}),(0,Ye.jsx)("p",{className:"text-sm text-gray-500 Ye-1",children:e.description})]}),(0,Ye.jsxs)(Ae,{children:[(0,Ye.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,Ye.jsxs)("div",{className:"flex items-center text-sm text-gray-600",children:[(0,Ye.jsx)(et.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,Ye.jsx)("span",{children:e.assignee.name})]}),(0,Ye.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Ye.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,Ye.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,Ye.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Ye.jsx)(et.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,Ye.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,Ye.jsx)("div",{className:"flex justify-between items-left",children:s&&(0,Ye.jsx)(at,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:s.name})})]})]})}var ye=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");var nt=A(require("react"));var Z=nt.forwardRef(({className:e,type:t,...r},o)=>(0,Ye.jsx)("input",{type:t,className:m("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:o,...r}));Z.displayName="Input";var ct=A(require("react")),Me=A(require("@radix-ui/react-label"));var br=(0,Ze.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),E=ct.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(Me.Root,{ref:r,className:m(br(),e),...t}));E.displayName=Me.Root.displayName;var p=A(require("@radix-ui/react-select")),_=A(require("react")),Le=p.Root;var Ie=p.Value,ge=_.forwardRef(({children:e,className:t,...r},o)=>(0,Ye.jsxs)(p.Trigger,{className:m("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:o,...r,children:[e,(0,Ye.jsx)(p.Icon,{asChild:!0,children:(0,Ye.jsx)(et.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));ge.displayName=p.Trigger.displayName;var pt=_.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(p.ScrollUpButton,{className:m("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,Ye.jsx)(et.ChevronUp,{className:"h-4 w-4"})}));pt.displayName=p.ScrollUpButton.displayName;var ut=_.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(p.ScrollDownButton,{className:m("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,Ye.jsx)(et.ChevronDown,{className:"h-4 w-4"})}));ut.displayName=p.ScrollDownButton.displayName;var be=_.forwardRef(({children:e,className:t,position:r="popper",...o},s)=>(0,Ye.jsx)(p.Portal,{children:(0,Ye.jsxs)(p.Content,{className:m("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-Ye-1 data-[side=right]:translate-Ye-1 data-[side=top]:-translate-y-1",t),position:r,ref:s,...o,children:[(0,Ye.jsx)(pt,{}),(0,Ye.jsx)(p.Viewport,{className:m("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Ye.jsx)(ut,{})]})}));be.displayName=p.Content.displayName;var vr=_.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(p.Label,{className:m("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:r,...t}));vr.displayName=p.Label.displayName;var ve=_.forwardRef(({children:e,className:t,...r},o)=>(0,Ye.jsxs)(p.Item,{className:m("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:o,...r,children:[(0,Ye.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Ye.jsx)(p.ItemIndicator,{children:(0,Ye.jsx)(et.Check,{className:"h-4 w-4"})})}),(0,Ye.jsx)(p.ItemText,{children:e})]}));ve.displayName=p.Item.displayName;var hr=_.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(p.Separator,{className:m("-mx-1 my-1 h-px bg-muted",e),ref:r,...t}));hr.displayName=p.Separator.displayName;var se=A(require("@radix-ui/react-checkbox")),gt=A(require("react")),ne=gt.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)(se.Root,{className:m("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,Ye.jsx)(se.Indicator,{className:m("flex items-center justify-center text-current"),children:(0,Ye.jsx)(et.Check,{className:"h-4 w-4"})})}));ne.displayName=se.Root.displayName;var bt=A(require("react")),le=bt.forwardRef(({className:e,...t},r)=>(0,Ye.jsx)("textarea",{className:m("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}));le.displayName="Textarea";var Ee=A(require("react")),z=A(require("@radix-ui/react-scroll-area"));var ze=Ee.forwardRef(({className:e,children:t,...r},o)=>(0,Ye.jsxs)(z.Root,{ref:o,className:m("relative overflow-hidden",e),...r,children:[(0,Ye.jsx)(z.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Ye.jsx)(ht,{}),(0,Ye.jsx)(z.Corner,{})]}));ze.displayName=z.Root.displayName;var ht=Ee.forwardRef(({className:e,orientation:t="vertical",...r},o)=>(0,Ye.jsx)(z.ScrollAreaScrollbar,{ref:o,orientation:t,className:m("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,Ye.jsx)(z.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));ht.displayName=z.ScrollAreaScrollbar.displayName;function xt({onSubmit:e}){var s;let[t,r]=(0,Rt.useState)({name:"",intro:"",active:!0});return(0,Ye.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,Ye.jsxs)("div",{className:"space-y-2",children:[(0,Ye.jsx)(E,{htmlFor:"customerName",children:"Customer Name"}),(0,Ye.jsx)(Z,{id:"customerName",value:t.name,onChange:i=>r({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,Ye.jsxs)("div",{className:"space-y-2",children:[(0,Ye.jsx)(E,{htmlFor:"customerIntro",children:"Intro"}),(0,Ye.jsx)(le,{id:"customerIntro",value:(s=t.intro)!=null?s:"",onChange:i=>r({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,Ye.jsxs)("div",{className:"flex items-center space-Ye-2",children:[(0,Ye.jsx)(ne,{id:"activeCustomer",checked:!!t.active,onCheckedChange:i=>r({...t,active:i})}),(0,Ye.jsx)(E,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,Ye.jsx)(U,{type:"submit",className:"w-full",children:"Add Customer"})]})}function Ct({customers:e,users:t,categories:r,onSubmit:o,initialDeal:s,onAddCustomer:i,onClose:l}){var N,T,F,H;let[a,u]=(0,Rt.useState)(s||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[R,w]=(0,Rt.useState)(!1),[v,D]=(0,Rt.useState)({});(0,Rt.useEffect)(()=>{s&&u(s)},[s]);let k=()=>{let c={};return a.customer||(c.customer="Customer is required"),a.value||(c.value="Value is required"),a.assignee||(c.assignee="Assignee is required"),a.closureDate||(c.closureDate="Closure Date is required"),D(c),Object.keys(c).length===0},M=c=>{c.preventDefault(),k()&&(o({...a}),u({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),D({}),l==null||l())},h=c=>{u(y=>{var G;return{...y,categories:(G=y.categories)!=null&&G.includes(c)?y.categories.filter(ce=>ce!==c):[...y.categories||[],c]}})},f=c=>{e.push(c),u({...a,customer:c}),w(!1),i(c)};return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsxs)("form",{onSubmit:M,className:"space-y-6",children:[(0,Ye.jsx)(ze,{className:"h-[60vh] pr-4",children:(0,Ye.jsxs)("div",{className:"space-y-6 px-4",children:[(0,Ye.jsxs)("div",{className:"space-y-2 space-Ye-2",children:[(0,Ye.jsx)(E,{htmlFor:"customer",children:"Customer"}),(0,Ye.jsxs)("div",{className:"flex items-center space-Ye-2",children:[(0,Ye.jsxs)(Le,{value:(T=(N=a.customer)==null?void 0:N.id)==null?void 0:T.toString(),onValueChange:c=>u({...a,customer:{id:Number(c)}}),children:[(0,Ye.jsx)(ge,{children:(0,Ye.jsx)(Ie,{placeholder:"Select customer"})}),(0,Ye.jsx)(be,{children:e.map(c=>{var y;return(0,Ye.jsx)(ve,{value:((y=c.id)==null?void 0:y.toString())||"",children:c.name},c.id)})})]}),(0,Ye.jsx)(U,{variant:"outline",size:"icon",onClick:()=>w(!0),children:(0,Ye.jsx)(et.PlusIcon,{className:"w-5 h-5"})})]}),v.customerId&&(0,Ye.jsx)("p",{className:"text-red-500 text-sm",children:v.customerId})]}),(0,Ye.jsxs)("div",{className:"space-y-2 space-Ye-2",children:[(0,Ye.jsx)(E,{htmlFor:"value",children:"Value"}),(0,Ye.jsx)(Z,{id:"value",type:"number",value:a.value||"",onChange:c=>u({...a,value:Number.parseFloat(c.target.value)}),placeholder:"Enter deal value"}),v.value&&(0,Ye.jsx)("p",{className:"text-red-500 text-sm",children:v.value})]}),(0,Ye.jsxs)("div",{className:"space-y-2 space-Ye-2",children:[(0,Ye.jsx)(E,{htmlFor:"assignee",children:"Assignee"}),(0,Ye.jsxs)(Le,{value:(H=(F=a.assignee)==null?void 0:F.id)==null?void 0:H.toString(),onValueChange:c=>u({...a,assignee:{id:Number(c)}}),children:[(0,Ye.jsx)(ge,{children:(0,Ye.jsx)(Ie,{placeholder:"Select assignee"})}),(0,Ye.jsx)(be,{children:t&&t.map(c=>{var y;return(0,Ye.jsx)(ve,{value:((y=c.id)==null?void 0:y.toString())||"",children:c.name},c.id)})})]}),v.assignee&&(0,Ye.jsx)("p",{className:"text-red-500 text-sm",children:v.assignee})]}),(0,Ye.jsxs)("div",{className:"space-y-2 space-Ye-2",children:[(0,Ye.jsx)(E,{htmlFor:"description",children:"Description"}),(0,Ye.jsx)(le,{id:"description",value:a.description||"",onChange:c=>u({...a,description:c.target.value}),placeholder:"Enter deal description"})]}),(0,Ye.jsxs)("div",{className:"space-y-2 space-Ye-2",children:[(0,Ye.jsx)(E,{children:"Categories"}),(0,Ye.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(c=>(0,Ye.jsxs)("div",{className:"space-y-2",children:[(0,Ye.jsx)("h4",{className:"text-sm font-medium",children:c.charAt(0).toUpperCase()+c.slice(1)}),(0,Ye.jsx)("div",{className:"grid grid-cols-2 gap-2",children:r.filter(y=>y.type===c).map(y=>{var G;return(0,Ye.jsxs)("div",{className:"flex items-center space-Ye-2",children:[(0,Ye.jsx)(ne,{id:y.id,checked:(G=a.categories)==null?void 0:G.includes(y.id),onCheckedChange:()=>h(y.id)}),(0,Ye.jsx)("label",{htmlFor:y.id,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:y.name})]},y.id)})})]},c))})]}),(0,Ye.jsxs)("div",{className:"space-y-2 space-Ye-2",children:[(0,Ye.jsx)(E,{htmlFor:"closureDate",children:"Closure Date"}),(0,Ye.jsx)(Z,{id:"closureDate",type:"date",value:a.closureDate,onChange:c=>u({...a,closureDate:c.target.value})}),v.closureDate&&(0,Ye.jsx)("p",{className:"text-red-500 text-sm",children:v.closureDate})]})]})}),(0,Ye.jsx)(U,{type:"submit",className:"w-full",children:s?"Update Deal":"Add Deal"})]}),(0,Ye.jsx)(ue,{open:R,onOpenChange:w,children:(0,Ye.jsxs)(oe,{children:[(0,Ye.jsx)(ae,{children:(0,Ye.jsx)(ie,{children:"Add New Customer"})}),(0,Ye.jsx)(xt,{onSubmit:f})]})})]})}function yr({status:e,deals:t,users:r,customers:o,categories:s,onDealClick:i,calculateColumnValue:l,calculateWeightedValue:a,addNewDeal:u,onAddCustomer:R}){let[w,v]=(0,Rt.useState)(!1);return(0,Ye.jsxs)("div",{className:"flex flex-col w-80",children:[(0,Ye.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),u&&(0,Ye.jsxs)(ue,{open:w,onOpenChange:v,children:[(0,Ye.jsx)(tt,{asChild:!0,children:(0,Ye.jsxs)(U,{className:"mb-4 w-full bg-green-500 hover:bg-green-600 text-white",children:[(0,Ye.jsx)(et.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,Ye.jsxs)(oe,{children:[(0,Ye.jsx)(ae,{children:(0,Ye.jsx)(ie,{children:"Add New Deal"})}),(0,Ye.jsx)(Ct,{customers:o,users:r,categories:s,onSubmit:u,onAddCustomer:R,onClose:()=>v(!1)})]})]}),(0,Ye.jsx)(ye.Droppable,{droppableId:e,isDropDisabled:!1,children:D=>(0,Ye.jsxs)("div",{ref:D.innerRef,...D.droppableProps,className:"bg-gray-100 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((k,M)=>(0,Ye.jsx)(ye.Draggable,{draggableId:k.id.toString(),index:k.id,children:h=>(0,Ye.jsx)("div",{ref:h.innerRef,...h.draggableProps,...h.dragHandleProps,children:(0,Ye.jsx)(st,{deal:k,customer:o.find(f=>f.id===k.customer.id),categories:s,onClick:()=>i(k)})})},k.id.toString())),D.placeholder]})}),(0,Ye.jsxs)("div",{className:"Ye-4 text-sm bg-white p-3 rounded-lg shadow",children:[(0,Ye.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,Ye.jsxs)("span",{className:"text-green-600",children:["\xA3",l(t).toLocaleString()]})]}),(0,Ye.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,Ye.jsxs)("span",{className:"text-blue-600",children:["\xA3",a(t,e).toLocaleString()]})]})]})]})}0&&(module.exports={KanbanColumn});