componentables 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Login/Login.d.ts.map +1 -1
- package/dist/components/Login/types.d.ts +1 -0
- package/dist/components/Login/types.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +791 -788
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Login.d.ts","sourceRoot":"","sources":["../../../src/components/Login/Login.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EACV,UAAU,EAIX,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"Login.d.ts","sourceRoot":"","sources":["../../../src/components/Login/Login.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EACV,UAAU,EAIX,MAAM,SAAS,CAAC;AAKjB,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAoO/B,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -14,6 +14,7 @@ export interface LoginCredentials {
|
|
|
14
14
|
export interface LoginProps {
|
|
15
15
|
title?: string;
|
|
16
16
|
showForgotPassword?: boolean;
|
|
17
|
+
onlyForgotPassword?: boolean;
|
|
17
18
|
className?: string;
|
|
18
19
|
onLogin?: (credentials: LoginCredentials) => Promise<void>;
|
|
19
20
|
onForgotPassword?: (email: string) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Login/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Login/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),k=require("react"),Te=require("react-loader-spinner"),Ie=require("react-dom"),X=require("react-toastify");function fe(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(r=fe(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function Oe(){for(var e,t,r=0,o="",l=arguments.length;r<l;r++)(e=arguments[r])&&(t=fe(e))&&(o&&(o+=" "),o+=t);return o}const ie="-",_e=e=>{const t=$e(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{const n=i.split(ie);return n[0]===""&&n.length!==1&&n.shift(),he(n,t)||Fe(i)},getConflictingClassGroupIds:(i,n)=>{const c=r[i]||[];return n&&o[i]?[...c,...o[i]]:c}}},he=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),l=o?he(e.slice(1),o):void 0;if(l)return l;if(t.validators.length===0)return;const a=e.join(ie);return t.validators.find(({validator:i})=>i(a))?.classGroupId},ce=/^\[(.+)\]$/,Fe=e=>{if(ce.test(e)){const t=ce.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},$e=e=>{const{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return Ve(Object.entries(e.classGroups),r).forEach(([a,i])=>{ae(i,o,a,t)}),o},ae=(e,t,r,o)=>{e.forEach(l=>{if(typeof l=="string"){const a=l===""?t:de(t,l);a.classGroupId=r;return}if(typeof l=="function"){if(Re(l)){ae(l(o),t,r,o);return}t.validators.push({validator:l,classGroupId:r});return}Object.entries(l).forEach(([a,i])=>{ae(i,de(t,a),r,o)})})},de=(e,t)=>{let r=e;return t.split(ie).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},Re=e=>e.isThemeGetter,Ve=(e,t)=>t?e.map(([r,o])=>{const l=o.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([i,n])=>[t+i,n])):a);return[r,l]}):e,Be=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const l=(a,i)=>{r.set(a,i),t++,t>e&&(t=0,o=r,r=new Map)};return{get(a){let i=r.get(a);if(i!==void 0)return i;if((i=o.get(a))!==void 0)return l(a,i),i},set(a,i){r.has(a)?r.set(a,i):l(a,i)}}},xe="!",Ge=e=>{const{separator:t,experimentalParseClassName:r}=e,o=t.length===1,l=t[0],a=t.length,i=n=>{const c=[];let d=0,g=0,h;for(let p=0;p<n.length;p++){let w=n[p];if(d===0){if(w===l&&(o||n.slice(p,p+a)===t)){c.push(n.slice(g,p)),g=p+a;continue}if(w==="/"){h=p;continue}}w==="["?d++:w==="]"&&d--}const x=c.length===0?n:n.substring(g),y=x.startsWith(xe),m=y?x.substring(1):x,v=h&&h>g?h-g:void 0;return{modifiers:c,hasImportantModifier:y,baseClassName:m,maybePostfixModifierPosition:v}};return r?n=>r({className:n,parseClassName:i}):i},We=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(o=>{o[0]==="["?(t.push(...r.sort(),o),r=[]):r.push(o)}),t.push(...r.sort()),t},He=e=>({cache:Be(e.cacheSize),parseClassName:Ge(e),..._e(e)}),Ue=/\s+/,Ye=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:l}=t,a=[],i=e.trim().split(Ue);let n="";for(let c=i.length-1;c>=0;c-=1){const d=i[c],{modifiers:g,hasImportantModifier:h,baseClassName:x,maybePostfixModifierPosition:y}=r(d);let m=!!y,v=o(m?x.substring(0,y):x);if(!v){if(!m){n=d+(n.length>0?" "+n:n);continue}if(v=o(x),!v){n=d+(n.length>0?" "+n:n);continue}m=!1}const p=We(g).join(":"),w=h?p+xe:p,b=w+v;if(a.includes(b))continue;a.push(b);const S=l(v,m);for(let z=0;z<S.length;++z){const j=S[z];a.push(w+j)}n=d+(n.length>0?" "+n:n)}return n};function Je(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=ye(t))&&(o&&(o+=" "),o+=r);return o}const ye=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=ye(e[o]))&&(r&&(r+=" "),r+=t);return r};function Ke(e,...t){let r,o,l,a=i;function i(c){const d=t.reduce((g,h)=>h(g),e());return r=He(d),o=r.cache.get,l=r.cache.set,a=n,n(c)}function n(c){const d=o(c);if(d)return d;const g=Ye(c,r);return l(c,g),g}return function(){return a(Je.apply(null,arguments))}}const A=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},ve=/^\[(?:([a-z-]+):)?(.+)\]$/i,qe=/^\d+\/\d+$/,Ze=new Set(["px","full","screen"]),Xe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qe=/\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$/,et=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,tt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>q(e)||Ze.has(e)||qe.test(e),G=e=>Z(e,"length",dt),q=e=>!!e&&!Number.isNaN(Number(e)),se=e=>Z(e,"number",q),Q=e=>!!e&&Number.isInteger(Number(e)),ot=e=>e.endsWith("%")&&q(e.slice(0,-1)),N=e=>ve.test(e),W=e=>Xe.test(e),st=new Set(["length","size","percentage"]),nt=e=>Z(e,st,we),at=e=>Z(e,"position",we),lt=new Set(["image","url"]),it=e=>Z(e,lt,pt),ct=e=>Z(e,"",ut),ee=()=>!0,Z=(e,t,r)=>{const o=ve.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):r(o[2]):!1},dt=e=>Qe.test(e)&&!et.test(e),we=()=>!1,ut=e=>tt.test(e),pt=e=>rt.test(e),mt=()=>{const e=A("colors"),t=A("spacing"),r=A("blur"),o=A("brightness"),l=A("borderColor"),a=A("borderRadius"),i=A("borderSpacing"),n=A("borderWidth"),c=A("contrast"),d=A("grayscale"),g=A("hueRotate"),h=A("invert"),x=A("gap"),y=A("gradientColorStops"),m=A("gradientColorStopPositions"),v=A("inset"),p=A("margin"),w=A("opacity"),b=A("padding"),S=A("saturate"),z=A("scale"),j=A("sepia"),P=A("skew"),f=A("space"),I=A("translate"),R=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",N,t],L=()=>[N,t],M=()=>["",B,G],D=()=>["auto",q,N],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],E=()=>["","0",N],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[q,N];return{cacheSize:500,separator:":",theme:{colors:[ee],spacing:[B,G],blur:["none","",W,N],brightness:F(),borderColor:[e],borderRadius:["none","","full",W,N],borderSpacing:L(),borderWidth:M(),contrast:F(),grayscale:E(),hueRotate:F(),invert:E(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[ot,G],inset:U(),margin:U(),opacity:F(),padding:L(),saturate:F(),scale:F(),sepia:E(),skew:F(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[W]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:[...$(),N]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Q,N]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:E()}],shrink:[{shrink:E()}],order:[{order:["first","last","none",Q,N]}],"grid-cols":[{"grid-cols":[ee]}],"col-start-end":[{col:["auto",{span:["full",Q,N]},N]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[ee]}],"row-start-end":[{row:["auto",{span:[Q,N]},N]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[f]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[f]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[W]},W]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",W,G]}],"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:[ee]}],"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",N]}],"line-clamp":[{"line-clamp":["none",q,se]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",B,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",B,G]}],"underline-offset":[{"underline-offset":["auto",B,N]}],"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:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],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",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),at]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",nt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},it]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-b":[{"border-b":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:O()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[B,N]}],"outline-w":[{outline:[B,G]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[B,G]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",W,ct]}],"shadow-color":[{shadow:[ee]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",W,N]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[h]}],saturate:[{saturate:[S]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[Q,N]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[B,G,se]}],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-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-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"]}}},bt=Ke(mt);function u(...e){return bt(Oe(e))}function ke(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,o=parseInt(e.slice(5,7),16)/255,l=Math.max(t,r,o),a=Math.min(t,r,o);let i=0,n=0;const c=(l+a)/2;if(l!==a){const d=l-a;switch(n=c>.5?d/(2-l-a):d/(l+a),l){case t:i=((r-o)/d+(r<o?6:0))/6;break;case r:i=((o-t)/d+2)/6;break;case o:i=((t-r)/d+4)/6;break}}return[i*360,n*100,c*100]}function le(e,t,r){r/=100;const o=t*Math.min(r,1-r)/100,l=a=>{const i=(a+e/30)%12,n=r-o*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*n).toString(16).padStart(2,"0")};return`#${l(0)}${l(8)}${l(4)}`}function te(e){const[t,r,o]=ke(e);return{base:e,light:le(t,Math.max(0,r-10),Math.min(100,o+15)),dark:le(t,Math.min(100,r+10),Math.max(0,o-15))}}const T={colors:{primary:"#6366f1",primaryLight:"#818cf8",primaryDark:"#4f46e5",secondary:"#8b5cf6",secondaryLight:"#a78bfa",secondaryDark:"#7c3aed",danger:"#ef4444",dangerLight:"#f87171",dangerDark:"#dc2626",text:"#1f2937",textMuted:"#6b7280",textLight:"#9ca3af",border:"#e5e7eb",borderDark:"#d1d5db",background:"#ffffff",backgroundDark:"#f9fafb",backgroundLight:"#f3f4f6",disabled:"#e5e7eb",light:"#f9fafb",active:"#4338ca"}},je=k.createContext(T);function gt(){return k.useContext(je)}function ue(e){const t=document.documentElement;t.style.setProperty("--componentables-primary",e.colors.primary),t.style.setProperty("--componentables-primary-light",e.colors.primaryLight),t.style.setProperty("--componentables-primary-dark",e.colors.primaryDark),t.style.setProperty("--componentables-secondary",e.colors.secondary),t.style.setProperty("--componentables-secondary-light",e.colors.secondaryLight),t.style.setProperty("--componentables-secondary-dark",e.colors.secondaryDark),t.style.setProperty("--componentables-danger",e.colors.danger),t.style.setProperty("--componentables-danger-light",e.colors.dangerLight),t.style.setProperty("--componentables-danger-dark",e.colors.dangerDark),t.style.setProperty("--componentables-text",e.colors.text),t.style.setProperty("--componentables-text-muted",e.colors.textMuted),t.style.setProperty("--componentables-text-light",e.colors.textLight),t.style.setProperty("--componentables-border",e.colors.border),t.style.setProperty("--componentables-border-dark",e.colors.borderDark),t.style.setProperty("--componentables-background",e.colors.background),t.style.setProperty("--componentables-background-dark",e.colors.backgroundDark),t.style.setProperty("--componentables-background-light",e.colors.backgroundLight),t.style.setProperty("--componentables-disabled",e.colors.disabled),t.style.setProperty("--componentables-light",e.colors.light),t.style.setProperty("--componentables-active",e.colors.active)}function ft({children:e,theme:t}){const r=k.useMemo(()=>{const o=t?.colors||{},l=o.primary?te(o.primary):null,a=o.secondary?te(o.secondary):null,i=o.danger?te(o.danger):null;return{colors:{primary:o.primary||T.colors.primary,primaryLight:l?.light||T.colors.primaryLight,primaryDark:l?.dark||T.colors.primaryDark,secondary:o.secondary||T.colors.secondary,secondaryLight:a?.light||T.colors.secondaryLight,secondaryDark:a?.dark||T.colors.secondaryDark,danger:o.danger||T.colors.danger,dangerLight:i?.light||T.colors.dangerLight,dangerDark:i?.dark||T.colors.dangerDark,text:o.text||T.colors.text,textMuted:o.textMuted||T.colors.textMuted,textLight:o.textLight||T.colors.textLight,border:o.border||T.colors.border,borderDark:o.borderDark||T.colors.borderDark,background:o.background||T.colors.background,backgroundDark:o.backgroundDark||T.colors.backgroundDark,backgroundLight:o.backgroundLight||T.colors.backgroundLight,disabled:o.disabled||T.colors.disabled,light:o.light||T.colors.light,active:o.active||T.colors.active}}},[t]);return typeof window<"u"&&ue(r),k.useEffect(()=>{ue(r)},[r]),k.createElement(je.Provider,{value:r},e)}const ht={primary:"bg-primary text-white border-primary hover:bg-primary-dark hover:border-primary-dark active:bg-active",secondary:"bg-secondary text-white border-secondary hover:bg-secondary-dark hover:border-secondary-dark",outline:"bg-transparent text-primary border-primary hover:bg-primary hover:text-white",ghost:"bg-transparent text-primary border-transparent hover:bg-primary hover:text-white hover:border-primary",light:"bg-light text-text border-border hover:bg-background-light",danger:"bg-transparent text-danger border-danger hover:text-white hover:bg-danger hover:border-danger active:bg-danger-dark",link:"bg-transparent text-secondary-light! underline hover:text-primary! border-0"},xt={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",xl:"px-8 py-4 text-xl"};function Y({children:e,onClick:t,disabled:r=!1,type:o="button",variant:l="primary",size:a="md",fullWidth:i=!1,loading:n=!1,className:c="",...d}){return s.jsxs("button",{type:o,onClick:r||n?void 0:t,disabled:r||n,className:u("inline-flex shadow-md hover:shadow-lg cursor-pointer items-center justify-center font-medium rounded-lg border transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-opacity-50",r||n?"bg-disabled text-text-muted border-disabled cursor-not-allowed hover:bg-disabled hover:border-disabled hover:text-text-muted":ht[l],xt[a],i&&"w-full",n&&"cursor-wait opacity-75",c),...d,children:[n&&s.jsxs("svg",{className:"w-4 h-4 mr-2 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e]})}function yt({id:e,name:t,type:r="text",value:o,onChange:l,placeholder:a,label:i,error:n,disabled:c=!1,required:d=!1,colorScheme:g="secondary",className:h="",...x}){const y=()=>{const v="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed placeholder:text-text-muted";if(n)return u(v,"border-danger focus:border-danger focus:shadow-danger-light");switch(g){case"primary":return u(v,"text-primary border-primary focus:border-primary");case"secondary":default:return u(v,"text-secondary border-secondary focus:border-secondary")}},m=()=>g==="primary"?"text-primary":"text-secondary";return s.jsxs("div",{className:u("mb-6",h),children:[i&&s.jsxs("label",{htmlFor:e,className:u("block mb-2 text-sm font-medium",m()),children:[i,d&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsx("input",{id:e,name:t,type:r,value:o,onChange:l,placeholder:a,disabled:c,required:d,className:y(),...x}),n&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:n})]})}function vt({id:e,name:t,value:r,onChange:o,placeholder:l,label:a,error:i,disabled:n=!1,required:c=!1,colorScheme:d="secondary",className:g="",rows:h=4,...x}){const y=()=>{const v="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed placeholder:text-text-muted resize-none";if(i)return u(v,"border-danger focus:border-danger focus:shadow-danger-light");switch(d){case"primary":return u(v,"text-primary border-primary focus:border-primary");case"secondary":default:return u(v,"text-secondary border-secondary focus:border-secondary")}},m=()=>d==="primary"?"text-primary":"text-secondary";return s.jsxs("div",{className:u("mb-6",g),children:[a&&s.jsxs("label",{htmlFor:e,className:u("block mb-2 text-sm font-medium",m()),children:[a,c&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsx("textarea",{id:e,name:t,value:r,onChange:o,placeholder:l,disabled:n,required:c,rows:h,className:y(),...x}),i&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:i})]})}const Ce={Input:yt,InputArea:vt};function wt({id:e,name:t,checked:r=!1,onChange:o,disabled:l=!1,label:a,colorScheme:i="secondary",size:n="md",className:c="",...d}){const[g,h]=k.useState(r),x=b=>{const S=b.target.checked;h(S),o?.(S)},y=()=>({primary:{bg:"bg-primary",border:"border-primary",text:"text-primary"},secondary:{bg:"bg-secondary",border:"border-secondary",text:"text-secondary"}})[i],m=()=>{switch(n){case"sm":return"w-10 h-6";case"lg":return"w-16 h-8";case"md":default:return"w-13 h-7"}},v=()=>{switch(n){case"sm":return"w-5 h-5";case"lg":return"w-7 h-7";case"md":default:return"w-6 h-6"}},p=()=>{if(!g)return"translate-x-0";switch(n){case"sm":return"translate-x-5";case"lg":return"translate-x-8";case"md":default:return"translate-x-6"}},w=y();return s.jsxs("div",{className:u("flex items-center gap-3",c),children:[s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:"checkbox",id:e,name:t,checked:g,onChange:x,disabled:l,className:"sr-only",...d}),s.jsx("label",{htmlFor:e,className:u("block cursor-pointer transition-all duration-300 rounded-full border-2",m(),g?u(w.bg,w.border):"bg-gray-200 border-gray-300",l?"opacity-50 cursor-not-allowed":"hover:shadow-md"),children:s.jsx("span",{className:u("absolute top-0.5 left-0.5 inline-block rounded-full bg-white transition-all duration-300 shadow-sm",v(),p())})})]}),a&&s.jsx("label",{htmlFor:e,className:u("text-sm font-medium cursor-pointer select-none",w.text,l&&"opacity-50 cursor-not-allowed"),children:a})]})}const kt={Toggle:wt},Ne=({size:e=40,wrapperStyle:t={},wrapperClass:r="",ariaLabel:o="Cargando...",label:l="Cargando...",visible:a=!0,direction:i="column"})=>{const n={display:"flex",flexDirection:i,justifyContent:"center",alignItems:"center",minHeight:"100px",...t};return s.jsxs("div",{style:n,className:r,children:[s.jsx("label",{children:l}),s.jsx(Te.Oval,{visible:a,height:e,width:e,ariaLabel:o,wrapperStyle:{},wrapperClass:"",secondaryColor:"#cdae90",color:"#cdae90"})]})},{Input:ne}=Ce,jt=({title:e="Iniciar Sesión",showForgotPassword:t=!0,className:r="",onLogin:o,onForgotPassword:l})=>{const[a,i]=k.useState({email:"",password:""}),[n,c]=k.useState({}),[d,g]=k.useState(!1),[h,x]=k.useState("login"),y=(j,P)=>{switch(j){case"email":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(P)?"":"Por favor ingresa un email válido";case"password":return P.length>=6?"":"La contraseña debe tener al menos 6 caracteres";default:return""}},m=j=>{const{name:P,value:f}=j.target;i(I=>({...I,[P]:f})),n[P]&&c(I=>({...I,[P]:""}))},v=()=>{const j={},P=y("email",a.email);if(P&&(j.email=P),h==="login"){const f=y("password",a.password);f&&(j.password=f)}return c(j),Object.keys(j).length===0},p=async j=>{if(j.preventDefault(),!!v()){g(!0);try{switch(h){case"login":o&&await o({email:a.email,password:a.password});break;case"forgot":l&&await l(a.email);break}}catch(P){console.error("Login error:",P)}finally{g(!1)}}},w=j=>{x(j),c({}),i({email:a.email,password:""})},b=()=>{switch(h){case"forgot":return s.jsx(ne,{id:"email",type:"email",name:"email",placeholder:"Ingresa tu email",label:"Email",value:a.email,onChange:m,error:n.email,disabled:d,colorScheme:"secondary"});default:return s.jsxs(s.Fragment,{children:[s.jsx(ne,{id:"email",type:"email",name:"email",placeholder:"Ingresa tu email",label:"Email",value:a.email,onChange:m,error:n.email,disabled:d,colorScheme:"secondary"}),s.jsx(ne,{id:"password",type:"password",name:"password",placeholder:"Ingresa tu contraseña",label:"Contraseña",value:a.password,onChange:m,error:n.password,disabled:d,colorScheme:"secondary"})]})}},S=()=>{switch(h){case"forgot":return"Recuperar Contraseña";default:return e}},z=()=>{if(d)return s.jsx(Ne,{size:20,wrapperStyle:{minHeight:"auto"}});switch(h){case"forgot":return"Enviar Enlace";default:return"Entrar"}};return s.jsx("div",{className:`flex justify-center items-center min-h-[90vh] p-6 bg-background sm:p-4 ${r||""}`,children:s.jsxs("div",{className:"w-full max-w-100 p-12 bg-white rounded-2xl shadow-lg animate-[fadeIn_0.3s_ease-out] sm:p-8",children:[s.jsx("h2",{className:"text-center mb-12 text-3xl font-semibold text-primary sm:text-2xl sm:mb-8",children:S()}),s.jsx("div",{className:"space-y-4 mb-6",children:b()}),s.jsx("form",{onSubmit:p,children:s.jsx(Y,{type:"submit",disabled:d,loading:d,fullWidth:!0,variant:"primary",size:"lg",className:"mb-6",children:!d&&z()})}),h==="login"&&t&&s.jsx(Y,{type:"button",onClick:()=>w("forgot"),variant:"link",size:"sm",fullWidth:!0,className:"shadow-none! !hover:shadow-none",children:"¿Olvidaste tu contraseña?"}),h==="forgot"&&s.jsx(Y,{type:"button",onClick:()=>w("login"),variant:"link",size:"sm",fullWidth:!0,className:"shadow-none! !hover:shadow-none",children:"Volver al inicio de sesión"})]})})};var Me={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},pe=k.createContext&&k.createContext(Me),Ct=["attr","size","title"];function Nt(e,t){if(e==null)return{};var r=Mt(e,t),o,l;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(l=0;l<a.length;l++)o=a[l],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function Mt(e,t){if(e==null)return{};var r={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;r[o]=e[o]}return r}function re(){return re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},re.apply(this,arguments)}function me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),r.push.apply(r,o)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?me(Object(r),!0).forEach(function(o){St(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):me(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function St(e,t,r){return t=Et(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Et(e){var t=Lt(e,"string");return typeof t=="symbol"?t:t+""}function Lt(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Se(e){return e&&e.map((t,r)=>k.createElement(t.tag,oe({key:r},t.attr),Se(t.child)))}function H(e){return t=>k.createElement(zt,re({attr:oe({},e.attr)},t),Se(e.child))}function zt(e){var t=r=>{var{attr:o,size:l,title:a}=e,i=Nt(e,Ct),n=l||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),k.createElement("svg",re({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,o,i,{className:c,style:oe(oe({color:e.color||r.color},r.style),e.style),height:n,width:n,xmlns:"http://www.w3.org/2000/svg"}),a&&k.createElement("title",null,a),e.children)};return pe!==void 0?k.createElement(pe.Consumer,null,r=>t(r)):t(Me)}function Dt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"line",attr:{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},child:[]}]})(e)}const Ee=(e,t=500)=>{const[r,o]=k.useState(e);return k.useEffect(()=>{const l=setTimeout(()=>{o(e)},t);return()=>clearTimeout(l)},[e,t]),r},At=()=>({showToast:(t,r)=>{const o={position:"bottom-right",autoClose:2e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!1,progress:void 0};switch(t){case"success":X.toast.success(r,o);break;case"error":X.toast.error(r,o);break;case"warning":X.toast.warning(r,o);break;case"info":X.toast.info(r,o);break;default:X.toast(r,o);break}}});function Pt(e=768){const[t,r]=k.useState(()=>typeof window>"u"?!1:window.innerWidth<e);return k.useEffect(()=>{if(typeof window>"u")return;const o=()=>{r(window.innerWidth<e)};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[e]),t}function Tt({value:e,onChange:t,placeholder:r="Search...",disabled:o=!1,colorScheme:l="secondary",label:a,className:i="",debounceDelay:n=500,...c}){const[d,g]=k.useState(e||""),h=Ee(d,n),x=k.useCallback(t,[t]);k.useEffect(()=>{x(h)},[h,x]);const y=()=>{const p="w-full px-4 py-4 pl-10 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed placeholder:text-text-muted";switch(l){case"primary":return u(p,"text-primary border-primary focus:border-primary");case"secondary":default:return u(p,"text-secondary border-secondary focus:border-secondary")}},m=()=>l==="primary"?"text-primary":"text-secondary",v=()=>l==="primary"?"text-primary":"text-secondary";return s.jsxs("div",{className:u("mb-0",i),children:[a&&s.jsx("label",{className:u("block mb-2 text-sm font-medium",v()),children:a}),s.jsxs("div",{className:"relative w-full",children:[s.jsx(Dt,{className:u("absolute left-3 top-1/2 -translate-y-1/2 text-base pointer-events-none",m())}),s.jsx("input",{type:"text",value:d,onChange:p=>g(p.target.value),placeholder:r,disabled:o,className:y(),...c})]})]})}function It(e){return H({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(e)}function Ot(e){return H({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"},child:[]}]})(e)}function _t({labelPage:e="Page",labelOf:t="of",setPagination:r,totalPages:o,currentPage:l,showLabel:a=!0,className:i="",isLoading:n=!1,fetchPage:c}){const d=parseInt(String(l))===1||parseInt(String(o))===0||n,g=parseInt(String(l))===parseInt(String(o))||parseInt(String(o))===0||n,h=()=>{n||(c?c(l-1):r&&r(y=>({...y,page:y.page-1})))},x=()=>{n||(c?c(l+1):r&&r(y=>({...y,page:y.page+1})))};return s.jsxs("div",{className:u("flex justify-center items-center mt-8",i),children:[s.jsx(Y,{disabled:d,onClick:h,variant:"secondary",children:s.jsx(It,{size:14})}),s.jsx("h5",{className:"font-bold mx-2.5 text-text",children:`${a?e:""} ${l}${a?` ${t} `:" / "}${o}`}),s.jsx(Y,{disabled:g,onClick:x,variant:"primary",children:s.jsx(Ot,{size:14})})]})}function Le(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m112 184 144 144 144-144"},child:[]}]})(e)}function Ft(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34z"},child:[]}]})(e)}function $t(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M456.69 421.39 362.6 327.3a173.81 173.81 0 0 0 34.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 0 0 327.3 362.6l94.09 94.09a25 25 0 0 0 35.3-35.3zM97.92 222.72a124.8 124.8 0 1 1 124.8 124.8 124.95 124.95 0 0 1-124.8-124.8z"},child:[]}]})(e)}function Rt({title:e,subtitle:t,children:r,defaultExpanded:o=!1,expanded:l,onToggle:a,className:i="",colorScheme:n="primary",icon:c,disabled:d=!1,headerExtra:g}){const[h,x]=k.useState(o),y=l!==void 0?l:h,m=()=>{if(d)return;const b=!y;l===void 0&&x(b),a?.(b)},v=()=>n==="primary"?"border-primary":"border-secondary",p=()=>n==="primary"?"text-primary":"text-secondary",w=()=>n==="primary"?"hover:bg-primary/5":"hover:bg-secondary/5";return s.jsxs("div",{className:u("w-full rounded-lg border-2 bg-background transition-all duration-300",v(),y&&"shadow-lg",i),children:[s.jsxs("button",{type:"button",onClick:m,disabled:d,className:u("w-full flex cursor-pointer items-center justify-between p-4 text-left transition-all duration-300 rounded-lg",!d&&w(),d&&"opacity-50"),"aria-expanded":y,children:[s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[c&&s.jsx("div",{className:u("shrink-0",p()),children:c}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:u("text-base font-medium truncate",p()),children:e}),t&&s.jsx("p",{className:"text-sm text-text-muted truncate mt-0.5",children:t})]})]}),s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[g&&s.jsx("div",{onClick:b=>b.stopPropagation(),children:g}),s.jsx("div",{className:u("h-5 w-5 transition-transform duration-300",p(),y&&"rotate-180"),children:s.jsx(Le,{className:"h-5 w-5"})})]})]}),s.jsx("div",{className:u("overflow-hidden transition-all duration-300 ease-in-out",y?"max-h-500 opacity-100":"max-h-0 opacity-0"),children:s.jsx("div",{className:u("p-4 pt-0 border-t-0",v()),children:s.jsx("div",{className:"border-t border-border pt-4",children:r})})})]})}function Vt({children:e,className:t=""}){return s.jsx("div",{className:u("py-4",t),children:e})}function Bt({options:e,value:t,onChange:r,children:o,className:l="",colorScheme:a="primary",variant:i="underline"}){const[n,c]=k.useState(t??e[0]?.value??""),d=t!==void 0?t:n,g=m=>{t===void 0&&c(m),r?.(m)},h=(m,v)=>{const p=d===m,w="px-4 py-3 cursor-pointer text-sm font-medium transition-all duration-300 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed";if(v)return u(w,"text-text-muted");switch(i){case"filled":return u(w,"rounded-lg",p?a==="primary"?"bg-primary text-white":"bg-secondary text-white":"text-text-muted hover:bg-background-light");case"pills":return u(w,"rounded-full",p?a==="primary"?"bg-primary/10 text-primary border-2 border-primary":"bg-secondary/10 text-secondary border-2 border-secondary":"text-text-muted hover:bg-background-light border-2 border-transparent");case"underline":default:return u(w,"border-b-2",p?a==="primary"?"border-primary text-primary":"border-secondary text-secondary":"border-transparent text-text-muted hover:text-text hover:border-border")}},x=()=>{switch(i){case"filled":return"flex gap-1 p-1 bg-background-light rounded-lg";case"pills":return"flex gap-2 flex-wrap";case"underline":default:return"flex border-b-2 border-border"}},y=k.Children.toArray(o).find(m=>k.isValidElement(m)?m.props.value===d:!1);return s.jsxs("div",{className:u("w-full",l),children:[s.jsx("div",{className:x(),role:"tablist",children:e.map(m=>s.jsx("button",{type:"button",role:"tab","aria-selected":d===m.value,"aria-controls":`tabpanel-${m.value}`,disabled:m.disabled,onClick:()=>!m.disabled&&g(m.value),className:h(m.value,m.disabled),children:m.label},m.value))}),s.jsx("div",{role:"tabpanel",id:`tabpanel-${d}`,children:y})]})}function be(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"},child:[]}]})(e)}function ge(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"},child:[]}]})(e)}const ze=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],De=["Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],Ae=["January","February","March","April","May","June","July","August","September","October","November","December"],Pe=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];function Gt(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function Wt(e){const t=new Date(e.getFullYear(),e.getMonth(),1).getDay();return t===0?6:t-1}function Ht({value:e,onChange:t,disabled:r=!1,className:o="",colorScheme:l="secondary",lang:a="en",...i}){const[n,c]=k.useState(e||new Date),d={en:"en-US",es:"es-ES"},g={en:ze,es:De},h={en:Ae,es:Pe},x=Gt(n),y=Wt(n),m=[];for(let f=0;f<y;f++)m.push(null);for(let f=1;f<=x;f++){const I=new Date(n.getFullYear(),n.getMonth(),f,12,0,0);m.push(I)}const v=()=>{c(new Date(n.getFullYear(),n.getMonth()-1,1,12,0,0))},p=()=>{c(new Date(n.getFullYear(),n.getMonth()+1,1,12,0,0))},w=()=>{c(new Date(n.getFullYear()-1,n.getMonth(),1,12,0,0))},b=()=>{c(new Date(n.getFullYear()+1,n.getMonth(),1,12,0,0))},S=f=>{if(f&&!r){const I=new Date(f.getFullYear(),f.getMonth(),f.getDate(),12,0,0);c(I),t?.(I)}},j=(()=>{switch(l){case"primary":return{header:"text-primary",selected:"bg-primary text-white",hover:"hover:bg-primary/10",button:"text-primary border-primary hover:bg-primary/20"};case"secondary":default:return{header:"text-secondary",selected:"bg-secondary text-white",hover:"hover:bg-secondary/10",button:"text-secondary border-secondary hover:bg-secondary/20"}}})(),P=f=>f&&e?f.toDateString()===e.toDateString():!1;return s.jsxs("div",{className:u("w-full max-w-sm bg-background border-2 border-border rounded-lg p-6 shadow-md",o),...i,children:[s.jsxs("div",{className:"mb-6",children:[s.jsxs("div",{className:u("flex items-center justify-between mb-4",j.header),children:[s.jsx("button",{type:"button",onClick:w,disabled:r,className:u("p-2 rounded-lg border transition-all duration-300",j.button,r&&"opacity-50 cursor-not-allowed"),children:s.jsx(be,{size:18})}),s.jsx("h2",{className:"font-semibold text-lg",children:n.getFullYear()}),s.jsx("button",{type:"button",onClick:b,disabled:r,className:u("p-2 rounded-lg border transition-all duration-300",j.button,r&&"opacity-50 cursor-not-allowed"),children:s.jsx(ge,{size:18})})]}),s.jsxs("div",{className:u("flex items-center justify-between",j.header),children:[s.jsx("button",{type:"button",onClick:v,disabled:r,className:u("p-2 rounded-lg border transition-all duration-300",j.button,r&&"opacity-50 cursor-not-allowed"),children:s.jsx(be,{size:18})}),s.jsx("h2",{className:"font-semibold text-lg",children:h[a][n.getMonth()]}),s.jsx("button",{type:"button",onClick:p,disabled:r,className:u("p-2 rounded-lg border transition-all duration-300",j.button,r&&"opacity-50 cursor-not-allowed"),children:s.jsx(ge,{size:18})})]})]}),s.jsx("div",{className:"grid grid-cols-7 gap-2 mb-4",children:g[a].map(f=>s.jsx("div",{className:u("text-center text-sm font-medium py-2",j.header),children:f},f))}),s.jsx("div",{className:"grid grid-cols-7 gap-2",children:m.map((f,I)=>s.jsx("button",{type:"button",onClick:()=>S(f),disabled:!f||r,className:u("p-2 rounded-lg text-sm font-medium transition-all duration-300",f?u("cursor-pointer",j.hover,P(f)?j.selected:"text-text border border-transparent hover:border-border",r&&"opacity-50 cursor-not-allowed"):"cursor-default"),children:f?f.getDate():""},I))}),e&&s.jsx("div",{className:u("mt-6 p-3 rounded-lg bg-background-dark border border-border text-center text-sm font-medium",j.header),children:e.toLocaleDateString(d[a],{year:"numeric",month:"long",day:"numeric"})})]})}function Ut({headers:e,data:t,loading:r,loadingText:o="Loading...",actions:l,actionsHeader:a="Actions",onRowClick:i,className:n="",rowClassName:c="",cellClassName:d="",headerClassName:g="",emptyText:h="No data available",showCount:x=!0,countText:y=v=>`Showing ${v} record${v!==1?"s":""}`,keyExtractor:m=(v,p)=>v._id||v.id||p}){if(r)return s.jsx("div",{className:"flex justify-center items-center min-h-50",children:s.jsx("div",{className:"text-lg text-text-light",children:o})});if(t.length===0)return s.jsx("div",{className:"flex justify-center items-center min-h-50",children:s.jsx("div",{className:"text-lg text-text-muted",children:h})});const v=(p,w)=>{const b=w.toLowerCase().replace(/\s+/g,"_");let S=p[b];if(S===void 0){const z=[b.replace(/_/g,""),w.toLowerCase().replace(/\s+/g,""),b.replace(/_([a-z])/g,(j,P)=>P.toUpperCase())];for(const j of z)if(p[j]!==void 0){S=p[j];break}}if(S===void 0){const z=w.toLowerCase().split(" "),j=Object.keys(p).find(P=>z.some(f=>P.toLowerCase().includes(f)));j&&(S=p[j])}return S!=null?String(S):"N/A"};return s.jsxs("div",{className:u("overflow-x-auto",n),children:[s.jsxs("table",{className:"w-full border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b-2 border-border",children:[e.map((p,w)=>s.jsx("th",{className:u("text-left py-3 px-4 font-semibold text-text",g),children:p},w)),l&&s.jsx("th",{className:u("text-center py-3 px-4 font-semibold text-text",g),children:a})]})}),s.jsx("tbody",{children:t.map((p,w)=>s.jsxs("tr",{className:u("border-b border-border-dark hover:bg-background-light transition-colors",i&&"cursor-pointer",c),onClick:()=>i?.(p),children:[e.map((b,S)=>s.jsx("td",{className:u("py-4 px-4",d),children:s.jsx("div",{className:"text-text-light",children:v(p,b)})},S)),l&&s.jsx("td",{className:u("py-4 px-4",d),children:s.jsx("div",{className:"flex gap-2 justify-center",children:l.map((b,S)=>{const z=j=>{j?.stopPropagation(),b.onClick?.(p)};if(b.component){const j=b.component;return s.jsxs(j,{onClick:z,className:b.className||"",...b.props||{},children:[b.icon&&s.jsx("span",{className:"inline-block",children:k.createElement(b.icon)}),b.label&&b.label]},S)}return s.jsxs(Y,{onClick:z,className:b.className||"",...b.props||{},children:[b.icon&&s.jsx("span",{className:"inline-block",children:k.createElement(b.icon)}),b.label&&b.label]},S)})})})]},m(p,w)))})]}),x&&t.length>0&&s.jsx("div",{className:"mt-6 text-center text-text-light text-sm",children:y(t.length)})]})}function Yt({label:e,options:t,value:r="",onChange:o,multiple:l=!1,className:a="",searchable:i=!1,onSearchInputCustom:n,placeholder:c="Select...",disabled:d=!1,error:g,required:h=!1,colorScheme:x="primary",noResultsText:y="No results found",searchPlaceholder:m="Search...",...v}){const[p,w]=k.useState(!1),[b,S]=k.useState(""),[z,j]=k.useState({top:0,left:0,openUpward:!1}),P=Array.isArray(r)?r:r?[r]:[],[f,I]=k.useState(P.map(C=>t.find(E=>E.value===C)).filter(Boolean)),R=k.useRef(null),V=k.useRef(null),U=()=>{const C="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed";if(g)return u(C,"border-danger focus:border-danger");switch(x){case"primary":return u(C,"text-primary border-primary focus:border-primary");case"secondary":default:return u(C,"text-secondary border-secondary focus:border-secondary")}},L=()=>x==="primary"?"text-primary":"text-secondary";k.useEffect(()=>{const E=(Array.isArray(r)?r:r!==""&&r!==null&&r!==void 0?[r]:[]).map(_=>t.find(F=>F.value===_)).filter(Boolean);I(E)},[r,t]),k.useEffect(()=>{p&&i&&V.current&&V.current.focus()},[p,i]);const M=k.useCallback(()=>{if(!R.current)return;const C=R.current.getBoundingClientRect(),E=window.innerHeight,_=250,K=E-C.bottom<_&&C.top>_;j({top:K?C.top:C.bottom,left:C.left,width:C.width,openUpward:K})},[]);k.useEffect(()=>{function C(_){R.current&&!R.current.contains(_.target)&&w(!1)}function E(){p&&M()}return document.addEventListener("mousedown",C),window.addEventListener("scroll",E,!0),window.addEventListener("resize",E),()=>{document.removeEventListener("mousedown",C),window.removeEventListener("scroll",E,!0),window.removeEventListener("resize",E)}},[p,M]);const D=C=>{const E=t.find(F=>F.value===C);if(!E)return;let _;l?(_=f.some(K=>K.value===C)?f.filter(K=>K.value!==C):[...f,E],I(_),o(_)):(_=[E],I(_),o(E),w(!1),S(""))},$=C=>{S(C),n?.(C)},O=i?t.filter(C=>C.label.toLowerCase().includes(b.toLowerCase())):t,J=()=>f.length===0?c:l?f.length===1?f[0].label:`${f.length} selected`:f[0]?.label||c;return s.jsxs("div",{className:u("mb-6",a),children:[e&&s.jsxs("label",{className:u("block mb-2 text-sm font-medium",L()),children:[e,h&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsxs("div",{ref:R,className:"relative w-full",children:[s.jsxs("button",{type:"button",onClick:C=>{C.preventDefault(),C.stopPropagation(),p||M(),w(!p)},className:u(U(),"inline-flex items-center justify-between cursor-pointer h-auto min-h-14",d&&"cursor-not-allowed",p&&"ring-1"),disabled:d,...v,children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[f.length>0&&f[0].hex&&s.jsx("div",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:f[0].hex}}),s.jsx("span",{className:f.length>0?"":"text-text-muted",children:J()})]}),s.jsx("div",{className:u("h-5 w-5 transition-transform duration-200",p&&"rotate-180"),children:s.jsx(Le,{className:"h-5 w-5"})})]}),p&&s.jsxs("div",{className:u("fixed z-9999 rounded-lg border-2 bg-white shadow-xl",g?"border-danger":x==="primary"?"border-primary":"border-secondary"),style:{top:`${z.top+(z.openUpward?0:8)}px`,left:`${z.left}px`,width:`${z.width}px`,transform:z.openUpward?"translateY(-100%)":"none"},children:[i&&s.jsx("div",{className:"border-b border-border p-3",children:s.jsxs("div",{className:"relative",children:[s.jsx($t,{className:"absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 transform text-text-muted"}),s.jsx("input",{ref:V,type:"text",value:b,onChange:C=>$(C.target.value),placeholder:m,className:u("w-full rounded-lg border-2 py-2 pr-10 pl-10 text-sm transition-all duration-300 focus:outline-none focus:ring-1",x==="primary"?"border-primary text-primary":"border-secondary text-secondary")}),b&&s.jsx("button",{type:"button",onClick:()=>S(""),className:"absolute top-1/2 right-3 h-4 w-4 -translate-y-1/2 transform text-text-muted hover:text-text",children:s.jsx(Ft,{className:"h-4 w-4"})})]})}),s.jsxs("div",{className:"max-h-60 overflow-y-auto py-1",children:[O.map(C=>s.jsx("button",{type:"button",onClick:()=>D(C.value??""),className:u("w-full px-4 py-3 text-left text-sm transition-colors",f.some(E=>E.value===C.value)?x==="primary"?"bg-primary/10 text-primary font-medium":"bg-secondary/10 text-secondary font-medium":"text-text hover:bg-background-light"),children:s.jsxs("div",{className:"flex items-center gap-3",children:[l&&s.jsx("div",{className:u("flex h-4 w-4 items-center justify-center rounded border-2 transition-colors",f.some(E=>E.value===C.value)?x==="primary"?"border-primary bg-primary":"border-secondary bg-secondary":"border-border"),children:f.some(E=>E.value===C.value)&&s.jsx("svg",{className:"h-3 w-3 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})}),C.hex&&s.jsx("div",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:C.hex}}),s.jsx("span",{children:C.label})]})},C.value)),O.length===0&&b&&t.length>0&&s.jsx("div",{className:"px-4 py-3",children:s.jsx("span",{className:"text-sm text-text-muted",children:y})})]})]})]}),g&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:g})]})}const Jt=({id:e,name:t,onFilesSelected:r,placeholder:o="Arrastra y suelta archivos aquí o haz clic para seleccionar",labelSelectedFiles:l="archivo:",label:a,error:i,disabled:n=!1,required:c=!1,colorScheme:d="secondary",className:g="",accept:h="*/*",multiple:x=!1,...y})=>{const m=k.useRef(null),[v,p]=k.useState(!1),[w,b]=k.useState([]),S=()=>{const M="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed cursor-pointer min-h-[120px]";if(i)return u(M,"border-danger focus:border-danger focus:ring-1 focus:ring-danger");switch(d){case"primary":return u(M,"border-primary focus:border-primary focus:ring-1 focus:ring-primary hover:border-primary-dark");case"secondary":default:return u(M,"border-secondary focus:border-secondary focus:ring-1 focus:ring-secondary hover:border-secondary-dark")}},z=()=>{switch(d){case"primary":return"text-primary";case"secondary":default:return"text-secondary"}},j=M=>{M.preventDefault(),M.stopPropagation(),n||(M.type==="dragenter"||M.type==="dragover"?p(!0):M.type==="dragleave"&&p(!1))},P=M=>{if(M.preventDefault(),M.stopPropagation(),p(!1),n)return;const D=M.dataTransfer.files;I(D)},f=M=>{const D=M.target.files;D&&I(D)},I=M=>{const D=Array.from(M);if(h!=="*/*"){const $=D.filter(O=>R(O,h));if($.length===0){console.warn("No valid files selected");return}b(x?$:[$[0]]),r(x?$:[$[0]])}else b(x?D:[D[0]]),r(x?D:[D[0]])},R=(M,D)=>D.split(",").map(O=>O.trim()).some(O=>{if(O.startsWith("."))return M.name.toLowerCase().endsWith(O.toLowerCase());if(O.includes("/")){const[J,C]=O.split("/"),E=M.type.split("/")[0];return C==="*"?E===J:M.type===O}return!1}),V=()=>{n||m.current?.click()},U=M=>{const D=w.filter(($,O)=>O!==M);b(D),r(D)},L=M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),V())};return s.jsxs("div",{className:`mb-6 ${g}`,children:[a&&s.jsxs("label",{className:`block mb-2 text-sm font-medium ${z()}`,children:[a,c&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsxs("div",{className:u(S(),v&&"bg-background-light border-2-dashed"),onDragEnter:j,onDragLeave:j,onDragOver:j,onDrop:P,onClick:V,onKeyDown:L,role:"button",tabIndex:n?-1:0,children:[s.jsx("input",{ref:m,id:e,name:t,type:"file",onChange:f,disabled:n,required:c,accept:h,multiple:x,className:"hidden",...y}),s.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[s.jsx("svg",{className:`w-8 h-8 mb-2 ${d==="primary"?"text-primary":"text-secondary"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),s.jsx("p",{className:`text-sm ${z()}`,children:o})]})]}),s.jsxs("div",{className:"mt-4 space-y-2",children:[s.jsxs("p",{className:`text-sm font-medium ${z()}`,children:[w.length," ",l,"(s) seleccionado(s):"]}),s.jsx("ul",{className:"space-y-1",children:w.map((M,D)=>s.jsxs("li",{className:"flex items-center justify-between p-2 bg-light rounded border border-border",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[s.jsxs("svg",{className:"w-4 h-4 text-text-muted shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:[s.jsx("path",{d:"M8 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM15 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0z"}),s.jsx("path",{d:"M3 4a1 1 0 00-1 1v10a1 1 0 001 1h1.05a2.5 2.5 0 014.9 0H10a1 1 0 001-1V5a1 1 0 00-1-1H3zM14 7a1 1 0 00-1 1v6.05A2.5 2.5 0 0115.95 10H17a1 1 0 001-1v-3a1 1 0 00-1-1h-3z"})]}),s.jsx("span",{className:"text-sm text-text truncate",children:M.name})]}),s.jsx("button",{onClick:$=>{$.stopPropagation(),U(D)},className:"ml-2 text-danger hover:text-danger-dark shrink-0",type:"button",children:"✕"})]},D))})]}),i&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:i})]})},Kt=({text:e,className:t="",variant:r="default",visible:o=!0,...l})=>{if(!o)return null;const a={default:"bg-gray-200 text-gray-800",primary:"bg-primary text-white",secondary:"bg-secondary text-white",secondaryDark:"bg-secondary-dark text-white",danger:"bg-danger text-white",warning:"bg-warning text-white"},i="inline-flex items-center px-3 py-1 rounded-full text-xs font-bold uppercase shadow-md",n=a[r]||a.default;return s.jsx("div",{className:`${i} ${n} ${t}`,...l,children:e})};function qt({isOpen:e,onClose:t,title:r,children:o,size:l="md",className:a="",overlayClassName:i="",showCloseButton:n=!0,closeOnOverlayClick:c=!0,closeOnEscape:d=!0}){if(k.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]),k.useEffect(()=>{if(!d||!e)return;const y=m=>{m.key==="Escape"&&t()};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[e,t,d]),!e)return null;const g={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl"},h=()=>{c&&t()},x=s.jsx("div",{className:u("fixed inset-0 bg-black/40 flex items-center justify-center z-9999 p-4",i),onClick:h,role:"dialog","aria-modal":"true","aria-labelledby":r?"modal-title":void 0,children:s.jsxs("div",{className:u("relative bg-white rounded-xl shadow-2xl max-h-[90vh] flex flex-col w-full transition-all duration-300",g[l],a),onClick:y=>y.stopPropagation(),children:[(r||n)&&s.jsxs("div",{className:"flex justify-between items-center px-6 py-5 border-b border-border rounded-t-xl shrink-0",children:[r&&s.jsx("h2",{id:"modal-title",className:"text-xl sm:text-2xl font-bold text-primary m-0",children:r}),n&&s.jsx("button",{className:"flex items-center justify-center w-8 h-8 text-text-muted hover:text-text hover:bg-background-light transition-colors duration-200 rounded-lg",onClick:t,"aria-label":"Cerrar modal",type:"button",children:s.jsx("span",{className:"text-2xl font-light leading-none",children:"×"})})]}),s.jsx("div",{className:"p-6 overflow-y-auto flex-1",children:o})]})});return Ie.createPortal(x,document.body)}function Zt({id:e,name:t,checked:r=!1,onChange:o,disabled:l=!1,required:a=!1,colorScheme:i="secondary",variant:n="solid",label:c,className:d="",...g}){const h=(x,y)=>{const m="checkbox-input size-4 shrink-0 rounded transition-all duration-300 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-opacity-50 disabled:cursor-not-allowed disabled:opacity-50";if(x==="outline")switch(y){case"primary":return`${m} checkbox-outline checkbox-primary`;case"secondary":default:return`${m} checkbox-outline checkbox-secondary`}else switch(y){case"primary":return`${m} checkbox-solid checkbox-primary`;case"secondary":default:return`${m} checkbox-solid checkbox-secondary`}};return c?s.jsxs("div",{className:`flex items-center gap-2 ${d}`,children:[s.jsx("input",{id:e,name:t,type:"checkbox",checked:r,onChange:o,disabled:l,required:a,className:h(n,i),...g}),s.jsxs("label",{htmlFor:e,className:"text-sm text-text cursor-pointer font-medium",children:[c,a&&s.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})]}):s.jsx("input",{id:e,name:t,type:"checkbox",checked:r,onChange:o,disabled:l,required:a,className:`${h(n,i)} ${d}`,style:{accentColor:"white"},...g})}const{Input:Xt,InputArea:Qt}=Ce,{Toggle:er}=kt;exports.Badge=Kt;exports.Button=Y;exports.Calendar=Ht;exports.Checkbox=Zt;exports.Dropdown=Yt;exports.EN_DEFAULT_DAY_NAMES=ze;exports.EN_DEFAULT_MONTH_NAMES=Ae;exports.ES_DEFAULT_DAY_NAMES=De;exports.ES_DEFAULT_MONTH_NAMES=Pe;exports.ExpandableCard=Rt;exports.FileDropZone=Jt;exports.Input=Xt;exports.InputArea=Qt;exports.Loader=Ne;exports.Login=jt;exports.Modal=qt;exports.Pagination=_t;exports.SearchInput=Tt;exports.TabPanel=Vt;exports.Table=Ut;exports.Tabs=Bt;exports.ThemeProvider=ft;exports.Toggle=er;exports.cn=u;exports.defaultTheme=T;exports.generateColorVariants=te;exports.hexToHsl=ke;exports.hslToHex=le;exports.useDebounce=Ee;exports.useIsMobile=Pt;exports.useTheme=gt;exports.useToast=At;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),w=require("react"),Te=require("react-loader-spinner"),Ie=require("react-dom"),X=require("react-toastify");function fe(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=fe(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function Oe(){for(var e,t,r=0,o="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=fe(e))&&(o&&(o+=" "),o+=t);return o}const ie="-",_e=e=>{const t=$e(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{const n=i.split(ie);return n[0]===""&&n.length!==1&&n.shift(),he(n,t)||Fe(i)},getConflictingClassGroupIds:(i,n)=>{const c=r[i]||[];return n&&o[i]?[...c,...o[i]]:c}}},he=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),a=o?he(e.slice(1),o):void 0;if(a)return a;if(t.validators.length===0)return;const l=e.join(ie);return t.validators.find(({validator:i})=>i(l))?.classGroupId},ce=/^\[(.+)\]$/,Fe=e=>{if(ce.test(e)){const t=ce.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},$e=e=>{const{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return Ve(Object.entries(e.classGroups),r).forEach(([l,i])=>{ae(i,o,l,t)}),o},ae=(e,t,r,o)=>{e.forEach(a=>{if(typeof a=="string"){const l=a===""?t:de(t,a);l.classGroupId=r;return}if(typeof a=="function"){if(Re(a)){ae(a(o),t,r,o);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([l,i])=>{ae(i,de(t,l),r,o)})})},de=(e,t)=>{let r=e;return t.split(ie).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},Re=e=>e.isThemeGetter,Ve=(e,t)=>t?e.map(([r,o])=>{const a=o.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([i,n])=>[t+i,n])):l);return[r,a]}):e,Be=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const a=(l,i)=>{r.set(l,i),t++,t>e&&(t=0,o=r,r=new Map)};return{get(l){let i=r.get(l);if(i!==void 0)return i;if((i=o.get(l))!==void 0)return a(l,i),i},set(l,i){r.has(l)?r.set(l,i):a(l,i)}}},xe="!",Ge=e=>{const{separator:t,experimentalParseClassName:r}=e,o=t.length===1,a=t[0],l=t.length,i=n=>{const c=[];let u=0,m=0,k;for(let p=0;p<n.length;p++){let v=n[p];if(u===0){if(v===a&&(o||n.slice(p,p+l)===t)){c.push(n.slice(m,p)),m=p+l;continue}if(v==="/"){k=p;continue}}v==="["?u++:v==="]"&&u--}const f=c.length===0?n:n.substring(m),y=f.startsWith(xe),b=y?f.substring(1):f,x=k&&k>m?k-m:void 0;return{modifiers:c,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:x}};return r?n=>r({className:n,parseClassName:i}):i},We=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(o=>{o[0]==="["?(t.push(...r.sort(),o),r=[]):r.push(o)}),t.push(...r.sort()),t},He=e=>({cache:Be(e.cacheSize),parseClassName:Ge(e),..._e(e)}),Ue=/\s+/,Ye=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:a}=t,l=[],i=e.trim().split(Ue);let n="";for(let c=i.length-1;c>=0;c-=1){const u=i[c],{modifiers:m,hasImportantModifier:k,baseClassName:f,maybePostfixModifierPosition:y}=r(u);let b=!!y,x=o(b?f.substring(0,y):f);if(!x){if(!b){n=u+(n.length>0?" "+n:n);continue}if(x=o(f),!x){n=u+(n.length>0?" "+n:n);continue}b=!1}const p=We(m).join(":"),v=k?p+xe:p,h=v+x;if(l.includes(h))continue;l.push(h);const S=a(x,b);for(let z=0;z<S.length;++z){const M=S[z];l.push(v+M)}n=u+(n.length>0?" "+n:n)}return n};function Je(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=ye(t))&&(o&&(o+=" "),o+=r);return o}const ye=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=ye(e[o]))&&(r&&(r+=" "),r+=t);return r};function Ke(e,...t){let r,o,a,l=i;function i(c){const u=t.reduce((m,k)=>k(m),e());return r=He(u),o=r.cache.get,a=r.cache.set,l=n,n(c)}function n(c){const u=o(c);if(u)return u;const m=Ye(c,r);return a(c,m),m}return function(){return l(Je.apply(null,arguments))}}const P=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},ve=/^\[(?:([a-z-]+):)?(.+)\]$/i,qe=/^\d+\/\d+$/,Ze=new Set(["px","full","screen"]),Xe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qe=/\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$/,et=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,tt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>q(e)||Ze.has(e)||qe.test(e),G=e=>Z(e,"length",dt),q=e=>!!e&&!Number.isNaN(Number(e)),se=e=>Z(e,"number",q),Q=e=>!!e&&Number.isInteger(Number(e)),ot=e=>e.endsWith("%")&&q(e.slice(0,-1)),C=e=>ve.test(e),W=e=>Xe.test(e),st=new Set(["length","size","percentage"]),nt=e=>Z(e,st,we),at=e=>Z(e,"position",we),lt=new Set(["image","url"]),it=e=>Z(e,lt,pt),ct=e=>Z(e,"",ut),ee=()=>!0,Z=(e,t,r)=>{const o=ve.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):r(o[2]):!1},dt=e=>Qe.test(e)&&!et.test(e),we=()=>!1,ut=e=>tt.test(e),pt=e=>rt.test(e),mt=()=>{const e=P("colors"),t=P("spacing"),r=P("blur"),o=P("brightness"),a=P("borderColor"),l=P("borderRadius"),i=P("borderSpacing"),n=P("borderWidth"),c=P("contrast"),u=P("grayscale"),m=P("hueRotate"),k=P("invert"),f=P("gap"),y=P("gradientColorStops"),b=P("gradientColorStopPositions"),x=P("inset"),p=P("margin"),v=P("opacity"),h=P("padding"),S=P("saturate"),z=P("scale"),M=P("sepia"),D=P("skew"),g=P("space"),T=P("translate"),_=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",C,t],L=()=>[C,t],N=()=>["",B,G],A=()=>["auto",q,C],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>["start","end","center","between","around","evenly","stretch"],E=()=>["","0",C],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[q,C];return{cacheSize:500,separator:":",theme:{colors:[ee],spacing:[B,G],blur:["none","",W,C],brightness:$(),borderColor:[e],borderRadius:["none","","full",W,C],borderSpacing:L(),borderWidth:N(),contrast:$(),grayscale:E(),hueRotate:$(),invert:E(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[ot,G],inset:U(),margin:U(),opacity:$(),padding:L(),saturate:$(),scale:$(),sepia:E(),skew:$(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",C]}],container:["container"],columns:[{columns:[W]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...R(),C]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Q,C]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",C]}],grow:[{grow:E()}],shrink:[{shrink:E()}],order:[{order:["first","last","none",Q,C]}],"grid-cols":[{"grid-cols":[ee]}],"col-start-end":[{col:["auto",{span:["full",Q,C]},C]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[ee]}],"row-start-end":[{row:["auto",{span:[Q,C]},C]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",C]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",C]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[g]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[g]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",C,t]}],"min-w":[{"min-w":[C,t,"min","max","fit"]}],"max-w":[{"max-w":[C,t,"none","full","min","max","fit","prose",{screen:[W]},W]}],h:[{h:[C,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[C,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[C,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[C,t,"auto","min","max","fit"]}],"font-size":[{text:["base",W,G]}],"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:[ee]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",C]}],"line-clamp":[{"line-clamp":["none",q,se]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",B,C]}],"list-image":[{"list-image":["none",C]}],"list-style-type":[{list:["none","disc","decimal",C]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",B,G]}],"underline-offset":[{"underline-offset":["auto",B,C]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",C]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",C]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),at]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",nt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},it]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-b":[{"border-b":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:O()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[B,C]}],"outline-w":[{outline:[B,G]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[B,G]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",W,ct]}],"shadow-color":[{shadow:[ee]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",W,C]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[k]}],saturate:[{saturate:[S]}],sepia:[{sepia:[M]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[k]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[M]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",C]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",C]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",C]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[Q,C]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"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",C]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",C]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",C]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[B,G,se]}],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-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-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"]}}},bt=Ke(mt);function d(...e){return bt(Oe(e))}function ke(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,o=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,o),l=Math.min(t,r,o);let i=0,n=0;const c=(a+l)/2;if(a!==l){const u=a-l;switch(n=c>.5?u/(2-a-l):u/(a+l),a){case t:i=((r-o)/u+(r<o?6:0))/6;break;case r:i=((o-t)/u+2)/6;break;case o:i=((t-r)/u+4)/6;break}}return[i*360,n*100,c*100]}function le(e,t,r){r/=100;const o=t*Math.min(r,1-r)/100,a=l=>{const i=(l+e/30)%12,n=r-o*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*n).toString(16).padStart(2,"0")};return`#${a(0)}${a(8)}${a(4)}`}function te(e){const[t,r,o]=ke(e);return{base:e,light:le(t,Math.max(0,r-10),Math.min(100,o+15)),dark:le(t,Math.min(100,r+10),Math.max(0,o-15))}}const I={colors:{primary:"#6366f1",primaryLight:"#818cf8",primaryDark:"#4f46e5",secondary:"#8b5cf6",secondaryLight:"#a78bfa",secondaryDark:"#7c3aed",danger:"#ef4444",dangerLight:"#f87171",dangerDark:"#dc2626",text:"#1f2937",textMuted:"#6b7280",textLight:"#9ca3af",border:"#e5e7eb",borderDark:"#d1d5db",background:"#ffffff",backgroundDark:"#f9fafb",backgroundLight:"#f3f4f6",disabled:"#e5e7eb",light:"#f9fafb",active:"#4338ca"}},je=w.createContext(I);function gt(){return w.useContext(je)}function ue(e){const t=document.documentElement;t.style.setProperty("--componentables-primary",e.colors.primary),t.style.setProperty("--componentables-primary-light",e.colors.primaryLight),t.style.setProperty("--componentables-primary-dark",e.colors.primaryDark),t.style.setProperty("--componentables-secondary",e.colors.secondary),t.style.setProperty("--componentables-secondary-light",e.colors.secondaryLight),t.style.setProperty("--componentables-secondary-dark",e.colors.secondaryDark),t.style.setProperty("--componentables-danger",e.colors.danger),t.style.setProperty("--componentables-danger-light",e.colors.dangerLight),t.style.setProperty("--componentables-danger-dark",e.colors.dangerDark),t.style.setProperty("--componentables-text",e.colors.text),t.style.setProperty("--componentables-text-muted",e.colors.textMuted),t.style.setProperty("--componentables-text-light",e.colors.textLight),t.style.setProperty("--componentables-border",e.colors.border),t.style.setProperty("--componentables-border-dark",e.colors.borderDark),t.style.setProperty("--componentables-background",e.colors.background),t.style.setProperty("--componentables-background-dark",e.colors.backgroundDark),t.style.setProperty("--componentables-background-light",e.colors.backgroundLight),t.style.setProperty("--componentables-disabled",e.colors.disabled),t.style.setProperty("--componentables-light",e.colors.light),t.style.setProperty("--componentables-active",e.colors.active)}function ft({children:e,theme:t}){const r=w.useMemo(()=>{const o=t?.colors||{},a=o.primary?te(o.primary):null,l=o.secondary?te(o.secondary):null,i=o.danger?te(o.danger):null;return{colors:{primary:o.primary||I.colors.primary,primaryLight:a?.light||I.colors.primaryLight,primaryDark:a?.dark||I.colors.primaryDark,secondary:o.secondary||I.colors.secondary,secondaryLight:l?.light||I.colors.secondaryLight,secondaryDark:l?.dark||I.colors.secondaryDark,danger:o.danger||I.colors.danger,dangerLight:i?.light||I.colors.dangerLight,dangerDark:i?.dark||I.colors.dangerDark,text:o.text||I.colors.text,textMuted:o.textMuted||I.colors.textMuted,textLight:o.textLight||I.colors.textLight,border:o.border||I.colors.border,borderDark:o.borderDark||I.colors.borderDark,background:o.background||I.colors.background,backgroundDark:o.backgroundDark||I.colors.backgroundDark,backgroundLight:o.backgroundLight||I.colors.backgroundLight,disabled:o.disabled||I.colors.disabled,light:o.light||I.colors.light,active:o.active||I.colors.active}}},[t]);return typeof window<"u"&&ue(r),w.useEffect(()=>{ue(r)},[r]),w.createElement(je.Provider,{value:r},e)}const ht={primary:"bg-primary text-white border-primary hover:bg-primary-dark hover:border-primary-dark active:bg-active",secondary:"bg-secondary text-white border-secondary hover:bg-secondary-dark hover:border-secondary-dark",outline:"bg-transparent text-primary border-primary hover:bg-primary hover:text-white",ghost:"bg-transparent text-primary border-transparent hover:bg-primary hover:text-white hover:border-primary",light:"bg-light text-text border-border hover:bg-background-light",danger:"bg-transparent text-danger border-danger hover:text-white hover:bg-danger hover:border-danger active:bg-danger-dark",link:"bg-transparent text-secondary-light! underline hover:text-primary! border-0"},xt={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",xl:"px-8 py-4 text-xl"};function Y({children:e,onClick:t,disabled:r=!1,type:o="button",variant:a="primary",size:l="md",fullWidth:i=!1,loading:n=!1,className:c="",...u}){return s.jsxs("button",{type:o,onClick:r||n?void 0:t,disabled:r||n,className:d("inline-flex shadow-md hover:shadow-lg cursor-pointer items-center justify-center font-medium rounded-lg border transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-opacity-50",r||n?"bg-disabled text-text-muted border-disabled cursor-not-allowed hover:bg-disabled hover:border-disabled hover:text-text-muted":ht[a],xt[l],i&&"w-full",n&&"cursor-wait opacity-75",c),...u,children:[n&&s.jsxs("svg",{className:"w-4 h-4 mr-2 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e]})}function yt({id:e,name:t,type:r="text",value:o,onChange:a,placeholder:l,label:i,error:n,disabled:c=!1,required:u=!1,colorScheme:m="secondary",className:k="",...f}){const y=()=>{const x="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed placeholder:text-text-muted";if(n)return d(x,"border-danger focus:border-danger focus:shadow-danger-light");switch(m){case"primary":return d(x,"text-primary border-primary focus:border-primary");case"secondary":default:return d(x,"text-secondary border-secondary focus:border-secondary")}},b=()=>m==="primary"?"text-primary":"text-secondary";return s.jsxs("div",{className:d("mb-6",k),children:[i&&s.jsxs("label",{htmlFor:e,className:d("block mb-2 text-sm font-medium",b()),children:[i,u&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsx("input",{id:e,name:t,type:r,value:o,onChange:a,placeholder:l,disabled:c,required:u,className:y(),...f}),n&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:n})]})}function vt({id:e,name:t,value:r,onChange:o,placeholder:a,label:l,error:i,disabled:n=!1,required:c=!1,colorScheme:u="secondary",className:m="",rows:k=4,...f}){const y=()=>{const x="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed placeholder:text-text-muted resize-none";if(i)return d(x,"border-danger focus:border-danger focus:shadow-danger-light");switch(u){case"primary":return d(x,"text-primary border-primary focus:border-primary");case"secondary":default:return d(x,"text-secondary border-secondary focus:border-secondary")}},b=()=>u==="primary"?"text-primary":"text-secondary";return s.jsxs("div",{className:d("mb-6",m),children:[l&&s.jsxs("label",{htmlFor:e,className:d("block mb-2 text-sm font-medium",b()),children:[l,c&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsx("textarea",{id:e,name:t,value:r,onChange:o,placeholder:a,disabled:n,required:c,rows:k,className:y(),...f}),i&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:i})]})}const Ce={Input:yt,InputArea:vt};function wt({id:e,name:t,checked:r=!1,onChange:o,disabled:a=!1,label:l,colorScheme:i="secondary",size:n="md",className:c="",...u}){const[m,k]=w.useState(r),f=h=>{const S=h.target.checked;k(S),o?.(S)},y=()=>({primary:{bg:"bg-primary",border:"border-primary",text:"text-primary"},secondary:{bg:"bg-secondary",border:"border-secondary",text:"text-secondary"}})[i],b=()=>{switch(n){case"sm":return"w-10 h-6";case"lg":return"w-16 h-8";case"md":default:return"w-13 h-7"}},x=()=>{switch(n){case"sm":return"w-5 h-5";case"lg":return"w-7 h-7";case"md":default:return"w-6 h-6"}},p=()=>{if(!m)return"translate-x-0";switch(n){case"sm":return"translate-x-5";case"lg":return"translate-x-8";case"md":default:return"translate-x-6"}},v=y();return s.jsxs("div",{className:d("flex items-center gap-3",c),children:[s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:"checkbox",id:e,name:t,checked:m,onChange:f,disabled:a,className:"sr-only",...u}),s.jsx("label",{htmlFor:e,className:d("block cursor-pointer transition-all duration-300 rounded-full border-2",b(),m?d(v.bg,v.border):"bg-gray-200 border-gray-300",a?"opacity-50 cursor-not-allowed":"hover:shadow-md"),children:s.jsx("span",{className:d("absolute top-0.5 left-0.5 inline-block rounded-full bg-white transition-all duration-300 shadow-sm",x(),p())})})]}),l&&s.jsx("label",{htmlFor:e,className:d("text-sm font-medium cursor-pointer select-none",v.text,a&&"opacity-50 cursor-not-allowed"),children:l})]})}const kt={Toggle:wt},Ne=({size:e=40,wrapperStyle:t={},wrapperClass:r="",ariaLabel:o="Cargando...",label:a="Cargando...",visible:l=!0,direction:i="column"})=>{const n={display:"flex",flexDirection:i,justifyContent:"center",alignItems:"center",minHeight:"100px",...t};return s.jsxs("div",{style:n,className:r,children:[s.jsx("label",{children:a}),s.jsx(Te.Oval,{visible:l,height:e,width:e,ariaLabel:o,wrapperStyle:{},wrapperClass:"",secondaryColor:"#cdae90",color:"#cdae90"})]})},{Input:ne}=Ce,jt=({title:e="Iniciar Sesión",showForgotPassword:t=!0,onlyForgotPassword:r=!1,className:o="",onLogin:a,onForgotPassword:l})=>{const[i,n]=w.useState({email:"",password:""}),[c,u]=w.useState({}),[m,k]=w.useState(!1),[f,y]=w.useState(r?"forgot":"login"),b=(D,g)=>{switch(D){case"email":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(g)?"":"Por favor ingresa un email válido";case"password":return g.length>=6?"":"La contraseña debe tener al menos 6 caracteres";default:return""}},x=D=>{const{name:g,value:T}=D.target;n(_=>({..._,[g]:T})),c[g]&&u(_=>({..._,[g]:""}))},p=()=>{const D={},g=b("email",i.email);if(g&&(D.email=g),f==="login"){const T=b("password",i.password);T&&(D.password=T)}return u(D),Object.keys(D).length===0},v=async D=>{if(D.preventDefault(),!!p()){k(!0);try{switch(f){case"login":a&&await a({email:i.email,password:i.password});break;case"forgot":l&&await l(i.email);break}}catch(g){console.error("Login error:",g)}finally{k(!1)}}},h=D=>{y(D),u({}),n({email:i.email,password:""})},S=()=>{switch(f){case"forgot":return s.jsx(ne,{id:"email",type:"email",name:"email",placeholder:"Ingresa tu email",label:"Email",value:i.email,onChange:x,error:c.email,disabled:m,colorScheme:"secondary"});default:return s.jsxs(s.Fragment,{children:[s.jsx(ne,{id:"email",type:"email",name:"email",placeholder:"Ingresa tu email",label:"Email",value:i.email,onChange:x,error:c.email,disabled:m,colorScheme:"secondary"}),s.jsx(ne,{id:"password",type:"password",name:"password",placeholder:"Ingresa tu contraseña",label:"Contraseña",value:i.password,onChange:x,error:c.password,disabled:m,colorScheme:"secondary"})]})}},z=()=>{switch(f){case"forgot":return"Recuperar Contraseña";default:return e}},M=()=>{if(m)return s.jsx(Ne,{size:20,wrapperStyle:{minHeight:"auto"}});switch(f){case"forgot":return"Enviar Enlace";default:return"Entrar"}};return s.jsx("div",{className:`flex justify-center items-center min-h-[90vh] p-6 bg-background sm:p-4 ${o||""}`,children:s.jsxs("div",{className:"w-full max-w-100 p-12 bg-white rounded-2xl shadow-lg animate-[fadeIn_0.3s_ease-out] sm:p-8",children:[s.jsx("h2",{className:"text-center mb-12 text-3xl font-semibold text-primary sm:text-2xl sm:mb-8",children:z()}),s.jsx("div",{className:"space-y-4 mb-6",children:S()}),s.jsx("form",{onSubmit:v,children:s.jsx(Y,{type:"submit",disabled:m,loading:m,fullWidth:!0,variant:"primary",size:"lg",className:"mb-6",children:!m&&M()})}),f==="login"&&t&&s.jsx(Y,{type:"button",onClick:()=>h("forgot"),variant:"link",size:"sm",fullWidth:!0,className:"shadow-none! !hover:shadow-none",children:"¿Olvidaste tu contraseña?"}),f==="forgot"&&s.jsx(Y,{type:"button",onClick:()=>h("login"),variant:"link",size:"sm",fullWidth:!0,className:"shadow-none! !hover:shadow-none",children:"Volver al inicio de sesión"})]})})};var Me={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},pe=w.createContext&&w.createContext(Me),Ct=["attr","size","title"];function Nt(e,t){if(e==null)return{};var r=Mt(e,t),o,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)o=l[a],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function Mt(e,t){if(e==null)return{};var r={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;r[o]=e[o]}return r}function re(){return re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},re.apply(this,arguments)}function me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,o)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?me(Object(r),!0).forEach(function(o){St(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):me(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function St(e,t,r){return t=Et(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Et(e){var t=Lt(e,"string");return typeof t=="symbol"?t:t+""}function Lt(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Se(e){return e&&e.map((t,r)=>w.createElement(t.tag,oe({key:r},t.attr),Se(t.child)))}function H(e){return t=>w.createElement(zt,re({attr:oe({},e.attr)},t),Se(e.child))}function zt(e){var t=r=>{var{attr:o,size:a,title:l}=e,i=Nt(e,Ct),n=a||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),w.createElement("svg",re({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,o,i,{className:c,style:oe(oe({color:e.color||r.color},r.style),e.style),height:n,width:n,xmlns:"http://www.w3.org/2000/svg"}),l&&w.createElement("title",null,l),e.children)};return pe!==void 0?w.createElement(pe.Consumer,null,r=>t(r)):t(Me)}function Dt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"line",attr:{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},child:[]}]})(e)}const Ee=(e,t=500)=>{const[r,o]=w.useState(e);return w.useEffect(()=>{const a=setTimeout(()=>{o(e)},t);return()=>clearTimeout(a)},[e,t]),r},At=()=>({showToast:(t,r)=>{const o={position:"bottom-right",autoClose:2e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!1,progress:void 0};switch(t){case"success":X.toast.success(r,o);break;case"error":X.toast.error(r,o);break;case"warning":X.toast.warning(r,o);break;case"info":X.toast.info(r,o);break;default:X.toast(r,o);break}}});function Pt(e=768){const[t,r]=w.useState(()=>typeof window>"u"?!1:window.innerWidth<e);return w.useEffect(()=>{if(typeof window>"u")return;const o=()=>{r(window.innerWidth<e)};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[e]),t}function Tt({value:e,onChange:t,placeholder:r="Search...",disabled:o=!1,colorScheme:a="secondary",label:l,className:i="",debounceDelay:n=500,...c}){const[u,m]=w.useState(e||""),k=Ee(u,n),f=w.useCallback(t,[t]);w.useEffect(()=>{f(k)},[k,f]);const y=()=>{const p="w-full px-4 py-4 pl-10 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed placeholder:text-text-muted";switch(a){case"primary":return d(p,"text-primary border-primary focus:border-primary");case"secondary":default:return d(p,"text-secondary border-secondary focus:border-secondary")}},b=()=>a==="primary"?"text-primary":"text-secondary",x=()=>a==="primary"?"text-primary":"text-secondary";return s.jsxs("div",{className:d("mb-0",i),children:[l&&s.jsx("label",{className:d("block mb-2 text-sm font-medium",x()),children:l}),s.jsxs("div",{className:"relative w-full",children:[s.jsx(Dt,{className:d("absolute left-3 top-1/2 -translate-y-1/2 text-base pointer-events-none",b())}),s.jsx("input",{type:"text",value:u,onChange:p=>m(p.target.value),placeholder:r,disabled:o,className:y(),...c})]})]})}function It(e){return H({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(e)}function Ot(e){return H({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"},child:[]}]})(e)}function _t({labelPage:e="Page",labelOf:t="of",setPagination:r,totalPages:o,currentPage:a,showLabel:l=!0,className:i="",isLoading:n=!1,fetchPage:c}){const u=parseInt(String(a))===1||parseInt(String(o))===0||n,m=parseInt(String(a))===parseInt(String(o))||parseInt(String(o))===0||n,k=()=>{n||(c?c(a-1):r&&r(y=>({...y,page:y.page-1})))},f=()=>{n||(c?c(a+1):r&&r(y=>({...y,page:y.page+1})))};return s.jsxs("div",{className:d("flex justify-center items-center mt-8",i),children:[s.jsx(Y,{disabled:u,onClick:k,variant:"secondary",children:s.jsx(It,{size:14})}),s.jsx("h5",{className:"font-bold mx-2.5 text-text",children:`${l?e:""} ${a}${l?` ${t} `:" / "}${o}`}),s.jsx(Y,{disabled:m,onClick:f,variant:"primary",children:s.jsx(Ot,{size:14})})]})}function Le(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m112 184 144 144 144-144"},child:[]}]})(e)}function Ft(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34z"},child:[]}]})(e)}function $t(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M456.69 421.39 362.6 327.3a173.81 173.81 0 0 0 34.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 0 0 327.3 362.6l94.09 94.09a25 25 0 0 0 35.3-35.3zM97.92 222.72a124.8 124.8 0 1 1 124.8 124.8 124.95 124.95 0 0 1-124.8-124.8z"},child:[]}]})(e)}function Rt({title:e,subtitle:t,children:r,defaultExpanded:o=!1,expanded:a,onToggle:l,className:i="",colorScheme:n="primary",icon:c,disabled:u=!1,headerExtra:m}){const[k,f]=w.useState(o),y=a!==void 0?a:k,b=()=>{if(u)return;const h=!y;a===void 0&&f(h),l?.(h)},x=()=>n==="primary"?"border-primary":"border-secondary",p=()=>n==="primary"?"text-primary":"text-secondary",v=()=>n==="primary"?"hover:bg-primary/5":"hover:bg-secondary/5";return s.jsxs("div",{className:d("w-full rounded-lg border-2 bg-background transition-all duration-300",x(),y&&"shadow-lg",i),children:[s.jsxs("button",{type:"button",onClick:b,disabled:u,className:d("w-full flex cursor-pointer items-center justify-between p-4 text-left transition-all duration-300 rounded-lg",!u&&v(),u&&"opacity-50"),"aria-expanded":y,children:[s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[c&&s.jsx("div",{className:d("shrink-0",p()),children:c}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:d("text-base font-medium truncate",p()),children:e}),t&&s.jsx("p",{className:"text-sm text-text-muted truncate mt-0.5",children:t})]})]}),s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[m&&s.jsx("div",{onClick:h=>h.stopPropagation(),children:m}),s.jsx("div",{className:d("h-5 w-5 transition-transform duration-300",p(),y&&"rotate-180"),children:s.jsx(Le,{className:"h-5 w-5"})})]})]}),s.jsx("div",{className:d("overflow-hidden transition-all duration-300 ease-in-out",y?"max-h-500 opacity-100":"max-h-0 opacity-0"),children:s.jsx("div",{className:d("p-4 pt-0 border-t-0",x()),children:s.jsx("div",{className:"border-t border-border pt-4",children:r})})})]})}function Vt({children:e,className:t=""}){return s.jsx("div",{className:d("py-4",t),children:e})}function Bt({options:e,value:t,onChange:r,children:o,className:a="",colorScheme:l="primary",variant:i="underline"}){const[n,c]=w.useState(t??e[0]?.value??""),u=t!==void 0?t:n,m=b=>{t===void 0&&c(b),r?.(b)},k=(b,x)=>{const p=u===b,v="px-4 py-3 cursor-pointer text-sm font-medium transition-all duration-300 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed";if(x)return d(v,"text-text-muted");switch(i){case"filled":return d(v,"rounded-lg",p?l==="primary"?"bg-primary text-white":"bg-secondary text-white":"text-text-muted hover:bg-background-light");case"pills":return d(v,"rounded-full",p?l==="primary"?"bg-primary/10 text-primary border-2 border-primary":"bg-secondary/10 text-secondary border-2 border-secondary":"text-text-muted hover:bg-background-light border-2 border-transparent");case"underline":default:return d(v,"border-b-2",p?l==="primary"?"border-primary text-primary":"border-secondary text-secondary":"border-transparent text-text-muted hover:text-text hover:border-border")}},f=()=>{switch(i){case"filled":return"flex gap-1 p-1 bg-background-light rounded-lg";case"pills":return"flex gap-2 flex-wrap";case"underline":default:return"flex border-b-2 border-border"}},y=w.Children.toArray(o).find(b=>w.isValidElement(b)?b.props.value===u:!1);return s.jsxs("div",{className:d("w-full",a),children:[s.jsx("div",{className:f(),role:"tablist",children:e.map(b=>s.jsx("button",{type:"button",role:"tab","aria-selected":u===b.value,"aria-controls":`tabpanel-${b.value}`,disabled:b.disabled,onClick:()=>!b.disabled&&m(b.value),className:k(b.value,b.disabled),children:b.label},b.value))}),s.jsx("div",{role:"tabpanel",id:`tabpanel-${u}`,children:y})]})}function be(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"},child:[]}]})(e)}function ge(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"},child:[]}]})(e)}const ze=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],De=["Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],Ae=["January","February","March","April","May","June","July","August","September","October","November","December"],Pe=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];function Gt(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function Wt(e){const t=new Date(e.getFullYear(),e.getMonth(),1).getDay();return t===0?6:t-1}function Ht({value:e,onChange:t,disabled:r=!1,className:o="",colorScheme:a="secondary",lang:l="en",...i}){const[n,c]=w.useState(e||new Date),u={en:"en-US",es:"es-ES"},m={en:ze,es:De},k={en:Ae,es:Pe},f=Gt(n),y=Wt(n),b=[];for(let g=0;g<y;g++)b.push(null);for(let g=1;g<=f;g++){const T=new Date(n.getFullYear(),n.getMonth(),g,12,0,0);b.push(T)}const x=()=>{c(new Date(n.getFullYear(),n.getMonth()-1,1,12,0,0))},p=()=>{c(new Date(n.getFullYear(),n.getMonth()+1,1,12,0,0))},v=()=>{c(new Date(n.getFullYear()-1,n.getMonth(),1,12,0,0))},h=()=>{c(new Date(n.getFullYear()+1,n.getMonth(),1,12,0,0))},S=g=>{if(g&&!r){const T=new Date(g.getFullYear(),g.getMonth(),g.getDate(),12,0,0);c(T),t?.(T)}},M=(()=>{switch(a){case"primary":return{header:"text-primary",selected:"bg-primary text-white",hover:"hover:bg-primary/10",button:"text-primary border-primary hover:bg-primary/20"};case"secondary":default:return{header:"text-secondary",selected:"bg-secondary text-white",hover:"hover:bg-secondary/10",button:"text-secondary border-secondary hover:bg-secondary/20"}}})(),D=g=>g&&e?g.toDateString()===e.toDateString():!1;return s.jsxs("div",{className:d("w-full max-w-sm bg-background border-2 border-border rounded-lg p-6 shadow-md",o),...i,children:[s.jsxs("div",{className:"mb-6",children:[s.jsxs("div",{className:d("flex items-center justify-between mb-4",M.header),children:[s.jsx("button",{type:"button",onClick:v,disabled:r,className:d("p-2 rounded-lg border transition-all duration-300",M.button,r&&"opacity-50 cursor-not-allowed"),children:s.jsx(be,{size:18})}),s.jsx("h2",{className:"font-semibold text-lg",children:n.getFullYear()}),s.jsx("button",{type:"button",onClick:h,disabled:r,className:d("p-2 rounded-lg border transition-all duration-300",M.button,r&&"opacity-50 cursor-not-allowed"),children:s.jsx(ge,{size:18})})]}),s.jsxs("div",{className:d("flex items-center justify-between",M.header),children:[s.jsx("button",{type:"button",onClick:x,disabled:r,className:d("p-2 rounded-lg border transition-all duration-300",M.button,r&&"opacity-50 cursor-not-allowed"),children:s.jsx(be,{size:18})}),s.jsx("h2",{className:"font-semibold text-lg",children:k[l][n.getMonth()]}),s.jsx("button",{type:"button",onClick:p,disabled:r,className:d("p-2 rounded-lg border transition-all duration-300",M.button,r&&"opacity-50 cursor-not-allowed"),children:s.jsx(ge,{size:18})})]})]}),s.jsx("div",{className:"grid grid-cols-7 gap-2 mb-4",children:m[l].map(g=>s.jsx("div",{className:d("text-center text-sm font-medium py-2",M.header),children:g},g))}),s.jsx("div",{className:"grid grid-cols-7 gap-2",children:b.map((g,T)=>s.jsx("button",{type:"button",onClick:()=>S(g),disabled:!g||r,className:d("p-2 rounded-lg text-sm font-medium transition-all duration-300",g?d("cursor-pointer",M.hover,D(g)?M.selected:"text-text border border-transparent hover:border-border",r&&"opacity-50 cursor-not-allowed"):"cursor-default"),children:g?g.getDate():""},T))}),e&&s.jsx("div",{className:d("mt-6 p-3 rounded-lg bg-background-dark border border-border text-center text-sm font-medium",M.header),children:e.toLocaleDateString(u[l],{year:"numeric",month:"long",day:"numeric"})})]})}function Ut({headers:e,data:t,loading:r,loadingText:o="Loading...",actions:a,actionsHeader:l="Actions",onRowClick:i,className:n="",rowClassName:c="",cellClassName:u="",headerClassName:m="",emptyText:k="No data available",showCount:f=!0,countText:y=x=>`Showing ${x} record${x!==1?"s":""}`,keyExtractor:b=(x,p)=>x._id||x.id||p}){if(r)return s.jsx("div",{className:"flex justify-center items-center min-h-50",children:s.jsx("div",{className:"text-lg text-text-light",children:o})});if(t.length===0)return s.jsx("div",{className:"flex justify-center items-center min-h-50",children:s.jsx("div",{className:"text-lg text-text-muted",children:k})});const x=(p,v)=>{const h=v.toLowerCase().replace(/\s+/g,"_");let S=p[h];if(S===void 0){const z=[h.replace(/_/g,""),v.toLowerCase().replace(/\s+/g,""),h.replace(/_([a-z])/g,(M,D)=>D.toUpperCase())];for(const M of z)if(p[M]!==void 0){S=p[M];break}}if(S===void 0){const z=v.toLowerCase().split(" "),M=Object.keys(p).find(D=>z.some(g=>D.toLowerCase().includes(g)));M&&(S=p[M])}return S!=null?String(S):"N/A"};return s.jsxs("div",{className:d("overflow-x-auto",n),children:[s.jsxs("table",{className:"w-full border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b-2 border-border",children:[e.map((p,v)=>s.jsx("th",{className:d("text-left py-3 px-4 font-semibold text-text",m),children:p},v)),a&&s.jsx("th",{className:d("text-center py-3 px-4 font-semibold text-text",m),children:l})]})}),s.jsx("tbody",{children:t.map((p,v)=>s.jsxs("tr",{className:d("border-b border-border-dark hover:bg-background-light transition-colors",i&&"cursor-pointer",c),onClick:()=>i?.(p),children:[e.map((h,S)=>s.jsx("td",{className:d("py-4 px-4",u),children:s.jsx("div",{className:"text-text-light",children:x(p,h)})},S)),a&&s.jsx("td",{className:d("py-4 px-4",u),children:s.jsx("div",{className:"flex gap-2 justify-center",children:a.map((h,S)=>{const z=M=>{M?.stopPropagation(),h.onClick?.(p)};if(h.component){const M=h.component;return s.jsxs(M,{onClick:z,className:h.className||"",...h.props||{},children:[h.icon&&s.jsx("span",{className:"inline-block",children:w.createElement(h.icon)}),h.label&&h.label]},S)}return s.jsxs(Y,{onClick:z,className:h.className||"",...h.props||{},children:[h.icon&&s.jsx("span",{className:"inline-block",children:w.createElement(h.icon)}),h.label&&h.label]},S)})})})]},b(p,v)))})]}),f&&t.length>0&&s.jsx("div",{className:"mt-6 text-center text-text-light text-sm",children:y(t.length)})]})}function Yt({label:e,options:t,value:r="",onChange:o,multiple:a=!1,className:l="",searchable:i=!1,onSearchInputCustom:n,placeholder:c="Select...",disabled:u=!1,error:m,required:k=!1,colorScheme:f="primary",noResultsText:y="No results found",searchPlaceholder:b="Search...",...x}){const[p,v]=w.useState(!1),[h,S]=w.useState(""),[z,M]=w.useState({top:0,left:0,openUpward:!1}),D=Array.isArray(r)?r:r?[r]:[],[g,T]=w.useState(D.map(j=>t.find(E=>E.value===j)).filter(Boolean)),_=w.useRef(null),V=w.useRef(null),U=()=>{const j="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none focus:ring-1 disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed";if(m)return d(j,"border-danger focus:border-danger");switch(f){case"primary":return d(j,"text-primary border-primary focus:border-primary");case"secondary":default:return d(j,"text-secondary border-secondary focus:border-secondary")}},L=()=>f==="primary"?"text-primary":"text-secondary";w.useEffect(()=>{const E=(Array.isArray(r)?r:r!==""&&r!==null&&r!==void 0?[r]:[]).map(F=>t.find($=>$.value===F)).filter(Boolean);T(E)},[r,t]),w.useEffect(()=>{p&&i&&V.current&&V.current.focus()},[p,i]);const N=w.useCallback(()=>{if(!_.current)return;const j=_.current.getBoundingClientRect(),E=window.innerHeight,F=250,K=E-j.bottom<F&&j.top>F;M({top:K?j.top:j.bottom,left:j.left,width:j.width,openUpward:K})},[]);w.useEffect(()=>{function j(F){_.current&&!_.current.contains(F.target)&&v(!1)}function E(){p&&N()}return document.addEventListener("mousedown",j),window.addEventListener("scroll",E,!0),window.addEventListener("resize",E),()=>{document.removeEventListener("mousedown",j),window.removeEventListener("scroll",E,!0),window.removeEventListener("resize",E)}},[p,N]);const A=j=>{const E=t.find($=>$.value===j);if(!E)return;let F;a?(F=g.some(K=>K.value===j)?g.filter(K=>K.value!==j):[...g,E],T(F),o(F)):(F=[E],T(F),o(E),v(!1),S(""))},R=j=>{S(j),n?.(j)},O=i?t.filter(j=>j.label.toLowerCase().includes(h.toLowerCase())):t,J=()=>g.length===0?c:a?g.length===1?g[0].label:`${g.length} selected`:g[0]?.label||c;return s.jsxs("div",{className:d("mb-6",l),children:[e&&s.jsxs("label",{className:d("block mb-2 text-sm font-medium",L()),children:[e,k&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsxs("div",{ref:_,className:"relative w-full",children:[s.jsxs("button",{type:"button",onClick:j=>{j.preventDefault(),j.stopPropagation(),p||N(),v(!p)},className:d(U(),"inline-flex items-center justify-between cursor-pointer h-auto min-h-14",u&&"cursor-not-allowed",p&&"ring-1"),disabled:u,...x,children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[g.length>0&&g[0].hex&&s.jsx("div",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:g[0].hex}}),s.jsx("span",{className:g.length>0?"":"text-text-muted",children:J()})]}),s.jsx("div",{className:d("h-5 w-5 transition-transform duration-200",p&&"rotate-180"),children:s.jsx(Le,{className:"h-5 w-5"})})]}),p&&s.jsxs("div",{className:d("fixed z-9999 rounded-lg border-2 bg-white shadow-xl",m?"border-danger":f==="primary"?"border-primary":"border-secondary"),style:{top:`${z.top+(z.openUpward?0:8)}px`,left:`${z.left}px`,width:`${z.width}px`,transform:z.openUpward?"translateY(-100%)":"none"},children:[i&&s.jsx("div",{className:"border-b border-border p-3",children:s.jsxs("div",{className:"relative",children:[s.jsx($t,{className:"absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 transform text-text-muted"}),s.jsx("input",{ref:V,type:"text",value:h,onChange:j=>R(j.target.value),placeholder:b,className:d("w-full rounded-lg border-2 py-2 pr-10 pl-10 text-sm transition-all duration-300 focus:outline-none focus:ring-1",f==="primary"?"border-primary text-primary":"border-secondary text-secondary")}),h&&s.jsx("button",{type:"button",onClick:()=>S(""),className:"absolute top-1/2 right-3 h-4 w-4 -translate-y-1/2 transform text-text-muted hover:text-text",children:s.jsx(Ft,{className:"h-4 w-4"})})]})}),s.jsxs("div",{className:"max-h-60 overflow-y-auto py-1",children:[O.map(j=>s.jsx("button",{type:"button",onClick:()=>A(j.value??""),className:d("w-full px-4 py-3 text-left text-sm transition-colors",g.some(E=>E.value===j.value)?f==="primary"?"bg-primary/10 text-primary font-medium":"bg-secondary/10 text-secondary font-medium":"text-text hover:bg-background-light"),children:s.jsxs("div",{className:"flex items-center gap-3",children:[a&&s.jsx("div",{className:d("flex h-4 w-4 items-center justify-center rounded border-2 transition-colors",g.some(E=>E.value===j.value)?f==="primary"?"border-primary bg-primary":"border-secondary bg-secondary":"border-border"),children:g.some(E=>E.value===j.value)&&s.jsx("svg",{className:"h-3 w-3 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})}),j.hex&&s.jsx("div",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:j.hex}}),s.jsx("span",{children:j.label})]})},j.value)),O.length===0&&h&&t.length>0&&s.jsx("div",{className:"px-4 py-3",children:s.jsx("span",{className:"text-sm text-text-muted",children:y})})]})]})]}),m&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:m})]})}const Jt=({id:e,name:t,onFilesSelected:r,placeholder:o="Arrastra y suelta archivos aquí o haz clic para seleccionar",labelSelectedFiles:a="archivo:",label:l,error:i,disabled:n=!1,required:c=!1,colorScheme:u="secondary",className:m="",accept:k="*/*",multiple:f=!1,...y})=>{const b=w.useRef(null),[x,p]=w.useState(!1),[v,h]=w.useState([]),S=()=>{const N="w-full p-4 border-2 rounded-lg text-base bg-white transition-all duration-300 focus:outline-none disabled:bg-light disabled:text-text-muted disabled:cursor-not-allowed cursor-pointer min-h-[120px]";if(i)return d(N,"border-danger focus:border-danger focus:ring-1 focus:ring-danger");switch(u){case"primary":return d(N,"border-primary focus:border-primary focus:ring-1 focus:ring-primary hover:border-primary-dark");case"secondary":default:return d(N,"border-secondary focus:border-secondary focus:ring-1 focus:ring-secondary hover:border-secondary-dark")}},z=()=>{switch(u){case"primary":return"text-primary";case"secondary":default:return"text-secondary"}},M=N=>{N.preventDefault(),N.stopPropagation(),n||(N.type==="dragenter"||N.type==="dragover"?p(!0):N.type==="dragleave"&&p(!1))},D=N=>{if(N.preventDefault(),N.stopPropagation(),p(!1),n)return;const A=N.dataTransfer.files;T(A)},g=N=>{const A=N.target.files;A&&T(A)},T=N=>{const A=Array.from(N);if(k!=="*/*"){const R=A.filter(O=>_(O,k));if(R.length===0){console.warn("No valid files selected");return}h(f?R:[R[0]]),r(f?R:[R[0]])}else h(f?A:[A[0]]),r(f?A:[A[0]])},_=(N,A)=>A.split(",").map(O=>O.trim()).some(O=>{if(O.startsWith("."))return N.name.toLowerCase().endsWith(O.toLowerCase());if(O.includes("/")){const[J,j]=O.split("/"),E=N.type.split("/")[0];return j==="*"?E===J:N.type===O}return!1}),V=()=>{n||b.current?.click()},U=N=>{const A=v.filter((R,O)=>O!==N);h(A),r(A)},L=N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),V())};return s.jsxs("div",{className:`mb-6 ${m}`,children:[l&&s.jsxs("label",{className:`block mb-2 text-sm font-medium ${z()}`,children:[l,c&&s.jsx("span",{className:"text-danger ml-1",children:"*"})]}),s.jsxs("div",{className:d(S(),x&&"bg-background-light border-2-dashed"),onDragEnter:M,onDragLeave:M,onDragOver:M,onDrop:D,onClick:V,onKeyDown:L,role:"button",tabIndex:n?-1:0,children:[s.jsx("input",{ref:b,id:e,name:t,type:"file",onChange:g,disabled:n,required:c,accept:k,multiple:f,className:"hidden",...y}),s.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[s.jsx("svg",{className:`w-8 h-8 mb-2 ${u==="primary"?"text-primary":"text-secondary"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),s.jsx("p",{className:`text-sm ${z()}`,children:o})]})]}),s.jsxs("div",{className:"mt-4 space-y-2",children:[s.jsxs("p",{className:`text-sm font-medium ${z()}`,children:[v.length," ",a,"(s) seleccionado(s):"]}),s.jsx("ul",{className:"space-y-1",children:v.map((N,A)=>s.jsxs("li",{className:"flex items-center justify-between p-2 bg-light rounded border border-border",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[s.jsxs("svg",{className:"w-4 h-4 text-text-muted shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:[s.jsx("path",{d:"M8 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM15 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0z"}),s.jsx("path",{d:"M3 4a1 1 0 00-1 1v10a1 1 0 001 1h1.05a2.5 2.5 0 014.9 0H10a1 1 0 001-1V5a1 1 0 00-1-1H3zM14 7a1 1 0 00-1 1v6.05A2.5 2.5 0 0115.95 10H17a1 1 0 001-1v-3a1 1 0 00-1-1h-3z"})]}),s.jsx("span",{className:"text-sm text-text truncate",children:N.name})]}),s.jsx("button",{onClick:R=>{R.stopPropagation(),U(A)},className:"ml-2 text-danger hover:text-danger-dark shrink-0",type:"button",children:"✕"})]},A))})]}),i&&s.jsx("span",{className:"block mt-1 text-xs text-danger font-medium",children:i})]})},Kt=({text:e,className:t="",variant:r="default",visible:o=!0,...a})=>{if(!o)return null;const l={default:"bg-gray-200 text-gray-800",primary:"bg-primary text-white",secondary:"bg-secondary text-white",secondaryDark:"bg-secondary-dark text-white",danger:"bg-danger text-white",warning:"bg-warning text-white"},i="inline-flex items-center px-3 py-1 rounded-full text-xs font-bold uppercase shadow-md",n=l[r]||l.default;return s.jsx("div",{className:`${i} ${n} ${t}`,...a,children:e})};function qt({isOpen:e,onClose:t,title:r,children:o,size:a="md",className:l="",overlayClassName:i="",showCloseButton:n=!0,closeOnOverlayClick:c=!0,closeOnEscape:u=!0}){if(w.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]),w.useEffect(()=>{if(!u||!e)return;const y=b=>{b.key==="Escape"&&t()};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[e,t,u]),!e)return null;const m={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl"},k=()=>{c&&t()},f=s.jsx("div",{className:d("fixed inset-0 bg-black/40 flex items-center justify-center z-9999 p-4",i),onClick:k,role:"dialog","aria-modal":"true","aria-labelledby":r?"modal-title":void 0,children:s.jsxs("div",{className:d("relative bg-white rounded-xl shadow-2xl max-h-[90vh] flex flex-col w-full transition-all duration-300",m[a],l),onClick:y=>y.stopPropagation(),children:[(r||n)&&s.jsxs("div",{className:"flex justify-between items-center px-6 py-5 border-b border-border rounded-t-xl shrink-0",children:[r&&s.jsx("h2",{id:"modal-title",className:"text-xl sm:text-2xl font-bold text-primary m-0",children:r}),n&&s.jsx("button",{className:"flex items-center justify-center w-8 h-8 text-text-muted hover:text-text hover:bg-background-light transition-colors duration-200 rounded-lg",onClick:t,"aria-label":"Cerrar modal",type:"button",children:s.jsx("span",{className:"text-2xl font-light leading-none",children:"×"})})]}),s.jsx("div",{className:"p-6 overflow-y-auto flex-1",children:o})]})});return Ie.createPortal(f,document.body)}function Zt({id:e,name:t,checked:r=!1,onChange:o,disabled:a=!1,required:l=!1,colorScheme:i="secondary",variant:n="solid",label:c,className:u="",...m}){const k=(f,y)=>{const b="checkbox-input size-4 shrink-0 rounded transition-all duration-300 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-opacity-50 disabled:cursor-not-allowed disabled:opacity-50";if(f==="outline")switch(y){case"primary":return`${b} checkbox-outline checkbox-primary`;case"secondary":default:return`${b} checkbox-outline checkbox-secondary`}else switch(y){case"primary":return`${b} checkbox-solid checkbox-primary`;case"secondary":default:return`${b} checkbox-solid checkbox-secondary`}};return c?s.jsxs("div",{className:`flex items-center gap-2 ${u}`,children:[s.jsx("input",{id:e,name:t,type:"checkbox",checked:r,onChange:o,disabled:a,required:l,className:k(n,i),...m}),s.jsxs("label",{htmlFor:e,className:"text-sm text-text cursor-pointer font-medium",children:[c,l&&s.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})]}):s.jsx("input",{id:e,name:t,type:"checkbox",checked:r,onChange:o,disabled:a,required:l,className:`${k(n,i)} ${u}`,style:{accentColor:"white"},...m})}const{Input:Xt,InputArea:Qt}=Ce,{Toggle:er}=kt;exports.Badge=Kt;exports.Button=Y;exports.Calendar=Ht;exports.Checkbox=Zt;exports.Dropdown=Yt;exports.EN_DEFAULT_DAY_NAMES=ze;exports.EN_DEFAULT_MONTH_NAMES=Ae;exports.ES_DEFAULT_DAY_NAMES=De;exports.ES_DEFAULT_MONTH_NAMES=Pe;exports.ExpandableCard=Rt;exports.FileDropZone=Jt;exports.Input=Xt;exports.InputArea=Qt;exports.Loader=Ne;exports.Login=jt;exports.Modal=qt;exports.Pagination=_t;exports.SearchInput=Tt;exports.TabPanel=Vt;exports.Table=Ut;exports.Tabs=Bt;exports.ThemeProvider=ft;exports.Toggle=er;exports.cn=d;exports.defaultTheme=I;exports.generateColorVariants=te;exports.hexToHsl=ke;exports.hslToHex=le;exports.useDebounce=Ee;exports.useIsMobile=Pt;exports.useTheme=gt;exports.useToast=At;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|