1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[45581],{25391:function(e,t,n){var i=n(61544).w_;e.exports.Y=function(e){return i({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 11L6.414 11 11.707 5.707 10.293 4.293 2.586 12 10.293 19.707 11.707 18.293 6.414 13 21 13z"}}]})(e)}},96025:function(e,t,n){var i=n(61544).w_;e.exports.Q=function(e){return i({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M7 14C8.10457 14 9 13.1046 9 12C9 10.8954 8.10457 10 7 10C5.89543 10 5 10.8954 5 12C5 13.1046 5.89543 14 7 14Z",fill:"currentColor"}},{tag:"path",attr:{d:"M14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z",fill:"currentColor"}},{tag:"path",attr:{d:"M17 14C18.1046 14 19 13.1046 19 12C19 10.8954 18.1046 10 17 10C15.8954 10 15 10.8954 15 12C15 13.1046 15.8954 14 17 14Z",fill:"currentColor"}},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12ZM22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor"}}]})(e)}},64314:function(e,t,n){var i=n(61544).w_;e.exports.D=function(e){return i({tag:"svg",attr:{viewBox:"0 0 8 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M0 8c0-2.2 1.8-4 4-4s4 1.8 4 4-1.8 4-4 4-4-1.8-4-4z"}}]})(e)}},81646:function(e,t,n){var i=n(61544).w_;e.exports.U=function(e){return i({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M10.072 8.024L5.715 3.667l.618-.62L11 7.716v.618L6.333 13l-.618-.619 4.357-4.357z"}}]})(e)}},65881:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/area-riservata/eventi/richieste-di-modifica",function(){return n(22798)}])},53275:function(e,t,n){"use strict";n.d(t,{Z:function(){return i.Z}});var i=n(92444)},32739:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var i=n(36734),l=n(51776),a=n(28757),r=n(4698),o=n(48456);let s=(0,l.forwardRef)((e,t)=>{let{isClearable:n=!0,onChange:s,title:c,name:u,placeholder:d,value:v="",resetVariable:f,disabled:h=!1,regionId:m,regionName:p,provinceId:x,provinceName:g,nationId:I,isCrm:j=!1}=e,{t:C}=(0,a.Z)("filters"),[E,R]=(0,l.useState)(v);(0,l.useEffect)(()=>{s&&s(E)},[E]),(0,l.useImperativeHandle)(t,()=>({clear(){R("")}})),(0,l.useEffect)(()=>{void 0!==f&&R("")},[f]);let b=(0,l.useMemo)(()=>E?{label:(null==E?void 0:E.name)||"",value:E}:null,[E]),N=(0,l.useCallback)(e=>{R(e)},[]);return(0,i.jsxs)("div",{children:[(0,i.jsx)(r.ZP,{htmlFor:null!=u?u:"location",isCrm:j,children:null!=c?c:C("filters:cities.label")}),(0,i.jsx)(o.Z,{isClearable:n,name:null!=u?u:"location",placeholder:null!=d?d:C("filters:cities.placeholder"),value:b,onAdd:e=>N(null!=e?e:""),disabled:h,regionId:m,regionName:p,provinceId:x,provinceName:g,nationId:I,crm:j})]})});s.displayName="CityInputSelector";var c=s},78534:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var i=n(36734),l=n(51776),a=n(9369),r=n.n(a),o=n(1863),s=n(4698);let c=e=>{let{onChange:t,className:n="",small:a=!0,fromLabel:c,toLabel:u,resetVariable:d,value:v}=e,[f,h]=(0,l.useState)(null!=v?v:{fromDate:"",toDate:""});(0,l.useEffect)(()=>{h(null!=v?v:{fromDate:"",toDate:""})},[v]),(0,l.useEffect)(()=>{t(f)},[f]),(0,l.useEffect)(()=>{void 0!==d&&h({fromDate:"",toDate:""})},[d]);let m=(0,l.useCallback)((e,t)=>{h(n=>({...n,[e]:t||""}))},[]);return(0,i.jsxs)("div",{className:"grid ".concat(n||"grid-cols-2"," gap-4"),children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(s.ZP,{htmlFor:"fromDate",children:c}),(0,i.jsx)(o.z,{name:"fromDate",value:(null==f?void 0:f.fromDate)?r()(null==f?void 0:f.fromDate).toDate():null,onChange:e=>m("fromDate",e),hideErrorText:!0,maxDate:(null==f?void 0:f.toDate)?r()(null==f?void 0:f.toDate).toDate():void 0,small:a})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(s.ZP,{htmlFor:"toDate",children:u}),(0,i.jsx)(o.z,{name:"toDate",value:(null==f?void 0:f.toDate)?r()(null==f?void 0:f.toDate).toDate():null,onChange:e=>m("toDate",e),minDate:(null==f?void 0:f.fromDate)?r()(null==f?void 0:f.fromDate).toDate():void 0,hideErrorText:!0,small:a})]})]})};var u=c},4704:function(e,t,n){"use strict";
1var i=n(36734),l=n(51776),a=n(28757),r=n(69640),o=n(4698),s=n(90946);let c=(0,l.forwardRef)((e,t)=>{let{onChange:n,resetVariable:c,selectedRegionIds:u,selectedProvinceId:d,selectStyle:v="react-select-container",showLabel:f=!0,allValueKey:h}=e,{t:m}=(0,a.Z)("filters"),p=(0,s.LT)(),[x,g]=(0,l.useState)("");(0,l.useImperativeHandle)(t,()=>({clear(){g("")}})),(0,l.useEffect)(()=>{if(d&&p){let e=p.find(e=>Number(null==e?void 0:e.id)===Number(d));e&&g(e)}},[p,d]),(0,l.useEffect)(()=>{n(x)},[x]),(0,l.useEffect)(()=>{void 0!==c&&g("")},[c]);let I=(0,l.useMemo)(()=>x?{label:null==x?void 0:x.name,value:x}:{label:m(null!=h?h:"filters:tutte"),value:""},[h,x,m]),j=(0,l.useMemo)(()=>{let e=p.filter(e=>!u||u.includes(Number(null==e?void 0:e.regionId))),t=e.map(e=>({label:e.name,value:e}));return[{label:m(null!=h?h:"filters:tutte"),value:""},...t]},[h,p,u,m]),C=(0,l.useCallback)(e=>{g(e)},[]),E=(0,l.useMemo)(()=>j.length>0,[j.length]);return(0,i.jsx)("div",{children:E&&(0,i.jsxs)(i.Fragment,{children:[f&&(0,i.jsx)(o.ZP,{htmlFor:"province",children:m("provinces.defaultTitle")}),(0,i.jsx)(r.ZP,{ref:t,placeholder:m("provinces.placeholder"),classNamePrefix:v,className:v,name:"province",value:I,options:j,onChange:e=>C((null==e?void 0:e.value)||"")})]})})});c.displayName="ProvinceSelector",t.Z=c},66718:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var i=n(36734),l=n(51776),a=n(28757),r=n(69640),o=n(4698),s=n(90946);let c=(0,l.forwardRef)((e,t)=>{let{onChange:n,resetVariable:c,selectedRegionId:u,selectStyle:d="react-select-container",showLabel:v=!0,title:f="Regione:",allValueKey:h}=e,{t:m}=(0,a.Z)(),p=(0,s.eH)(),[x,g]=(0,l.useState)("");(0,l.useImperativeHandle)(t,()=>({clear(){g("")}})),(0,l.useEffect)(()=>{if(u){let e=null==p?void 0:p.find(e=>+e.id==+u);e&&g(e)}},[p,u]),(0,l.useEffect)(()=>{n(x)},[x]),(0,l.useEffect)(()=>{void 0!==c&&g("")},[c]);let I=(0,l.useMemo)(()=>x?{label:null==x?void 0:x.name,value:x}:{label:m(null!=h?h:"filters:tutte"),value:""},[m,h,x]),j=(0,l.useMemo)(()=>{let e=p.map(e=>({label:null==e?void 0:e.name,value:e}));return[{label:m(null!=h?h:"filters:tutte"),value:""},...e]},[h,p,m]),C=(0,l.useCallback)(e=>{g(e)},[]),E=(0,l.useMemo)(()=>j.length>0,[j.length]);return(0,i.jsx)("div",{children:E&&(0,i.jsxs)(i.Fragment,{children:[v&&(0,i.jsx)(o.ZP,{htmlFor:"region",children:f}),(0,i.jsx)(r.ZP,{ref:t,placeholder:"Regione",classNamePrefix:d,className:d,name:"region",value:I,options:j,onChange:e=>C(null==e?void 0:e.value)})]})})});c.displayName="RegionSelector";var u=c},98405:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var i=n(36734),l=n(51776),a=n(28757),r=n(69640),o=n(4698);let s=e=>{let{onChange:t,resetVariable:n,title:s,name:c="sortByEventDate"}=e,{t:u}=(0,a.Z)("filters"),[d,v]=(0,l.useState)("");(0,l.useEffect)(()=>{t(d)},[d]),(0,l.useEffect)(()=>{void 0!==n&&v("")},[n]);let f=(0,l.useMemo)(()=>{switch(d){case"DESC":return{label:u("sorting.desc"),value:d};case"ASC":return{label:u("sorting.asc"),value:d};default:return{label:u("sorting.none"),value:""}}},[d,u]),h=(0,l.useMemo)(()=>[{label:u("sorting.none"),value:""},{label:u("sorting.desc"),value:"DESC"},{label:u("sorting.asc"),value:"ASC"}],[u]),m=(0,l.useCallback)(e=>{v(e)},[]);return(0,i.jsxs)("div",{children:[(0,i.jsx)(o.ZP,{htmlFor:c,children:s}),(0,i.jsx)(r.ZP,{placeholder:u("sorting.placeholder"),classNamePrefix:"react-select-container",className:"react-select-container",name:c,value:f,options:h,onChange:e=>m(null==e?void 0:e.value)})]})};var c=s},60499:function(e,t,n){"use strict";n.d(t,{Z:function(){return i.Z}});var i=n(30335)},26295:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var i=n(36734);n(51776);var l=n(83349);function a(e){let{children:t,onlyOn:n}=e,a=(0,l.o)(n);return a?(0,i.jsx)(i.Fragment,{children:t}):null}},90946:function(e,t,n){"use strict";n.d(t,{LT:function(){return o},eH:function(){return r}});var i=n(51776),l=n(27734),a=n(99972);let r=()=>{var e;let{data:t}=(0,l.a)(a.IY);return(0,i.useMemo)(()=>null!==(e=null==t?void 0:t.regions)&&void 0!==e?e:[],[null==t?void 0:t.regions])},o=e=>{var t;let{data:n}=(0,l.a)(a.Pd);return(0,i.useMemo)(()=>null!==(t=null==n?void 0:n.provinces)&&void 0!==t?t:[],[null==n?void 0:n.provinces])}},99972:function(e,t,n){"use strict";n.d(t,{IY:function(){return c},Pd:function(){return u},ek:function(){return d}});var i=n(73097),l=n(33450);function a(){let e=(0,i._)(["\n query regions {\n regions {\n id\n name\n }\n }\n"]);return a=function(){return e},e}function r(){let e=(0,i._)(["\n query provinces($filter: ProvincesFilterInput) {\n provinces(filter: $filter) {\n id\n name\n code\n regionId\n regionName\n }\n }\n"]);return r=function(){return e},e}function o(){let e=(0,i._)(["\n query nationsWithReferents {\n nationsWithReferents {\n id\n name\n iso2\n iso3\n referentsCount\n }\n }\n"]);return o=function(){return e},e}function s(){let e=(0,i._)(["\n query nationReferents($id: Int!) {\n nationReferents(id: $id) {\n nation {\n id\n name\n iso2\n iso3\n }\n referents {\n firstName\n lastName\n type\n locationName\n }\n }\n }\n"]);return s=function(){return e},e}let c=(0,l.Ps)(a()),u=(0,l.Ps)(r());(0,l.Ps)(o());let d=(0,l.Ps)(s())},98836:function(e,t,n){"use strict";n.d(t,{K:function(){return s}});
1var i=n(36734),l=n(51776),a=n(28757),r=n(5788);let o=e=>{let{value:t,label:n,placeholder:o,withAllOption:s=!0,...c}=e,{t:u}=(0,a.Z)("filters"),d=(0,l.useMemo)(()=>{let e=null!=n?n:u("nations.defaultTitle"),i=null!=o?o:u("nations.all");return{value:t,label:e,placeholder:i,withAllOption:s,isClearable:!0,...c}},[n,u,o,t,s,c]);return(0,i.jsx)(r.Z,{type:"nation",config:d})};var s=o},22798:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return eL},default:function(){return eH}});var i=n(36734),l=n(20150),a=n.n(l),r=n(28757),o=n(46799),s=n(53275),c=n(33906),u=n(51776),d=n(9369),v=n.n(d),f=n(58060),h=n(31030),m=n(86981),p=n(63766),x=n(9758),g=n(61210),I=n(32711),j=n(96354),C=n(147),E=n(81025),R=n(3646),b=n(43954),N=n(56675);let M=["",N._0.CATEGORIA,N._0.LUOGO,N._0.DATA_ULTIMA_MODIFICA,N._0.DATA,N._0.REFERENTE,N._0.STATUS],A=[...M,N._0.AZIONI],Z=["",N._0.CATEGORIA,N._0.LUOGO,N._0.DATA,N._0.GRAPHICSTATUS],D={[b.vX.ADMIN]:[...M],[b.vX.GRAPHIC]:[...A],[b.vX.NATIONAL_REFERENT]:[...M],[b.vX.REGIONAL_SECRETARY]:[...M],[b.vX.REGIONAL_UNDER_SECRETARY]:[...M],[b.vX.REGIONAL_REFERENT]:[...M],[b.vX.VICE_REGIONAL_REFERENT]:[...M],[b.vX.PROVINCIAL_REFERENT]:[...Z],[b.vX.VICE_PROVINCIAL_REFERENT]:[...Z],[b.vX.LOCAL_REFERENT]:[...Z],[b.vX.SOCIAL]:[...M]},_=e=>D[e];var w=n(44329),S=n(4833),y=n(41258);let T=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>t.reduce(async(e,t)=>t(await e),e)};var q=n(56683),P=n(39979),F=n(18171),G=n(11650),O=n(60427),k=n(8304),L=n(31921),H=n(26982),X=n(59011),U=n(13501),V=n(84767),B=n(45012),z=n(34521),Y=n(72742);let J=async(e,t,n)=>(0,V.AX)().then(i=>n.mutate({mutation:z.qS,context:{currentSession:null==i?void 0:i.user},variables:{requestModificationId:e,id:t}}).then(e=>{let{data:t}=e;if(t)return null==t?void 0:t.approveRequestModification;throw Error()}).catch(t=>((0,B.U)({message:"Request modification ID:".concat(e," went wrong with the following error:").concat(t,"!"),exception:t}),!1))),K=async(e,t,n)=>(0,V.AX)().then(i=>n.mutate({mutation:z.BG,context:{currentSession:null==i?void 0:i.user},variables:{requestModificationId:e,id:t}}).then(e=>{let{data:t}=e;if(t)return null==t?void 0:t.rejectRequestModification;throw Error()}).catch(t=>((0,B.U)({message:"Delete event ID:".concat(e," went wrong with the following error:").concat(t,"!"),exception:t}),!1))),$=async(e,t)=>(0,V.AX)().then(n=>t.query({query:j.GL,context:{currentSession:null==n?void 0:n.user},variables:{id:e}}).then(e=>{let{data:t}=e;if(t)return null==t?void 0:t.requestModificationEvent;throw Error()}).catch(t=>(G.Z.error("Non \xe8 stato possibile recuperare i dati della richiesta di modifica!"),(0,B.U)({message:"Could not retrieve request modification with ID:".concat(e," with the following error:").concat(t,"!"),exception:t}),!1))),W=async(e,t,n)=>(0,V.AX)().then(i=>n.mutate({mutation:Y.jK,context:{currentSession:null==i?void 0:i.user},variables:{requestModificationId:e,reason:t}}).then(e=>{let{data:t}=e;if(t)return null==t?void 0:t.approveRequestModificationGraphic;throw Error()}).catch(e=>(console.error(e),!1))),Q=async(e,t,n)=>(0,V.AX)().then(i=>n.mutate({mutation:Y.NV,context:{currentSession:null==i?void 0:i.user},variables:{requestModificationId:e,reason:t}}).then(e=>{let{data:t}=e;if(t)return null==t?void 0:t.rejectRequestModificationGraphic;throw Error()}).catch(e=>(console.error(e),!1)));var ee=n(65633),et=n(59363),en=n.n(et),ei=n(98910);let el=[{name:"date",colspan:"col-span-3"},{name:"applicant",colspan:"col-span-3"},{name:"status",colspan:"col-span-3"},{name:"graphicRequest",colspan:"col-span-2"},{name:"Actions",colspan:"col-span-1",css:"text-left pl-4"}],ea=e=>{let{requests:t,eventId:n}=e,{t:l}=(0,r.Z)("eventi"),a=(0,w.x)(),{api:{refetch:o}}=(0,h.ai)();(0,f.kP)();let{role:s}=(0,X.w)(),{openRecap:c,recapModal:d}=(0,L.Z)({title:l("r-events:modals.modificationRequest.title")}),v=(0,u.useCallback)(async e=>{let t=await $(e,a);if(t){let e={...t};await c({automaticallyApproved:null==e?void 0:e.automaticallyApproved,graphicsManaged:null==e?void 0:e.graphicsManaged,graphicMessage:null==e?void 0:e.graphicMessage,communication:null==e?void 0:e.communication,description:null==e?void 0:e.description,originalEvent:null==e?void 0:e.currentEvent,modifiedEvent:{...JSON.parse(null==e?void 0:e.requiredModifications)},isPartial:!0})}},[a,c]),m=(0,u.useCallback)(async(e,t,n)=>{let i=n?await J(e,t,a):await K(e,t,a);i?(G.Z.success(l("r-events:toasts.modificationRequest.".concat(n?"successApproved":"successRejected"))),await o()):G.Z.error(l("r-events:toasts.modificationRequest.".concat(n?"errorApproved":"errorRejected")))},[a,o,l]),p=(0,u.useCallback)(async(e,t,n)=>{let i=n?await W(e,t,a):await Q(e,t,a);i?G.Z.success(l("eventi-reserved:requestModificationGraphic.toast.success")):G.Z.error(l("eventi-reserved:requestModificationGraphic.toast.error")),await o()},[a,o,l]),x={handleRequestModification:m,openRecapModal:v,handleRequestModificationGraphics:p};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:en().listaContainer,children:null==t?void 0:t.map(e=>(0,i.jsx)("div",{className:en().singolaRichiesta,children:el.map(t=>{let{name:a,colspan:r,css:o=""}=t;return(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 ".concat(r," ").concat(o),children:[(0,i.jsx)(E.Z,{tag:"span",className:"font-semibold",children:l("r-events:tab.RICHIESTE_MODIFICA.columns.".concat(a))}),er(a,e,l,s,x,n)]},a)})},null==e?void 0:e.id))}),d]})},er=(e,t,n,i,l,a)=>eo[e](t,n,i,l,a),eo={date:e=>{let t=null==e?void 0:e.creationTime.split(":"),n=e=>{switch(e){case"hours":return Number(t[0]);case"minutes":return Number(t[1])}};return(0,i.jsxs)(E.Z,{tag:"span",children:[v()(null==e?void 0:e.createdAt).format(g.vc)," -"," ",v().utc().set("hours",n("hours")).set("minutes",n("minutes")).tz("Europe/Rome").format("HH:mm")]})},applicant:e=>(0,i.jsx)(E.Z,{tag:"span",children:(0,p.P)(null==e?void 0:e.createdBy)}),graphicRequest:(e,t)=>
1{if(!e.automaticallyApproved||!e.graphicsManaged)return(0,i.jsx)("span",{children:"-"});switch(e.graphicsManaged.toLowerCase()){case U.wN.PENDING:return(0,i.jsx)("img",{src:"/icons/in_attesa.svg",alt:t("eventi-reserved:requestModificationGraphic.graphicMessage.PENDING"),title:t("eventi-reserved:requestModificationGraphic.graphicMessage.PENDING"),width:"24",height:"24"});case U.wN.MANAGED:return(0,i.jsx)("img",{src:"/icons/approvata.svg",alt:t("eventi-reserved:requestModificationGraphic.graphicMessage.MANAGED"),title:t("eventi-reserved:requestModificationGraphic.graphicMessage.MANAGED"),width:"24",height:"24"});case U.wN.REJECTED:return(0,i.jsx)("img",{src:"/icons/rejected.svg",alt:t("eventi-reserved:requestModificationGraphic.graphicMessage.REJECTED"),title:t("eventi-reserved:requestModificationGraphic.graphicMessage.REJECTED"),width:"24",height:"24"})}},status:(e,t)=>{let n;switch(null==e?void 0:e.status){case ee.p.ACCEPTED:n="success";break;case ee.p.REJECTED:n="danger";break;default:n="warning"}return(0,i.jsx)(C.Z,{size:"admin",variation:n,className:"w-max",children:t("status.".concat(null==e?void 0:e.status))})},Actions:(e,t,n,l,a)=>{let[r,o]=(0,u.useState)(!1);(0,P.b)(()=>o(!1));let s=async()=>{o(!r)},c=(0,u.useRef)(),d=T(s,()=>l.openRecapModal(null==e?void 0:e.id)),v=T(s,()=>l.handleRequestModification(null==e?void 0:e.id,a,!0)),f=T(s,()=>l.handleRequestModification(null==e?void 0:e.id,a,!1)),h=(0,q.Kf)(n)&&(0,k.B5)(e),m=async t=>{await l.handleRequestModificationGraphics(null==e?void 0:e.id,t,!0)},p=async t=>{await l.handleRequestModificationGraphics(null==e?void 0:e.id,t,!1)},{open:x,textInputModal:g}=(0,F.Z)({title:t("eventi-reserved:requestModificationGraphic.modal.areYouSure"),textAreaTitle:(0,i.jsxs)(i.Fragment,{children:[t("eventi-reserved:requestModificationGraphic.modal.approveTitle"),(0,i.jsx)("br",{}),t("eventi-reserved:requestModificationGraphic.modal.details")]}),textAreaPlaceHolder:"",textAreaRequired:!1,onConfirm:m,confirmButtonText:"Conferma",onCancel:ei.Z}),{open:I,textInputModal:j}=(0,F.Z)({title:"Sei sicuro?",textAreaTitle:(0,i.jsxs)(i.Fragment,{children:[t("eventi-reserved:requestModificationGraphic.modal.rejectTitle"),(0,i.jsx)("br",{}),t("eventi-reserved:requestModificationGraphic.modal.details")]}),textAreaPlaceHolder:"",textAreaRequired:!1,onConfirm:p,confirmButtonText:"Conferma",onCancel:ei.Z});return(0,i.jsxs)("div",{className:"w-[80px] max-w-[80px]",children:[(0,i.jsx)(y.ZP,{interactive:!0,placement:"bottom-end",offset:[0,-10],theme:"plastic-free-cms",visible:r,ref:c,onClickOutside:s,content:(0,i.jsxs)(O.p2,{children:[(0,i.jsx)("li",{children:(0,i.jsx)("button",{onClick:d,children:t("r-events:tab.RICHIESTE_MODIFICA.viewDetails")})}),((0,H.P)(n)||n===b.vX.GRAPHIC)&&(null==e?void 0:e.status)==="PENDING"&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("li",{children:(0,i.jsx)("button",{onClick:v,children:t("r-events:tab.RICHIESTE_MODIFICA.approve")})}),(0,i.jsx)("li",{children:(0,i.jsx)("button",{onClick:f,children:t("r-events:tab.RICHIESTE_MODIFICA.reject")})})]}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("li",{children:(0,i.jsx)("button",{onClick:x,children:t("eventi-reserved:requestModificationGraphic.actions.approve")})}),(0,i.jsx)("li",{children:(0,i.jsx)("button",{onClick:I,children:t("eventi-reserved:requestModificationGraphic.actions.reject")})})]})]}),children:(0,i.jsx)("div",{onClick:s,className:"flex w-full h-full items-center cursor-pointer text-2xl",children:(0,i.jsx)(S.W,{})})}),g,j]})}};var es=n(40981),ec=n(5379),eu=n(75206),ed=n(83349),ev=n(69832),ef=n(83328),eh=n(69640),em=n(21849),ep=n(98836),ex=n(32739),eg=n(78534),eI=n(4698),ej=n(4704),eC=n(66718),eE=n(98405),eR=n(14807),eb=n(60499),eN=n(26295),eM=n(23826);function eA(){let{role:e}=(0,X.w)(),{data:{hasFiltersApplied:t},api:{resetFilters:n}}=(0,h.ai)(),[l,a]=(0,u.useState)(!1),r=()=>{a(e=>!e),n()};return(0,i.jsx)(eb.Z,{onResetFilters:r,resetEnabled:t,children:[b.vX.ADMIN,b.vX.GRAPHIC].includes(e)?(0,i.jsx)(eZ,{resetVariable:l}):(0,i.jsx)(eD,{resetVariable:l})})}function eZ(e){var t,n,l,a,o;let{resetVariable:s}=e,{t:c}=(0,r.Z)("r-users"),d=(0,ed.o)(),{data:{filters:f},api:{changeFilter:m}}=(0,h.ai)(),p=(0,em.S)(null==f?void 0:null===(t=f.filter)||void 0===t?void 0:t.fromSignupDate,null==f?void 0:null===(n=f.filter)||void 0===n?void 0:n.toSignupDate),x=(0,u.useCallback)(e=>{m("createdByUserId",parseInt(null==e?void 0:e.id)||void 0)},[m]),I=(0,u.useMemo)(()=>eS.map(e=>({...e,label:c(e.label)})),[c]),j=d?null==f?void 0:null===(l=f.filter)||void 0===l?void 0:l.nationId:eM.x.Italy,C=j===eM.x.Italy,E=(0,u.useRef)(null),R=(0,u.useRef)(null),b=(0,u.useRef)(null);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"xl:col-span-3",children:(0,i.jsx)(e_,{})}),(0,i.jsxs)("div",{className:"xl:col-span-3",children:[(0,i.jsx)(eI.ZP,{htmlFor:"category",children:c("evento-form:step2.infoForm.category.title")}),(0,i.jsx)(eh.ZP,{instanceId:"category",placeholder:c("evento-form:step2.infoForm.category.placeholder"),classNamePrefix:"react-select-container",className:"react-select-container",name:"category",value:I.find(e=>{var t;return e.value===(null===(t=f.filter)||void 0===t?void 0:t.category)}),options:I,onChange:e=>m("category",(null==e?void 0:e.value)||void 0)})]}),(0,i.jsx)("div",{className:"xl:col-span-6",children:(0,i.jsx)(eg.Z,{className:"grid-cols-1 xl:grid-cols-2",value:p,resetVariable:s,fromLabel:"".concat(c("eventi:filters.fromDate"),":"),toLabel:"".concat(c("eventi:filters.toDate"),":"),onChange:e=>{m("fromDate",(null==e?void 0:e.fromDate)?v()(null==e?void 0:e.fromDate).format(g.gR):""),m("toDate",(null==e?void 0:e.toDate)?v()(null==e?void 0:e.toDate).format(g.gR):"")}})}),(0,i.jsx)("div",{className:"xl:col-span-3",children:(0,i.jsx)(eR.Z,{newLabel:c("eventi:filters.referent.title"),name:"referents",placeholder:c("eventi:filters.referent.placeholder"),isClearable:!0,keepValue:!0,resetVariable:s,onAdd:x})}),(0,i.jsx)(eN.Z,{children:(0,i.jsx)("div",{className:"xl:col-span-3",children:(0,i.jsx)(ep.K,{name:"nation",value:j,onChange:e=>{m("nationId",e),m("cityId",null),m("regionId",null),m("provinceId",null)}})})}),C&&(0,i.jsx)("div",{className:"xl:col-span-3",children:(0,i.jsx)(eC.Z,{ref:E,resetVariable:s,onChange:e=>{var t,n;m("regionId",e?Number(null==e?void 0:e.id):""),null==R||null===(t=R.current)||void 0===t||t.clear(),m("provinceId",null),null==b||null===(n=b.current)||void 0===n||n.clear(),m("cityId",null)}})}),C&&(0,i.jsx)("div",{className:"xl:col-span-3",children:(0,i.jsx)(ej.Z,{ref:R,resetVariable:s,selectedRegionIds:(null==f?void 0:f.filter.regionId)?[null==f?void 0:f.filter.regionId]:void 0,onChange:e=>{var t;m("provinceId",e?Number(null==e?void 0:e.id):""),null==b||null===(t=b.current)||void 0===t||t.clear(),m("cityId",null)}})}),(0,i.jsx)("div",{className:"xl:col-span-3",children:(0,i.jsx)(ex.Z,{ref:b,t
1itle:c("filters:municipality.label"),placeholder:c("filters:municipality.placeholder"),resetVariable:s,nationId:j,regionId:null==f?void 0:null===(a=f.filter)||void 0===a?void 0:a.regionId,provinceId:null==f?void 0:null===(o=f.filter)||void 0===o?void 0:o.provinceId,disabled:!j,onChange:e=>{m("cityId",e?Number(null==e?void 0:e.id):"")}})})]})}function eD(e){var t;let{resetVariable:n}=e,{api:{changeFilter:l},data:{filters:a}}=(0,h.ai)(),{t:o}=(0,r.Z)("filters"),s=(0,ed.o)(),c=s?null==a?void 0:null===(t=a.filter)||void 0===t?void 0:t.nationId:eM.x.Italy,u=c===eM.x.Italy;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"col-span-3",children:(0,i.jsx)(eE.Z,{title:o("sorting.title"),resetVariable:n,onChange:e=>l("sortByEventDate",e)})}),(0,i.jsx)(eN.Z,{children:(0,i.jsx)("div",{className:"col-span-3",children:(0,i.jsx)(ep.K,{name:"nation",value:c,onChange:e=>{l("nationId",e),l("cityId",null),l("regionId",null),l("provinceId",null)}})})}),u&&(0,i.jsx)("div",{className:"col-span-3",children:(0,i.jsx)(ej.Z,{resetVariable:n,onChange:e=>l("provinceId",e?Number(null==e?void 0:e.id):"")})}),(0,i.jsx)("div",{className:"col-span-3",children:(0,i.jsx)(e_,{})})]})}let e_=()=>{let{t:e}=(0,r.Z)("r-users"),{data:{filters:t},api:{changeFilter:n}}=(0,h.ai)(),l=(0,u.useMemo)(()=>ew.map(t=>({...t,label:e(t.label)})),[e]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eI.ZP,{htmlFor:"category",children:[e("eventi:filters.graphicStatus"),":"]}),(0,i.jsx)(eh.ZP,{instanceId:"graphicStatus",placeholder:e("eventi:filters.graphicStatus"),classNamePrefix:"react-select-container",className:"react-select-container",name:"graphicStatus",value:l.find(e=>{var n;return e.value===(null===(n=t.filter)||void 0===n?void 0:n.graphicStatus)}),options:l,onChange:e=>n("graphicStatus",(null==e?void 0:e.value)||void 0)})]})},ew=[{value:void 0,label:"filters:tutti"},...Object.keys(U.S1).map(e=>({value:e,label:"evento-form:graphicStep.updateProcessingForm.radio.".concat(e)}))],eS=[{value:void 0,label:"filters:tutte"},...Object.keys(U.Jk).map(e=>({value:e,label:"evento-form:types.".concat(e)}))],ey=()=>{let[e]=(0,f.kP)(),{data:{me:t}}=(0,I.aF)(e),{t:n}=(0,r.Z)("r-events"),l=(0,u.useMemo)(()=>{let e=_(null==t?void 0:t.role),i=e.map(e=>e?n("common.columns.".concat(e)):e);return{keys:e,translated:i}},[null==t?void 0:t.role,n]),a=(0,u.useMemo)(()=>l.keys.includes(N._0.AZIONI),[l]);return(0,i.jsx)(eP,{columns:l.keys,withActions:a,children:(0,i.jsxs)(h.ZP,{query:j.lm,queryName:"eventsWithRequestModifications",emptyText:n("tab.RICHIESTE_MODIFICA.noResults"),initialFilters:{withRequestModifications:!0},children:[(0,i.jsx)(ef.Z,{}),(0,i.jsx)(eA,{}),(0,i.jsx)(eu.h,{type:es.yq.RICHIESTE_MODIFICA}),(0,i.jsx)(h.Le,{columns:l.translated,Row:eF,firstSmall:!0,secondSmall:!0,secondToLastSmall:!0,lastSmall:a})]})})},eT=(0,u.createContext)(null),eq=()=>(0,u.useContext)(eT),eP=e=>{let{columns:t,withActions:n,children:l}=e,a=(0,u.useMemo)(()=>({columns:t,withActions:n}),[t,n]);return(0,i.jsx)(eT.Provider,{value:a,children:l})},eF=(0,u.memo)(e=>{let{item:t}=e,{columns:n,withActions:l}=eq(),{t:a}=(0,r.Z)("eventi"),o=(0,I.j$)(),s=(0,c.useRouter)(),d=s.locales,{copy:v}=(0,x.Z)({msg:a("r-events:tab.RICHIESTE_MODIFICA.copiedUrl")}),f=(0,u.useCallback)(e=>{let n=(0,k.zb)({ev:t,locale:e});v("".concat("https://www.plasticfreeonlus.it")+n)},[v,t]),h=(0,u.useMemo)(()=>{let e=null==t?void 0:t.requestModifications;return!!e&&(null==e?void 0:e.some(e=>(null==e?void 0:e.status)===ee.p.PENDING))},[t]),p=(0,ed.o)();return(0,i.jsx)(m.Z,{secondSmall:!0,secondToLastSmall:!0,collapsible:!0,actions:l?(0,R.j)({event:t,userRole:o,t:a,actions:{},activeLocales:d,copyToClipboard:f,router:s}):void 0,content:n.filter(e=>"azioni"!==e&&""!==e).map(e=>eG(e,t,a,v,h,p)),collapsedContent:(0,i.jsx)(ea,{requests:null==t?void 0:t.requestModifications,eventId:null==t?void 0:t.id})})}),eG=(e,t,n,i,l,a)=>eO[e](t,n,i,l,a),eO={[N._0.CATEGORIA]:e=>(0,i.jsx)(ec.R,{category:null==e?void 0:e.category}),[N._0.LUOGO]:(e,t,n,l,a)=>{let r=null==e?void 0:e.location;return(0,i.jsx)(E.Z,{tag:"span",children:a?(0,ev.dH)(r):(0,ev.H0)(r)})},[N._0.DATA_ULTIMA_MODIFICA]:e=>(0,i.jsx)(E.Z,{tag:"span",children:v()(null==e?void 0:e.updatedAt).format(g.vc)}),[N._0.DATA]:e=>(0,i.jsx)(E.Z,{tag:"span",children:v()(null==e?void 0:e.startDate).format(g.vc)}),[N._0.REFERENTE]:e=>(0,i.jsx)(E.Z,{tag:"span",children:(0,p.P)(null==e?void 0:e.owner)}
1),[N._0.GRAPHICSTATUS]:(e,t)=>{let n="primary";switch(null==e?void 0:e.graphicStatus){case"COMPLETED":n="success";break;case"IN_PROGRESS":n="primary";break;default:n="violet"}return(0,i.jsx)(C.Z,{size:"admin",variation:n,children:t("graphicStatus.".concat(null==e?void 0:e.graphicStatus))})},[N._0.STATUS]:(e,t,n,l)=>{let a=(0,k.fU)(e.requestModifications);return(0,i.jsx)("div",{className:"pl-[14px]",children:(0,i.jsx)("img",{src:"/icons/".concat(l||a?"in_attesa":"approvata",".svg"),alt:t("r-events:tab.RICHIESTE_MODIFICA.requestsStatus"),title:t("r-events:tab.RICHIESTE_MODIFICA.".concat(l?"waitingRequests":"completedRequests")),width:"24",height:"24"})})}};eF.displayName="SingleEventRow";let ek=()=>{let{t:e}=(0,r.Z)("r-events");return(0,i.jsxs)("div",{children:[(0,i.jsx)(a(),{children:(0,i.jsx)("title",{children:e("tab.".concat(es.yq.RICHIESTE_MODIFICA,".title"))})}),(0,i.jsx)(o.Z,{children:(0,i.jsx)(s.Z,{group:"events",children:(0,i.jsx)(ey,{})})})]})};var eL=!0,eH=ek},98910:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=()=>void 0},59363:function(e){e.exports={listaContainer:"lista-richieste-modifica_listaContainer__Uvj2u",singolaRichiesta:"lista-richieste-modifica_singolaRichiesta__YZ1GS"}}},function(e){e.O(0,[56562,2489,28966,13435,93543,52017,56888,12184,41754,60947,27030,11688,46799,99779,50452,85081,92444,8304,69263,47120,96965,94242,31379,38387,49774,92888,40179],function(){return e(e.s=65881)}),_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.