ui-mathilde-web 1.0.13 → 1.0.14
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/ui-mathilde-web.js
CHANGED
|
@@ -34744,15 +34744,13 @@ const qo = () => `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, gL
|
|
|
34744
34744
|
const f = setTimeout(() => {
|
|
34745
34745
|
d(l), e.forEach((g) => {
|
|
34746
34746
|
g.categories.forEach((m) => {
|
|
34747
|
-
|
|
34748
|
-
|
|
34749
|
-
m.onCategorySearch(p);
|
|
34750
|
-
}
|
|
34747
|
+
const p = l[m.id] ?? "";
|
|
34748
|
+
m.onCategorySearch && p.trim() && m.onCategorySearch(p);
|
|
34751
34749
|
});
|
|
34752
34750
|
});
|
|
34753
34751
|
}, 2500);
|
|
34754
34752
|
return () => clearTimeout(f);
|
|
34755
|
-
}, [l
|
|
34753
|
+
}, [l]);
|
|
34756
34754
|
const h = Pd(() => {
|
|
34757
34755
|
const f = {};
|
|
34758
34756
|
return e.forEach((g) => {
|
|
@@ -587,4 +587,4 @@ Valid keys: `+JSON.stringify(Object.keys(E),null," "));var V=ae(G,q,j,O,z+"."+q
|
|
|
587
587
|
max-sm:rounded-none max-sm:top-12
|
|
588
588
|
`,children:g.jsxs("div",{className:"flex-1 min-w-52",children:[g.jsx(hf.Calendar,{date:m??new Date,onChange:b,minDate:n,maxDate:r,locale:uh,color:"#fff",disabledDay:S,dayContentRenderer:P=>{const _=S(P),B=w(P);return g.jsx("span",{style:{opacity:_?.4:1,color:B?"#999":"inherit"},children:P.getDate()})}}),g.jsx("div",{className:"px-5 py-3 text-sm text-right font-normal cursor-pointer",onClick:y,children:"Reset"})]})})]})}),Ds={"loader-wrapper":"loader-module__loader-wrapper__faxmX",container:"loader-module__container__Vj8hl","mathilde-loading":"loader-module__mathilde-loading__qdEVv","loading-1":"loader-module__loading-1__mro54",logo:"loader-module__logo__IXZKs","ball-container":"loader-module__ball-container__qDvi5",ball:"loader-module__ball__MSPUh"},kN=function(){return g.jsx("div",{className:`mth_loader ${Ds["loader-wrapper"]}`,children:g.jsx("div",{className:Ds.container,children:g.jsxs("div",{className:Ds["mathilde-loading"],children:[g.jsx("img",{className:Ds.logo,src:"https://ftp.mathilde-ads.com/345-38ea95da72fc8edd1d853f315945b449.png",alt:"Logo Mathilde"}),g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:Ds["loading-1"],children:g.jsx("circle",{cx:"50",cy:"50",r:"40"})}),g.jsx("div",{className:Ds["ball-container"],children:g.jsx("div",{className:Ds.ball})})]})})})},_N=({label:e,dismissOnClick:t,items:n,size:r,className:s,styles:o,mode:a="simple",columns:i=2,onSelectionChange:l,selectedItems:c=[],activeChevron:d=!0,icon:u,iconSize:h=20})=>{const[f,p]=M.useState(c),m=(w,x)=>{const k=x?[...f,w]:f.filter(S=>S!==w);p(k),l==null||l(k)},b=()=>n.map(w=>g.jsx(wy,{...w,href:w.href,children:w.label},w.value||w.label)),y=()=>{const w=i===1?"grid-cols-1":i===2?"grid-cols-2":i===3?"grid-cols-3":i===4?"grid-cols-4":"grid-cols-2";return g.jsx("div",{className:`grid min-w-[200px] gap-2 p-2 ${w}`,children:n.map(x=>{const k=x.value||x.label,S=f.includes(k);return g.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm p-2 hover:bg-gray-100",children:[g.jsx("input",{type:"checkbox",checked:S,onChange:P=>m(k,P.target.checked),disabled:x.disabled,className:"size-3 rounded-sm border-gray-300 bg-gray-100 text-blue-600 focus:ring-blue-500"}),g.jsx("span",{className:`text-xs ${x.disabled?"text-gray-400":"text-black"}`,children:x.label})]},k)})})},v=w=>{if(!w)return null;if(typeof w=="string")return g.jsx("img",{src:w,alt:"icon",width:h,height:h});const x=w;return g.jsx(x,{size:h})};return g.jsx(g.Fragment,{children:g.jsx(yy,{label:e,dismissOnClick:a==="simple"?t:!1,size:r,renderTrigger:()=>g.jsx("button",{className:s,style:o,type:"button",children:g.jsxs("span",{className:"flex items-center gap-2",children:[v(u),e,d&&v(KD)]})}),className:"left-0",children:a==="simple"?b():y()})})},CN=function({steps:e=[],initialStep:t=1,activeStep:n,onStepChange:r,renderControls:s,onNext:o,onBack:a,onFinish:i}){var b;const l=typeof n=="number",[c,d]=M.useState(t),u=l?n:c,h=()=>{if(u<e.length){const y=u+1;l?(r==null||r(y),o==null||o()):(d(y),o==null||o())}else i==null||i()},f=()=>{if(u>1){const y=u-1;l?(r==null||r(y),a==null||a()):(d(y),a==null||a())}},p=y=>{y!==u&&(y<1||y>e.length||(l?r==null||r(y):d(y)))},m={activeStep:u,stepsLength:e.length,isFirst:u===1,isLast:u===e.length,next:h,back:f,goToStep:p};return g.jsxs("div",{className:"mx-auto flex w-full flex-col md:flex-row",children:[g.jsx("ol",{className:"relative border-s-2 border-blue-mathilde-300 text-gray-500 w-full self-start",children:e.map((y,v)=>{const w=v===e.length-1,x=v+1===u,k=v+1<u;return g.jsxs("li",{className:`ms-4 ${w?"":"mb-8"}`,children:[g.jsx("span",{className:`absolute -inset-s-2 size-3.5 items-center justify-center rounded-full ring-1
|
|
589
589
|
${k||x?"bg-blue-mathilde-300 ring-blue-mathilde-300":"bg-[#C0D4FF] ring-[#C0D4FF]"}`}),g.jsx("h3",{className:`text-sm font-medium leading-tight transition-colors duration-300
|
|
590
|
-
${k||x?"text-black":"text-gray-600"}`,children:y.title})]},y.title)})}),g.jsxs("div",{className:"w-full mt-6 ml-10 flex flex-col justify-between border-l border-[#8B8B8B] md:mt-0 transition-all duration-300",children:[g.jsx("div",{children:((b=e[u-1])==null?void 0:b.content)||g.jsx("p",{children:"No hay contenido."})}),g.jsx("div",{className:"bottom-0 left-0 w-full",children:g.jsx("div",{className:"flex justify-end gap-2",children:s?g.jsx("div",{className:"w-full flex justify-end",children:s(m)}):g.jsxs(g.Fragment,{children:[g.jsx(gr,{typeButton:"white",txtBtn:"Atrás",disabled:u===1,onClick:f,type:"button",full:!1}),u<e.length?g.jsx(gr,{typeButton:"blue",txtBtn:"Siguiente",onClick:h,type:"button",full:!1}):g.jsx(gr,{typeButton:"blue",txtBtn:"Finalizar",onClick:i,type:"button",full:!1})]})})})]})]})},SN=({label:e,options:t,classNameRadio:n,classNameLabel:r,className:s,onChange:o})=>g.jsxs("div",{className:`flex max-w-md flex-col gap-2 ${s??""}`,children:[e?g.jsx("div",{className:"text-sm font-medium text-gray-900",children:e}):null,g.jsx("div",{className:"flex items-center gap-4",children:t==null?void 0:t.map(a=>g.jsxs("div",{className:"flex items-center gap-x-1.5",children:[g.jsx(xy,{id:a.id,value:a.value,name:a.name,onChange:o,defaultChecked:a.checked,disabled:a.disabled,className:`ring-1 ring-[#C4C4C4] focus:ring-[#C0D4FF] cursor-pointer size-5 ${n??""} ${a.disabled?"ring-[#C4C4C4] bg-[#DDDDDD] cursor-not-allowed":""}`}),g.jsx(Il,{htmlFor:a.id,className:`text-sm font-medium text-gray-900 ${r??""} ${a.disabled?"text-[#9F9F9F]":""}`,children:a.label}),a.tooltip?g.jsx(ka,{content:a.tooltip,trigger:a.tooltipTrigger??"hover",disabled:a.disabled,children:a.tooltipChildren??g.jsx("button",{type:"button","aria-label":"Más información",className:"inline-flex size-4 items-center justify-center rounded-full border border-gray-300 text-[10px] leading-none text-gray-600 hover:bg-gray-50",children:"i"})}):null]},a.id))})]});function B2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=B2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Es(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=B2(e))&&(r&&(r+=" "),r+=t);return r}const Dc=({id:e,title:t,children:n,isOpen:r,onToggle:s,variant:o="minimal",icon:a,iconPosition:i="right",classes:l,titleClasses:c})=>{const d=Es({minimal:"",bordered:"border border-gray-300","shadow-sm":"shadow-sm",ghost:"bg-transparent"}[o]);return g.jsxs("div",{id:e,className:Es("rounded-lg w-full",d),children:[g.jsxs("button",{onClick:s,className:Es("flex w-full items-center justify-between px-5 cursor-pointer text-left ",l||"p-4"),children:[g.jsxs("div",{className:"flex items-center gap-2",children:[a&&i==="left"&&g.jsx("span",{className:Es("transition-transform text-blue-mathilde-300",r&&"rotate-90"),children:a}),g.jsx("span",{className:Es(c||"text-base font-semibold"),children:t})]}),a&&i==="right"&&g.jsx("span",{className:Es("transition-transform text-blue-mathilde-300",r&&"rotate-90"),children:a})]}),r&&g.jsx("div",{className:"overflow-hidden",children:g.jsx("div",{className:"px-4 pb-3 text-gray-700",children:n})},"content")]})},z2=({items:e,mode:t="multi",defaultOpen:n=[],className:r})=>{const[s,o]=M.useState(n),a=i=>{o(t==="multi"?l=>l.includes(i)?l.filter(c=>c!==i):[...l,i]:l=>l.includes(i)?[]:[i])};return g.jsx("div",{className:r,children:e.map(i=>g.jsx("div",{className:Es("mb-2 rounded-md",i.containerButtonClasses?i.containerButtonClasses:"border border-[#C4C4C4]"),children:g.jsx(Dc,{id:i.id,title:i.title,isOpen:s.includes(i.id),onToggle:()=>a(i.id),variant:i.variant,icon:i.icon,iconPosition:i.iconPosition,classes:i.classes??"p-5",titleClasses:i.titleClasses,children:i.content})},i.id))})},MN={dropdownListUl:"dropdownList-module__dropdownListUl__M0NZ4"},ON=({onSelect:e,items:t=[],placeholder:n="Buscar país, región o ciudad",fetchItems:r,minCharsToSearch:s=3,debounceMs:o=300,classIncludes:a,disabled:i=!1})=>{const[l,c]=M.useState(!1),[d,u]=M.useState(""),[h,f]=M.useState(t),p=M.useRef(null);M.useEffect(()=>{f(t)},[t]),M.useEffect(()=>{if(!r)return;if(d.trim().length<s){f([]);return}const b=new AbortController,y=setTimeout(async()=>{try{const v=await r(d.trim());f(v)}catch{f([])}},o);return()=>{clearTimeout(y),b.abort()}},[d,r,o,s]);const m=b=>{e(b),u(b.label),c(!1)};return g.jsxs("div",{ref:p,className:a,children:[g.jsx(Xr,{style:{borderRadius:"10px",width:"290px"},type:"search",placeholder:n,name:"search",value:d,onChange:b=>{u(b.target.value),c(!0)},onFocus:()=>c(!0),onBlur:()=>{c(!1)},icon:!1,autoComplete:"off",disabled:i}),l&&h.length>0&&g.jsx("ul",{className:MN.dropdownListUl,children:h.map(b=>g.jsx("li",{onMouseDown:y=>{y.preventDefault(),y.stopPropagation(),m(b)},children:g.jsx("div",{className:"text-xs",children:b.label})},b.id))})]})},fh={dropdownListUl:"dropdownListWithCheckbox-module__dropdownListUl__hLddF",dropdownListItem:"dropdownListWithCheckbox-module__dropdownListItem__x1PgS",selected:"dropdownListWithCheckbox-module__selected__xNGEj"},DN=({items:e=[],fetchItems:t,value:n,defaultValue:r=[],onChange:s,selectAll:o,placeholder:a="Buscar...",disabled:i=!1,iconSearch:l=!1,minCharsToSearch:c=3,debounceMs:d=300,className:u})=>{const h=n!==void 0,[f,p]=M.useState(r),m=h?n:f,[b,y]=M.useState(!1),[v,w]=M.useState(""),[x,k]=M.useState(e),S=M.useRef(null);M.useEffect(()=>{t||k(e)},[e,t]),M.useEffect(()=>{if(!t)return;if(v.trim().length<c){k([]);return}const I=setTimeout(async()=>{try{const U=await t(v.trim());k(U)}catch{k([])}},d);return()=>clearTimeout(I)},[v,t,d,c]),M.useEffect(()=>{const I=U=>{S.current&&!S.current.contains(U.target)&&y(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]),M.useEffect(()=>{if(!o)return;const I=new Set(m.map(F=>F.id));if(!x.every(F=>I.has(F.id))&&x.length>0){const F=x;h||p(F),s==null||s(F)}},[o,x]);const P=M.useCallback(I=>m.some(U=>U.id===I.id),[m]),_=I=>{h||p(I),s==null||s(I)},B=I=>{const F=P(I)?m.filter(R=>R.id!==I.id):[...m,I];_(F)};return g.jsxs("div",{ref:S,className:u,children:[g.jsx(Xr,{type:"search",placeholder:a,value:v,onChange:I=>{w(I.target.value),y(!0)},onFocus:()=>y(!0),icon:l,disabled:i,autoComplete:"off",classInclude:`rounded-md ${i?"opacity-60":"border border-[#19196080]"}`}),b&&x.length>0&&g.jsx("ul",{className:fh.dropdownListUl,children:x.map(I=>g.jsx("li",{className:`${fh.dropdownListItem} ${P(I)?fh.selected:""}`,children:g.jsx(Ch,{label:I.label,value:I.value,icono:I.icono,checked:P(I),onChange:()=>B(I)})},I.id))})]})},EN=({items:e,title:t,onRemove:n,colors:r={},className:s="",containerClassName:o="",titleClassName:a="",showTitle:i=!0})=>{const c={...{backgroundColor:"#EEEEEE",textColor:"#191960",closeButtonBackgroundColor:"#191960",closeButtonTextColor:"#FFFFFF",borderRadius:20},...r},d={borderRadius:`${c.borderRadius}px`,backgroundColor:c.backgroundColor},u={color:c.textColor},h={backgroundColor:c.closeButtonBackgroundColor,color:c.closeButtonTextColor};return g.jsxs("div",{className:`${s}`,children:[i&&t&&g.jsx("h2",{className:`${a}`,children:t}),g.jsx("div",{className:`${o}`,style:{marginTop:6},children:g.jsx("div",{children:e.map(f=>g.jsxs("div",{className:"mb-1 ml-1 inline-flex items-center gap-2 bg-[#EEEEEE] px-2 py-1",style:d,children:[g.jsx("span",{className:"text-xs text-blue-mathilde-300",style:u,children:f.name}),g.jsx("button",{className:"flex size-4 items-center justify-center rounded-full font-semibold",style:h,onClick:()=>n(f.id),"aria-label":`Eliminar ${f.name}`,type:"button",children:"×"})]},f.id))})})]})},H2={success:{url:"https://ftp.mathilde-ads.com/382-fd0ab04039e5e3af316d454eb3ae0c89.svg",imageWidth:70,imageHeight:70},error:{url:"https://ftp.mathilde-ads.com/382-39f2a6acf3e4d6764f422b18995f0d78.svg",imageWidth:70,imageHeight:70},warning:{url:"https://ftp.mathilde-ads.com/382-2f512deea742dcc31826f8f0f612bbb9.svg",imageWidth:70,imageHeight:70}},Ec={};function PN(e){Object.assign(Ec,e)}function TN(e){return Ec[e]??H2[e]}function IN(){for(const e of Object.keys(Ec))delete Ec[e]}const Va={mth_image_icon:"styles-module__mth_image_icon__ivJY8",mth_alert_title:"styles-module__mth_alert_title__beG0Z",mth_alert_container:"styles-module__mth_alert_container__P-oAe",mth_confirm_button:"styles-module__mth_confirm_button__yrvkf",mth_cancel_button:"styles-module__mth_cancel_button__EWLco"},V2={title:Va.mth_alert_title,htmlContainer:Va.mth_alert_container,image:Va.mth_image_icon,cancelButton:Va.mth_cancel_button,confirmButton:Va.mth_confirm_button};function Y2(e){if(e!==void 0){if(Array.isArray(e))return e.join(" ").trim()||void 0;if(typeof e=="string")return e.trim()||void 0}}function AN(e){const t=new Set([...Object.keys(V2),...e?Object.keys(e):[]]),n={};for(const r of t){const s=Y2(V2[r]),o=Y2(e==null?void 0:e[r]),a=[s,o].filter(Boolean).join(" ");a&&(n[r]=a)}return Object.keys(n).length?n:void 0}function RN(e){const{imageIconKey:t,imageUrl:n,imageWidth:r,imageHeight:s,...o}=e,a=()=>({...o,imageUrl:n,imageWidth:r,imageHeight:s});if(!t||n)return a();const i=TN(t);return i?{...o,imageUrl:i.url,imageWidth:r??i.imageWidth??70,imageHeight:s??i.imageHeight??70}:a()}const NN=({isOpen:e,onConfirm:t,onCancel:n,onClose:r,...s})=>(M.useEffect(()=>{if(!e)return;const o=RN(s),{customClass:a,...i}=o,l=AN(a);co.fire({...i,...l?{customClass:l}:{}}).then(c=>{c.isConfirmed&&t&&t(),c.isDismissed&&n&&n(),r&&r()})},[e,n,r,t,s]),null),Pc={"mth-parent-row":"collapsibleTable-module__mth-parent-row__X3y2O","mth-sub-row":"collapsibleTable-module__mth-sub-row__WQDui",mth_head_table:"collapsibleTable-module__mth_head_table__BLx3L",mth_body_table:"collapsibleTable-module__mth_body_table__eXjny"},jN=({columns:e,data:t,showSearch:n=!1,itemsPerPage:r=5,title:s,classesHeadTable:o,classesBodyTable:a,showPagination:i=!0,showCheckboxes:l=!1,selectedRows:c=new Set,onToggleChange:d,onRowSelect:u,onSelectAll:h,isRowSelectable:f=()=>!0,collapsible:p=!1,collapseMode:m="multi",defaultOpenRows:b=[],onCollapseChange:y,openRowIds:v,getSubRows:w,collapseToggleColumnKey:x="id",collapseButtonClassName:k,parentRowClassName:S,subRowClassName:P})=>{const[_,B]=Y.useState(""),[I,U]=Y.useState(1),[F,R]=Y.useState(null),[C,A]=Y.useState(b),W=v??C,N=H=>{if(v)return y==null?void 0:y(H);A(H),y==null||y(H)},D=H=>{p&&N(m==="multi"?W.includes(H)?W.filter(ne=>ne!==H):[...W,H]:W.includes(H)?[]:[H])},X=Y.useMemo(()=>F?[...t].sort((H,ne)=>{const oe=H[F.key],te=ne[F.key];return oe==null||te==null?0:typeof oe=="string"&&typeof te=="string"?F.direction==="asc"?oe.localeCompare(te):te.localeCompare(oe):F.direction==="asc"?Number(oe)-Number(te):Number(te)-Number(oe)}):t,[t,F]),E=Y.useMemo(()=>{if(!_.trim())return X;const H=_.toLowerCase().trim();return X.filter(ne=>e.some(oe=>{const te=ne[oe.relation];return te!=null&&String(te).toLowerCase().includes(H)}))},[X,_,e]),$=Y.useMemo(()=>{const H=(I-1)*r,ne=H+r;return E.slice(H,ne)},[E,I,r]),L=Math.ceil(E.length/r),T=()=>{if(!h)return;const H=$.filter(oe=>f(oe)),ne=H.length>0&&H.every(oe=>c.has(oe.id));h(!ne,H.map(oe=>oe.id))},j=H=>{if(!u||!f(H))return;const ne=H.id,oe=c.has(ne);u(ne,!oe)},O=Y.useMemo(()=>$.filter(H=>f(H)),[$,f]),z=O.filter(H=>c.has(H.id)).length,G=O.length>0&&z===O.length,Q=z>0&&z<O.length,K=H=>{R(ne=>!ne||ne.key!==H?{key:H,direction:"asc"}:{key:H,direction:ne.direction==="asc"?"desc":"asc"})},q=(H,ne)=>typeof H=="function"?H(ne):!!H,ae=(H,ne)=>typeof H=="function"?H(ne):H,V=(H,ne,oe)=>{const te=ne[H.relation],ve=!!(oe!=null&&oe.isSubRow);if(H.isToggle){const be=!!te;return g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(zu,{checked:be,onChange:Me=>d==null?void 0:d({rowId:ne.id,checked:Me,row:ne,columnKey:H.relation}),disabled:!1}),H.toggleText&&g.jsx("span",{className:"text-sm text-gray-600",children:be?H.toggleText.active:H.toggleText.inactive})]})}if(H.badgeConfig)return g.jsx(Py,{value:te,config:H.badgeConfig});if(H.cell)return H.cell(ne);if(H.component){const be=H.component;return Y.createElement(be,{row:ne,value:te,...H.cellProps||{}})}const _e=te??"";if(ve&&H.subRowTooltip&&q(H.subRowTooltip.enabled,ne)){const Me=ae(H.subRowTooltip.content,ne);return g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("span",{children:_e}),g.jsx(ka,{content:Me,trigger:H.subRowTooltip.trigger??"hover",children:g.jsx(Ga,{size:16,className:"size-4","aria-label":H.subRowTooltip.iconAlt??"info"})})]})}return _e},re=(H,ne,oe,te)=>g.jsxs("div",{className:"flex items-center gap-1",children:[oe?g.jsx("button",{type:"button",onClick:()=>D(ne.id),className:k??"mth-collapse-btn","aria-label":te?"Colapsar fila":"Expandir fila",children:te?g.jsx(to,{className:"size-3 text-blue-mathilde-300 -ml-3"}):g.jsx(qD,{className:"size-3 text-blue-mathilde-300 -ml-3"})}):g.jsx("span",{className:"mth-collapse-spacer"}),V(H,ne)]});return g.jsxs("div",{className:"w-full",children:[g.jsx("div",{className:"mb-2 flex items-center justify-between",children:s&&g.jsx("h2",{className:"text-base font-bold",children:s})}),g.jsx("div",{className:"flex",children:n&&g.jsx("div",{className:"mb-5 w-1/2",children:g.jsx(Nu,{rightIcon:Sy,placeholder:"Buscar",value:_,onChange:H=>{B(H.target.value),U(1)}})})}),g.jsxs("div",{className:"mt-0",children:[g.jsx("div",{className:"overflow-x-auto",children:g.jsxs(ju,{children:[g.jsx(Fu,{className:`${Pc.mth_head_table} ${o}`,children:g.jsxs(eo,{children:[l&&g.jsx(xa,{className:"bg-blue-mathilde-light-200",children:g.jsx(fa,{checked:G,ref:H=>{H&&(H.indeterminate=Q)},onChange:T})},"checkbox-head"),e.map((H,ne)=>g.jsx(xa,{className:"bg-blue-mathilde-light-200 cursor-pointer text-xs",onClick:()=>H.sortable!==!1&&K(H.relation),children:g.jsxs("div",{className:"flex items-center gap-1",children:[H.header,H.sortable!==!1&&g.jsx("span",{children:(F==null?void 0:F.key)===H.relation?F.direction==="desc"?g.jsx(to,{className:"size-3"}):g.jsx(Hu,{className:"size-3"}):g.jsx(to,{className:"size-3 opacity-50"})})]})},`column-${ne}-${H.relation}`))]})}),g.jsx(Lu,{className:`divide-y text-xs md:text-base lg:text-base ${Pc.mth_body_table} ${a}`,children:$.map(H=>{const ne=w?w(H):[],oe=p&&ne.length>0,te=oe&&W.includes(H.id);return g.jsxs(Y.Fragment,{children:[g.jsxs(eo,{className:`${te?Pc["mth-parent-row"]:""} ${S}`,children:[l&&g.jsx(sr,{children:g.jsx(fa,{className:"bg-transparent",checked:c.has(H.id),disabled:!f(H),onChange:()=>j(H)})}),e.map((ve,_e)=>ve.relation===x?g.jsx(sr,{className:"whitespace-nowrap font-medium ",children:re(ve,H,oe,te)},`${H.id}-${_e}`):g.jsx(sr,{className:"whitespace-nowrap font-medium",children:V(ve,H)},`${H.id}-${_e}`))]}),oe&&te&&ne.map((ve,_e)=>g.jsxs(eo,{className:`${te?Pc["mth-sub-row"]:""} ${P}`,children:[l&&g.jsx(sr,{}),e.map((be,Me)=>be.relation===x?g.jsx(sr,{className:"whitespace-nowrap font-normal",children:g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("span",{className:"mth-collapse-spacer"}),V(be,ve,{isSubRow:!0})]})},`${H.id}-sub-${_e}-${Me}`):g.jsx(sr,{className:"whitespace-nowrap font-normal",children:V(be,ve,{isSubRow:!0})},`${H.id}-sub-${_e}-${Me}`))]},`${H.id}-sub-${_e}`))]},H.id)})})]})}),i&&L>1&&g.jsx("div",{className:"mt-2 flex w-full justify-end",children:g.jsx(Bu,{currentPage:I,totalPages:L,onPageChange:U})})]})]})};function Tc(e){return $t({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M2 4.75A.75.75 0 0 1 2.75 4h14.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 4.75ZM2 10a.75.75 0 0 1 .75-.75h14.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 10Zm0 5.25a.75.75 0 0 1 .75-.75h14.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"},child:[]}]})(e)}function hh(e){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"},child:[]}]})(e)}const xo=()=>`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,LN=({item:e,categoryId:t})=>g.jsx("div",{className:"px-4 py-1 w-fit text-black font-light rounded-md text-sm cursor-move hover:bg-[#C0D4FF] border border-neutral-200 flex flex-col items-center",draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="copy",n.dataTransfer.setData("application/json",JSON.stringify({categoryId:t,itemId:e.id,label:e.label}))},children:g.jsxs("span",{className:"select-none flex items-center gap-2 text-sm",children:[g.jsx(Tc,{className:"w-4 h-4 text-blue-mathilde-300"}),e.label]})}),FN=({groupId:e,conditions:t,onDrop:n,onRemoveCondition:r})=>{const[s,o]=M.useState(!1),a=c=>{c.preventDefault(),c.dataTransfer.dropEffect="copy",o(!0)},i=()=>{o(!1)},l=c=>{c.preventDefault(),o(!1);try{const d=JSON.parse(c.dataTransfer.getData("application/json")),u={id:xo(),categoryId:d.categoryId,itemId:d.itemId,label:d.label};n(e,u)}catch(d){console.error("Error al procesar el drop:",d)}};return g.jsx("div",{className:`min-h-[40px] p-2 border rounded-md transition-colors ${s?"border-blue-mathilde-300 bg-[#C0D4FF]":"border-[#C4C4C4] bg-gray-50"}`,onDragOver:a,onDragLeave:i,onDrop:l,children:t.length===0?g.jsx("div",{className:"text-gray-400 text-sm text-center",children:"Arrastra elementos aquí"}):g.jsx("div",{className:"flex flex-wrap gap-2 max-h-[200px] overflow-y-auto",children:t.map((c,d)=>g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsxs("div",{className:"px-2 py-1 border border-[#C4C4C4] rounded-md text-sm inline-flex items-center gap-2",children:[g.jsx(Tc,{className:"w-4 h-4 text-blue-mathilde-300"}),g.jsx("span",{children:c.label}),g.jsx(gr,{leftIcon:My,iconSize:16,txtBtn:"",typeButton:"red",full:!1,type:"button",onClick:()=>r(e,c.id),classes:"px-1 py-0.5 rounded-md"})]}),d<t.length-1&&g.jsx("span",{className:"text-xs font-semibold text-gray-500 px-1",children:"AND"})]},c.id))})})},WN=({categories:e,onQueryChange:t,maxGroups:n=5,titleCategories:r="Buscar categorías"})=>{const[s,o]=M.useState([]),[a,i]=M.useState([{id:xo(),title:"Incluir",groups:[{id:xo(),conditions:[],operator:"AND"}]},{id:xo(),title:"Excluir",groups:[{id:xo(),conditions:[],operator:"AND"}]}]),l=f=>{o(p=>p.includes(f)?p.filter(m=>m!==f):[...p,f])},c=(f,p,m)=>{const b=a.map(y=>{if(y.id===f){const v=y.groups.map(w=>w.id===p?w.conditions.some(k=>k.categoryId===m.categoryId&&k.itemId===m.itemId)?w:{...w,conditions:[...w.conditions,m]}:w);return{...y,groups:v}}return y});i(b),t==null||t(b)},d=(f,p,m)=>{const b=a.map(y=>{if(y.id===f){const v=y.groups.map(w=>w.id===p?{...w,conditions:w.conditions.filter(x=>x.id!==m)}:w);return{...y,groups:v}}return y});i(b),t==null||t(b)},u=f=>{const p=a.map(m=>m.id===f&&m.groups.length<n?{...m,groups:[...m.groups,{id:xo(),conditions:[],operator:"OR"}]}:m);i(p),t==null||t(p)},h=(f,p)=>{const m=a.map(b=>b.id===f&&b.groups.length>1?{...b,groups:b.groups.filter(y=>y.id!==p)}:b);i(m),t==null||t(m)};return g.jsxs("div",{className:"flex gap-4 w-full h-full",children:[g.jsxs("div",{className:"w-1/4 bg-white p-4 overflow-y-auto",children:[g.jsx("h3",{className:"text-sm font-semibold mb-2 text-gray-700",children:r||"Categorías"}),g.jsx("div",{className:"bg-white mb-2 overflow-y-auto",children:g.jsx(Xr,{type:"search",placeholder:"Buscar",classInclude:"w-full py-0 rounded-md",className:"mb-2",icon:!1})}),g.jsx("div",{className:"space-y-1 border rounded-md p-5",children:e.map(f=>g.jsx(Dc,{id:f.id,title:f.title,isOpen:s.includes(f.id),onToggle:()=>l(f.id),icon:g.jsx(hh,{className:"w-5 h-5"}),iconPosition:"right",classes:"p-2",children:g.jsx("div",{className:"space-y-1",children:g.jsx("div",{className:"space-y-1",children:f.items.map(p=>g.jsx(LN,{item:p,categoryId:f.id},p.id))})},f.id)},f.id))})]}),g.jsx("div",{className:"flex-1 bg-white border border-gray-200 rounded-lg p-4 overflow-y-auto",children:g.jsx("div",{className:"space-y-2",children:a.map(f=>g.jsx(Dc,{id:f.id,title:f.title,isOpen:s.includes(f.id),onToggle:()=>l(f.id),variant:"bordered",icon:g.jsx(hh,{className:"w-5 h-5"}),iconPosition:"right",classes:"p-4",children:g.jsxs("div",{className:"space-y-2",children:[f.groups.map((p,m)=>g.jsxs("div",{children:[m>0&&g.jsx("div",{className:"flex justify-center my-2",children:g.jsx("span",{className:"px-2 py-1 bg-blue-mathilde-300 text-white text-xs font-semibold rounded-sm",children:"OR"})}),g.jsxs("div",{className:"flex flex-row space-y-1",children:[g.jsx("div",{className:"w-11/12",children:g.jsx(FN,{groupId:p.id,conditions:p.conditions,onDrop:(b,y)=>c(f.id,b,y),onRemoveCondition:(b,y)=>d(f.id,b,y)})}),g.jsx("div",{className:"w-1/12",children:f.groups.length>1&&m>0&&g.jsx("div",{className:"flex justify-end",children:g.jsx(gr,{leftIcon:"https://ftp.mathilde-ads.com/382-6986b247c2c7729fb231da467b8e913c.svg",iconSize:14,txtBtn:"",typeButton:"blue",full:!1,type:"button",onClick:()=>h(f.id,p.id),classes:"px-1 rounded-md text-white w-8 h-8"})})})]})]},p.id)),f.groups.length<n&&g.jsx("div",{className:"flex mt-3",children:g.jsx(gr,{leftIcon:$D,iconSize:14,txtBtn:"",typeButton:"blue",full:!1,type:"button",onClick:()=>u(f.id),classes:"px-2 py-2 rounded-md"})})]})},f.id))})})]})},mh=()=>`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,U2=(e,t)=>e.some(n=>n.categoryId===t.categoryId&&n.itemId===t.itemId),G2=(e,t,n)=>e.map(r=>r.id===t?{...r,conditions:[...r.conditions,n]}:r),BN=(e,t,n,r,s)=>e.map(o=>{if(o.id!==t)return o;if(n){const i=o.groups.find(l=>l.id===n);return!i||U2(i.conditions,r)?o:{...o,groups:G2(o.groups,n,r)}}const a=o.groups.find(i=>i.conditions.length>0&&i.conditions[0].categoryId===r.categoryId);return a?U2(a.conditions,r)?o:{...o,groups:G2(o.groups,a.id,r)}:o.groups.length>=s?o:{...o,groups:[...o.groups,{id:mh(),conditions:[r],operator:"OR"}]}}),zN=(e,t,n,r)=>e.map(s=>{if(s.id!==t)return s;const o=s.groups.map(a=>a.id===n?{...a,conditions:a.conditions.filter(i=>i.id!==r)}:a).filter(a=>a.conditions.length>0);return{...s,groups:o}}),HN=({categoryGroups:e,onQueryChange:t,maxGroups:n})=>{const[r,s]=M.useState([]),[o,a]=M.useState(null),[i,l]=M.useState(null),[c,d]=M.useState(()=>[{id:mh(),title:"Configuración de audiencia",operator:"AND",groups:[]}]);return M.useEffect(()=>{s(m=>m.length===0&&c.length>0?[c[0].id]:m)},[]),{filterSections:c,openCategoryId:i,openAccordions:r,dragData:o,setDragData:a,toggleAccordion:m=>{s(b=>b.includes(m)?b.filter(y=>y!==m):[...b,m])},handleDrop:(m,b,y)=>{const v=BN(c,m,b,y,n);d(v),t==null||t(v)},handleRemoveCondition:(m,b,y)=>{const v=zN(c,m,b,y);d(v),t==null||t(v)},handleSearch:m=>{const b=m.trim().toLowerCase();if(!b){l(null);return}const v=e.flatMap(w=>w.categories).find(w=>{const x=w.title.toLowerCase().includes(b),k=w.items.some(S=>S.label.toLowerCase().includes(b));return x||k});l(v?v.id:null)}}},X2=M.createContext({dragData:null,setDragData:()=>{}}),K2=()=>M.useContext(X2),Z2="drag-cursor-override",VN=({item:e,categoryId:t})=>{const[n,r]=M.useState(!1),{setDragData:s}=K2(),o={categoryId:t,itemId:e.id,label:e.label},a=M.useRef(!1),i=M.useCallback(()=>{const d=document.getElementById(Z2);d&&d.remove()},[]),l=M.useCallback(()=>{i();const d=document.createElement("style");d.id=Z2,d.textContent="* { cursor: grabbing !important; }",document.head.appendChild(d)},[i]),c=M.useCallback(()=>{r(!1),s(null),i(),a.current=!1},[i,s]);return M.useEffect(()=>{const d=()=>{c()};return window.addEventListener("dragend",d),window.addEventListener("drop",d),()=>{window.removeEventListener("dragend",d),window.removeEventListener("drop",d),i()}},[i,c]),g.jsx("div",{className:`flex max-w-[200px] items-center rounded-[5px] border border-neutral-200 px-3 py-1.5 text-sm font-light text-black transition-all hover:bg-pale-blue-300 ${n?"cursor-grabbing opacity-50":"cursor-grab"}`,draggable:!0,onPointerDown:()=>{a.current=!1,l()},onPointerUp:()=>{a.current||i()},onDragStart:d=>{a.current=!0,r(!0),s(o),d.dataTransfer.effectAllowed="all";try{d.dataTransfer.dropEffect="copy"}catch{}d.dataTransfer.setData("application/json",JSON.stringify(o)),l();const u=d.currentTarget.cloneNode(!0);u.style.position="absolute",u.style.top="-9999px",u.style.left="-9999px",u.style.opacity="0.9",u.style.transform="rotate(3deg)",u.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)",document.body.appendChild(u);const h=d.currentTarget.getBoundingClientRect();d.dataTransfer.setDragImage(u,h.width/2,h.height/2),setTimeout(()=>{document.body.contains(u)&&document.body.removeChild(u)},0)},onDragEnd:c,children:g.jsxs("span",{className:"flex min-w-0 flex-1 select-none items-start gap-2",children:[g.jsx(Tc,{className:"mt-0.5 size-4 shrink-0 text-blue-mathilde-300"}),g.jsx("span",{className:"min-w-0 wrap-break-word",children:e.label})]})})},YN=({categoryGroups:e,openCategoryId:t,onSearch:n,selectedItemKeys:r})=>{const[s,o]=M.useState({}),[a,i]=M.useState({}),[l,c]=M.useState({}),[d,u]=M.useState({});M.useEffect(()=>{const f=setTimeout(()=>{i(s);const p=Object.values(s).join(" ");n(p)},2500);return()=>clearTimeout(f)},[s]),M.useEffect(()=>{const f=setTimeout(()=>{u(l),e.forEach(p=>{p.categories.forEach(m=>{if(m.onCategorySearch){const b=l[m.id]??"";m.onCategorySearch(b)}})})},2500);return()=>clearTimeout(f)},[l,e]);const h=M.useMemo(()=>{const f={};return e.forEach(p=>{const m=(a[p.id]??"").trim().toLowerCase(),b=p.categories.map(y=>({...y,items:y.items.filter(v=>!r.has(`${y.id}:${v.id}`))})).filter(y=>y.items.length>0||y.searchable===!0);if(!m){f[p.id]=b;return}f[p.id]=b.map(y=>{const v=y.title.toLowerCase().includes(m),w=y.items.filter(x=>x.label.toLowerCase().includes(m));return v?y:w.length===0&&!y.searchable?null:{...y,items:w}}).filter(y=>y!==null)}),f},[e,a,r]);return g.jsx("div",{className:"w-1/3 overflow-y-auto bg-white p-4 space-y-4",children:e.map(f=>{const p=h[f.id]??[],m=p.length===0?[]:t&&p.some(b=>b.id===t)?[t]:[p[0].id];return g.jsxs("div",{className:"rounded-md border border-neutral-200 p-3",children:[g.jsx("h3",{className:"mb-2 text-base font-semibold text-black",children:f.title}),f.searchable&&g.jsx("div",{className:"mb-2",children:g.jsx(Xr,{type:"search",placeholder:f.searchPlaceholder??"Busca los filtros",icon:!0,onChange:b=>{const y=b.target.value;o(v=>({...v,[f.id]:y}))}})}),g.jsx(z2,{mode:"single",defaultOpen:m,items:p.map(b=>({id:b.id,title:b.title,icon:g.jsx(hh,{className:"size-5"}),iconPosition:"right",classes:"p-1",titleClasses:"text-sm",containerButtonClasses:"border-none",content:(()=>{const y=(d[b.id]??"").trim().toLowerCase(),v=y?b.items.filter(w=>w.label.toLowerCase().includes(y)||w.id.toLowerCase().includes(y)):b.items;return g.jsxs("div",{className:"space-y-1",children:[b.searchable&&g.jsx("div",{className:"mb-2",children:g.jsx(Xr,{type:"search",placeholder:b.searchPlaceholder??"Buscar...",classInclude:"w-full py-0 rounded-md",icon:!0,onChange:w=>{c(x=>({...x,[b.id]:w.target.value}))}})}),g.jsx("div",{className:"max-h-[200px] space-y-1 overflow-y-auto",children:v.map(w=>g.jsx(VN,{item:w,categoryId:b.id},w.id))})]})})()}))},`${f.id}-${t}`)]},f.id)})})},UN=({groupId:e,conditions:t,onRemoveCondition:n})=>g.jsx("div",{className:"flex flex-col gap-2",children:t.map(r=>g.jsx("div",{className:"flex items-center",children:g.jsxs("div",{className:"flex w-[200px] items-start gap-1 rounded-[5px] border border-neutral-200 px-3 py-1.5 text-sm",children:[g.jsx(Tc,{className:"mt-0.5 size-4 shrink-0 text-blue-mathilde-300"}),g.jsx("span",{className:"min-w-0 flex-1 wrap-break-word",children:r.label}),g.jsx(gr,{leftIcon:My,iconSize:18,txtBtn:"",typeButton:"red",full:!1,type:"button",onClick:()=>n(e||"",r.id),classes:"text-black"})]})},r.id))}),GN=({section:e,onDrop:t,onRemoveCondition:n})=>{const[r,s]=M.useState(!1),{dragData:o}=K2(),a=e.groups.some(d=>d.conditions.length>0),i=d=>{d.preventDefault(),d.dataTransfer.dropEffect="copy",s(!0)},l=d=>{d.currentTarget.contains(d.relatedTarget)||s(!1)},c=d=>{d.preventDefault(),s(!1);let u=null;const h=d.dataTransfer.getData("application/json");if(h!=null&&h.trim())try{u=JSON.parse(h)}catch(p){console.error("Error al procesar el drop:",p);return}else o&&(u=o);if(!u)return;const f={id:mh(),categoryId:u.categoryId,itemId:u.itemId,label:u.label};t(e.id,null,f)};return g.jsx("div",{className:"border border-white shadow-[0px_0px_2px_0px_#25252540] rounded-md p-2.5",children:g.jsx("div",{className:`${r?"bg-blue-mathilde-light-50":""} border-2 border-blue-mathilde-100 border-dashed rounded-md p-2.5 min-h-80 w-full transition-colors hover:border-blue-mathilde-300`,onDragOver:i,onDragLeave:l,onDrop:c,children:a?g.jsx("div",{className:"flex flex-col items-start gap-1 2xl:flex-row 2xl:flex-wrap 2xl:gap-1",children:e.groups.map((d,u)=>g.jsxs(M.Fragment,{children:[u>0&&g.jsx("div",{className:"flex items-center justify-center my-1 2xl:my-0 2xl:px-2",children:g.jsx("span",{className:"px-2 py-1 bg-blue-mathilde-300 text-white text-xs font-semibold rounded-sm",children:"AND"})}),g.jsx("div",{className:"shrink-0",children:g.jsx(UN,{groupId:d.id,conditions:d.conditions,onRemoveCondition:(h,f)=>n(e.id,h||d.id,f)})})]},d.id))}):g.jsxs("span",{className:"text-base text-neutral-400 gap-2",children:[g.jsx(vh,{size:40,"aria-hidden":!0,className:"my-2"}),g.jsx("b",{className:"font-semibold",children:"Drag and drop."})," ",g.jsx("br",{}),g.jsx("span",{className:"font-normal",children:"Selecciona las opciones y arrastra hasta aquí."})]})})})},XN=({filterSections:e,sectionTitle:t,onDrop:n,onRemoveCondition:r})=>g.jsx("div",{className:"flex-1 bg-white px-1 py-4 overflow-y-auto",children:g.jsx("div",{className:"px-5 py-4 border border-neutral-200 rounded-md space-y-4 gap-2",children:e.map(s=>g.jsxs(M.Fragment,{children:[t,g.jsx(GN,{section:s,onDrop:n,onRemoveCondition:r})]},s.id))})}),KN=({categoryGroups:e,onQueryChange:t,maxGroups:n=5,isToolTipOpen:r=!1,messageContent:s="Configuración de audiencia"})=>{const{filterSections:o,openCategoryId:a,openAccordions:i,dragData:l,setDragData:c,toggleAccordion:d,handleDrop:u,handleRemoveCondition:h,handleSearch:f}=HN({categoryGroups:e,onQueryChange:t,maxGroups:n}),p=M.useMemo(()=>{const b=new Set;return o.forEach(y=>{y.groups.forEach(v=>{v.conditions.forEach(w=>{b.add(`${w.categoryId}:${w.itemId}`)})})}),b},[o]),m=r?g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-sm text-black font-semibold font-poppins",children:"Configuración de audiencia"}),g.jsx(ka,{content:s,trigger:"hover",children:g.jsx(Ga,{className:"size-4 text-blue-mathilde-300","aria-label":"info"})})]}):g.jsxs("div",{className:"p-0",children:[g.jsx("span",{className:"text-sm text-black font-semibold font-poppins",children:"Configuración de audiencia"}),g.jsx("p",{className:"text-xs text-black bg-blue-mathilde-light-300 font-semibold px-3 py-2.5 rounded-md mt-2.5",children:s})]});return g.jsx(X2.Provider,{value:{dragData:l,setDragData:c},children:g.jsxs("div",{className:"flex w-full",children:[g.jsx(YN,{categoryGroups:e,openCategoryId:a,onSearch:f,selectedItemKeys:p}),g.jsx(XN,{filterSections:o,openAccordions:i,maxGroups:n,sectionTitle:m,onToggleAccordion:d,onDrop:u,onRemoveCondition:h})]})})},gt={"audience-loading":"spinnerMth-module__audience-loading__LEgdv",spinner:"spinnerMth-module__spinner__fFqhw","spinner-center":"spinnerMth-module__spinner-center__GyDhh","spinner-segment":"spinnerMth-module__spinner-segment__gU-wW","segment-1":"spinnerMth-module__segment-1__sSDuK","segment-2":"spinnerMth-module__segment-2__9W-CH","segment-3":"spinnerMth-module__segment-3__fyp4E","segment-4":"spinnerMth-module__segment-4__hMDSa","segment-5":"spinnerMth-module__segment-5__0b-Ow","segment-6":"spinnerMth-module__segment-6__-u1-Q","segment-7":"spinnerMth-module__segment-7__UD-7L","segment-8":"spinnerMth-module__segment-8__6-wy2"},ZN=({description:e=""})=>g.jsx(g.Fragment,{children:g.jsxs("div",{className:gt["audience-loading"],children:[g.jsxs("div",{className:gt.spinner,children:[g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-1"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-2"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-3"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-4"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-5"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-6"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-7"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-8"]}`}),g.jsx("div",{className:gt["spinner-center"]})]}),e&&g.jsx("p",{className:"audience-text",dangerouslySetInnerHTML:{__html:e}})]})}),Q2=({text:e,icon:t,className:n,contentClassName:r,textClassName:s,...o})=>{const a=Kh("inline-flex items-center gap-1.5",r);return g.jsx(Il,{className:n,...o,children:g.jsxs("span",{className:a,children:[s?g.jsx("span",{className:s,children:e}):e,t?g.jsx("span",{className:"inline-flex shrink-0 items-center",children:t}):null]})})};Q2.displayName="Label";const QN=["inline-flex items-center justify-center","rounded-md","text-sm leading-none font-bold font-poppins","cursor-pointer select-none","transition-colors duration-150 ease-in-out","focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:pointer-events-none"],gh="px-5 py-2",JN=ti({base:QN,variants:{variant:{default:["bg-blue-mathilde-300 text-white border-transparent gap-2.5","hover:bg-blue-mathilde-100","active:bg-blue-mathilde-400","focus:shadow-md","focus-visible:ring-blue-mathilde-200","disabled:bg-neutral-200 disabled:text-white"],secondary:["bg-white text-blue-mathilde-300 border border-blue-mathilde-300 gap-2.5","hover:bg-pale-blue-300","active:bg-pale-blue-300","focus-visible:ring-blue-mathilde-300","disabled:border-neutral-200 disabled:text-neutral-200"],link:["bg-transparent text-blue-mathilde-300 underline border-transparent px-0 gap-2.5","hover:text-blue-mathilde-100","active:text-blue-mathilde-400","focus-visible:ring-blue-mathilde-300","disabled:text-blue-mathilde-50"]},iconPosition:{none:gh,left:gh,right:gh,"icon-only":"size-8 p-0"}},defaultVariants:{variant:"default",iconPosition:"none"}}),$N=({variant:e="default",iconPosition:t="none",icon:n,children:r,full:s,...o})=>{const a=t==="icon-only";return g.jsxs("button",{...o,className:JN({variant:e,iconPosition:t}),style:s?{width:"100%"}:void 0,"aria-label":a&&!o["aria-label"]?"button":o["aria-label"],children:[t==="left"&&n,!a&&r,t==="right"&&n,a&&n]})};se.Accordion=Dc,se.AccordionGroup=z2,se.AddSvgIcon=fx,se.AiChatSvgIcon=gx,se.Alert=NN,se.AlertCircleSvgIcon=cx,se.AttachFile=Lc,se.BUILT_IN_ALERT_IMAGE_ICONS=H2,se.BUILT_IN_IMAGE_ICON_SRC=Fc,se.Button=$N,se.ButtonFormat=gr,se.CalendarAnalysis=hx,se.CancelSquareSvgIcon=ux,se.Card=Iy,se.CardIndicator=x1,se.Checkbox=Ch,se.CheckmarkCircleSvgIcon=dx,se.CheckmarkSvgIcon=ix,se.ChipList=EN,se.CollapsibleTable=jN,se.CustomPagination=Bu,se.DashboardBrowsingSvgIcon=mx,se.DatePickerComponent=xN,se.DateRangePicker=wN,se.Delete=xh,se.DragAndDrop=KN,se.DropdownButton=_N,se.DropdownList=ON,se.DropdownListWithCheckbox=DN,se.Dropzone=t8,se.EditSvgIcon=lx,se.Eye=yh,se.EyeSlash=wh,se.FacebookIcon=rx,se.GoogleIcon=sx,se.HandSwipeRight=vh,se.ImageFormat=Mo,se.InfoTooltipSvgIcon=Ga,se.InputForm=Xr,se.Label=Q2,se.LayoutOutside=l6,se.ListFile=r8,se.Loader=kN,se.MathildeIcon=ox,se.ModalFormat=r_,se.MyDoughnutChart=X5,se.PasswordInput=Kc,se.PasswordValidationList=Ty,se.ProgressBar=Jh,se.QueryBuilder=WN,se.RadioButton=SN,se.SearchSvgIcon=kh,se.SelectForm=$h,se.SidebarPro=qS,se.Spinner=s8,se.SpinnerMth=ZN,se.Stepper=CN,se.TableComponent=a6,se.TableOfContents=m6,se.TabsComponent=o8,se.Tag=Vu,se.TermsCheckbox=c6,se.TikTokIcon=ax,se.Toggle=zu,se.TooltipComponent=ka,se.UserListSvgIcon=px,se.ValidationPassword=u6,se.clearAlertImageIcons=IN,se.clearImageIconSrcRegistry=yx,se.getImageIconSrc=Wc,se.registerAlertImageIcons=PN,se.registerImageIconSrc=bx,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
|
|
590
|
+
${k||x?"text-black":"text-gray-600"}`,children:y.title})]},y.title)})}),g.jsxs("div",{className:"w-full mt-6 ml-10 flex flex-col justify-between border-l border-[#8B8B8B] md:mt-0 transition-all duration-300",children:[g.jsx("div",{children:((b=e[u-1])==null?void 0:b.content)||g.jsx("p",{children:"No hay contenido."})}),g.jsx("div",{className:"bottom-0 left-0 w-full",children:g.jsx("div",{className:"flex justify-end gap-2",children:s?g.jsx("div",{className:"w-full flex justify-end",children:s(m)}):g.jsxs(g.Fragment,{children:[g.jsx(gr,{typeButton:"white",txtBtn:"Atrás",disabled:u===1,onClick:f,type:"button",full:!1}),u<e.length?g.jsx(gr,{typeButton:"blue",txtBtn:"Siguiente",onClick:h,type:"button",full:!1}):g.jsx(gr,{typeButton:"blue",txtBtn:"Finalizar",onClick:i,type:"button",full:!1})]})})})]})]})},SN=({label:e,options:t,classNameRadio:n,classNameLabel:r,className:s,onChange:o})=>g.jsxs("div",{className:`flex max-w-md flex-col gap-2 ${s??""}`,children:[e?g.jsx("div",{className:"text-sm font-medium text-gray-900",children:e}):null,g.jsx("div",{className:"flex items-center gap-4",children:t==null?void 0:t.map(a=>g.jsxs("div",{className:"flex items-center gap-x-1.5",children:[g.jsx(xy,{id:a.id,value:a.value,name:a.name,onChange:o,defaultChecked:a.checked,disabled:a.disabled,className:`ring-1 ring-[#C4C4C4] focus:ring-[#C0D4FF] cursor-pointer size-5 ${n??""} ${a.disabled?"ring-[#C4C4C4] bg-[#DDDDDD] cursor-not-allowed":""}`}),g.jsx(Il,{htmlFor:a.id,className:`text-sm font-medium text-gray-900 ${r??""} ${a.disabled?"text-[#9F9F9F]":""}`,children:a.label}),a.tooltip?g.jsx(ka,{content:a.tooltip,trigger:a.tooltipTrigger??"hover",disabled:a.disabled,children:a.tooltipChildren??g.jsx("button",{type:"button","aria-label":"Más información",className:"inline-flex size-4 items-center justify-center rounded-full border border-gray-300 text-[10px] leading-none text-gray-600 hover:bg-gray-50",children:"i"})}):null]},a.id))})]});function B2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=B2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Es(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=B2(e))&&(r&&(r+=" "),r+=t);return r}const Dc=({id:e,title:t,children:n,isOpen:r,onToggle:s,variant:o="minimal",icon:a,iconPosition:i="right",classes:l,titleClasses:c})=>{const d=Es({minimal:"",bordered:"border border-gray-300","shadow-sm":"shadow-sm",ghost:"bg-transparent"}[o]);return g.jsxs("div",{id:e,className:Es("rounded-lg w-full",d),children:[g.jsxs("button",{onClick:s,className:Es("flex w-full items-center justify-between px-5 cursor-pointer text-left ",l||"p-4"),children:[g.jsxs("div",{className:"flex items-center gap-2",children:[a&&i==="left"&&g.jsx("span",{className:Es("transition-transform text-blue-mathilde-300",r&&"rotate-90"),children:a}),g.jsx("span",{className:Es(c||"text-base font-semibold"),children:t})]}),a&&i==="right"&&g.jsx("span",{className:Es("transition-transform text-blue-mathilde-300",r&&"rotate-90"),children:a})]}),r&&g.jsx("div",{className:"overflow-hidden",children:g.jsx("div",{className:"px-4 pb-3 text-gray-700",children:n})},"content")]})},z2=({items:e,mode:t="multi",defaultOpen:n=[],className:r})=>{const[s,o]=M.useState(n),a=i=>{o(t==="multi"?l=>l.includes(i)?l.filter(c=>c!==i):[...l,i]:l=>l.includes(i)?[]:[i])};return g.jsx("div",{className:r,children:e.map(i=>g.jsx("div",{className:Es("mb-2 rounded-md",i.containerButtonClasses?i.containerButtonClasses:"border border-[#C4C4C4]"),children:g.jsx(Dc,{id:i.id,title:i.title,isOpen:s.includes(i.id),onToggle:()=>a(i.id),variant:i.variant,icon:i.icon,iconPosition:i.iconPosition,classes:i.classes??"p-5",titleClasses:i.titleClasses,children:i.content})},i.id))})},MN={dropdownListUl:"dropdownList-module__dropdownListUl__M0NZ4"},ON=({onSelect:e,items:t=[],placeholder:n="Buscar país, región o ciudad",fetchItems:r,minCharsToSearch:s=3,debounceMs:o=300,classIncludes:a,disabled:i=!1})=>{const[l,c]=M.useState(!1),[d,u]=M.useState(""),[h,f]=M.useState(t),p=M.useRef(null);M.useEffect(()=>{f(t)},[t]),M.useEffect(()=>{if(!r)return;if(d.trim().length<s){f([]);return}const b=new AbortController,y=setTimeout(async()=>{try{const v=await r(d.trim());f(v)}catch{f([])}},o);return()=>{clearTimeout(y),b.abort()}},[d,r,o,s]);const m=b=>{e(b),u(b.label),c(!1)};return g.jsxs("div",{ref:p,className:a,children:[g.jsx(Xr,{style:{borderRadius:"10px",width:"290px"},type:"search",placeholder:n,name:"search",value:d,onChange:b=>{u(b.target.value),c(!0)},onFocus:()=>c(!0),onBlur:()=>{c(!1)},icon:!1,autoComplete:"off",disabled:i}),l&&h.length>0&&g.jsx("ul",{className:MN.dropdownListUl,children:h.map(b=>g.jsx("li",{onMouseDown:y=>{y.preventDefault(),y.stopPropagation(),m(b)},children:g.jsx("div",{className:"text-xs",children:b.label})},b.id))})]})},fh={dropdownListUl:"dropdownListWithCheckbox-module__dropdownListUl__hLddF",dropdownListItem:"dropdownListWithCheckbox-module__dropdownListItem__x1PgS",selected:"dropdownListWithCheckbox-module__selected__xNGEj"},DN=({items:e=[],fetchItems:t,value:n,defaultValue:r=[],onChange:s,selectAll:o,placeholder:a="Buscar...",disabled:i=!1,iconSearch:l=!1,minCharsToSearch:c=3,debounceMs:d=300,className:u})=>{const h=n!==void 0,[f,p]=M.useState(r),m=h?n:f,[b,y]=M.useState(!1),[v,w]=M.useState(""),[x,k]=M.useState(e),S=M.useRef(null);M.useEffect(()=>{t||k(e)},[e,t]),M.useEffect(()=>{if(!t)return;if(v.trim().length<c){k([]);return}const I=setTimeout(async()=>{try{const U=await t(v.trim());k(U)}catch{k([])}},d);return()=>clearTimeout(I)},[v,t,d,c]),M.useEffect(()=>{const I=U=>{S.current&&!S.current.contains(U.target)&&y(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]),M.useEffect(()=>{if(!o)return;const I=new Set(m.map(F=>F.id));if(!x.every(F=>I.has(F.id))&&x.length>0){const F=x;h||p(F),s==null||s(F)}},[o,x]);const P=M.useCallback(I=>m.some(U=>U.id===I.id),[m]),_=I=>{h||p(I),s==null||s(I)},B=I=>{const F=P(I)?m.filter(R=>R.id!==I.id):[...m,I];_(F)};return g.jsxs("div",{ref:S,className:u,children:[g.jsx(Xr,{type:"search",placeholder:a,value:v,onChange:I=>{w(I.target.value),y(!0)},onFocus:()=>y(!0),icon:l,disabled:i,autoComplete:"off",classInclude:`rounded-md ${i?"opacity-60":"border border-[#19196080]"}`}),b&&x.length>0&&g.jsx("ul",{className:fh.dropdownListUl,children:x.map(I=>g.jsx("li",{className:`${fh.dropdownListItem} ${P(I)?fh.selected:""}`,children:g.jsx(Ch,{label:I.label,value:I.value,icono:I.icono,checked:P(I),onChange:()=>B(I)})},I.id))})]})},EN=({items:e,title:t,onRemove:n,colors:r={},className:s="",containerClassName:o="",titleClassName:a="",showTitle:i=!0})=>{const c={...{backgroundColor:"#EEEEEE",textColor:"#191960",closeButtonBackgroundColor:"#191960",closeButtonTextColor:"#FFFFFF",borderRadius:20},...r},d={borderRadius:`${c.borderRadius}px`,backgroundColor:c.backgroundColor},u={color:c.textColor},h={backgroundColor:c.closeButtonBackgroundColor,color:c.closeButtonTextColor};return g.jsxs("div",{className:`${s}`,children:[i&&t&&g.jsx("h2",{className:`${a}`,children:t}),g.jsx("div",{className:`${o}`,style:{marginTop:6},children:g.jsx("div",{children:e.map(f=>g.jsxs("div",{className:"mb-1 ml-1 inline-flex items-center gap-2 bg-[#EEEEEE] px-2 py-1",style:d,children:[g.jsx("span",{className:"text-xs text-blue-mathilde-300",style:u,children:f.name}),g.jsx("button",{className:"flex size-4 items-center justify-center rounded-full font-semibold",style:h,onClick:()=>n(f.id),"aria-label":`Eliminar ${f.name}`,type:"button",children:"×"})]},f.id))})})]})},H2={success:{url:"https://ftp.mathilde-ads.com/382-fd0ab04039e5e3af316d454eb3ae0c89.svg",imageWidth:70,imageHeight:70},error:{url:"https://ftp.mathilde-ads.com/382-39f2a6acf3e4d6764f422b18995f0d78.svg",imageWidth:70,imageHeight:70},warning:{url:"https://ftp.mathilde-ads.com/382-2f512deea742dcc31826f8f0f612bbb9.svg",imageWidth:70,imageHeight:70}},Ec={};function PN(e){Object.assign(Ec,e)}function TN(e){return Ec[e]??H2[e]}function IN(){for(const e of Object.keys(Ec))delete Ec[e]}const Va={mth_image_icon:"styles-module__mth_image_icon__ivJY8",mth_alert_title:"styles-module__mth_alert_title__beG0Z",mth_alert_container:"styles-module__mth_alert_container__P-oAe",mth_confirm_button:"styles-module__mth_confirm_button__yrvkf",mth_cancel_button:"styles-module__mth_cancel_button__EWLco"},V2={title:Va.mth_alert_title,htmlContainer:Va.mth_alert_container,image:Va.mth_image_icon,cancelButton:Va.mth_cancel_button,confirmButton:Va.mth_confirm_button};function Y2(e){if(e!==void 0){if(Array.isArray(e))return e.join(" ").trim()||void 0;if(typeof e=="string")return e.trim()||void 0}}function AN(e){const t=new Set([...Object.keys(V2),...e?Object.keys(e):[]]),n={};for(const r of t){const s=Y2(V2[r]),o=Y2(e==null?void 0:e[r]),a=[s,o].filter(Boolean).join(" ");a&&(n[r]=a)}return Object.keys(n).length?n:void 0}function RN(e){const{imageIconKey:t,imageUrl:n,imageWidth:r,imageHeight:s,...o}=e,a=()=>({...o,imageUrl:n,imageWidth:r,imageHeight:s});if(!t||n)return a();const i=TN(t);return i?{...o,imageUrl:i.url,imageWidth:r??i.imageWidth??70,imageHeight:s??i.imageHeight??70}:a()}const NN=({isOpen:e,onConfirm:t,onCancel:n,onClose:r,...s})=>(M.useEffect(()=>{if(!e)return;const o=RN(s),{customClass:a,...i}=o,l=AN(a);co.fire({...i,...l?{customClass:l}:{}}).then(c=>{c.isConfirmed&&t&&t(),c.isDismissed&&n&&n(),r&&r()})},[e,n,r,t,s]),null),Pc={"mth-parent-row":"collapsibleTable-module__mth-parent-row__X3y2O","mth-sub-row":"collapsibleTable-module__mth-sub-row__WQDui",mth_head_table:"collapsibleTable-module__mth_head_table__BLx3L",mth_body_table:"collapsibleTable-module__mth_body_table__eXjny"},jN=({columns:e,data:t,showSearch:n=!1,itemsPerPage:r=5,title:s,classesHeadTable:o,classesBodyTable:a,showPagination:i=!0,showCheckboxes:l=!1,selectedRows:c=new Set,onToggleChange:d,onRowSelect:u,onSelectAll:h,isRowSelectable:f=()=>!0,collapsible:p=!1,collapseMode:m="multi",defaultOpenRows:b=[],onCollapseChange:y,openRowIds:v,getSubRows:w,collapseToggleColumnKey:x="id",collapseButtonClassName:k,parentRowClassName:S,subRowClassName:P})=>{const[_,B]=Y.useState(""),[I,U]=Y.useState(1),[F,R]=Y.useState(null),[C,A]=Y.useState(b),W=v??C,N=H=>{if(v)return y==null?void 0:y(H);A(H),y==null||y(H)},D=H=>{p&&N(m==="multi"?W.includes(H)?W.filter(ne=>ne!==H):[...W,H]:W.includes(H)?[]:[H])},X=Y.useMemo(()=>F?[...t].sort((H,ne)=>{const oe=H[F.key],te=ne[F.key];return oe==null||te==null?0:typeof oe=="string"&&typeof te=="string"?F.direction==="asc"?oe.localeCompare(te):te.localeCompare(oe):F.direction==="asc"?Number(oe)-Number(te):Number(te)-Number(oe)}):t,[t,F]),E=Y.useMemo(()=>{if(!_.trim())return X;const H=_.toLowerCase().trim();return X.filter(ne=>e.some(oe=>{const te=ne[oe.relation];return te!=null&&String(te).toLowerCase().includes(H)}))},[X,_,e]),$=Y.useMemo(()=>{const H=(I-1)*r,ne=H+r;return E.slice(H,ne)},[E,I,r]),L=Math.ceil(E.length/r),T=()=>{if(!h)return;const H=$.filter(oe=>f(oe)),ne=H.length>0&&H.every(oe=>c.has(oe.id));h(!ne,H.map(oe=>oe.id))},j=H=>{if(!u||!f(H))return;const ne=H.id,oe=c.has(ne);u(ne,!oe)},O=Y.useMemo(()=>$.filter(H=>f(H)),[$,f]),z=O.filter(H=>c.has(H.id)).length,G=O.length>0&&z===O.length,Q=z>0&&z<O.length,K=H=>{R(ne=>!ne||ne.key!==H?{key:H,direction:"asc"}:{key:H,direction:ne.direction==="asc"?"desc":"asc"})},q=(H,ne)=>typeof H=="function"?H(ne):!!H,ae=(H,ne)=>typeof H=="function"?H(ne):H,V=(H,ne,oe)=>{const te=ne[H.relation],ve=!!(oe!=null&&oe.isSubRow);if(H.isToggle){const be=!!te;return g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(zu,{checked:be,onChange:Me=>d==null?void 0:d({rowId:ne.id,checked:Me,row:ne,columnKey:H.relation}),disabled:!1}),H.toggleText&&g.jsx("span",{className:"text-sm text-gray-600",children:be?H.toggleText.active:H.toggleText.inactive})]})}if(H.badgeConfig)return g.jsx(Py,{value:te,config:H.badgeConfig});if(H.cell)return H.cell(ne);if(H.component){const be=H.component;return Y.createElement(be,{row:ne,value:te,...H.cellProps||{}})}const _e=te??"";if(ve&&H.subRowTooltip&&q(H.subRowTooltip.enabled,ne)){const Me=ae(H.subRowTooltip.content,ne);return g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("span",{children:_e}),g.jsx(ka,{content:Me,trigger:H.subRowTooltip.trigger??"hover",children:g.jsx(Ga,{size:16,className:"size-4","aria-label":H.subRowTooltip.iconAlt??"info"})})]})}return _e},re=(H,ne,oe,te)=>g.jsxs("div",{className:"flex items-center gap-1",children:[oe?g.jsx("button",{type:"button",onClick:()=>D(ne.id),className:k??"mth-collapse-btn","aria-label":te?"Colapsar fila":"Expandir fila",children:te?g.jsx(to,{className:"size-3 text-blue-mathilde-300 -ml-3"}):g.jsx(qD,{className:"size-3 text-blue-mathilde-300 -ml-3"})}):g.jsx("span",{className:"mth-collapse-spacer"}),V(H,ne)]});return g.jsxs("div",{className:"w-full",children:[g.jsx("div",{className:"mb-2 flex items-center justify-between",children:s&&g.jsx("h2",{className:"text-base font-bold",children:s})}),g.jsx("div",{className:"flex",children:n&&g.jsx("div",{className:"mb-5 w-1/2",children:g.jsx(Nu,{rightIcon:Sy,placeholder:"Buscar",value:_,onChange:H=>{B(H.target.value),U(1)}})})}),g.jsxs("div",{className:"mt-0",children:[g.jsx("div",{className:"overflow-x-auto",children:g.jsxs(ju,{children:[g.jsx(Fu,{className:`${Pc.mth_head_table} ${o}`,children:g.jsxs(eo,{children:[l&&g.jsx(xa,{className:"bg-blue-mathilde-light-200",children:g.jsx(fa,{checked:G,ref:H=>{H&&(H.indeterminate=Q)},onChange:T})},"checkbox-head"),e.map((H,ne)=>g.jsx(xa,{className:"bg-blue-mathilde-light-200 cursor-pointer text-xs",onClick:()=>H.sortable!==!1&&K(H.relation),children:g.jsxs("div",{className:"flex items-center gap-1",children:[H.header,H.sortable!==!1&&g.jsx("span",{children:(F==null?void 0:F.key)===H.relation?F.direction==="desc"?g.jsx(to,{className:"size-3"}):g.jsx(Hu,{className:"size-3"}):g.jsx(to,{className:"size-3 opacity-50"})})]})},`column-${ne}-${H.relation}`))]})}),g.jsx(Lu,{className:`divide-y text-xs md:text-base lg:text-base ${Pc.mth_body_table} ${a}`,children:$.map(H=>{const ne=w?w(H):[],oe=p&&ne.length>0,te=oe&&W.includes(H.id);return g.jsxs(Y.Fragment,{children:[g.jsxs(eo,{className:`${te?Pc["mth-parent-row"]:""} ${S}`,children:[l&&g.jsx(sr,{children:g.jsx(fa,{className:"bg-transparent",checked:c.has(H.id),disabled:!f(H),onChange:()=>j(H)})}),e.map((ve,_e)=>ve.relation===x?g.jsx(sr,{className:"whitespace-nowrap font-medium ",children:re(ve,H,oe,te)},`${H.id}-${_e}`):g.jsx(sr,{className:"whitespace-nowrap font-medium",children:V(ve,H)},`${H.id}-${_e}`))]}),oe&&te&&ne.map((ve,_e)=>g.jsxs(eo,{className:`${te?Pc["mth-sub-row"]:""} ${P}`,children:[l&&g.jsx(sr,{}),e.map((be,Me)=>be.relation===x?g.jsx(sr,{className:"whitespace-nowrap font-normal",children:g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("span",{className:"mth-collapse-spacer"}),V(be,ve,{isSubRow:!0})]})},`${H.id}-sub-${_e}-${Me}`):g.jsx(sr,{className:"whitespace-nowrap font-normal",children:V(be,ve,{isSubRow:!0})},`${H.id}-sub-${_e}-${Me}`))]},`${H.id}-sub-${_e}`))]},H.id)})})]})}),i&&L>1&&g.jsx("div",{className:"mt-2 flex w-full justify-end",children:g.jsx(Bu,{currentPage:I,totalPages:L,onPageChange:U})})]})]})};function Tc(e){return $t({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M2 4.75A.75.75 0 0 1 2.75 4h14.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 4.75ZM2 10a.75.75 0 0 1 .75-.75h14.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 10Zm0 5.25a.75.75 0 0 1 .75-.75h14.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"},child:[]}]})(e)}function hh(e){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"},child:[]}]})(e)}const xo=()=>`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,LN=({item:e,categoryId:t})=>g.jsx("div",{className:"px-4 py-1 w-fit text-black font-light rounded-md text-sm cursor-move hover:bg-[#C0D4FF] border border-neutral-200 flex flex-col items-center",draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="copy",n.dataTransfer.setData("application/json",JSON.stringify({categoryId:t,itemId:e.id,label:e.label}))},children:g.jsxs("span",{className:"select-none flex items-center gap-2 text-sm",children:[g.jsx(Tc,{className:"w-4 h-4 text-blue-mathilde-300"}),e.label]})}),FN=({groupId:e,conditions:t,onDrop:n,onRemoveCondition:r})=>{const[s,o]=M.useState(!1),a=c=>{c.preventDefault(),c.dataTransfer.dropEffect="copy",o(!0)},i=()=>{o(!1)},l=c=>{c.preventDefault(),o(!1);try{const d=JSON.parse(c.dataTransfer.getData("application/json")),u={id:xo(),categoryId:d.categoryId,itemId:d.itemId,label:d.label};n(e,u)}catch(d){console.error("Error al procesar el drop:",d)}};return g.jsx("div",{className:`min-h-[40px] p-2 border rounded-md transition-colors ${s?"border-blue-mathilde-300 bg-[#C0D4FF]":"border-[#C4C4C4] bg-gray-50"}`,onDragOver:a,onDragLeave:i,onDrop:l,children:t.length===0?g.jsx("div",{className:"text-gray-400 text-sm text-center",children:"Arrastra elementos aquí"}):g.jsx("div",{className:"flex flex-wrap gap-2 max-h-[200px] overflow-y-auto",children:t.map((c,d)=>g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsxs("div",{className:"px-2 py-1 border border-[#C4C4C4] rounded-md text-sm inline-flex items-center gap-2",children:[g.jsx(Tc,{className:"w-4 h-4 text-blue-mathilde-300"}),g.jsx("span",{children:c.label}),g.jsx(gr,{leftIcon:My,iconSize:16,txtBtn:"",typeButton:"red",full:!1,type:"button",onClick:()=>r(e,c.id),classes:"px-1 py-0.5 rounded-md"})]}),d<t.length-1&&g.jsx("span",{className:"text-xs font-semibold text-gray-500 px-1",children:"AND"})]},c.id))})})},WN=({categories:e,onQueryChange:t,maxGroups:n=5,titleCategories:r="Buscar categorías"})=>{const[s,o]=M.useState([]),[a,i]=M.useState([{id:xo(),title:"Incluir",groups:[{id:xo(),conditions:[],operator:"AND"}]},{id:xo(),title:"Excluir",groups:[{id:xo(),conditions:[],operator:"AND"}]}]),l=f=>{o(p=>p.includes(f)?p.filter(m=>m!==f):[...p,f])},c=(f,p,m)=>{const b=a.map(y=>{if(y.id===f){const v=y.groups.map(w=>w.id===p?w.conditions.some(k=>k.categoryId===m.categoryId&&k.itemId===m.itemId)?w:{...w,conditions:[...w.conditions,m]}:w);return{...y,groups:v}}return y});i(b),t==null||t(b)},d=(f,p,m)=>{const b=a.map(y=>{if(y.id===f){const v=y.groups.map(w=>w.id===p?{...w,conditions:w.conditions.filter(x=>x.id!==m)}:w);return{...y,groups:v}}return y});i(b),t==null||t(b)},u=f=>{const p=a.map(m=>m.id===f&&m.groups.length<n?{...m,groups:[...m.groups,{id:xo(),conditions:[],operator:"OR"}]}:m);i(p),t==null||t(p)},h=(f,p)=>{const m=a.map(b=>b.id===f&&b.groups.length>1?{...b,groups:b.groups.filter(y=>y.id!==p)}:b);i(m),t==null||t(m)};return g.jsxs("div",{className:"flex gap-4 w-full h-full",children:[g.jsxs("div",{className:"w-1/4 bg-white p-4 overflow-y-auto",children:[g.jsx("h3",{className:"text-sm font-semibold mb-2 text-gray-700",children:r||"Categorías"}),g.jsx("div",{className:"bg-white mb-2 overflow-y-auto",children:g.jsx(Xr,{type:"search",placeholder:"Buscar",classInclude:"w-full py-0 rounded-md",className:"mb-2",icon:!1})}),g.jsx("div",{className:"space-y-1 border rounded-md p-5",children:e.map(f=>g.jsx(Dc,{id:f.id,title:f.title,isOpen:s.includes(f.id),onToggle:()=>l(f.id),icon:g.jsx(hh,{className:"w-5 h-5"}),iconPosition:"right",classes:"p-2",children:g.jsx("div",{className:"space-y-1",children:g.jsx("div",{className:"space-y-1",children:f.items.map(p=>g.jsx(LN,{item:p,categoryId:f.id},p.id))})},f.id)},f.id))})]}),g.jsx("div",{className:"flex-1 bg-white border border-gray-200 rounded-lg p-4 overflow-y-auto",children:g.jsx("div",{className:"space-y-2",children:a.map(f=>g.jsx(Dc,{id:f.id,title:f.title,isOpen:s.includes(f.id),onToggle:()=>l(f.id),variant:"bordered",icon:g.jsx(hh,{className:"w-5 h-5"}),iconPosition:"right",classes:"p-4",children:g.jsxs("div",{className:"space-y-2",children:[f.groups.map((p,m)=>g.jsxs("div",{children:[m>0&&g.jsx("div",{className:"flex justify-center my-2",children:g.jsx("span",{className:"px-2 py-1 bg-blue-mathilde-300 text-white text-xs font-semibold rounded-sm",children:"OR"})}),g.jsxs("div",{className:"flex flex-row space-y-1",children:[g.jsx("div",{className:"w-11/12",children:g.jsx(FN,{groupId:p.id,conditions:p.conditions,onDrop:(b,y)=>c(f.id,b,y),onRemoveCondition:(b,y)=>d(f.id,b,y)})}),g.jsx("div",{className:"w-1/12",children:f.groups.length>1&&m>0&&g.jsx("div",{className:"flex justify-end",children:g.jsx(gr,{leftIcon:"https://ftp.mathilde-ads.com/382-6986b247c2c7729fb231da467b8e913c.svg",iconSize:14,txtBtn:"",typeButton:"blue",full:!1,type:"button",onClick:()=>h(f.id,p.id),classes:"px-1 rounded-md text-white w-8 h-8"})})})]})]},p.id)),f.groups.length<n&&g.jsx("div",{className:"flex mt-3",children:g.jsx(gr,{leftIcon:$D,iconSize:14,txtBtn:"",typeButton:"blue",full:!1,type:"button",onClick:()=>u(f.id),classes:"px-2 py-2 rounded-md"})})]})},f.id))})})]})},mh=()=>`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,U2=(e,t)=>e.some(n=>n.categoryId===t.categoryId&&n.itemId===t.itemId),G2=(e,t,n)=>e.map(r=>r.id===t?{...r,conditions:[...r.conditions,n]}:r),BN=(e,t,n,r,s)=>e.map(o=>{if(o.id!==t)return o;if(n){const i=o.groups.find(l=>l.id===n);return!i||U2(i.conditions,r)?o:{...o,groups:G2(o.groups,n,r)}}const a=o.groups.find(i=>i.conditions.length>0&&i.conditions[0].categoryId===r.categoryId);return a?U2(a.conditions,r)?o:{...o,groups:G2(o.groups,a.id,r)}:o.groups.length>=s?o:{...o,groups:[...o.groups,{id:mh(),conditions:[r],operator:"OR"}]}}),zN=(e,t,n,r)=>e.map(s=>{if(s.id!==t)return s;const o=s.groups.map(a=>a.id===n?{...a,conditions:a.conditions.filter(i=>i.id!==r)}:a).filter(a=>a.conditions.length>0);return{...s,groups:o}}),HN=({categoryGroups:e,onQueryChange:t,maxGroups:n})=>{const[r,s]=M.useState([]),[o,a]=M.useState(null),[i,l]=M.useState(null),[c,d]=M.useState(()=>[{id:mh(),title:"Configuración de audiencia",operator:"AND",groups:[]}]);return M.useEffect(()=>{s(m=>m.length===0&&c.length>0?[c[0].id]:m)},[]),{filterSections:c,openCategoryId:i,openAccordions:r,dragData:o,setDragData:a,toggleAccordion:m=>{s(b=>b.includes(m)?b.filter(y=>y!==m):[...b,m])},handleDrop:(m,b,y)=>{const v=BN(c,m,b,y,n);d(v),t==null||t(v)},handleRemoveCondition:(m,b,y)=>{const v=zN(c,m,b,y);d(v),t==null||t(v)},handleSearch:m=>{const b=m.trim().toLowerCase();if(!b){l(null);return}const v=e.flatMap(w=>w.categories).find(w=>{const x=w.title.toLowerCase().includes(b),k=w.items.some(S=>S.label.toLowerCase().includes(b));return x||k});l(v?v.id:null)}}},X2=M.createContext({dragData:null,setDragData:()=>{}}),K2=()=>M.useContext(X2),Z2="drag-cursor-override",VN=({item:e,categoryId:t})=>{const[n,r]=M.useState(!1),{setDragData:s}=K2(),o={categoryId:t,itemId:e.id,label:e.label},a=M.useRef(!1),i=M.useCallback(()=>{const d=document.getElementById(Z2);d&&d.remove()},[]),l=M.useCallback(()=>{i();const d=document.createElement("style");d.id=Z2,d.textContent="* { cursor: grabbing !important; }",document.head.appendChild(d)},[i]),c=M.useCallback(()=>{r(!1),s(null),i(),a.current=!1},[i,s]);return M.useEffect(()=>{const d=()=>{c()};return window.addEventListener("dragend",d),window.addEventListener("drop",d),()=>{window.removeEventListener("dragend",d),window.removeEventListener("drop",d),i()}},[i,c]),g.jsx("div",{className:`flex max-w-[200px] items-center rounded-[5px] border border-neutral-200 px-3 py-1.5 text-sm font-light text-black transition-all hover:bg-pale-blue-300 ${n?"cursor-grabbing opacity-50":"cursor-grab"}`,draggable:!0,onPointerDown:()=>{a.current=!1,l()},onPointerUp:()=>{a.current||i()},onDragStart:d=>{a.current=!0,r(!0),s(o),d.dataTransfer.effectAllowed="all";try{d.dataTransfer.dropEffect="copy"}catch{}d.dataTransfer.setData("application/json",JSON.stringify(o)),l();const u=d.currentTarget.cloneNode(!0);u.style.position="absolute",u.style.top="-9999px",u.style.left="-9999px",u.style.opacity="0.9",u.style.transform="rotate(3deg)",u.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)",document.body.appendChild(u);const h=d.currentTarget.getBoundingClientRect();d.dataTransfer.setDragImage(u,h.width/2,h.height/2),setTimeout(()=>{document.body.contains(u)&&document.body.removeChild(u)},0)},onDragEnd:c,children:g.jsxs("span",{className:"flex min-w-0 flex-1 select-none items-start gap-2",children:[g.jsx(Tc,{className:"mt-0.5 size-4 shrink-0 text-blue-mathilde-300"}),g.jsx("span",{className:"min-w-0 wrap-break-word",children:e.label})]})})},YN=({categoryGroups:e,openCategoryId:t,onSearch:n,selectedItemKeys:r})=>{const[s,o]=M.useState({}),[a,i]=M.useState({}),[l,c]=M.useState({}),[d,u]=M.useState({});M.useEffect(()=>{const f=setTimeout(()=>{i(s);const p=Object.values(s).join(" ");n(p)},2500);return()=>clearTimeout(f)},[s]),M.useEffect(()=>{const f=setTimeout(()=>{u(l),e.forEach(p=>{p.categories.forEach(m=>{const b=l[m.id]??"";m.onCategorySearch&&b.trim()&&m.onCategorySearch(b)})})},2500);return()=>clearTimeout(f)},[l]);const h=M.useMemo(()=>{const f={};return e.forEach(p=>{const m=(a[p.id]??"").trim().toLowerCase(),b=p.categories.map(y=>({...y,items:y.items.filter(v=>!r.has(`${y.id}:${v.id}`))})).filter(y=>y.items.length>0||y.searchable===!0);if(!m){f[p.id]=b;return}f[p.id]=b.map(y=>{const v=y.title.toLowerCase().includes(m),w=y.items.filter(x=>x.label.toLowerCase().includes(m));return v?y:w.length===0&&!y.searchable?null:{...y,items:w}}).filter(y=>y!==null)}),f},[e,a,r]);return g.jsx("div",{className:"w-1/3 overflow-y-auto bg-white p-4 space-y-4",children:e.map(f=>{const p=h[f.id]??[],m=p.length===0?[]:t&&p.some(b=>b.id===t)?[t]:[p[0].id];return g.jsxs("div",{className:"rounded-md border border-neutral-200 p-3",children:[g.jsx("h3",{className:"mb-2 text-base font-semibold text-black",children:f.title}),f.searchable&&g.jsx("div",{className:"mb-2",children:g.jsx(Xr,{type:"search",placeholder:f.searchPlaceholder??"Busca los filtros",icon:!0,onChange:b=>{const y=b.target.value;o(v=>({...v,[f.id]:y}))}})}),g.jsx(z2,{mode:"single",defaultOpen:m,items:p.map(b=>({id:b.id,title:b.title,icon:g.jsx(hh,{className:"size-5"}),iconPosition:"right",classes:"p-1",titleClasses:"text-sm",containerButtonClasses:"border-none",content:(()=>{const y=(d[b.id]??"").trim().toLowerCase(),v=y?b.items.filter(w=>w.label.toLowerCase().includes(y)||w.id.toLowerCase().includes(y)):b.items;return g.jsxs("div",{className:"space-y-1",children:[b.searchable&&g.jsx("div",{className:"mb-2",children:g.jsx(Xr,{type:"search",placeholder:b.searchPlaceholder??"Buscar...",classInclude:"w-full py-0 rounded-md",icon:!0,onChange:w=>{c(x=>({...x,[b.id]:w.target.value}))}})}),g.jsx("div",{className:"max-h-[200px] space-y-1 overflow-y-auto",children:v.map(w=>g.jsx(VN,{item:w,categoryId:b.id},w.id))})]})})()}))},`${f.id}-${t}`)]},f.id)})})},UN=({groupId:e,conditions:t,onRemoveCondition:n})=>g.jsx("div",{className:"flex flex-col gap-2",children:t.map(r=>g.jsx("div",{className:"flex items-center",children:g.jsxs("div",{className:"flex w-[200px] items-start gap-1 rounded-[5px] border border-neutral-200 px-3 py-1.5 text-sm",children:[g.jsx(Tc,{className:"mt-0.5 size-4 shrink-0 text-blue-mathilde-300"}),g.jsx("span",{className:"min-w-0 flex-1 wrap-break-word",children:r.label}),g.jsx(gr,{leftIcon:My,iconSize:18,txtBtn:"",typeButton:"red",full:!1,type:"button",onClick:()=>n(e||"",r.id),classes:"text-black"})]})},r.id))}),GN=({section:e,onDrop:t,onRemoveCondition:n})=>{const[r,s]=M.useState(!1),{dragData:o}=K2(),a=e.groups.some(d=>d.conditions.length>0),i=d=>{d.preventDefault(),d.dataTransfer.dropEffect="copy",s(!0)},l=d=>{d.currentTarget.contains(d.relatedTarget)||s(!1)},c=d=>{d.preventDefault(),s(!1);let u=null;const h=d.dataTransfer.getData("application/json");if(h!=null&&h.trim())try{u=JSON.parse(h)}catch(p){console.error("Error al procesar el drop:",p);return}else o&&(u=o);if(!u)return;const f={id:mh(),categoryId:u.categoryId,itemId:u.itemId,label:u.label};t(e.id,null,f)};return g.jsx("div",{className:"border border-white shadow-[0px_0px_2px_0px_#25252540] rounded-md p-2.5",children:g.jsx("div",{className:`${r?"bg-blue-mathilde-light-50":""} border-2 border-blue-mathilde-100 border-dashed rounded-md p-2.5 min-h-80 w-full transition-colors hover:border-blue-mathilde-300`,onDragOver:i,onDragLeave:l,onDrop:c,children:a?g.jsx("div",{className:"flex flex-col items-start gap-1 2xl:flex-row 2xl:flex-wrap 2xl:gap-1",children:e.groups.map((d,u)=>g.jsxs(M.Fragment,{children:[u>0&&g.jsx("div",{className:"flex items-center justify-center my-1 2xl:my-0 2xl:px-2",children:g.jsx("span",{className:"px-2 py-1 bg-blue-mathilde-300 text-white text-xs font-semibold rounded-sm",children:"AND"})}),g.jsx("div",{className:"shrink-0",children:g.jsx(UN,{groupId:d.id,conditions:d.conditions,onRemoveCondition:(h,f)=>n(e.id,h||d.id,f)})})]},d.id))}):g.jsxs("span",{className:"text-base text-neutral-400 gap-2",children:[g.jsx(vh,{size:40,"aria-hidden":!0,className:"my-2"}),g.jsx("b",{className:"font-semibold",children:"Drag and drop."})," ",g.jsx("br",{}),g.jsx("span",{className:"font-normal",children:"Selecciona las opciones y arrastra hasta aquí."})]})})})},XN=({filterSections:e,sectionTitle:t,onDrop:n,onRemoveCondition:r})=>g.jsx("div",{className:"flex-1 bg-white px-1 py-4 overflow-y-auto",children:g.jsx("div",{className:"px-5 py-4 border border-neutral-200 rounded-md space-y-4 gap-2",children:e.map(s=>g.jsxs(M.Fragment,{children:[t,g.jsx(GN,{section:s,onDrop:n,onRemoveCondition:r})]},s.id))})}),KN=({categoryGroups:e,onQueryChange:t,maxGroups:n=5,isToolTipOpen:r=!1,messageContent:s="Configuración de audiencia"})=>{const{filterSections:o,openCategoryId:a,openAccordions:i,dragData:l,setDragData:c,toggleAccordion:d,handleDrop:u,handleRemoveCondition:h,handleSearch:f}=HN({categoryGroups:e,onQueryChange:t,maxGroups:n}),p=M.useMemo(()=>{const b=new Set;return o.forEach(y=>{y.groups.forEach(v=>{v.conditions.forEach(w=>{b.add(`${w.categoryId}:${w.itemId}`)})})}),b},[o]),m=r?g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-sm text-black font-semibold font-poppins",children:"Configuración de audiencia"}),g.jsx(ka,{content:s,trigger:"hover",children:g.jsx(Ga,{className:"size-4 text-blue-mathilde-300","aria-label":"info"})})]}):g.jsxs("div",{className:"p-0",children:[g.jsx("span",{className:"text-sm text-black font-semibold font-poppins",children:"Configuración de audiencia"}),g.jsx("p",{className:"text-xs text-black bg-blue-mathilde-light-300 font-semibold px-3 py-2.5 rounded-md mt-2.5",children:s})]});return g.jsx(X2.Provider,{value:{dragData:l,setDragData:c},children:g.jsxs("div",{className:"flex w-full",children:[g.jsx(YN,{categoryGroups:e,openCategoryId:a,onSearch:f,selectedItemKeys:p}),g.jsx(XN,{filterSections:o,openAccordions:i,maxGroups:n,sectionTitle:m,onToggleAccordion:d,onDrop:u,onRemoveCondition:h})]})})},gt={"audience-loading":"spinnerMth-module__audience-loading__LEgdv",spinner:"spinnerMth-module__spinner__fFqhw","spinner-center":"spinnerMth-module__spinner-center__GyDhh","spinner-segment":"spinnerMth-module__spinner-segment__gU-wW","segment-1":"spinnerMth-module__segment-1__sSDuK","segment-2":"spinnerMth-module__segment-2__9W-CH","segment-3":"spinnerMth-module__segment-3__fyp4E","segment-4":"spinnerMth-module__segment-4__hMDSa","segment-5":"spinnerMth-module__segment-5__0b-Ow","segment-6":"spinnerMth-module__segment-6__-u1-Q","segment-7":"spinnerMth-module__segment-7__UD-7L","segment-8":"spinnerMth-module__segment-8__6-wy2"},ZN=({description:e=""})=>g.jsx(g.Fragment,{children:g.jsxs("div",{className:gt["audience-loading"],children:[g.jsxs("div",{className:gt.spinner,children:[g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-1"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-2"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-3"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-4"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-5"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-6"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-7"]}`}),g.jsx("div",{className:`${gt["spinner-segment"]} ${gt["segment-8"]}`}),g.jsx("div",{className:gt["spinner-center"]})]}),e&&g.jsx("p",{className:"audience-text",dangerouslySetInnerHTML:{__html:e}})]})}),Q2=({text:e,icon:t,className:n,contentClassName:r,textClassName:s,...o})=>{const a=Kh("inline-flex items-center gap-1.5",r);return g.jsx(Il,{className:n,...o,children:g.jsxs("span",{className:a,children:[s?g.jsx("span",{className:s,children:e}):e,t?g.jsx("span",{className:"inline-flex shrink-0 items-center",children:t}):null]})})};Q2.displayName="Label";const QN=["inline-flex items-center justify-center","rounded-md","text-sm leading-none font-bold font-poppins","cursor-pointer select-none","transition-colors duration-150 ease-in-out","focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:pointer-events-none"],gh="px-5 py-2",JN=ti({base:QN,variants:{variant:{default:["bg-blue-mathilde-300 text-white border-transparent gap-2.5","hover:bg-blue-mathilde-100","active:bg-blue-mathilde-400","focus:shadow-md","focus-visible:ring-blue-mathilde-200","disabled:bg-neutral-200 disabled:text-white"],secondary:["bg-white text-blue-mathilde-300 border border-blue-mathilde-300 gap-2.5","hover:bg-pale-blue-300","active:bg-pale-blue-300","focus-visible:ring-blue-mathilde-300","disabled:border-neutral-200 disabled:text-neutral-200"],link:["bg-transparent text-blue-mathilde-300 underline border-transparent px-0 gap-2.5","hover:text-blue-mathilde-100","active:text-blue-mathilde-400","focus-visible:ring-blue-mathilde-300","disabled:text-blue-mathilde-50"]},iconPosition:{none:gh,left:gh,right:gh,"icon-only":"size-8 p-0"}},defaultVariants:{variant:"default",iconPosition:"none"}}),$N=({variant:e="default",iconPosition:t="none",icon:n,children:r,full:s,...o})=>{const a=t==="icon-only";return g.jsxs("button",{...o,className:JN({variant:e,iconPosition:t}),style:s?{width:"100%"}:void 0,"aria-label":a&&!o["aria-label"]?"button":o["aria-label"],children:[t==="left"&&n,!a&&r,t==="right"&&n,a&&n]})};se.Accordion=Dc,se.AccordionGroup=z2,se.AddSvgIcon=fx,se.AiChatSvgIcon=gx,se.Alert=NN,se.AlertCircleSvgIcon=cx,se.AttachFile=Lc,se.BUILT_IN_ALERT_IMAGE_ICONS=H2,se.BUILT_IN_IMAGE_ICON_SRC=Fc,se.Button=$N,se.ButtonFormat=gr,se.CalendarAnalysis=hx,se.CancelSquareSvgIcon=ux,se.Card=Iy,se.CardIndicator=x1,se.Checkbox=Ch,se.CheckmarkCircleSvgIcon=dx,se.CheckmarkSvgIcon=ix,se.ChipList=EN,se.CollapsibleTable=jN,se.CustomPagination=Bu,se.DashboardBrowsingSvgIcon=mx,se.DatePickerComponent=xN,se.DateRangePicker=wN,se.Delete=xh,se.DragAndDrop=KN,se.DropdownButton=_N,se.DropdownList=ON,se.DropdownListWithCheckbox=DN,se.Dropzone=t8,se.EditSvgIcon=lx,se.Eye=yh,se.EyeSlash=wh,se.FacebookIcon=rx,se.GoogleIcon=sx,se.HandSwipeRight=vh,se.ImageFormat=Mo,se.InfoTooltipSvgIcon=Ga,se.InputForm=Xr,se.Label=Q2,se.LayoutOutside=l6,se.ListFile=r8,se.Loader=kN,se.MathildeIcon=ox,se.ModalFormat=r_,se.MyDoughnutChart=X5,se.PasswordInput=Kc,se.PasswordValidationList=Ty,se.ProgressBar=Jh,se.QueryBuilder=WN,se.RadioButton=SN,se.SearchSvgIcon=kh,se.SelectForm=$h,se.SidebarPro=qS,se.Spinner=s8,se.SpinnerMth=ZN,se.Stepper=CN,se.TableComponent=a6,se.TableOfContents=m6,se.TabsComponent=o8,se.Tag=Vu,se.TermsCheckbox=c6,se.TikTokIcon=ax,se.Toggle=zu,se.TooltipComponent=ka,se.UserListSvgIcon=px,se.ValidationPassword=u6,se.clearAlertImageIcons=IN,se.clearImageIconSrcRegistry=yx,se.getImageIconSrc=Wc,se.registerAlertImageIcons=PN,se.registerImageIconSrc=bx,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
|