lawgic-dev-kit 0.22.6 → 0.22.8

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.
@@ -11,13 +11,13 @@ const V = ({
11
11
  placeholder: p,
12
12
  className: x = "",
13
13
  disabled: t = !1,
14
- size: d = "md",
14
+ size: m = "md",
15
15
  leftSide: a
16
16
  }) => {
17
17
  const {
18
- field: { value: n = "", onChange: m, ref: f, onBlur: g },
19
- fieldState: { error: l }
20
- } = w({ name: e, control: c }), [s, h] = y(!1), { t: u } = N(), o = {
18
+ field: { value: n = "", onChange: d, ref: f, onBlur: g },
19
+ fieldState: { error: o }
20
+ } = w({ name: e, control: c }), [s, h] = y(!1), { t: u } = N(), l = {
21
21
  sm: {
22
22
  container: "px-16 py-8",
23
23
  text: "text-sm",
@@ -32,17 +32,17 @@ const V = ({
32
32
  error: "text-sm",
33
33
  gap: "gap-8"
34
34
  }
35
- }[d];
35
+ }[m];
36
36
  return /* @__PURE__ */ r.jsxs(
37
37
  "label",
38
38
  {
39
- className: `flex flex-col group select-none ${o.gap} ${t && "cursor-not-allowed"} ${x}`,
39
+ className: `flex flex-col group select-none ${l.gap} ${t && "cursor-not-allowed"} ${x}`,
40
40
  htmlFor: e,
41
41
  children: [
42
42
  /* @__PURE__ */ r.jsx(
43
43
  "h6",
44
44
  {
45
- className: `text-gray-600 font-600 group ${l && "!text-red-500"} ${o.label} ${t && "text-gray-300"}`,
45
+ className: `text-gray-600 font-600 group ${o && "!text-red-500"} ${l.label} ${t && "text-gray-300"}`,
46
46
  children: i
47
47
  }
48
48
  ),
@@ -51,9 +51,9 @@ const V = ({
51
51
  {
52
52
  htmlFor: e,
53
53
  className: `
54
- flex items-center justify-between gap-8 ${o.container}
54
+ flex items-center justify-between gap-8 ${l.container}
55
55
 
56
- ${l && "!border-red-500"}
56
+ ${o && "!border-red-500"}
57
57
 
58
58
  bg-light
59
59
 
@@ -80,10 +80,10 @@ const V = ({
80
80
  disabled: t,
81
81
  placeholder: p,
82
82
  value: n,
83
- onChange: (b) => m(b.target.value),
83
+ onChange: (b) => d(b.target.value),
84
84
  onBlur: g,
85
85
  ref: f,
86
- className: `group bg-transparent w-full h-full font-600 placeholder:font-600 ${o.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none`
86
+ className: `group bg-transparent w-full h-full font-600 placeholder:font-600 ${l.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none`
87
87
  }
88
88
  ),
89
89
  /* @__PURE__ */ r.jsx(
@@ -97,7 +97,7 @@ const V = ({
97
97
  ]
98
98
  }
99
99
  ),
100
- /* @__PURE__ */ r.jsx("h4", { className: `font-500 text-red-500 leading-none ${o.error}`, children: l && u(l.message || "", { x: u(e) }) })
100
+ (o == null ? void 0 : o.message) && /* @__PURE__ */ r.jsx("h4", { className: `font-500 text-red-500 leading-none ${l.error}`, children: u(o.message, { x: u(e) }) })
101
101
  ]
102
102
  }
103
103
  );
@@ -89,7 +89,7 @@ const S = ({
89
89
  ]
90
90
  }
91
91
  ),
92
- /* @__PURE__ */ l.jsx("h4", { className: `font-500 text-red-500 leading-none ${o.error}`, children: (r == null ? void 0 : r.message) && s(r.message, { x: y || $ }) })
92
+ (r == null ? void 0 : r.message) && /* @__PURE__ */ l.jsx("h4", { className: `font-500 text-red-500 leading-none ${o.error}`, children: s(r.message, { x: y || $ }) })
93
93
  ]
94
94
  }
95
95
  );
@@ -81,7 +81,7 @@ const w = ({
81
81
  ]
82
82
  }
83
83
  ),
84
- /* @__PURE__ */ o.jsx("h4", { className: `font-500 text-red-500 leading-none ${r.error}`, children: l && x(l || "", { x: x(t) }) })
84
+ l && /* @__PURE__ */ o.jsx("h4", { className: `font-500 text-red-500 leading-none ${r.error}`, children: x(l, { x: x(t) }) })
85
85
  ]
86
86
  }
87
87
  );
@@ -152,7 +152,7 @@ const ge = ({
152
152
  }
153
153
  )
154
154
  ] }),
155
- /* @__PURE__ */ t.jsx("h4", { className: "font-500 text-label text-red-500 leading-none", children: c && x(c || "", { x: x(p) }) }),
155
+ c && /* @__PURE__ */ t.jsx("h4", { className: "font-500 text-label text-red-500 leading-none", children: x(c, { x: x(p) }) }),
156
156
  U && /* @__PURE__ */ t.jsx(
157
157
  "div",
158
158
  {
@@ -677,7 +677,7 @@ function print() { __p += __j.call(arguments, '') }
677
677
  group-focus-within:border-blue-500 transition-colors duration-200 ease-in-out
678
678
  ${u&&"hover:!cursor-pointer"}
679
679
  group-disabled:bg-gray-500
680
- `,children:[h&&h,g.jsx("input",{...m,id:r,name:r,disabled:c,placeholder:o,value:n,onChange:T=>{t(T.target.value)},className:`group bg-transparent w-full h-full font-600 placeholder:font-600 ${b.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none ${u&&"pointer-events-none !select-none !caret-transparent"}`}),p&&p]}),g.jsx("h4",{className:`font-500 text-red-500 leading-none ${b.error}`,children:s&&x(s||"",{x:x(r)})})]})},Zb=e=>_n(e,"dd/MM/yyyy"),Jb=e=>{const[t,n,r]=e.split("/");if((t==null?void 0:t.length)===2&&(n==null?void 0:n.length)===2&&(r==null?void 0:r.length)===4){const s=new Date(Number(r),Number(n)-1,Number(t));return isNaN(s.getTime())?null:s}return null},sN=({control:e,name:t,showTimeSelector:n=!1,label:r,translateKey:s="",placeholder:o,futureDates:a=!1,pastDates:c=!0,size:u})=>{const{field:{value:d,onChange:h,onBlur:p},fieldState:{error:m}}=vr.useController({name:t,control:e}),{t:x}=Ue(),S=x(t),b=x(s),[T,v]=O.useState(!1),[A,C]=O.useState("");O.useEffect(()=>{d instanceof Date&&!isNaN(d.getTime())?C(Zb(d)):C("")},[d]);const I=Jb(A),P=R=>{const F=R.replace(/\D/g,"").slice(0,8),W=[];F.length>0&&W.push(F.slice(0,2)),F.length>2&&W.push(F.slice(2,4)),F.length>4&&W.push(F.slice(4,8));const Q=W.join("/");if(C(Q),v(!1),Q.length===10){const ee=Jb(Q);h(ee)}},D=()=>{h(null),C("")};return g.jsx(gs,{open:T,strategy:"fixed",padding:0,offset:0,onClose:()=>v(!1),className:"p-0!",component:g.jsx(Ud,{date:I||new Date,onDateChange:R=>{C(Zb(R)),h(R),v(!1)},showTimeSelector:n,futureDates:a,pastDates:c}),children:g.jsx(al,{size:u,onBlur:p,name:b||S,label:r,value:A,onFocus:R=>{R.preventDefault(),v(!0)},disabledInput:!0,onChange:R=>P(R),placeholder:o,error:m==null?void 0:m.message,rightSide:!!I&&g.jsx(Pe,{icon:nx,className:"text-gray-500 cursor-pointer",onClick:D})})})},Qb=({title:e,description:t,open:n,onClose:r,onConfirm:s,onCancel:o,icon:a=wb,showCloseButton:c=!0})=>{const u={hidden:{opacity:0},visible:{opacity:1}},d={hidden:{opacity:0,scale:.8,y:-20},visible:{opacity:1,scale:1,y:0,transition:{type:"spring",stiffness:300,damping:25}},exit:{opacity:0,scale:.8,y:20,transition:{duration:.2}}},h=()=>{s==null||s(),r()},p=()=>{o==null||o(),r()},{t:m}=Ue();return g.jsx(qn,{children:n&&g.jsx(g.Fragment,{children:g.jsx(st.div,{className:"fixed inset-0 bg-black/50 z-9999 flex items-center justify-center",initial:"hidden",animate:"visible",exit:"hidden",variants:u,onClick:r,children:g.jsx(st.div,{className:"w-full max-w-sm mx-16 z-50",variants:d,initial:"hidden",animate:"visible",exit:"exit",onClick:x=>x.stopPropagation(),children:g.jsxs(yi,{className:"flex flex-col gap-20 p-32",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"flex justify-end",children:c&&g.jsx(Pe,{icon:pf,className:"cursor-pointer text-2xl text-gray-500 transition-all duration-300 hover:text-gray-700",onClick:r})}),g.jsx("div",{className:"flex justify-center",children:g.jsx("div",{className:"bg-blue-100 rounded-full w-76 h-76 flex justify-center items-center",children:g.jsx(Pe,{icon:a,className:"w-32 h-36 min-h-36 min-w-36 text-blue-500",onClick:r})})})]}),g.jsxs("div",{className:"flex flex-col gap-20 items-center justify-center",children:[g.jsxs("div",{className:"text-center w-full",children:[g.jsx("h3",{className:"text-black font-700 text-3xl w-full",children:e}),g.jsx("p",{className:"text-gray-500 text-xl font-600 w-full",children:t})]}),g.jsxs("div",{className:"flex justify-center w-full gap-16",children:[!!o&&g.jsx(ys,{size:"lg",onClick:p,variant:"transparent",children:m("cancel")}),!!s&&g.jsx(ys,{size:"lg",onClick:h,children:m("confirm")})]})]})]})})})})})},e2={duration:.3,ease:[.32,.72,0,1]},iN={initial:{opacity:0,height:0,y:-8},animate:{opacity:1,height:"auto",y:0},exit:{opacity:0,height:0,y:-8}},oN=({isOpen:e})=>g.jsx(st.div,{animate:{rotate:e?180:0},transition:{duration:.5,ease:[.16,1,.3,1]},children:g.jsx(Pe,{icon:YD,className:"text-gray-500 w-12 h-12 max-w-12 max-h-12"})}),aN=({label:e,children:t,subtitle:n,open:r,onClick:s,className:o="",labelClassName:a=""})=>{const{t:c}=Ue(),[u,d]=O.useState(!1),h=r!==void 0?r:u,p=s||(()=>d(!u));return g.jsxs(st.div,{className:"relative w-full bg-white border border-blue-100 rounded-2xl overflow-hidden",children:[g.jsxs("button",{onClick:p,className:`py-24 px-32 text-black font-semibold border-b
680
+ `,children:[h&&h,g.jsx("input",{...m,id:r,name:r,disabled:c,placeholder:o,value:n,onChange:T=>{t(T.target.value)},className:`group bg-transparent w-full h-full font-600 placeholder:font-600 ${b.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none ${u&&"pointer-events-none !select-none !caret-transparent"}`}),p&&p]}),s&&g.jsx("h4",{className:`font-500 text-red-500 leading-none ${b.error}`,children:x(s,{x:x(r)})})]})},Zb=e=>_n(e,"dd/MM/yyyy"),Jb=e=>{const[t,n,r]=e.split("/");if((t==null?void 0:t.length)===2&&(n==null?void 0:n.length)===2&&(r==null?void 0:r.length)===4){const s=new Date(Number(r),Number(n)-1,Number(t));return isNaN(s.getTime())?null:s}return null},sN=({control:e,name:t,showTimeSelector:n=!1,label:r,translateKey:s="",placeholder:o,futureDates:a=!1,pastDates:c=!0,size:u})=>{const{field:{value:d,onChange:h,onBlur:p},fieldState:{error:m}}=vr.useController({name:t,control:e}),{t:x}=Ue(),S=x(t),b=x(s),[T,v]=O.useState(!1),[A,C]=O.useState("");O.useEffect(()=>{d instanceof Date&&!isNaN(d.getTime())?C(Zb(d)):C("")},[d]);const I=Jb(A),P=R=>{const F=R.replace(/\D/g,"").slice(0,8),W=[];F.length>0&&W.push(F.slice(0,2)),F.length>2&&W.push(F.slice(2,4)),F.length>4&&W.push(F.slice(4,8));const Q=W.join("/");if(C(Q),v(!1),Q.length===10){const ee=Jb(Q);h(ee)}},D=()=>{h(null),C("")};return g.jsx(gs,{open:T,strategy:"fixed",padding:0,offset:0,onClose:()=>v(!1),className:"p-0!",component:g.jsx(Ud,{date:I||new Date,onDateChange:R=>{C(Zb(R)),h(R),v(!1)},showTimeSelector:n,futureDates:a,pastDates:c}),children:g.jsx(al,{size:u,onBlur:p,name:b||S,label:r,value:A,onFocus:R=>{R.preventDefault(),v(!0)},disabledInput:!0,onChange:R=>P(R),placeholder:o,error:m==null?void 0:m.message,rightSide:!!I&&g.jsx(Pe,{icon:nx,className:"text-gray-500 cursor-pointer",onClick:D})})})},Qb=({title:e,description:t,open:n,onClose:r,onConfirm:s,onCancel:o,icon:a=wb,showCloseButton:c=!0})=>{const u={hidden:{opacity:0},visible:{opacity:1}},d={hidden:{opacity:0,scale:.8,y:-20},visible:{opacity:1,scale:1,y:0,transition:{type:"spring",stiffness:300,damping:25}},exit:{opacity:0,scale:.8,y:20,transition:{duration:.2}}},h=()=>{s==null||s(),r()},p=()=>{o==null||o(),r()},{t:m}=Ue();return g.jsx(qn,{children:n&&g.jsx(g.Fragment,{children:g.jsx(st.div,{className:"fixed inset-0 bg-black/50 z-9999 flex items-center justify-center",initial:"hidden",animate:"visible",exit:"hidden",variants:u,onClick:r,children:g.jsx(st.div,{className:"w-full max-w-sm mx-16 z-50",variants:d,initial:"hidden",animate:"visible",exit:"exit",onClick:x=>x.stopPropagation(),children:g.jsxs(yi,{className:"flex flex-col gap-20 p-32",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"flex justify-end",children:c&&g.jsx(Pe,{icon:pf,className:"cursor-pointer text-2xl text-gray-500 transition-all duration-300 hover:text-gray-700",onClick:r})}),g.jsx("div",{className:"flex justify-center",children:g.jsx("div",{className:"bg-blue-100 rounded-full w-76 h-76 flex justify-center items-center",children:g.jsx(Pe,{icon:a,className:"w-32 h-36 min-h-36 min-w-36 text-blue-500",onClick:r})})})]}),g.jsxs("div",{className:"flex flex-col gap-20 items-center justify-center",children:[g.jsxs("div",{className:"text-center w-full",children:[g.jsx("h3",{className:"text-black font-700 text-3xl w-full",children:e}),g.jsx("p",{className:"text-gray-500 text-xl font-600 w-full",children:t})]}),g.jsxs("div",{className:"flex justify-center w-full gap-16",children:[!!o&&g.jsx(ys,{size:"lg",onClick:p,variant:"transparent",children:m("cancel")}),!!s&&g.jsx(ys,{size:"lg",onClick:h,children:m("confirm")})]})]})]})})})})})},e2={duration:.3,ease:[.32,.72,0,1]},iN={initial:{opacity:0,height:0,y:-8},animate:{opacity:1,height:"auto",y:0},exit:{opacity:0,height:0,y:-8}},oN=({isOpen:e})=>g.jsx(st.div,{animate:{rotate:e?180:0},transition:{duration:.5,ease:[.16,1,.3,1]},children:g.jsx(Pe,{icon:YD,className:"text-gray-500 w-12 h-12 max-w-12 max-h-12"})}),aN=({label:e,children:t,subtitle:n,open:r,onClick:s,className:o="",labelClassName:a=""})=>{const{t:c}=Ue(),[u,d]=O.useState(!1),h=r!==void 0?r:u,p=s||(()=>d(!u));return g.jsxs(st.div,{className:"relative w-full bg-white border border-blue-100 rounded-2xl overflow-hidden",children:[g.jsxs("button",{onClick:p,className:`py-24 px-32 text-black font-semibold border-b
681
681
  ${h?"border-blue-100 bg-gray-50/50":"border-transparent"}
682
682
  transition-all duration-200 ease-in-out focus:outline-none hover:bg-gray-50/50
683
683
  flex items-center gap-2 group w-full justify-between`,children:[g.jsx("span",{className:`text-left text-lg md:text-xl font-700 ${a}`,children:c(e)}),g.jsxs("div",{className:"flex gap-10 items-center",children:[g.jsx("span",{className:"text-gray-500 font-normal text-base md:text-lg",children:n}),g.jsx(oN,{isOpen:h})]})]}),g.jsx(qn,{mode:"wait",children:h&&g.jsx(st.div,{...iN,transition:{height:{duration:e2.duration,ease:e2.ease},opacity:{duration:.15,ease:"easeOut"}},className:`w-full bg-white overflow-hidden ${o}`,children:t})})]})},Ht={LOADING:"loading",COMPLETE:"complete",ERROR:"error"},lN=({file:e,onDelete:t,onRetry:n,uploadDuration:r=4e3})=>{const{t:s}=Ue(),o=()=>e.error?Ht.ERROR:e.loading?Ht.LOADING:Ht.COMPLETE,[a,c]=O.useState(o()),[u,d]=O.useState(0),[h,p]=O.useState(10);O.useEffect(()=>{const b=o();c(b);let T;if(b===Ht.LOADING&&u<100){const C=100/(r/100);T=setInterval(()=>{d(I=>{const P=Math.min(I+C,99),D=Math.max(0,Math.round((100-P)/10));return p(D),P})},100)}else b===Ht.COMPLETE&&u<100&&d(100);return()=>{T&&clearInterval(T)}},[e.loading,e.error,r,o,u]);const m=()=>{switch(a){case Ht.LOADING:return`${Math.round(u)}% (${h} ${s("seconds_left")})`;case Ht.COMPLETE:return s("file_uploaded");case Ht.ERROR:return s("upload_error");default:return""}},x=()=>{switch(a){case Ht.COMPLETE:return"text-green-500 font-600";case Ht.ERROR:return"text-red-500 font-600";default:return"text-gray-300 font-400"}},S=()=>{if(!(e!=null&&e.file_size))return s("unknown");const b=e.file_size/1024;return b<1024?`${b.toFixed(1)} KB`:`${(b/1024).toFixed(1)} MB`};return g.jsxs("div",{className:"border border-gray-100 bg-white rounded-lg p-16 shadow-sm w-full",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx(Pe,{icon:d5,className:"w-12 h-12 min-w-12 min-h-12 text-gray-400"}),g.jsx("span",{className:"text-gray-500 text-sm",children:e.user_file_name})]}),a===Ht.COMPLETE&&g.jsx("button",{onClick:t,className:"text-gray-400 transition-all duration-200 hover:text-gray-600 focus:outline-none",children:g.jsx(Pe,{icon:f5})}),a===Ht.ERROR&&g.jsx("button",{onClick:n,className:"text-gray-400 transition-all duration-200 hover:text-gray-600 focus:outline-none",children:g.jsx(Pe,{icon:c5})})]}),g.jsx("div",{className:"flex items-center mt-2",children:e!=null&&e.analyzing?g.jsxs("div",{className:"flex items-center gap-6",children:[g.jsx(st.div,{className:"h-14 w-14 rounded-full border-2 border-t-blue-500 border-r-blue-300 border-b-blue-200 border-l-blue-400",animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"}}),g.jsxs("span",{className:"text-sm text-gray-500",children:[s("analyzing_file_with_ai"),"..."]})]}):g.jsxs("div",{className:"text-sm",children:[g.jsxs("span",{className:"text-gray-500",children:[S()," |"]})," ",g.jsx("span",{className:x(),children:m()})]})}),a===Ht.LOADING&&g.jsx("div",{className:"mt-2 bg-gray-200 rounded-full h-2",children:g.jsx("div",{className:"h-2 rounded-full transition-all duration-100 ease-linear bg-blue-500",style:{width:`${u}%`}})})]})},t2=({index:e,label:t,active:n,completed:r})=>g.jsxs("div",{className:"flex items-center gap-8",children:[g.jsx("div",{className:`
@@ -708,7 +708,7 @@ function print() { __p += __j.call(arguments, '') }
708
708
  focus-within:border-blue-500 transition-colors duration-200 ease-in-out
709
709
  ${p&&"hover:!cursor-pointer"}
710
710
  group-disabled:bg-gray-500
711
- `,...re,children:[A&&A,g.jsx("input",{ref:R,id:e,name:e,disabled:p,placeholder:d,value:n,onClick:()=>{S&&!P&&!p&&D(!0)},onChange:B=>k(B.target.value),onKeyDown:B=>{o&&o(B),B.key==="Enter"&&(B.preventDefault(),K.length>0&&$(K[0])),B.key==="Escape"&&D(!1)},className:`group bg-transparent w-full h-full font-600 placeholder:font-600 text-body-m disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none ${p&&"pointer-events-none !select-none !caret-transparent"}`}),C&&!b?C:b&&g.jsx(Pe,{icon:NE,className:`text-xl text-gray-500 cursor-pointer ${P&&"rotate-180"} transition-transform duration-150 ease-in-out`,onClick:X})]}),T&&g.jsx(ys,{variant:"filled",size:"lg",onClick:c,className:"h-[55px]!",children:x})]}),g.jsx("h4",{className:"font-500 text-label text-red-500 leading-none",children:t&&I(t||"",{x:I(e)})}),Y&&g.jsx("div",{ref:ee.setFloating,style:{position:Q,top:W??0,left:F??0,...z,width:ee.reference.current instanceof Element?ee.reference.current.clientWidth:void 0,zIndex:50},className:"bg-white border border-blue-400 rounded-3xl shadow-lg overflow-hidden",...ue(),children:g.jsx("div",{className:"max-h-[250px] overflow-y-auto",children:K.length>0?g.jsx("ul",{className:"py-4",children:K.map((B,J)=>g.jsx("li",{className:`flex items-center px-16 py-10 transition-all duration-200 hover:bg-blue-50 cursor-pointer ${n===B.label?"bg-blue-100/30 text-blue-500 font-medium":""}`,onClick:oe=>{oe.stopPropagation(),$(B)},children:g.jsx("span",{children:I(B.label)})},`${B.label}-${J}`))}):n&&(n==null?void 0:n.length)>0?g.jsxs("div",{className:"px-16 py-16 text-center text-gray-500",children:[g.jsx("svg",{className:"mx-auto h-24 w-24 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),g.jsxs("p",{className:"mt-8 text-body-s",children:['No se encontraron resultados para "',n,'"']})]}):null})})]})},Yd=({label:e,onClick:t,onRemove:n,readOnly:r})=>g.jsxs("div",{className:"flex justify-between items-center gap-10 bg-[#DEE6F7] rounded-[4px] p-8 text-14",onClick:t,children:[g.jsx("span",{className:"text-blue-500 font-semibold text-nowrap text-ellipsis overflow-hidden",children:e}),!r&&n&&g.jsx("button",{onClick:s=>{n(),s.stopPropagation()},className:"flex items-center text-blue-300 hover:text-red-500",children:g.jsx(Pe,{icon:i0})})]}),MN=({values:e,onPillRemove:t})=>{const[n,r]=O.useState(!1),s=e.slice(0,3),o=e.slice(3);return g.jsxs("div",{className:"flex justify-between items-start gap-20",children:[g.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.map(a=>g.jsx(Yd,{label:a.label,onRemove:()=>t(a.value)},a.value)),g.jsx(qn,{children:n&&o.map(a=>g.jsx(st.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},children:g.jsx(Yd,{label:a.label,onRemove:()=>t(a.value)})},a.value))})]}),o.length>0&&g.jsx("button",{type:"button",onClick:()=>r(!n),className:"flex items-center gap-8 w-fit text-blue-500 font-semibold text-14 transition hover:text-blue-700 text-nowrap shrink-0",children:n?g.jsxs(g.Fragment,{children:[g.jsx("p",{children:"Ocultar"})," ",g.jsx(Pe,{icon:l5})]}):g.jsxs(g.Fragment,{children:[g.jsxs("p",{children:["Ver ",o.length," más"]})," ",g.jsx(Pe,{icon:h5})]})})]})},ON=({open:e,onClose:t,children:n,side:r="right",className:s="",backdropClassName:o="",width:a="650px",zIndex:c=9999,usePortal:u=!0})=>{O.useEffect(()=>{const m=x=>{x.key==="Escape"&&e&&t()};return e&&(document.addEventListener("keydown",m),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",m),document.body.style.overflow="unset"}},[e,t]);const d={initial:{x:r==="right"?"100%":"-100%"},animate:{x:0,transition:{type:"spring",stiffness:300,damping:30,opacity:{duration:.2}}},exit:{x:r==="right"?"100%":"-100%",transition:{type:"spring",stiffness:300,damping:30,opacity:{duration:.15}}}},h={initial:{opacity:0},animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0,transition:{duration:.15}}},p=g.jsx(qn,{children:e&&g.jsxs("div",{className:"fixed inset-0 flex",style:{zIndex:c},children:[g.jsx(st.div,{variants:h,initial:"initial",animate:"animate",exit:"exit",className:`absolute inset-0 bg-black/50 backdrop-blur-[0.60px] ${o}`,onClick:m=>{m.preventDefault(),m.stopPropagation(),t()}}),g.jsx("div",{className:`relative flex w-full pointer-events-none ${r==="left"?"justify-start":"justify-end"}`,children:g.jsx(st.div,{variants:d,initial:"initial",animate:"animate",exit:"exit",className:`
711
+ `,...re,children:[A&&A,g.jsx("input",{ref:R,id:e,name:e,disabled:p,placeholder:d,value:n,onClick:()=>{S&&!P&&!p&&D(!0)},onChange:B=>k(B.target.value),onKeyDown:B=>{o&&o(B),B.key==="Enter"&&(B.preventDefault(),K.length>0&&$(K[0])),B.key==="Escape"&&D(!1)},className:`group bg-transparent w-full h-full font-600 placeholder:font-600 text-body-m disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none ${p&&"pointer-events-none !select-none !caret-transparent"}`}),C&&!b?C:b&&g.jsx(Pe,{icon:NE,className:`text-xl text-gray-500 cursor-pointer ${P&&"rotate-180"} transition-transform duration-150 ease-in-out`,onClick:X})]}),T&&g.jsx(ys,{variant:"filled",size:"lg",onClick:c,className:"h-[55px]!",children:x})]}),t&&g.jsx("h4",{className:"font-500 text-label text-red-500 leading-none",children:I(t,{x:I(e)})}),Y&&g.jsx("div",{ref:ee.setFloating,style:{position:Q,top:W??0,left:F??0,...z,width:ee.reference.current instanceof Element?ee.reference.current.clientWidth:void 0,zIndex:50},className:"bg-white border border-blue-400 rounded-3xl shadow-lg overflow-hidden",...ue(),children:g.jsx("div",{className:"max-h-[250px] overflow-y-auto",children:K.length>0?g.jsx("ul",{className:"py-4",children:K.map((B,J)=>g.jsx("li",{className:`flex items-center px-16 py-10 transition-all duration-200 hover:bg-blue-50 cursor-pointer ${n===B.label?"bg-blue-100/30 text-blue-500 font-medium":""}`,onClick:oe=>{oe.stopPropagation(),$(B)},children:g.jsx("span",{children:I(B.label)})},`${B.label}-${J}`))}):n&&(n==null?void 0:n.length)>0?g.jsxs("div",{className:"px-16 py-16 text-center text-gray-500",children:[g.jsx("svg",{className:"mx-auto h-24 w-24 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),g.jsxs("p",{className:"mt-8 text-body-s",children:['No se encontraron resultados para "',n,'"']})]}):null})})]})},Yd=({label:e,onClick:t,onRemove:n,readOnly:r})=>g.jsxs("div",{className:"flex justify-between items-center gap-10 bg-[#DEE6F7] rounded-[4px] p-8 text-14",onClick:t,children:[g.jsx("span",{className:"text-blue-500 font-semibold text-nowrap text-ellipsis overflow-hidden",children:e}),!r&&n&&g.jsx("button",{onClick:s=>{n(),s.stopPropagation()},className:"flex items-center text-blue-300 hover:text-red-500",children:g.jsx(Pe,{icon:i0})})]}),MN=({values:e,onPillRemove:t})=>{const[n,r]=O.useState(!1),s=e.slice(0,3),o=e.slice(3);return g.jsxs("div",{className:"flex justify-between items-start gap-20",children:[g.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.map(a=>g.jsx(Yd,{label:a.label,onRemove:()=>t(a.value)},a.value)),g.jsx(qn,{children:n&&o.map(a=>g.jsx(st.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},children:g.jsx(Yd,{label:a.label,onRemove:()=>t(a.value)})},a.value))})]}),o.length>0&&g.jsx("button",{type:"button",onClick:()=>r(!n),className:"flex items-center gap-8 w-fit text-blue-500 font-semibold text-14 transition hover:text-blue-700 text-nowrap shrink-0",children:n?g.jsxs(g.Fragment,{children:[g.jsx("p",{children:"Ocultar"})," ",g.jsx(Pe,{icon:l5})]}):g.jsxs(g.Fragment,{children:[g.jsxs("p",{children:["Ver ",o.length," más"]})," ",g.jsx(Pe,{icon:h5})]})})]})},ON=({open:e,onClose:t,children:n,side:r="right",className:s="",backdropClassName:o="",width:a="650px",zIndex:c=9999,usePortal:u=!0})=>{O.useEffect(()=>{const m=x=>{x.key==="Escape"&&e&&t()};return e&&(document.addEventListener("keydown",m),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",m),document.body.style.overflow="unset"}},[e,t]);const d={initial:{x:r==="right"?"100%":"-100%"},animate:{x:0,transition:{type:"spring",stiffness:300,damping:30,opacity:{duration:.2}}},exit:{x:r==="right"?"100%":"-100%",transition:{type:"spring",stiffness:300,damping:30,opacity:{duration:.15}}}},h={initial:{opacity:0},animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0,transition:{duration:.15}}},p=g.jsx(qn,{children:e&&g.jsxs("div",{className:"fixed inset-0 flex",style:{zIndex:c},children:[g.jsx(st.div,{variants:h,initial:"initial",animate:"animate",exit:"exit",className:`absolute inset-0 bg-black/50 backdrop-blur-[0.60px] ${o}`,onClick:m=>{m.preventDefault(),m.stopPropagation(),t()}}),g.jsx("div",{className:`relative flex w-full pointer-events-none ${r==="left"?"justify-start":"justify-end"}`,children:g.jsx(st.div,{variants:d,initial:"initial",animate:"animate",exit:"exit",className:`
712
712
  relative bg-white shadow-2xl h-full overflow-hidden flex flex-col pointer-events-auto
713
713
  ${s}
714
714
  `,style:{width:typeof a=="number"?`${a}px`:a},onClick:m=>{m.preventDefault(),m.stopPropagation()},children:n})})]})});return u&&typeof document<"u"&&document.body?Ep.createPortal(p,document.body):p},$N=({filters:e})=>{const[t,n]=O.useState(!1),r=()=>n(!1),s=()=>n(!0);return g.jsx(gs,{open:t,onClose:r,placement:"bottom-start",className:"w-[326px] shadow-md px-0! text-base! py-12!",component:g.jsxs("div",{className:"relative flex flex-col gap-[10px]",children:[g.jsx("h4",{className:"px-24 text-lg font-semibold text-blue-900",children:"Filtros"}),g.jsx("div",{className:"flex flex-col",children:e.map((o,a)=>g.jsxs("div",{className:"group flex gap-[8px] items-center px-[24px] py-[8px] hover:bg-blue-100 cursor-pointer transition ease-in-out",onClick:o.onClick,children:[g.jsx(Pe,{icon:o.icon,className:"text-[14px] text-gray-600 group-hover:text-blue-500"}),g.jsx("p",{className:"text-[12px] text-gray-500 font-semibold group-hover:text-gray-800",children:o.label})]},a))})]}),children:g.jsx(Pe,{icon:LE,onClick:s,className:"transition text-[16px] ease-in-out duration-150 hover:text-gray-600 cursor-pointer"})})},_N=({label:e,options:t,selectedValues:n,onUpdate:r,placeholder:s="Seleccionar opciones",allowSearch:o=!0,className:a="",disabled:c=!1,size:u="md"})=>{var ue;const[d,h]=O.useState(!1),[p,m]=O.useState(""),x=O.useRef(null),S=O.useRef(null),T={sm:{container:"px-16 py-8",text:"text-sm",label:"text-sm",icon:"w-12 h-12",checkboxSize:16,gap:"gap-8",searchText:"text-sm",searchIcon:"size-12"},md:{container:"p-16",text:"text-14",label:"text-14",icon:"w-16 h-16",checkboxSize:20,gap:"gap-8",searchText:"text-14",searchIcon:"size-16"}}[u],{x:v,y:A,strategy:C,refs:I,context:P}=ir({open:d&&!c,onOpenChange:Y=>!c&&h(Y),middleware:[er(8),nr(),tr({padding:8}),Rr({apply({availableHeight:Y,elements:z}){Object.assign(z.floating.style,{maxHeight:`${Math.min(Y-10,500)}px`})},padding:8}),ms({element:S})],placement:"bottom-start",whileElementsMounted:Qn}),D=rr(P,{enabled:!c}),R=sr(P),{getReferenceProps:F,getFloatingProps:W}=or([D,R]),{isMounted:Q,styles:ee}=ar(P,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),ae=O.useCallback((Y,z)=>{if(c)return;let K;z?K=n.includes(Y)?n:[...n,Y]:K=n.filter($=>$!==Y),r(K)},[n,r,c]),ge=t.filter(Y=>Y.label.toLowerCase().includes(p.toLowerCase())),de=()=>{if(n.length===0)return s;const Y=t.filter(z=>n.includes(z.value)).map(z=>z.label);return Y.length===1?Y[0]:`${Y.length} seleccionados`},le=F({onClick:()=>!c&&h(!d)});return g.jsxs("div",{className:`flex flex-col select-none ${T.gap} ${c?"cursor-not-allowed":""} ${a}`,children:[e&&g.jsx("h6",{className:`text-gray-600 font-600 ${T.label} ${c?"text-gray-300":""}`,children:e}),g.jsxs("div",{ref:I.setReference,className:`
@@ -752,7 +752,7 @@ attempted value: ${a}
752
752
  group-focus-within:border-blue-500 transition-colors duration-200 ease-in-out
753
753
 
754
754
  group-disabled:bg-gray-500
755
- `,children:[c&&c,g.jsx("input",{id:n,type:x?"text":"password",autoComplete:"off","aria-autocomplete":"none",name:n,disabled:o,placeholder:r,value:u,onChange:A=>d(A.target.value),onBlur:p,ref:h,className:`group bg-transparent w-full h-full font-600 placeholder:font-600 ${v.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none`}),g.jsx(Pe,{icon:x?u5:a5,className:"min-h-16 max-h-16 text-gray-400 hover:text-gray-500 transition-colors duration-150 cursor-pointer ease-in-out",onClick:()=>S(!x)})]}),g.jsx("h4",{className:`font-500 text-red-500 leading-none ${v.error}`,children:m&&b(m.message||"",{x:b(n)})})]})},kk=({name:e,control:t,label:n="phone_number",placeholder:r="enter_phone_number",language:s="en",className:o="",translateKey:a,countries:c=M2})=>{var Ts,vl,Br,bl;const{t:u}=Ue(),{field:d,fieldState:h}=vr.useController({name:e,control:t,rules:{validate:{}}}),p=((Ts=d.value)==null?void 0:Ts.split(" "))||[],m=p[0]||null,x=p[1]||"",S=c.find(ve=>m===ve.phone),[b,T]=O.useState(!1),[v,A]=O.useState(""),[C,I]=O.useState(S||null),[P,D]=O.useState(x),[R,F]=O.useState(!1),W=O.useRef(null),Q=O.useRef(null),ee=O.useRef(null),ae=O.useRef(null),{x:ge,y:de,strategy:le,refs:ue,context:Y,placement:z,middlewareData:K}=ir({open:b,onOpenChange:T,middleware:[er(8),nr(),tr({padding:8}),Rr({apply({availableHeight:ve,elements:Ze}){Object.assign(Ze.floating.style,{maxHeight:`${Math.min(ve-10,300)}px`})},padding:8}),ms({element:Q})],placement:"bottom-start",whileElementsMounted:Qn}),$=rr(Y),k=sr(Y),{getReferenceProps:X,getFloatingProps:U}=or([$,k]),{isMounted:re,styles:B}=ar(Y,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),oe=(Array.isArray(c)?c:[]).filter(ve=>{if(!v.trim())return!0;const Ze=s==="es"&&ve.labelES?ve.labelES.toLowerCase():ve.label.toLowerCase(),Pt=ve.code?ve.code.toLowerCase():"",xn=ve.phone?ve.phone.toLowerCase():"";return Ze.includes(v.toLowerCase())||Pt.includes(v.toLowerCase())||xn.includes(v.toLowerCase())}),se=ve=>{I(ve),T(!1),A("");const Ze=`${ve.phone} ${P}`;d.onChange(Ze),setTimeout(()=>{var Pt;(Pt=ee.current)==null||Pt.focus()},100)},fe=ve=>{const Ze=ve.target.value;if(D(Ze),C){const Pt=`${C.phone} ${Ze}`;d.onChange(Pt)}},Ee=()=>{T(!b),!b&&W.current&&setTimeout(()=>{var ve;(ve=W.current)==null||ve.focus()},100)},Ve=()=>{setTimeout(()=>{b||d.onBlur()},200)},ie=()=>{F(!0)},me=()=>{F(!1)};O.useEffect(()=>{if(d.value){const ve=d.value.split(" "),Ze=ve[0]||"",Pt=ve[1]||"",xn=c.find(cr=>cr.phone===Ze);xn&&I(xn),D(Pt)}},[d.value,c]),O.useEffect(()=>{const ve=Ze=>{ae.current&&!ae.current.contains(Ze.target)&&d.onBlur()};return document.addEventListener("mousedown",ve),()=>{document.removeEventListener("mousedown",ve)}},[d]);const De=ve=>{var Ze;return ve?ve.codeISO2?ve.codeISO2.toLowerCase():((Ze=ve.code)==null?void 0:Ze.toLowerCase())||"":""},ft=(vl=K.arrow)==null?void 0:vl.x,ws=(Br=K.arrow)==null?void 0:Br.y,dt={top:"bottom",right:"left",bottom:"top",left:"right"}[z.split("-")[0]],yl=X({onClick:Ee,onBlur:Ve}),xl=()=>h.error?"border-red-500":R||b?"border-blue-400":"border-blue-100",Ss=u(n),qt=u(r),yn=(bl=h.error)==null?void 0:bl.message;return g.jsxs("div",{className:`w-full relative flex flex-col gap-8 ${o}`,children:[g.jsx("label",{className:`text-gray-600 font-600 group ${yn&&"!text-red-500"} text-label`,children:Ss}),g.jsxs("div",{ref:ae,className:"flex items-center w-full",onMouseEnter:ie,onMouseLeave:me,children:[g.jsxs("div",{ref:ue.setReference,className:`flex items-center justify-between text-lg max-w-120 font-600 bg-light rounded-l-full p-16 cursor-pointer border border-r-0 transition-all duration-200 ${yn?"border-red-500":xl()}`,style:{minWidth:"140px"},...yl,tabIndex:0,children:[C!=null&&C.code?g.jsxs("div",{className:"flex items-center truncate",children:[De(C)&&g.jsx("img",{loading:"lazy",width:"24",height:"16",className:"mr-2",src:`https://flagcdn.com/w20/${De(C)}.png`,srcSet:`https://flagcdn.com/w40/${De(C)}.png 2x`,alt:C.label,onError:ve=>{ve.currentTarget.style.display="none"}}),g.jsxs("span",{children:["+",C.phone]})]}):g.jsx("span",{className:"text-gray-400 font-600 text-body-m truncate",children:u("select_country")}),g.jsx(Pe,{icon:r0,className:"w-14 h-14 min-w-14 min-h-14"})]}),g.jsx("input",{ref:ee,type:"tel",className:`placeholder:text-gray-400 flex-grow bg-light rounded-r-full font-600 text-body-m p-16 border transition-all duration-200 ${yn?"border-red-500":xl()}`,placeholder:qt,value:P,onChange:fe,onBlur:Ve})]}),yn&&g.jsx("p",{className:"mt-1 text-sm text-red-600",children:u(yn,{x:u(a||"")||e})}),re&&g.jsxs("div",{ref:ue.setFloating,style:{position:le,top:de??0,left:ge??0,...B},className:"z-10 w-fit bg-white border border-blue-400 rounded-3xl shadow-lg overflow-auto max-w-120",...U(),children:[g.jsx("div",{ref:Q,className:"absolute w-4 h-4 bg-white rotate-45 border-blue-400",style:{left:ft!=null?`${ft}px`:"",top:ws!=null?`${ws}px`:"",right:"",bottom:"",[dt]:"-2px",borderRight:dt==="left"?"1px solid":"none",borderBottom:dt==="top"?"1px solid":"none",borderLeft:dt==="right"?"1px solid":"none",borderTop:dt==="bottom"?"1px solid":"none"}}),g.jsx("div",{className:"sticky top-0 bg-white p-2 z-20 w-fit",children:g.jsx("input",{ref:W,type:"text",className:"w-fit p-16",placeholder:u("search")+"...",value:v,onChange:ve=>A(ve.target.value),onClick:ve=>ve.stopPropagation(),onBlur:ve=>{ve.stopPropagation()},autoFocus:!0})}),g.jsx("div",{children:oe.length>0?g.jsx("ul",{className:"flex flex-col",children:oe.map((ve,Ze)=>{var xn;const Pt=ve.codeISO2?ve.codeISO2.toLowerCase():((xn=ve.code)==null?void 0:xn.toLowerCase())||"";return g.jsxs("li",{className:"flex items-center justify-between gap-10 px-16 py-8 transition-all duration-200 hover:bg-blue-100/50 cursor-pointer",onClick:cr=>{cr.stopPropagation(),se(ve)},children:[Pt&&g.jsx("img",{loading:"lazy",width:"24",height:"16",className:"mr-2",src:`https://flagcdn.com/w20/${Pt}.png`,srcSet:`https://flagcdn.com/w40/${Pt}.png 2x`,alt:ve.label,onError:cr=>{cr.currentTarget.style.display="none"}}),g.jsxs("span",{className:"text-gray-500",children:["+",ve.phone]})]},`${ve.code}-${Ze}`)})}):g.jsx("div",{className:"px-16 py-8 text-gray-500 text-body-s",children:u("no_countries_found")})})]})]})},jk={bgColor:"bg-blue-100",fillColor:"bg-blue-500"},Lk={bgColor:"bg-aqua-100",fillColor:"bg-aqua-500"},Rk=e=>{switch(e){case"aqua":return Lk;case"blue":default:return jk}},Fk=({progress:e,showPercentage:t=!1,color:n,className:r="",...s})=>{const{defaultColorScheme:o}=Ue(),a=n||o,{bgColor:c,fillColor:u}=Rk(a),d=Math.min(Math.max(e,0),100);return g.jsxs("div",{className:`flex items-center gap-12 ${r}`,...s,children:[g.jsx("div",{className:`w-full h-8 ${c} rounded-full`,children:g.jsx("div",{className:`h-full ${u} rounded-full transition-all duration-300 ease-in-out`,style:{width:`${d}%`}})}),t&&g.jsxs("span",{className:"text-sm text-gray-400 font-500",children:[d,"%"]})]})},Vk=()=>{const[e,t]=O.useState(!1),n=O.useRef(null),r=()=>{t(!0),setTimeout(()=>{var o;return(o=n.current)==null?void 0:o.focus()},100)},s=()=>{t(!1)};return g.jsx("div",{className:"relative flex items-center",children:g.jsxs("div",{className:`flex items-center justify-center bg-white shadow-md rounded-full transition-all duration-300 ease-in-out ${e?"w-[200px] h-[40px]":"size-[40px]"}`,children:[g.jsx("button",{onClick:r,className:"size-[40px] flex items-center justify-center rounded-full hover:bg-gray-100 transition-all",children:g.jsx(Pe,{icon:GD})}),g.jsx("input",{ref:n,type:"text",className:`w-full outline-none bg-transparent transition-all ${e?"w-full pr-[10px]":"w-0"}`,placeholder:"Buscar...",onBlur:s,style:{border:"none",outline:"none"}})]})})},Bk="w-fit transition-colors ease-in-out duration-200 flex items-center justify-center gap-12 px-24 py-7 text-base rounded-full font-600 bg-transparent",Wk={true:"bg-blue-100 text-blue-500 hover:bg-blue-100/80 active:bg-blue-100/50 !bg-blue-100",false:"text-gray-800 hover:bg-blue-100/40 hover:text-blue-500 active:bg-blue-100/20 active:text-blue-500"},Uk={true:"bg-aqua-100 text-aqua-500 hover:bg-aqua-100/80 active:bg-aqua-100/50 !bg-aqua-100",false:"text-gray-800 hover:bg-aqua-100/40 hover:text-aqua-500 active:bg-aqua-100/20 active:text-aqua-500"},zk=(e=!1,t="blue")=>{const n=String(e);let r;switch(t){case"aqua":r=Uk[n];break;case"blue":default:r=Wk[n];break}return Ln(Bk,r)},Gk=({label:e,href:t,onClick:n,active:r=!1,disabled:s=!1,className:o,icon:a,color:c})=>{const{defaultColorScheme:u}=Ue(),d=c||u,h=m=>{if(s){m.preventDefault();return}n==null||n(m)},p=`${zk(r,d)} ${s?"!text-gray-300 cursor-not-allowed !bg-transparent":""}`;return t?g.jsxs("a",{href:t,className:`${p} ${o||""}`,onClick:h,"aria-disabled":s,children:[a&&g.jsx(Pe,{icon:a,className:Do()}),e]}):g.jsxs("button",{className:`${p} ${o||""}`,onClick:h,disabled:s,children:[a&&g.jsx(Pe,{icon:a,className:Do()}),e]})},Yk="w-fit transition-colors group ease-in-out duration-200 flex flex-col items-center justify-center gap-12 text-base font-600",Hk={true:"text-blue-500 hover:text-blue-500",false:"text-gray-800 hover:text-blue-500"},qk={true:"text-aqua-500 hover:text-aqua-500",false:"text-gray-800 hover:text-aqua-500"},Kk="flex h-32 w-32 items-center justify-center transition-colors ease-in-out duration-200 rounded-full",Xk={true:"text-blue-500 bg-blue-100 rounded-full",false:"text-gray-800 hover:text-blue-500 active:text-blue-500 group-hover:bg-blue-100 group-hover:text-blue-500"},Zk={true:"text-aqua-500 bg-aqua-100 rounded-full",false:"text-gray-800 hover:text-aqua-500 active:text-aqua-500 group-hover:bg-aqua-100 group-hover:text-aqua-500"},O2=(e=!1,t="blue")=>{const n=String(e);let r;switch(t){case"blue":r=Xk[n];break;case"aqua":default:r=Zk[n];break}return Ln(Kk,r)},Jk=(e=!1,t="blue")=>{const n=String(e);let r;switch(t){case"aqua":r=qk[n];break;case"blue":default:r=Hk[n];break}return Ln(Yk,r)},Qk=({label:e,href:t,onClick:n,active:r=!1,disabled:s=!1,className:o,icon:a,color:c})=>{const{defaultColorScheme:u}=Ue(),d=c||u,h=m=>{if(s){m.preventDefault();return}n==null||n(m)},p=`${Jk(r,d)} ${s?"!text-gray-300 cursor-not-allowed !bg-transparent":""}`;return t?g.jsxs("a",{href:t,className:`${p} ${o||""}`,onClick:h,"aria-disabled":s,children:[a&&g.jsx("div",{className:O2(r,d),children:g.jsx(Pe,{icon:a,className:"size-16 max-h-16 max-w-16"})}),e]}):g.jsxs("button",{className:`${p} ${o||""}`,onClick:h,disabled:s,children:[a&&g.jsx("div",{className:O2(r,d),children:g.jsx(Pe,{icon:a,className:"size-16 max-h-16 max-w-16"})}),e]})},ej=e=>{const{display:t,...n}=e;return t==="desktop"?g.jsx(Gk,{...n}):t==="mobile"?g.jsx(Qk,{...n}):null},tj=({options:e,name:t,control:n,label:r="",placeholder:s="Type to search...",className:o="",input:a=!0,dropdownStyle:c={},innerClassName:u="",showChevron:d=!0,size:h="md"})=>{const{field:{value:p,onChange:m},fieldState:{error:x}}=vr.useController({name:t,control:n});return g.jsx(nj,{options:e,value:p,onChange:m,label:r,placeholder:s,error:x==null?void 0:x.message,className:o,input:a,dropdownStyle:c,innerClassName:u,showChevron:d,size:h})},nj=({options:e,value:t,onChange:n,label:r="Select an option",placeholder:s="Type to search...",error:o,input:a=!0,className:c="",dropdownStyle:u={},innerClassName:d="",showChevron:h=!0,size:p="md"})=>{var X;const{t:m}=Ue(),[x,S]=O.useState(!1),[b,T]=O.useState(""),[v,A]=O.useState(t||null),C=O.useRef(null),I=O.useRef(null),D={sm:{container:"px-16 py-8",text:"text-sm",label:"text-sm",error:"text-sm",gap:"gap-8",icon:"w-12 h-12"},md:{container:"p-16",text:"text-14",label:"text-14",error:"text-sm",gap:"gap-8",icon:"w-16 h-16"}}[p],{x:R,y:F,strategy:W,refs:Q,context:ee}=ir({open:x,onOpenChange:S,middleware:[er(8),nr(),tr({padding:8}),Rr({apply({availableHeight:U,elements:re}){Object.assign(re.floating.style,{maxHeight:`${Math.min(U-10,300)}px`})},padding:8}),ms({element:I})],placement:"bottom-start",whileElementsMounted:Qn}),ae=rr(ee),ge=sr(ee),{getReferenceProps:de,getFloatingProps:le}=or([ae,ge]),{isMounted:ue,styles:Y}=ar(ee,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),z=(()=>{const U=Array.isArray(e)?e:[];if(!b.trim())return U;const re=b.toLowerCase();return U.filter(B=>B.label.toLowerCase().includes(re)||B.key.toLowerCase().includes(re))})(),K=U=>{A(U),S(!1),T(""),n(U)},$=()=>{S(!x),!x&&C.current&&setTimeout(()=>{var U;return(U=C.current)==null?void 0:U.focus()},100)};O.useEffect(()=>{A(t)},[t]);const k=de({onClick:$});return g.jsxs("div",{className:`relative flex flex-col ${D.gap} ${c}`,children:[r&&g.jsx("h6",{className:`text-gray-600 font-600 ${o?"!text-red-500":""} ${D.label}`,children:r}),g.jsxs("div",{ref:Q.setReference,className:`${d} flex items-center justify-between bg-light rounded-full border transition-all duration-200
755
+ `,children:[c&&c,g.jsx("input",{id:n,type:x?"text":"password",autoComplete:"off","aria-autocomplete":"none",name:n,disabled:o,placeholder:r,value:u,onChange:A=>d(A.target.value),onBlur:p,ref:h,className:`group bg-transparent w-full h-full font-600 placeholder:font-600 ${v.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none`}),g.jsx(Pe,{icon:x?u5:a5,className:"min-h-16 max-h-16 text-gray-400 hover:text-gray-500 transition-colors duration-150 cursor-pointer ease-in-out",onClick:()=>S(!x)})]}),(m==null?void 0:m.message)&&g.jsx("h4",{className:`font-500 text-red-500 leading-none ${v.error}`,children:b(m.message,{x:b(n)})})]})},kk=({name:e,control:t,label:n="phone_number",placeholder:r="enter_phone_number",language:s="en",className:o="",translateKey:a,countries:c=M2})=>{var Ts,vl,Br,bl;const{t:u}=Ue(),{field:d,fieldState:h}=vr.useController({name:e,control:t,rules:{validate:{}}}),p=((Ts=d.value)==null?void 0:Ts.split(" "))||[],m=p[0]||null,x=p[1]||"",S=c.find(ve=>m===ve.phone),[b,T]=O.useState(!1),[v,A]=O.useState(""),[C,I]=O.useState(S||null),[P,D]=O.useState(x),[R,F]=O.useState(!1),W=O.useRef(null),Q=O.useRef(null),ee=O.useRef(null),ae=O.useRef(null),{x:ge,y:de,strategy:le,refs:ue,context:Y,placement:z,middlewareData:K}=ir({open:b,onOpenChange:T,middleware:[er(8),nr(),tr({padding:8}),Rr({apply({availableHeight:ve,elements:Ze}){Object.assign(Ze.floating.style,{maxHeight:`${Math.min(ve-10,300)}px`})},padding:8}),ms({element:Q})],placement:"bottom-start",whileElementsMounted:Qn}),$=rr(Y),k=sr(Y),{getReferenceProps:X,getFloatingProps:U}=or([$,k]),{isMounted:re,styles:B}=ar(Y,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),oe=(Array.isArray(c)?c:[]).filter(ve=>{if(!v.trim())return!0;const Ze=s==="es"&&ve.labelES?ve.labelES.toLowerCase():ve.label.toLowerCase(),Pt=ve.code?ve.code.toLowerCase():"",xn=ve.phone?ve.phone.toLowerCase():"";return Ze.includes(v.toLowerCase())||Pt.includes(v.toLowerCase())||xn.includes(v.toLowerCase())}),se=ve=>{I(ve),T(!1),A("");const Ze=`${ve.phone} ${P}`;d.onChange(Ze),setTimeout(()=>{var Pt;(Pt=ee.current)==null||Pt.focus()},100)},fe=ve=>{const Ze=ve.target.value;if(D(Ze),C){const Pt=`${C.phone} ${Ze}`;d.onChange(Pt)}},Ee=()=>{T(!b),!b&&W.current&&setTimeout(()=>{var ve;(ve=W.current)==null||ve.focus()},100)},Ve=()=>{setTimeout(()=>{b||d.onBlur()},200)},ie=()=>{F(!0)},me=()=>{F(!1)};O.useEffect(()=>{if(d.value){const ve=d.value.split(" "),Ze=ve[0]||"",Pt=ve[1]||"",xn=c.find(cr=>cr.phone===Ze);xn&&I(xn),D(Pt)}},[d.value,c]),O.useEffect(()=>{const ve=Ze=>{ae.current&&!ae.current.contains(Ze.target)&&d.onBlur()};return document.addEventListener("mousedown",ve),()=>{document.removeEventListener("mousedown",ve)}},[d]);const De=ve=>{var Ze;return ve?ve.codeISO2?ve.codeISO2.toLowerCase():((Ze=ve.code)==null?void 0:Ze.toLowerCase())||"":""},ft=(vl=K.arrow)==null?void 0:vl.x,ws=(Br=K.arrow)==null?void 0:Br.y,dt={top:"bottom",right:"left",bottom:"top",left:"right"}[z.split("-")[0]],yl=X({onClick:Ee,onBlur:Ve}),xl=()=>h.error?"border-red-500":R||b?"border-blue-400":"border-blue-100",Ss=u(n),qt=u(r),yn=(bl=h.error)==null?void 0:bl.message;return g.jsxs("div",{className:`w-full relative flex flex-col gap-8 ${o}`,children:[g.jsx("label",{className:`text-gray-600 font-600 group ${yn&&"!text-red-500"} text-label`,children:Ss}),g.jsxs("div",{ref:ae,className:"flex items-center w-full",onMouseEnter:ie,onMouseLeave:me,children:[g.jsxs("div",{ref:ue.setReference,className:`flex items-center justify-between text-lg max-w-120 font-600 bg-light rounded-l-full p-16 cursor-pointer border border-r-0 transition-all duration-200 ${yn?"border-red-500":xl()}`,style:{minWidth:"140px"},...yl,tabIndex:0,children:[C!=null&&C.code?g.jsxs("div",{className:"flex items-center truncate",children:[De(C)&&g.jsx("img",{loading:"lazy",width:"24",height:"16",className:"mr-2",src:`https://flagcdn.com/w20/${De(C)}.png`,srcSet:`https://flagcdn.com/w40/${De(C)}.png 2x`,alt:C.label,onError:ve=>{ve.currentTarget.style.display="none"}}),g.jsxs("span",{children:["+",C.phone]})]}):g.jsx("span",{className:"text-gray-400 font-600 text-body-m truncate",children:u("select_country")}),g.jsx(Pe,{icon:r0,className:"w-14 h-14 min-w-14 min-h-14"})]}),g.jsx("input",{ref:ee,type:"tel",className:`placeholder:text-gray-400 flex-grow bg-light rounded-r-full font-600 text-body-m p-16 border transition-all duration-200 ${yn?"border-red-500":xl()}`,placeholder:qt,value:P,onChange:fe,onBlur:Ve})]}),yn&&g.jsx("p",{className:"mt-1 text-sm text-red-600",children:u(yn,{x:u(a||"")||e})}),re&&g.jsxs("div",{ref:ue.setFloating,style:{position:le,top:de??0,left:ge??0,...B},className:"z-10 w-fit bg-white border border-blue-400 rounded-3xl shadow-lg overflow-auto max-w-120",...U(),children:[g.jsx("div",{ref:Q,className:"absolute w-4 h-4 bg-white rotate-45 border-blue-400",style:{left:ft!=null?`${ft}px`:"",top:ws!=null?`${ws}px`:"",right:"",bottom:"",[dt]:"-2px",borderRight:dt==="left"?"1px solid":"none",borderBottom:dt==="top"?"1px solid":"none",borderLeft:dt==="right"?"1px solid":"none",borderTop:dt==="bottom"?"1px solid":"none"}}),g.jsx("div",{className:"sticky top-0 bg-white p-2 z-20 w-fit",children:g.jsx("input",{ref:W,type:"text",className:"w-fit p-16",placeholder:u("search")+"...",value:v,onChange:ve=>A(ve.target.value),onClick:ve=>ve.stopPropagation(),onBlur:ve=>{ve.stopPropagation()},autoFocus:!0})}),g.jsx("div",{children:oe.length>0?g.jsx("ul",{className:"flex flex-col",children:oe.map((ve,Ze)=>{var xn;const Pt=ve.codeISO2?ve.codeISO2.toLowerCase():((xn=ve.code)==null?void 0:xn.toLowerCase())||"";return g.jsxs("li",{className:"flex items-center justify-between gap-10 px-16 py-8 transition-all duration-200 hover:bg-blue-100/50 cursor-pointer",onClick:cr=>{cr.stopPropagation(),se(ve)},children:[Pt&&g.jsx("img",{loading:"lazy",width:"24",height:"16",className:"mr-2",src:`https://flagcdn.com/w20/${Pt}.png`,srcSet:`https://flagcdn.com/w40/${Pt}.png 2x`,alt:ve.label,onError:cr=>{cr.currentTarget.style.display="none"}}),g.jsxs("span",{className:"text-gray-500",children:["+",ve.phone]})]},`${ve.code}-${Ze}`)})}):g.jsx("div",{className:"px-16 py-8 text-gray-500 text-body-s",children:u("no_countries_found")})})]})]})},jk={bgColor:"bg-blue-100",fillColor:"bg-blue-500"},Lk={bgColor:"bg-aqua-100",fillColor:"bg-aqua-500"},Rk=e=>{switch(e){case"aqua":return Lk;case"blue":default:return jk}},Fk=({progress:e,showPercentage:t=!1,color:n,className:r="",...s})=>{const{defaultColorScheme:o}=Ue(),a=n||o,{bgColor:c,fillColor:u}=Rk(a),d=Math.min(Math.max(e,0),100);return g.jsxs("div",{className:`flex items-center gap-12 ${r}`,...s,children:[g.jsx("div",{className:`w-full h-8 ${c} rounded-full`,children:g.jsx("div",{className:`h-full ${u} rounded-full transition-all duration-300 ease-in-out`,style:{width:`${d}%`}})}),t&&g.jsxs("span",{className:"text-sm text-gray-400 font-500",children:[d,"%"]})]})},Vk=()=>{const[e,t]=O.useState(!1),n=O.useRef(null),r=()=>{t(!0),setTimeout(()=>{var o;return(o=n.current)==null?void 0:o.focus()},100)},s=()=>{t(!1)};return g.jsx("div",{className:"relative flex items-center",children:g.jsxs("div",{className:`flex items-center justify-center bg-white shadow-md rounded-full transition-all duration-300 ease-in-out ${e?"w-[200px] h-[40px]":"size-[40px]"}`,children:[g.jsx("button",{onClick:r,className:"size-[40px] flex items-center justify-center rounded-full hover:bg-gray-100 transition-all",children:g.jsx(Pe,{icon:GD})}),g.jsx("input",{ref:n,type:"text",className:`w-full outline-none bg-transparent transition-all ${e?"w-full pr-[10px]":"w-0"}`,placeholder:"Buscar...",onBlur:s,style:{border:"none",outline:"none"}})]})})},Bk="w-fit transition-colors ease-in-out duration-200 flex items-center justify-center gap-12 px-24 py-7 text-base rounded-full font-600 bg-transparent",Wk={true:"bg-blue-100 text-blue-500 hover:bg-blue-100/80 active:bg-blue-100/50 !bg-blue-100",false:"text-gray-800 hover:bg-blue-100/40 hover:text-blue-500 active:bg-blue-100/20 active:text-blue-500"},Uk={true:"bg-aqua-100 text-aqua-500 hover:bg-aqua-100/80 active:bg-aqua-100/50 !bg-aqua-100",false:"text-gray-800 hover:bg-aqua-100/40 hover:text-aqua-500 active:bg-aqua-100/20 active:text-aqua-500"},zk=(e=!1,t="blue")=>{const n=String(e);let r;switch(t){case"aqua":r=Uk[n];break;case"blue":default:r=Wk[n];break}return Ln(Bk,r)},Gk=({label:e,href:t,onClick:n,active:r=!1,disabled:s=!1,className:o,icon:a,color:c})=>{const{defaultColorScheme:u}=Ue(),d=c||u,h=m=>{if(s){m.preventDefault();return}n==null||n(m)},p=`${zk(r,d)} ${s?"!text-gray-300 cursor-not-allowed !bg-transparent":""}`;return t?g.jsxs("a",{href:t,className:`${p} ${o||""}`,onClick:h,"aria-disabled":s,children:[a&&g.jsx(Pe,{icon:a,className:Do()}),e]}):g.jsxs("button",{className:`${p} ${o||""}`,onClick:h,disabled:s,children:[a&&g.jsx(Pe,{icon:a,className:Do()}),e]})},Yk="w-fit transition-colors group ease-in-out duration-200 flex flex-col items-center justify-center gap-12 text-base font-600",Hk={true:"text-blue-500 hover:text-blue-500",false:"text-gray-800 hover:text-blue-500"},qk={true:"text-aqua-500 hover:text-aqua-500",false:"text-gray-800 hover:text-aqua-500"},Kk="flex h-32 w-32 items-center justify-center transition-colors ease-in-out duration-200 rounded-full",Xk={true:"text-blue-500 bg-blue-100 rounded-full",false:"text-gray-800 hover:text-blue-500 active:text-blue-500 group-hover:bg-blue-100 group-hover:text-blue-500"},Zk={true:"text-aqua-500 bg-aqua-100 rounded-full",false:"text-gray-800 hover:text-aqua-500 active:text-aqua-500 group-hover:bg-aqua-100 group-hover:text-aqua-500"},O2=(e=!1,t="blue")=>{const n=String(e);let r;switch(t){case"blue":r=Xk[n];break;case"aqua":default:r=Zk[n];break}return Ln(Kk,r)},Jk=(e=!1,t="blue")=>{const n=String(e);let r;switch(t){case"aqua":r=qk[n];break;case"blue":default:r=Hk[n];break}return Ln(Yk,r)},Qk=({label:e,href:t,onClick:n,active:r=!1,disabled:s=!1,className:o,icon:a,color:c})=>{const{defaultColorScheme:u}=Ue(),d=c||u,h=m=>{if(s){m.preventDefault();return}n==null||n(m)},p=`${Jk(r,d)} ${s?"!text-gray-300 cursor-not-allowed !bg-transparent":""}`;return t?g.jsxs("a",{href:t,className:`${p} ${o||""}`,onClick:h,"aria-disabled":s,children:[a&&g.jsx("div",{className:O2(r,d),children:g.jsx(Pe,{icon:a,className:"size-16 max-h-16 max-w-16"})}),e]}):g.jsxs("button",{className:`${p} ${o||""}`,onClick:h,disabled:s,children:[a&&g.jsx("div",{className:O2(r,d),children:g.jsx(Pe,{icon:a,className:"size-16 max-h-16 max-w-16"})}),e]})},ej=e=>{const{display:t,...n}=e;return t==="desktop"?g.jsx(Gk,{...n}):t==="mobile"?g.jsx(Qk,{...n}):null},tj=({options:e,name:t,control:n,label:r="",placeholder:s="Type to search...",className:o="",input:a=!0,dropdownStyle:c={},innerClassName:u="",showChevron:d=!0,size:h="md"})=>{const{field:{value:p,onChange:m},fieldState:{error:x}}=vr.useController({name:t,control:n});return g.jsx(nj,{options:e,value:p,onChange:m,label:r,placeholder:s,error:x==null?void 0:x.message,className:o,input:a,dropdownStyle:c,innerClassName:u,showChevron:d,size:h})},nj=({options:e,value:t,onChange:n,label:r="Select an option",placeholder:s="Type to search...",error:o,input:a=!0,className:c="",dropdownStyle:u={},innerClassName:d="",showChevron:h=!0,size:p="md"})=>{var X;const{t:m}=Ue(),[x,S]=O.useState(!1),[b,T]=O.useState(""),[v,A]=O.useState(t||null),C=O.useRef(null),I=O.useRef(null),D={sm:{container:"px-16 py-8",text:"text-sm",label:"text-sm",error:"text-sm",gap:"gap-8",icon:"w-12 h-12"},md:{container:"p-16",text:"text-14",label:"text-14",error:"text-sm",gap:"gap-8",icon:"w-16 h-16"}}[p],{x:R,y:F,strategy:W,refs:Q,context:ee}=ir({open:x,onOpenChange:S,middleware:[er(8),nr(),tr({padding:8}),Rr({apply({availableHeight:U,elements:re}){Object.assign(re.floating.style,{maxHeight:`${Math.min(U-10,300)}px`})},padding:8}),ms({element:I})],placement:"bottom-start",whileElementsMounted:Qn}),ae=rr(ee),ge=sr(ee),{getReferenceProps:de,getFloatingProps:le}=or([ae,ge]),{isMounted:ue,styles:Y}=ar(ee,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),z=(()=>{const U=Array.isArray(e)?e:[];if(!b.trim())return U;const re=b.toLowerCase();return U.filter(B=>B.label.toLowerCase().includes(re)||B.key.toLowerCase().includes(re))})(),K=U=>{A(U),S(!1),T(""),n(U)},$=()=>{S(!x),!x&&C.current&&setTimeout(()=>{var U;return(U=C.current)==null?void 0:U.focus()},100)};O.useEffect(()=>{A(t)},[t]);const k=de({onClick:$});return g.jsxs("div",{className:`relative flex flex-col ${D.gap} ${c}`,children:[r&&g.jsx("h6",{className:`text-gray-600 font-600 ${o?"!text-red-500":""} ${D.label}`,children:r}),g.jsxs("div",{ref:Q.setReference,className:`${d} flex items-center justify-between bg-light rounded-full border transition-all duration-200
756
756
  ${D.container} cursor-pointer hover:border-blue-400
757
757
  ${o?"border-red-500 hover:border-red-600":""}
758
758
  ${x?"border-blue-400":"border-blue-100"}`,...k,children:[g.jsx("div",{className:"flex items-center w-full overflow-hidden",children:g.jsx("span",{className:`flex-grow font-600 truncate ${D.text} ${v?"":"text-gray-400"}`,children:m(v?v.label:s)})}),h&&g.jsx("svg",{className:`${D.icon} transition-transform ${x?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),o&&g.jsx("p",{className:`font-500 text-red-500 leading-none ${D.error}`,children:o}),ue&&g.jsxs("div",{ref:Q.setFloating,style:{position:W,top:F??0,left:R??0,...Y,width:(X=Q.reference.current)==null?void 0:X.clientWidth,zIndex:50,...u},className:"bg-white border border-blue-400 rounded-3xl shadow-lg overflow-hidden",...le(),children:[a&&g.jsx("div",{className:"sticky top-0 bg-white p-8 border-b border-gray-100 z-20",children:g.jsxs("div",{className:"relative",children:[g.jsx("div",{className:"absolute inset-y-0 left-0 pl-12 flex items-center pointer-events-none",children:g.jsx("svg",{className:"h-16 w-16 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),g.jsx("input",{ref:C,type:"text",className:"w-full py-8 pl-40 pr-12 rounded-full focus:outline-none text-body-s",placeholder:m("search_options"),value:b,onChange:U=>T(U.target.value),onClick:U=>U.stopPropagation(),autoFocus:!0})]})}),g.jsx("div",{className:"max-h-[250px] overflow-y-auto",children:z.length>0?g.jsx("ul",{className:"py-4",children:z.map((U,re)=>g.jsx("li",{className:`flex items-center px-16 py-10 transition-all duration-200 hover:bg-blue-50 cursor-pointer
@@ -786,7 +786,7 @@ attempted value: ${a}
786
786
  group-focus-within:border-blue-500 transition-colors duration-200 ease-in-out
787
787
 
788
788
  group-disabled:bg-gray-500
789
- `,children:[a&&a,g.jsx("input",{id:n,name:n,disabled:o,placeholder:r,value:p,onChange:P=>m(P.target.value),onBlur:S,ref:x,className:`group bg-transparent w-full h-full font-600 placeholder:font-600 ${A.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-hidden`,...h}),c&&c]}),g.jsx("h4",{className:`font-500 text-red-500 leading-none ${A.error}`,children:(b==null?void 0:b.message)&&T(b.message,{x:I||C})})]})},mj=({label:e,value:t,className:n})=>g.jsxs("div",{className:`flex flex-col gap-4 ${n||""}`,children:[g.jsx("p",{className:"text-lg font-600 text-gray-800",children:e}),g.jsx("p",{className:"text-base font-400 text-gray-600",children:t})]}),I2=({options:e,onChange:t,value:n,disabled:r,error:s,label:o="",placeholder:a="",allowSearch:c=!1,className:u="",innerClassName:d="",dropdownStyle:h={},showChevron:p=!0,size:m="md"})=>{const[x,S]=O.useState(!1),[b,T]=O.useState(""),v=O.useRef(null),A=O.useRef(null),C=e.find(U=>U.value===n),P={sm:{container:"px-16 py-8",text:"text-sm",label:"text-sm",error:"text-sm",gap:"gap-8",icon:"w-12 h-12",option:"text-sm"},md:{container:"p-16",text:"text-14",label:"text-14",error:"text-sm",gap:"gap-8",icon:"w-16 h-16",option:"text-14"}}[m],D=O.useMemo(()=>e.map(U=>({...U,searchableLabel:typeof U.label=="string"?U.label:O.isValidElement(U.label)?gl(U.label):String(U.label),searchableValue:String(U.value)})),[e]),R=O.useMemo(()=>{const U={keys:[{name:"searchableLabel",weight:2},{name:"searchableValue",weight:1}],threshold:.2,distance:150,includeScore:!0,includeMatches:!0,ignoreLocation:!0,minMatchCharLength:1,shouldSort:!0,findAllMatches:!0};return new cT(D,U)},[D]),{x:F,y:W,strategy:Q,refs:ee,context:ae}=ir({open:x,onOpenChange:S,middleware:[er(8),nr(),tr({padding:8}),Rr({apply({availableHeight:U,elements:re}){Object.assign(re.floating.style,{maxHeight:`${Math.min(U-10,300)}px`})},padding:8}),ms({element:A})],placement:"bottom-start",whileElementsMounted:Qn}),ge=rr(ae),de=sr(ae),{getReferenceProps:le,getFloatingProps:ue}=or([ge,de]),{isMounted:Y,styles:z}=ar(ae,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),K=O.useMemo(()=>b.trim()?R.search(b).map(re=>({...re.item,score:re.score,matches:re.matches})):e,[b,R,e]),$=U=>{t(U.value),S(!1),T("")},X=le({onClick:()=>{r||(S(!x),!x&&v.current&&c&&setTimeout(()=>{var U;return(U=v.current)==null?void 0:U.focus()},100))}});return g.jsxs("div",{className:`relative flex flex-col ${P.gap} ${u}`,children:[o&&g.jsx("h6",{className:`text-gray-600 font-600 group ${s?"!text-red-500":""} ${P.label} ${r?"text-gray-300":""}`,children:o}),g.jsxs("div",{ref:ee.setReference,className:`${d} flex items-center justify-between bg-light rounded-full
789
+ `,children:[a&&a,g.jsx("input",{id:n,name:n,disabled:o,placeholder:r,value:p,onChange:P=>m(P.target.value),onBlur:S,ref:x,className:`group bg-transparent w-full h-full font-600 placeholder:font-600 ${A.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-hidden`,...h}),c&&c]}),(b==null?void 0:b.message)&&g.jsx("h4",{className:`font-500 text-red-500 leading-none ${A.error}`,children:T(b.message,{x:I||C})})]})},mj=({label:e,value:t,className:n})=>g.jsxs("div",{className:`flex flex-col gap-4 ${n||""}`,children:[g.jsx("p",{className:"text-lg font-600 text-gray-800",children:e}),g.jsx("p",{className:"text-base font-400 text-gray-600",children:t})]}),I2=({options:e,onChange:t,value:n,disabled:r,error:s,label:o="",placeholder:a="",allowSearch:c=!1,className:u="",innerClassName:d="",dropdownStyle:h={},showChevron:p=!0,size:m="md"})=>{const[x,S]=O.useState(!1),[b,T]=O.useState(""),v=O.useRef(null),A=O.useRef(null),C=e.find(U=>U.value===n),P={sm:{container:"px-16 py-8",text:"text-sm",label:"text-sm",error:"text-sm",gap:"gap-8",icon:"w-12 h-12",option:"text-sm"},md:{container:"p-16",text:"text-14",label:"text-14",error:"text-sm",gap:"gap-8",icon:"w-16 h-16",option:"text-14"}}[m],D=O.useMemo(()=>e.map(U=>({...U,searchableLabel:typeof U.label=="string"?U.label:O.isValidElement(U.label)?gl(U.label):String(U.label),searchableValue:String(U.value)})),[e]),R=O.useMemo(()=>{const U={keys:[{name:"searchableLabel",weight:2},{name:"searchableValue",weight:1}],threshold:.2,distance:150,includeScore:!0,includeMatches:!0,ignoreLocation:!0,minMatchCharLength:1,shouldSort:!0,findAllMatches:!0};return new cT(D,U)},[D]),{x:F,y:W,strategy:Q,refs:ee,context:ae}=ir({open:x,onOpenChange:S,middleware:[er(8),nr(),tr({padding:8}),Rr({apply({availableHeight:U,elements:re}){Object.assign(re.floating.style,{maxHeight:`${Math.min(U-10,300)}px`})},padding:8}),ms({element:A})],placement:"bottom-start",whileElementsMounted:Qn}),ge=rr(ae),de=sr(ae),{getReferenceProps:le,getFloatingProps:ue}=or([ge,de]),{isMounted:Y,styles:z}=ar(ae,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),K=O.useMemo(()=>b.trim()?R.search(b).map(re=>({...re.item,score:re.score,matches:re.matches})):e,[b,R,e]),$=U=>{t(U.value),S(!1),T("")},X=le({onClick:()=>{r||(S(!x),!x&&v.current&&c&&setTimeout(()=>{var U;return(U=v.current)==null?void 0:U.focus()},100))}});return g.jsxs("div",{className:`relative flex flex-col ${P.gap} ${u}`,children:[o&&g.jsx("h6",{className:`text-gray-600 font-600 group ${s?"!text-red-500":""} ${P.label} ${r?"text-gray-300":""}`,children:o}),g.jsxs("div",{ref:ee.setReference,className:`${d} flex items-center justify-between bg-light rounded-full
790
790
  ${P.container} cursor-pointer border transition-all duration-200
791
791
  ${r?"opacity-60 cursor-not-allowed":"hover:border-blue-400"}
792
792
  ${s?"border-red-500 hover:border-red-600":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lawgic-dev-kit",
3
- "version": "0.22.6",
3
+ "version": "0.22.8",
4
4
  "description": "Componentes de UI para Lawgic",
5
5
  "type": "module",
6
6
  "private": false,