1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[32259],{78518:function(e,l,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/backoffice/marketplace/benefits/search",function(){return t(99795)}])},23267:function(e,l,t){"use strict";var i=t(85893),n=t(67294),a=t(39058),s=t(85874),r=t(72349),o=t(98027),d=t(51547),c=t(53467),u=t(25973);l.Z=e=>{let{setIsOpen:l,onDelete:t,isOpen:f,i18nItemType:v="ITEM",i18nItemLabel:x=null,i18nContext:p="male",toastMessage:h,children:m,i18nItemName:_,customSubtitle:b}=e,[E,g]=(0,n.useState)(null),[j,y]=(0,n.useState)(!1),{t:O}=(0,s.useTranslation)(),S=async()=>{y(!0);try{await T()}catch(e){(0,d.Z)(g)(e)}finally{l(!1)}},I=null!=x?x:O(v),{refetch:T,isSaving:N}=(0,o.Z)(async()=>t(),{withToast:!0,toastMessage:h||O("ITEM_DELETED_SUCCESSFULLY",{item:I,context:p})});return(0,n.useEffect)(()=>{f&&y(!1)},[f]),(0,i.jsx)(r.o,{actionElements:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u.bm,{onClick:()=>{l(!1),y(!1)}}),(0,i.jsx)(c.If,{disabled:N||j,variant:"danger",onClick:S,children:O("DELETE")})]}),errors:E,icon:a.Z,iconColor:"danger",isOpen:f,setIsOpen:l,subtitle:b||(0,i.jsxs)(i.Fragment,{children:[O("ARE_YOU_SURE_DELETE",{itemType:I.toLowerCase(),context:p,item:_,warning:""}),(0,i.jsxs)("b",{children:[" ",_]}),"?"]}),title:O("DELETE_ITEM",{item:I.toLowerCase()}),children:m})}},91061:function(e,l,t){"use strict";t.d(l,{Q:function(){return d}});var i=t(85893);t(67294);var n=t(18290),a=t(85874),s=t(9556),r=t(89102),o=t(36862);let d=e=>{let{variant:l="v2",label:t,required:d,value:c,onChange:u,placeholder:f,isMulti:v,isDisabled:x,isClearable:p,hideSelectedOptions:h,className:m,error:_,elementsPerPage:b=10,queryFn:E,parseData:g,searchKey:j="search",params:y={},cacheUniqs:O=[],hideDescriptionOnValue:S=!1,formatOptionLabel:I,filterOption:T}=e,{t:N}=(0,a.useTranslation)(),C="common"===l,F={...(0,o.fu)(_?{borderColor:"#f43f5e"}:{},x,v),menuPortal:e=>(0,o.tq)(e,{}),option:o.cM};async function R(e,l,t){let{page:i}=t,n={...y,page:i,paginate:b};e&&(n[j]=e);let a=await E(n),s=(null==a?void 0:a.data)||a;return{options:g(s),hasMore:(null==s?void 0:s.last_page)>(null==s?void 0:s.current_page),additional:{page:i+1}}}return(0,i.jsxs)("div",{className:"flex flex-col gap-1.5 w-full ".concat(m||""),children:[t&&(C?(0,i.jsx)(r.Z,{children:"".concat(N(t)," ").concat(d?"*":"")}):(0,i.jsxs)("label",{className:"ml-1 text-xs font-bold uppercase text-gray3",children:[N(t),d&&(0,i.jsx)("span",{className:"ml-1 text-rose-500",children:"*"})]})),(0,i.jsx)(s.n9,{additional:{page:1},cacheUniqs:O,closeMenuOnSelect:!v,filterOption:T,formatOptionLabel:null!=I?I:(e,l)=>{var t;let a=(null==l?void 0:l.context)==="menu"&&!1===h&&(null==l?void 0:null===(t=l.selectValue)||void 0===t?void 0:t.some(l=>(null==l?void 0:l.value)===e.value));return(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsx)("span",{className:C?"first-letter:capitalize":"font-medium text-slate-700",children:e.label}),e.description&&!(S&&(null==l?void 0:l.context)==="value")&&(0,i.jsx)("span",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-wider",children:e.description})]}),a&&(0,i.jsx)(n.Z,{sx:{fontSize:18,color:"#10b981"}})]})},hideSelectedOptions:h,isClearable:p,isDisabled:x,isMulti:v,loadOptions:R,loadingMessage:()=>N("LOADING"),menuPortalTarget:"undefined"!=typeof document?document.body:null,menuPosition:"fixed",noOptionsMessage:()=>N("NO_OPTIONS"),placeholder:f||N("SELECT_OPTION"),styles:C?F:{control:(e,l)=>({...e,borderRadius:"0.75rem",border:"1px solid ".concat(_?"#f43f5e":l.isFocused?"#10b981":"#e2e8f0"),boxShadow:l.isFocused?_?"0 0 0 4px rgba(244, 63, 94, 0.1)":"0 0 0 4px rgba(16, 185, 129, 0.1)":"none","&:hover":{borderColor:l.isFocused?"#10b981":"#cbd5e1"},minHeight:"2.75rem",fontFamily:"inherit",transition:"all 0.2s",backgroundColor:x?"#f1f5f9":"#FAFAFA"}),placeholder:e=>({...e,color:"#94a3b8",fontSize:"0.875rem",fontFamily:"inherit"}),valueContainer:e=>({...e,padding:"0 1rem"}),input:e=>({...e,margin:"0",padding:"0",fontSize:"0.875rem",fontFamily:"inherit"}),singleValue:e=>({...e,color:"#334155",fontSize:"0.875rem",fontFamily:"inherit"}),option:(e,l)=>{let t=l.isSelected&&l.isMulti;
1return{...e,backgroundColor:t?l.isFocused?"#ecfdf5":"white":l.isSelected?"#10b981":l.isFocused?"#ecfdf5":"white",color:t?"#1e293b":l.isSelected?"white":"#1e293b",fontWeight:t?600:e.fontWeight,cursor:"pointer",fontSize:"0.875rem",fontFamily:"inherit",padding:"0.625rem 1rem","&:active":{backgroundColor:t?"#ecfdf5":"#10b981"}}},menu:e=>({...e,borderRadius:"0.75rem",overflow:"hidden",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",border:"1px solid #e2e8f0",marginTop:"0.5rem",zIndex:9999}),multiValue:e=>({...e,backgroundColor:"#f1f5f9",borderRadius:"0.375rem"}),multiValueLabel:e=>({...e,color:"#475569",fontSize:"0.75rem",fontWeight:"600",fontFamily:"inherit"}),multiValueRemove:e=>({...e,color:"#94a3b8","&:hover":{backgroundColor:"#e2e8f0",color:"#475569"}}),menuPortal:e=>({...e,zIndex:9999})},theme:C?o.Sv:void 0,value:c,onChange:u}),_&&(0,i.jsx)("span",{className:"text-[11px] font-medium text-rose-500 ml-1",children:N(_)})]})}},7125:function(e,l,t){"use strict";var i=t(85893),n=t(78184),a=t(20881);l.Z=e=>{let{className:l,children:t,...s}=e,{tertiaryColor:r}=(0,n.KX)();return(0,i.jsx)("div",{className:"".concat(l||""," font-bold text-base px-4 py-3 rounded-3xl"),style:{backgroundColor:(0,a.e)(r,.2),color:r},...s,children:t})}},28588:function(e,l,t){"use strict";t.d(l,{Y:function(){return o}});var i=t(85893),n=t(22505),a=t(65902),s=t(52416),r=t(40319);let o=e=>{var l;let{children:t,isOpen:o,setIsOpen:d,isSaving:c,size:u="",title:f,headerElements:v,actionElements:x,reloadOnClose:p,errors:h,appear:m=!1}=e,_=(0,r.G)(p);return(0,i.jsxs)(a.u_,{blocking:c,isOpen:o,setIsOpen:d,variant:null!==(l=(0,s.$)(u))&&void 0!==l?l:"form",onClose:_,children:[(0,i.jsx)(a.xB,{actions:v,title:f}),(0,i.jsxs)(a.fe,{children:[t,(0,i.jsx)(n.Z,{errors:h})]}),x&&(0,i.jsx)(a.mz,{children:x})]})}},40319:function(e,l,t){"use strict";t.d(l,{G:function(){return n}});var i=t(11163);let n=e=>{let l=(0,i.useRouter)();if(e)return()=>l.reload()}},99795:function(e,l,t){"use strict";t.r(l),t.d(l,{__N_SSG:function(){return eT},default:function(){return eN}});var i=t(85893),n=t(67294),a=t(11163),s=t(85874),r=t(50982),o=t(22885),d=t(38706),c=t(14391),u=t(78184),f=t(79434),v=t(42465);let x=()=>{let{t:e}=(0,s.useTranslation)(),l=(0,a.useRouter)(),{benefitName:t}=(0,u.KX)(),r=(0,f.A)(e),[o,d]=(0,n.useState)();return(0,n.useEffect)(()=>{var e,t,i;d((null===(e=l.query)||void 0===e?void 0:e.benefit_type)?{value:null===(t=l.query)||void 0===t?void 0:t.benefit_type,label:null==r?void 0:null===(i=r.find(e=>{var t;return e.value==(null===(t=l.query)||void 0===t?void 0:t.benefit_type)}))||void 0===i?void 0:i.label}:null)},[l]),(0,i.jsx)(v.O,{title:e("BENEFIT_TYPE",{benefit:t}),children:(0,i.jsx)("div",{className:"flex-grow",children:(0,i.jsx)(c.Z,{handleChange:e=>{let t;d(e),t=new URLSearchParams(l.query).toString(),l.push({path:"search".concat(t?"?".concat(t):""),query:{...l.query,page:1,benefit_type:e.value}})},options:r,placeholder:e("SELECT_BENEFIT_TYPE",{benefit:t}),value:o})})})};var p=t(96026),h=t.n(p),m=t(51449),_=t(87728),b=t(98027),E=t(58497),g=t(33808);let j=e=>{let{filter:l,type:t}=e,{t:n}=(0,s.useTranslation)(),{tertiaryColor:r}=(0,u.KX)(),o=(0,a.useRouter)(),d=o.query[t]==(null==l?void 0:l.id);function c(e){let l=e.toString();return"search".concat(l?"?".concat(l):"")}return(0,i.jsx)("button",{className:"px-3 py-2 uppercase border rounded-xl border-gray1",style:{backgroundColor:d?r:"white"},onClick:()=>{let e,t;return t=c(e=new URLSearchParams(o.query)),void(d?(e.delete("benefit_category_id"),e.set("page",1),t=c(e),o.push(t,"",{scroll:!1})):o.push({path:t,query:{...o.query,benefit_category_id:null==l?void 0:l.id,page:1}}))},children:(0,i.jsx)(g.Z,{color:d?"text-white":"text-black",children:n(null==l?void 0:l.code.toUpperCase())})})},y=e=>{var l;let{backOffice:t,benefitType:r}=e,o=(0,a.useRouter)(),{employee:d}=(0,_.E)(),{t:c}=(0,s.useTranslation)(),u={with_benefits:1,only_maslow_benefits:1};(null==o?void 0:null===(l=o.query)||void 0===l?void 0:l.locations)&&(u.locations=o.query.locations),r&&(u.benefit_type=r);let{data:f,isLoading:x,refetch:p}=(0,b.Z)(async()=>t?(0,E.Zi)(u):(0,E.M4)(null==d?void 0:d.company_id,u),{transform:e=>t?e:e.filter(e=>
1e.visible_for_company).filter(e=>"my_benefits"!=e.code)});(0,n.useEffect)(()=>{d&&o.isReady&&p()},[d,o]);let g=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{height:"32",rx:"12",ry:"12",width:"130",x:"4",y:"0"}),(0,i.jsx)("rect",{height:"32",rx:"12",ry:"12",width:"90",x:"145",y:"0"})]}),y=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("rect",{height:"32",rx:"12",ry:"12",width:"90",x:"4",y:"0"}),(0,i.jsx)("rect",{height:"32",rx:"12",ry:"12",width:"130",x:"105",y:"0"})]});return(0,i.jsx)(v.O,{title:c("CATEGORIES"),children:(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:x?(0,i.jsx)(i.Fragment,{children:h()(3).map((e,l)=>(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsx)(m.Z,{customSkeleton:g,height:32,width:250}),(0,i.jsx)(m.Z,{customSkeleton:y,height:32,width:250})]},l))}):(0,i.jsx)(i.Fragment,{children:null==f?void 0:f.map((e,l)=>(0,i.jsx)(j,{filter:e,type:"benefit_category_id"},l))})})})};var O=t(48233),S=t(48382),I=t(63229);let T=e=>{var l,t;let{query:r,title:o,benefitType:d}=e,{t:u}=(0,s.useTranslation)(),f=(0,a.useRouter)(),[x,p]=(0,n.useState)(),{userCountry:h}=(0,I.N)(),m=null!==(t=null==f?void 0:null===(l=f.query)||void 0===l?void 0:l.locations)&&void 0!==t?t:h,_={...m&&"null"!==m?{location:m}:{},sort:"name",direction:"asc"};d&&(_.benefit_type=d);let{data:E,refetch:g}=(0,b.Z)(async()=>r(_));return(0,n.useEffect)(()=>{g()},[m]),(0,n.useEffect)(()=>{var e,l,t;p((null===(e=f.query)||void 0===e?void 0:e.merchant_id)?{value:null===(l=f.query)||void 0===l?void 0:l.merchant_id,label:null==E?void 0:null===(t=E.find(e=>{var l;return e.id==(null===(l=f.query)||void 0===l?void 0:l.merchant_id)}))||void 0===t?void 0:t.name}:null)},[f,E]),(0,i.jsx)(v.O,{title:u(o),children:(0,i.jsx)("div",{className:"flex-grow",children:(0,i.jsx)(c.Z,{handleChange:e=>{let l;p(e),l=new URLSearchParams(f.query).toString(),f.push({path:"search".concat(l?"?".concat(l):""),query:{...f.query,page:1,merchant_id:e.value}})},options:null==E?void 0:E.map(e=>({label:e.name,value:e.id})),placeholder:u("PARTNERS"),value:x})})})};var N=t(14922),C=t(91061);let F=e=>{var l;let{query:t,queryCompany:r}=e,{t:o}
1=(0,s.useTranslation)(),d=(0,a.useRouter)(),[c,u]=(0,n.useState)(null),f=null===(l=d.query)||void 0===l?void 0:l.benefit_of_company;return(0,n.useEffect)(()=>{if(!f){u(null);return}let e=!0;return u(e=>String(null==e?void 0:e.value)===f?e:{value:f,label:""}),r(f).then(l=>{var t,i;let n=null!==(i=null==l?void 0:null===(t=l.data)||void 0===t?void 0:t.data)&&void 0!==i?i:null==l?void 0:l.data;e&&u({value:f,label:(null==n?void 0:n.name)||"-"})}).catch(()=>{e&&u({value:f,label:"-"})}),()=>{e=!1}},[f,r]),(0,i.jsx)(v.O,{title:o("COMPANIES"),children:(0,i.jsx)(C.Q,{elementsPerPage:20,params:{has_benefit_of_company:!0},parseData:e=>{var l,t;return((null!==(t=null!==(l=null==e?void 0:e.data)&&void 0!==l?l:e)&&void 0!==t?t:[])||[]).map(e=>({value:e.id,label:e.name||"-",description:e.suspended?o("SUSPENDED"):void 0}))},placeholder:o("COMPANIES"),queryFn:t,searchKey:"name",value:c,variant:"common",onChange:e=>{u(e),d.push({query:{...d.query,page:1,benefit_of_company:e.value}})}})})};var R=t(82006),w=t(90257);let k=()=>{let{t:e}=(0,s.useTranslation)(),l=(0,a.useRouter)(),[t,r]=(0,n.useState)(),{data:o,refetch:d}=(0,b.Z)(async()=>(0,w.YZ)());return(0,n.useEffect)(()=>{d()},[]),(0,n.useEffect)(()=>{var e,t,i;r((null===(e=l.query)||void 0===e?void 0:e.provider_id)?{value:null===(t=l.query)||void 0===t?void 0:t.provider_id,label:null==o?void 0:null===(i=o.find(e=>{var t;return e.id==(null===(t=l.query)||void 0===t?void 0:t.provider_id)}))||void 0===i?void 0:i.name}:null)},[l,o]),(0,i.jsx)(v.O,{title:e("PROVIDER"),children:(0,i.jsx)("div",{className:"flex-grow",children:(0,i.jsx)(c.Z,{handleChange:e=>{let t;r(e),t=new URLSearchParams(l.query).toString(),l.push({path:"search".concat(t?"?".concat(t):""),query:{...l.query,page:1,provider_id:e.value}})},options:null==o?void 0:o.map(e=>({label:e.name,value:e.id})),placeholder:e("PROVIDERS"),value:t})})})};var A=t(78337),q=t(52056),L=t(96270),P=t(26028),M=t(60144),Z=t(38116);let B=()=>{let e=(0,a.useRouter)(),{company:l}=(0,q.M)(),{t}=(0,s.useTranslation)(),[r,o]=(0,n.useState)(!1),[d,c]=(0,n.useState)(!0),{data:u,refetch:f}=(0,b.Z)(async()=>(0,P.GW)({with_benefits:1,company_id:d?0:null}),{transform:e=>e.map(e=>({id:e.id,name:(0,Z.Y)(e.name,t)}))});(0,n.useEffect)(()=>{l&&f()},[l,d]);let x=(e.query.tags?e.query.tags.split(","):[]).map(e=>parseInt(e)),p=l=>{let t=(e.query.tags?e.query.tags.split(","):[]).map(e=>parseInt(e)),i=[];i=t.includes(l)?t.filter(e=>e!==l):[...t,l];let n={...e.query,tags:i,page:1};if(0===i.length)(0,L.k)("tags",e);else{let l=(0,L.D)(e,n);e.push(l)}},h=r?u:null==u?void 0:u.slice(0,8);return(0,i.jsxs)(v.O,{title:t("TAGS"),children:[(0,i.jsx)(A.X,{checked:d,label:t("SHOW_ONLY_MASLOW_TAGS"),onChange:()=>c(e=>!e)}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:null==h?void 0:h.map(e=>(0,i.jsx)("div",{className:"px-3 py-1 rounded-full text-sm cursor-pointer transition-colors ".concat((null==x?void 0:x.includes(e.id))?"bg-primary text-white":"bg-gray-100 hover:bg-gray-200 text-gray-700"),onClick:()=>p(e.id),children:e.name},e.id))}),!r&&(null==u?void 0:u.length)>8&&(0,i.jsx)(M.L8,{onClick:()=>o(!0),children:t("SHOW_MORE")})]})},D=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(N.F,{}),(0,i.jsx)(O.h,{}),(0,i.jsx)(F,{query:o.z,queryCompany:o._}),(0,i.jsx)(x,{}),(0,i.jsx)(S.g,{}),(0,i.jsx)(T,{query:d.pF,title:"BRANDS"}),(0,i.jsx)(k,{}),(0,i.jsx)(R.k,{}),(0,i.jsx)(y,{backOffice:!0}),(0,i.jsx)(B,{})]});var Y=t(26844),U=t(59184),W=t(86091),z=t(53467);let V=e=>{let{setIsOpen:l}=e,t=(0,a.useRouter)(),{t:r}=(0,s.useTranslation)(),{benefitName:o}=(0,u.KX)(),[d,c]=(0,n.useState)(!1),f=()=>{t.push("/backoffice/marketplace/benefits/bulk-load")};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,i.jsxs)(z.If,{onClick:()=>l(!0),children:[(0,i.jsx)(U.Z,{fontSize:"small"}),r("CREATE_BENEFIT",{benefit:o})]}),(0,i.jsx)(z.If,{variant:"soft",onClick:()=>f(),children:r("BULK_LOAD_LOCATIONS")}),(0,i.jsx)(z.If,{variant:"soft",onClick:()=>c(!0),children:r("EXPORT")})]}),d&&(0,i.jsx)(W.j,{isOpen:d,setIsOpen:c})]})};var K=t(28303),G=t(85699),X=t(28588),H=t(58020),Q=e=>{let{isOpen:l,setIsOpen:t}=e,{t:n}=(0,s.useTranslation)(),{benefitName:a}=(0,u.KX)();return(0,i.jsx)(X.Y,{actionElements:(0,i.jsxs)("div",{className:"flex justify-center w-full gap-4",children:[(0,i.jsxs)("div",{className:"flex flex-col items-center w-full gap-2",children:[(0,i.jsx)(H.F,{fullWidth:!0,href:G.k.BENEFIT
1S.BACKOFFICE_COMPANY_CREATE,variant:"soft",children:n("INTERNAL_BENEFIT",{benefit:a})}),(0,i.jsx)(H.F,{ghost:!0,href:"/backoffice/marketplace/benefits/saas-create",children:n("VIEW_PREVIOUS_FORM_VERSION")})]}),(0,i.jsxs)("div",{className:"flex flex-col items-center w-full gap-2",children:[(0,i.jsx)(H.F,{fullWidth:!0,href:G.k.BENEFITS.BACKOFFICE_MASLOW_CREATE,children:n("MASLOW_BENEFIT")}),(0,i.jsx)(H.F,{ghost:!0,href:"/backoffice/marketplace/benefits/create",children:n("VIEW_PREVIOUS_FORM_VERSION")})]})]}),isOpen:l,setIsOpen:t,title:n("CREATE_BENEFIT",{benefit:a}),children:(0,i.jsx)(K.Z,{children:n("SELECT_BENEFIT_TYPE_TO_CONTINUE",{benefit:a})})})},$=t(43089),J=t(67673),ee=t(95564),el=t(53908),et=t(12162),ei=t(60676),en=t(50901),ea=t(23267),es=t(5745),er=t(7125),eo=t(94574),ed=t(87507),ec=t(17540),eu=t(11913),ef=t(73896);let ev=e=>[{value:"benefit_provider_id",label:e("PROVIDER")},{value:"avg_time_delivery",label:e("AVG_DELIVERY_TIME")},{value:"tags",label:e("TAGS")},{value:"mandatory_fields",label:e("MANDATORY_FIELDS")},{value:"variations",label:e("VARIATIONS")},{value:"locations",label:e("LOCATIONS")},{value:"images",label:e("IMAGES")},{value:"files",label:e("FILES")}],ex={tags:["old_tags"],variations:["convertion_credit_id"],locations:["locations_restrictions"]},ep=e=>{let{isOpen:l,setIsOpen:t,element:r}=e,{t:o}
1=(0,s.useTranslation)(),d=(0,a.useRouter)(),[c,u]=(0,n.useState)([]),{refetch:f,errors:v,isSaving:x}=(0,b.Z)(async()=>h(),{withToast:!0}),p=e=>{u(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},h=async()=>{let e=c.reduce((e,l)=>(ex[l]&&e.push(...ex[l]),e),[]),l=await (0,eo.B5)(r.id,{optional_fields:[...c,...e]});if(l.data){var t;let e=!!(null!==(t=l.data.benefit_of_company)&&void 0!==t?t:null==r?void 0:r.benefit_of_company);d.push(e?G.k.BENEFITS.BACKOFFICE_COMPANY_EDIT(l.data.id):G.k.BENEFITS.BACKOFFICE_MASLOW_EDIT(l.data.id))}},m=ev(o);return(0,i.jsx)(es.Z,{errors:v,isOpen:l,isSaving:x,saveForm:f,setIsOpen:t,subtitle:"ARE_YOU_SURE_YOU_WANT_TO_COPY",title:o("COPY_BENEFIT_MODAL_TITLE"),children:(0,i.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,i.jsx)("p",{className:"mb-3 text-sm text-gray-600",children:o("SELECT_OPTIONAL_FIELDS_TO_COPY")}),(0,i.jsx)("div",{className:"flex flex-col gap-2",children:m.map(e=>(0,i.jsx)(A.X,{checked:c.includes(e.value),id:e.value,label:e.label,onChange:()=>p(e.value)},e.value))})]})})},eh=e=>{let{element:l}=e,t=(0,a.useRouter)(),{benefitName:r}=(0,u.KX)(),{t:o}=(0,s.useTranslation)(),[d,c]=(0,n.useState)(!1),[f,v]=(0,n.useState)(!1),[x,p]=(0,n.useState)(!1),h=async()=>{await (0,eo.iA)(null==l?void 0:l.id),null==t||t.reload()},m=async()=>{await (0,eo.qf)({id:null==l?void 0:l.id,visible:!(null==l?void 0:l.visible)}),null==t||t.reload()};return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(ef.P,{children:[(0,i.jsx)(eu.g,{children:(0,i.jsx)(ec.Z,{actionButtons:(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsxs)(er.Z,{className:"py-1",children:["Id: ",l.id]}),(0,i.jsx)("button",{className:"flex items-center px-3 py-1 border rounded-full shadow ".concat((null==l?void 0:l.visible)?"bg-yellow/50":"bg-gray-500/20"),onClick:()=>p(!0),children:(null==l?void 0:l.visible)?(0,i.jsx)(ei.Z,{}):(0,i.jsx)(en.Z,{})})]}),(0,i.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,i.jsx)(H.F,{"aria-label":o("EDIT"),href:(null==l?void 0:l.benefit_of_company)?G.k.BENEFITS.BACKOFFICE_COMPANY_EDIT(null==l?void 0:l.id):G.k.BENEFITS.BACKOFFICE_MASLOW_EDIT(null==l?void 0:l.id),children:(0,i.jsx)(el.Z,{fontSize:"small"})}),(0,i.jsx)(ed.N,{"aria-label":o("COPY"),variant:"primaryAlt",onClick:()=>c(!0),children:(0,i.jsx)(et.Z,{fontSize:"small"})}),(0,i.jsx)(ed.N,{"aria-label":o("DELETE"),variant:"danger",onClick:()=>v(!0),children:(0,i.jsx)(ee.Z,{fontSize:"small"})})]})]}),element:l})}),f&&(0,i.jsx)(ea.Z,{i18nItemName:null==l?void 0:l.name,i18nItemType:r,isOpen:f,itemId:null==l?void 0:l.id,setIsOpen:v,onDelete:h}),x&&(0,i.jsx)(es.Z,{isOpen:x,saveForm:m,setIsOpen:p,subtitle:o("ARE_YOU_SURE_YOU_WANT_TO_CONFIRM"),title:o((null==l?void 0:l.visible)?"HIDE_BENEFIT":"SHOW_BENEFIT",{benefit:r})}),d&&(0,i.jsx)(ep,{element:l,isOpen:d,setIsOpen:c})]})})};var em=t(92308),e_=t(55930);let eb=e=>{let{setPage:l,benefits:t,isLoading:a,isOpenMobileFilters:s}=e,[r,o]=(0,n.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)($.R,{isOpenMobileFilters:s,children:[(0,i.jsxs)("div",{className:"flex flex-wrap justify-between",children:[(0,i.jsx)(J.v,{benefits:t,isLoading:a}),(0,i.jsx)(V,{setIsOpen:o})]}),(0,i.jsx)(e_.x,{backoffice:!0}),(0,i.jsx)(em.t,{BenefitCardComponent:eh,benefits:t,isLoading:a,setPage:l})]}),r&&(0,i.jsx)(Q,{isOpen:r,setIsOpen:o})]})};var eE=t(68268),eg=t(50925),ej=t(24522),ey=t(57241),eO=t(85289),eS=t(83637),eI=t(71924),eT=!0,eN=function(){var e;(0,eg.a)({middleware:"auth"}),(0,ej.q)(["admin_marketplace"]);let{getFileUrl:l}=(0,ey.p)(),{hideCredits:t,companyCurrency:o}=(0,q.M)(),{t:d}=(0,s.useTranslation)(),{employee:c}=(0,_.E)(),[u,f]=(0,n.useState)(1),v=(0,a.useRouter)(),[x,p]=(0,n.useState)(!1),h={...null==v?void 0:v.query,benefit_type:(null==v?void 0:v.query.benefit_type)?[null==v?void 0:v.query.benefit_type]:[],tags:null==v?void 0:null===(e=v.query.tags)||void 0===e?void 0:e.split(",").map(e=>parseInt(e)),paginate:eO.E,employee_id:null==c?void 0:c.id,page:u};if(t){let e=parseInt((0,eS.zj)(parseInt(h.max_price),o)),l=parseInt((0,eS.zj)(parseInt(h.min_price),o));e?h.max_price=e:delete h.max_price,l?h.min_price=l:delete h.min_price}let{data:m,isLoading:E,isFetched:g,refetch:j}=(0,b.Z)(async()=>(0,eo.so)(h),{transform:e=>({...e,data:e.data.map(e=>(0,eI.P)({data:e,getFileUrl:l}))})});return(0,n.useEffect)(()=>{c&&v.isReady&&j()},[v,c,u]),(0,i.jsxs)(eE.Z,{blank:!0,children:[(0,i.jsx)(r.f,{children:"".concat(d("BENEFIT
1S"))}),(0,i.jsxs)("div",{className:"px-3 m-4 sm:grid sm:grid-cols-4 sm:gap-8 sm:px-0 lg:m-8",children:[(0,i.jsx)(Y.x,{backoffice:!0,filters:(0,i.jsx)(D,{}),isOpenMobileFilters:x,setIsOpenMobileFilters:p}),(0,i.jsx)(eb,{benefits:m,isFetched:g,isLoading:E,isOpenMobileFilters:x,setPage:f})]})]})}}},function(e){e.O(0,[50719,57383,41664,18573,42444,23157,67206,47536,32484,4939,2610,74549,9556,75159,840,98027,9e3,18082,85421,49848,93884,68268,21489,43302,87931,96741,92888,49774,40179],function(){return e(e.s=78518)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.