1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9122],{1661:function(e,t,a){a.d(t,{Z:function(){return b}});var l=a(85893),n=a(67294),s=a(87066),i=a(98388),r=a(16887),d=a(11163),o=a(22578),c=a(86853);function u(e){let{className:t,size:a=24}=e;return(0,l.jsx)("svg",{className:t,width:a,height:a,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{className:"fill-current",fillRule:"evenodd",clipRule:"evenodd",d:"M19.4783 14.2309C20.6092 14.2309 21.5263 13.3215 21.5263 12.2002C21.5263 12.2002 21.6085 11.1767 21.5264 10.8487C20.8306 8.05991 18.3565 3.34461 17.2059 3.00011H10.508C9.37708 3.00011 8.45996 3.90951 8.45996 5.03081V12.2004C8.45996 12.9212 11.9665 19.4754 11.9665 19.4754C12.3555 20.3227 13.3744 20.7038 14.2308 20.3229L14.4464 20.2267C15.3034 19.8459 15.6455 18.8736 15.4014 17.9749L14.5633 14.2309H19.4783ZM4 13.9196C3.44772 13.9196 3 13.4719 3 12.9196V4.00051C3 3.44821 3.44771 3.00051 4 3.00051H6.36765C6.91994 3.00051 7.36765 3.44821 7.36765 4.00051V12.9196C7.36765 13.4719 6.91994 13.9196 6.36765 13.9196H4Z",fill:""})})}function m(e){let{className:t,size:a=24}=e;return(0,l.jsx)("svg",{className:t,width:a,height:a,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{className:"fill-current",fillRule:"evenodd",clipRule:"evenodd",d:"M19.4783 9.23981C20.6092 9.23981 21.5263 10.1492 21.5263 11.2705C21.5263 11.2705 21.6085 12.294 21.5264 12.622C20.8306 15.4108 18.3565 20.1261 17.2059 20.4706H10.508C9.37708 20.4706 8.45996 19.5612 8.45996 18.4399V11.2703C8.45996 10.5495 11.9665 3.99529 11.9665 3.99529C12.3555 3.14803 13.3744 2.76686 14.2308 3.14782L14.4464 3.24405C15.3034 3.62478 15.6455 4.59708 15.4014 5.4958L14.5633 9.23981H19.4783ZM4 9.55106C3.44772 9.55106 3 9.99878 3 10.5511V19.4702C3 20.0225 3.44771 20.4702 4 20.4702H6.36765C6.91994 20.4702 7.36765 20.0225 7.36765 19.4702V10.5511C7.36765 9.99878 6.91994 9.55106 6.36765 9.55106H4Z",fill:""})})}var f=a(41664),x=a.n(f),p=a(8065),h=a(41376),g=a(14263),b=e=>{let{documentId:t,name:a,message:f,date:b,dislikes:v,likes:w,publicConsultation:y,refetchData:j}=e,{t:N}=(0,r.$G)("common"),{locale:k}=(0,d.useRouter)(),{user:C,token:_}=(0,h.a)(),[M,R]=(0,n.useState)(!1),[Z,H]=(0,n.useState)(!1),V=(0,n.useRef)(null),z=(0,c.Z)(k),B=(null==w?void 0:w.find(e=>(null==e?void 0:e.id)===(null==C?void 0:C.id)))?"like":"",T=(null==v?void 0:v.find(e=>(null==e?void 0:e.id)===(null==C?void 0:C.id)))?"dislike":"",L=B||T;(0,n.useEffect)(()=>{if(V.current){let{scrollHeight:e,clientHeight:t}=V.current;H(e>t)}},[]);let S=async e=>{if(_)try{let a=await (0,s.Z)({url:"/api/propositions/".concat(t,"/like"),method:"PUT",headers:{Authorization:"Bearer ".concat(_),"Content-Type":"application/json"},data:{data:e}});(null==a?void 0:a.status)===200&&await j()}catch(e){console.log(e)}};return(0,l.jsxs)("div",{className:"bg-container p-4 md:p-8 max-md:py-6 rounded-20",children:[!!y&&(0,l.jsxs)("div",{className:"pb-6 mb-6 border-black border-b",children:[(0,l.jsxs)(x(),{href:(0,g.gL)(y.slug),className:"group flex gap-4 text-lg hover:underline",children:[(0,l.jsx)("p",{className:"md:max-w-[calc(100%-2.5rem)] line-clamp-3",children:y.title}),(0,l.jsx)(p.Z,{className:"opacity-0 group-hover:opacity-100 max-md:hidden"})]}),(0,l.jsxs)("time",{dateTime:new Date(y.date).toDateString(),className:"text-xs text-secondary mt-4",children:[N("until")," ",(0,o.WU)(null==y?void 0:y.date,"dd MMMM yyyy",{locale:z})]})]}),(0,l.jsx)("p",{className:"text-lg md:text-xl mb-4 md:mb-6",title:a,children:a}),(0,l.jsx)("div",{ref:V,className:(0,i.m6)("text-secondary font-light max-md:text-sm line-clamp-6 md:line-clamp-4",M&&"!line-clamp-none"),children:f}),Z&&(0,l.jsx)("button",{className:"mt-4 hover:underline",onClick:()=>R(e=>!e),children:N(M?"show_less":"show_more")}),(0,l.jsxs)("footer",{className:"flex items-center justify-between mt-4 md:mt-6 text-secondary",children:[(0,l.jsx)("time",{dateTime:new Date(b).toDateString(),className:"text-sm",children:(0,o.WU)(b,"dd MMMM yyyy",{locale:z})}),(0,l.jsxs)("div",{className:"flex gap-4 [&>button]:flex [&>button]:items-center [&>button]:gap-1",children:[(0,l.jsxs)("button",{className:(0,i.m6)("dislike"===L&&"text-black [&>svg]:text-black"),onClick:()=>S(!1),children:[(0,l.jsx)(u,{className:"text-black/20"})," ",null==v?void 0:v.length]}),(0,l.jsxs)("button",{className:(0,i.m6)("like"===L&&"text-black [&>svg]:text-black"),onClick:()=>S(!0),children:[(0,l.jsx)(m,{className:"text-black/20"})," ",null==w?void 0:w.length]})]})]})]})}},68266:function(e,t,a){a.d(t,{Z:function(){return o}});var l=a(85893),n=a(67294),s=a(11163),i=a(85130),r=a(98388),d=a(16887);function o(e){let{pagination:t,handlePageChangeCustom:a}=e,{t:o}=(0,d.$G)("common"),c=(0,s.useRouter)(),u=t?t.page:1,m=t?t.pageCount:1,f=t?t.pageSize:10,x=(0,n.useMemo)(()=>{let e=[],t=u>3,a=u<m-2;if(t)e.push(1,"...");else for(let t=1;t<Math.min(3,m)+1;t++)e.push(t);let l=Math.max(u-1,2),n=Math.min(u+1,m-1);for(let t=l;t<=n;t++)e.includes(t)||e.push(t);if(a)e.push("...",m);else for(let t=Math.max(m-2,2);t<=m;t++)e.includes(t)||e.push(t);return e},[u,m,f]);if(!t||m<2)return null;let p=()=>{let e=document.getElementById("header");if(e){let{top:t,height:a}=e.getBoundingClientRect();window.scrollTo({top:window.scrollY+t+a})}},h=a||(e=>{c.push({pathname:c.pathname,query:{...c.query,page:e,pageSize:f}},void 0,{shallow:!0}),p()});return(0,l.jsxs)("div",{className:"w-full flex items-center justify-between py-4 md:py-5",children:[(0,l.jsxs)("button",{className:(0,r.m6)("flex gap-4 hover:underline",1===u&&"text-secondary pointer-events-none"),onClick:()=>h(u-1),disabled:1===u,children:[(0,l.jsx)(i.Z,{className:"transform rotate-180"}),(0,l.jsx)("span",{className:"max-md:hidden",children:o("back")})]}),(0,l.jsx)("div",{className:"flex gap-1 md:gap-2 items-center",children:x.map((e,t)=>"number"==typeof e?(0,l.jsx)("button",{className:(0,r.m6)("w-12 h-12 rounded-full flex justify-center items-center duration-200 hover:bg-grey1",e===u&&"bg-black text-white hover:bg-primaryIndigo"),onClick:()=>h(e),children:e},t):(0,l.jsx)("span",{className:"px-2",children:"..."},t))}),(0,l.jsxs)("button",{className:(0,r.m6)("flex gap-4 hover:underline",u===m&&"text-secondary pointer-events-none"),onClick:()=>h(u+1),disabled:u===m,children:[(0,l.jsx)("span",{className:"max-md:hidden",children:o("next")}),(0,l.jsx)(i.Z,{})]})]})}},15659:function(e,t,a){a.d(t,{Bw:function(){return x},Ph:function(){return o},Ql:function(){return p},i4:function(){return u},ki:function(){return c}});var l=a(85893),n=a(67294),s=a(62469),i=a(10777),r=a(27742),d=a(74560);let o=i.fC;i.ZA;let c=i.B4,u=n.forwardRef((e,t)=>
1{let{className:a,children:n,...s}=e;return(0,l.jsxs)(i.xz,{ref:t,className:(0,r.cn)("flex w-full items-center justify-between whitespace-nowrap rounded-full bg-white px-6 py-4 ring-offset-white data-[placeholder]:text-secondary focus:outline-none focus-visible:ring-1 focus-visible:ring-indigo-600 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 dark:border-neutral-800 dark:ring-offset-neutral-950 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-300","aria-[invalid=true]:border aria-[invalid=true]:border-solid aria-[invalid=true]:border-warning aria-[invalid=true]:text-warning [&>svg]:aria-[invalid=true]:text-warning","[&>span]:overflow-hidden [&>span]:text-ellipsis [&>span]:max-w-[calc(100%-1.5rem)]",a),...s,children:[n,(0,l.jsx)(i.JO,{asChild:!0,children:(0,l.jsx)(d.Z,{})})]})});u.displayName=i.xz.displayName;let m=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,l.jsx)(i.u_,{ref:t,className:(0,r.cn)("flex cursor-default items-center justify-center py-1 pointer-events-none",a),...n,children:(0,l.jsx)(s.g8U,{})})});m.displayName=i.u_.displayName;let f=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,l.jsx)(i.$G,{ref:t,className:(0,r.cn)("flex cursor-default items-center justify-center py-1 pointer-events-none",a),...n,children:(0,l.jsx)(s.v4q,{})})});f.displayName=i.$G.displayName;let x=n.forwardRef((e,t)=>{let{className:a,children:n,position:s="popper",...d}=e;return(0,l.jsx)(i.h_,{children:(0,l.jsxs)(i.VY,{ref:t,className:(0,r.cn)("relative z-50 h-auto max-h-[calc(var(--radix-select-content-available-height)-1rem)] md:max-h-96 min-w-[8rem] overflow-hidden rounded-10 bg-white text-neutral-950 shadow-[0px_6px_12px_0px_rgba(0,0,0,0.08)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50","popper"===s&&"w-[var(--radix-select-trigger-width)] data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:s,...d,children:[(0,l.jsx)(m,{}),(0,l.jsx)(i.l_,{className:(0,r.cn)("","popper"===s&&"h-[(var(--radix-select-trigger-height)]"),children:n}),(0,l.jsx)(f,{})]})})});x.displayName=i.VY.displayName,n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,l.jsx)(i.__,{ref:t,className:(0,r.cn)("px-2 py-1.5 text-sm font-semibold",a),...n})}).displayName=i.__.displayName;let p=n.forwardRef((e,t)=>{let{className:a,children:n,...s}=e;return(0,l.jsx)(i.ck,{ref:t,className:(0,r.cn)("relative flex w-full cursor-default select-none items-center p-4 text-13 outline-none focus-visible:outline-none focus:bg-neutral-100 focus:text-neutral-900 focus-visible:ring-offset-0 focus-visible:ring-1 focus-visible:ring-indigo-600 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50","data-[state=checked]:bg-container data-[state=checked]:underline",a),...s,children:(0,l.jsx)(i.eT,{children:n})})});p.displayName=i.ck.displayName,n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,l.jsx)(i.Z0,{ref:t,className:(0,r.cn)("-mx-1 my-1 h-px bg-neutral-100 dark:bg-neutral-800",a),...n})}).displayName=i.Z0.displayName}}]);
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.