"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4296],{58290:function(e,t,a){var n=a(11527),o=a(50959),r=a(20407),i=a.n(r),l=a(34801),u=a(19800),s=a(66770),c=a(22578),d=a(82382),v=a(7537),p=a(2103),g=a(30215),m=a(21409),f=a(3839),h=a(24721),w=a(56373),b=a(94362),y=a(64186),_=a(85386),k=a(10482);let S={[u.$u.Anonymous]:"anonymous",[u.$u.Registered]:"registered",[u.$u.Subscriber]:"subscriberLight",[u.$u.SubscriberFull]:"subscriber"};t.Z=()=>{let{isMobile:e,isDesktop:t,isTablet:a}=(0,u.Sj)(),r=(0,b.v)(),I=(0,y.T)(),{logoraUrl:T,isSpazioDibattiti:L}=(0,h.T)(),P=(0,_.Dv)(k.rp),M=(0,_.Dv)(k.AT),j=(0,_.Dv)(k.qv),{userConsents:E}=(0,w.We)(),[C]=(0,u.t6)(),{user:A}=(0,u.aF)(),x=(0,m.useRouter)(),Y=(0,p.Z)(),N=(0,u.$)(),[W,R]=(0,o.useState)(!1),F=(0,o.useRef)(0),{publishedDate:D,updatedDate:$}=null!=P?P:{},O=(0,g.useAmp)(),{indiceCurrentScheda:q,currentScheda:G}=(0,f.Xh)(),H=e=>(0,s.Lr)(e)?"ImageGallery":(0,s.GH)(e)?"Frontpage":(0,s.Wv)(e)?"Video":"Article",z=(0,o.useMemo)(()=>(0,s.GH)(P)?(null==M?void 0:M.seoTitle)?null==M?void 0:M.seoTitle:(0,c.bw)("title",N.key,null==M?void 0:M.path):(null==P?void 0:P.seoTitle)||(null==P?void 0:P.title),[null==P?void 0:P.id]),[B]=(0,v.z)("TYPE_PREMIUM",{type:null});(0,o.useEffect)(()=>{null!==B.type&&(B.pageTitle=z,P&&(B.page_location="https://".concat(N.url).concat("path"in P?P.path:"")),C(u.Sc.PAYWALL_EVENT,B))},[B.type]);let U=e=>e?e.split(/[^\s]+/).length-1:0,V=()=>{var e,t,a,n,o;return(0,s.g0)(P)?null===(e=P.lead)||void 0===e?void 0:e.length:(0,s.Lr)(P)?null===(t=P.caption)||void 0===t?void 0:t.length:(0,s.N9)(P)?0===q?null===(a=G.description)||void 0===a?void 0:a.length:null===(n=G.caption)||void 0===n?void 0:n.length:(0,s.Wv)(P)?null===(o=P.caption)||void 0===o?void 0:o.length:0},Q=()=>{if(Y===p.P.IS_PWA){if(e)return"pwa-mobile";if(t)return"pwa-desktop";if(a)return"pwa-tablet"}else if(O)return"amp";else if(t)return"desktop";else if(e)return"mobile";else if(a)return"tablet";return"unknow"},Z=()=>{var e,t,a;return!!(0,s.Wv)(P)||!!(0,s.g0)(P)&&((null===(e=P.topMedia)||void 0===e?void 0:e.__typename)==="Video"||null!==(t=P.topMedia)&&void 0!==t&&!!t.embedCode&&(null===(a=P.topMedia)||void 0===a?void 0:a.embedCode)!=="")},K=()=>{var e,t,a;return!!((0,s.Lr)(P)||(0,s.N9)(P)&&(null===(a=G.image)||void 0===a?void 0:a.baseUrl))||!!(0,s.g0)(P)&&((null===(e=P.topMedia)||void 0===e?void 0:e.__typename)==="Image"||(null===(t=P.topImage)||void 0===t?void 0:t.__typename)==="Image")},X=(0,o.useMemo)(()=>{var e,t,a,n;if(L)return null!==(e=T.split("/")[1])&&void 0!==e?e:"";switch(N.key){case u.Y0.Itinerari:return"itinerari";case u.Y0.Salus:return"salute";case u.Y0.Luce:return"luce";default:return(0,s.tQ)(P)?"HP":null!==(n=null==M?void 0:null===(a=M.contentPath)||void 0===a?void 0:null===(t=a[0])||void 0===t?void 0:t.title)&&void 0!==n?n:""}},[N.key,P,M,T]),J=(0,o.useMemo)(()=>{var e,t,a,n,o,r,i,l,c,d;if(L)return null!==(e=T.split("/").slice(2,3).join("/"))&&void 0!==e?e:"/";switch(N.key){case u.Y0.Itinerari:return null!==(n=null==M?void 0:null===(a=M.contentPath)||void 0===a?void 0:null===(t=a[0])||void 0===t?void 0:t.title)&&void 0!==n?n:"";case u.Y0.Salus:return null!==(i=null==M?void 0:null===(r=M.contentPath)||void 0===r?void 0:null===(o=r[0])||void 0===o?void 0:o.title)&&void 0!==i?i:"";default:return(0,s.tQ)(P)?"HP":null!==(d=null==M?void 0:null===(c=M.contentPath)||void 0===c?void 0:null===(l=c[1])||void 0===l?void 0:l.title)&&void 0!==d?d:""}},[N.key,P,M,T]),ee=(0,o.useMemo)(()=>{var e,t,a,n,o,r,i,l,c;switch(N.key){case u.Y0.Itinerari:return null!==(a=null==M?void 0:null===(t=M.contentPath)||void 0===t?void 0:null===(e=t[1])||void 0===e?void 0:e.title)&&void 0!==a?a:"";case u.Y0.Salus:return null!==(r=null==M?void 0:null===(o=M.contentPath)||void 0===o?void 0:null===(n=o[1])||void 0===n?void 0:n.title)&&void 0!==r?r:"";default:return(0,s.tQ)(P)?"HP":null!==(c=null==M?void 0:null===(l=M.contentPath)||void 0===l?void 0:null===(i=l[2])||void 0===i?void 0:i.title)&&void 0!==c?c:""}},[N.key,P,M,T]),et=(0,o.useMemo)(()=>{if(!P)return"";if(L)return"https://".concat(N.url).concat(null!=T?T:"");switch(N.key){case u.Y0.Itinerari:return"https://www.quotidiano.net/itinerari".concat("path"in P?P.path:"");case u.Y0.Salus:return"https://www.quotidiano.net/salute".concat("path"in P?P.path:"");default:return"https://".concat(N.url).concat("path"in P?P.path:"")}},[N.key,N.url,null==P?void 0:P.id,null==P?void 0:P.path,T]);return(0,o.useEffect)(()=>{let e=I!==F.current;if(F.current=I,P&&M&&j&&W&&E){var t,a,n,o,r;let i=H(P).toLowerCase(),c={pageType:i,pageSection:X,pageSubSection:J,pageSubSubSection:ee,pageTitle:z,pageTitleLength:null==z?void 0:z.length,pageSummaryLength:V(),artWordcount:(0,s.g0)(P)?U(null==P?void 0:P.bodyText):(0,s.N9)(P)?U(G.description):0,artImg:K(),artVideo:Z(),artPD:D,artMD:$||D,referer:document.referrer,page_location:et,artlive:!!(0,s.g0)(P)&&(P.articleType===l.Iq.LiveArticle||P.articleType===l.Iq.LiveBlog)};if((0,d.Q)(P)&&(c.artReload=["reload".concat((null!==(t=null==P?void 0:P.reloadIndex)&&void 0!==t?t:0)+1)]),(0,s.N9)(P)&&(c.artReload=["scheda".concat(q)]),(null!==(a=null==P?void 0:P.reloadIndex)&&void 0!==a?a:0)>0&&(c.referer="reload"),c.PageRefresh=(0,s.GH)(P)&&x.asPath.indexOf("/?live")>-1,c.PageChannel=Q(),"source"in P&&P.source||P.articleType===l.Iq.BrandedContent){if("article"!==i)c.artSource=""===P.source.toLowerCase()?"web":"".concat(P.source.toLowerCase());else if("article"!==i)c.artSource=""===P.source.toLowerCase()?"web":"".concat(P.source.toLowerCase());else if("article"===i&&P.articleType===l.Iq.BrandedContent)c.artSource="branded";else switch(P.source.toLowerCase()){case"farmacie":case"MGC":case"santi":c.artSource="MGC";break;case"mianews":case"lab":case"dire":case"askanews":case"ansa-mar":case"ansa-lom":case"ansa-emi":case"ansa-tos":case"ansa":case"aks":case"agi":case"9colonne":case"piu marche":case"italpress":case"adn kronos":case"bul":case"collaboratori":c.artSource="web-collaboratori";break;case"fromhermes":case"Synch da Polopoly":c.artSource="webcarta";break;case"ultimora_sport":case"ultimora_economia":case"ultimora_news":c.artSource="agenzie-ansa";break;case"carta":c.artSource="carta";break;case"aicarta":c.artSource="carta-opti";break;case"aicarta-titolo-desc":case"oroscopo_barbanera":c.artSource="carta-opti-title-som";break;case"aicarta-titolo":c.artSource="carta-opti-title";break;case"migration":c.artSource="web";break;default:c.artSource=P.source.toLowerCase().startsWith("ultimora_")?"ansa":"web"}}else c.artSource="web";c.prerender=document.prerendering||(null===(r=self.performance)||void 0===r?void 0:null===(o=r.getEntriesByType)||void 0===o?void 0:null===(n=o.call(r,"navigation")[0])||void 0===n?void 0:n.activationStart)>0;let{loginStatus:v,sub:p}=(0,u.WH)(A);if(c.userType=S[v],p&&(c.userID=p),c.login=v!==u.$u.Anonymous,e&&(c.PageRefresh=!0,c.referer="refresh"),C(u.Sc.PAGE_VIEW,c),!e&&x.asPath.indexOf("/?")>-1){let e=Object.fromEntries(new URLSearchParams(x.asPath.replace("/?","")).entries());"utm_campaign"in e&&C(u.Sc.UTM_CAMPAIGN,e),"fbclid"in e&&C(u.Sc.SOCIAL_FACEBOOK,e),delete e.utm_campaign,delete e.live,delete e.fbclid,delete e.debug_mode,Object.keys(e).length&&C(u.Sc.QUERY_STRING,e)}}},[E,P,M,j,W,T,r,W,I]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i(),{strategy:"afterInteractive",src:"https://www.googletagmanager.com/gtag/js?id=".concat(N.ga4_id_measurement),onReady:()=>R(!0)}),(0,n.jsx)(i(),{id:"ga4",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:"\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('consent', 'default', {\n 'ad_storage': 'denied',\n 'ad_user_data': 'denied',\n 'ad_personalization': 'denied',\n 'analytics_storage': 'denied'\n });\n gtag('js', new Date());\n gtag('config', '".concat(N.ga4_id_measurement,"', {\n send_page_view: false\n });\n ")}})]})}},41895:function(e,t,a){a.d(t,{X:function(){return g},Z:function(){return m}});var n=a(11527),o=a(30215),r=a(50959),i=a(20407),l=a.n(i),u=a(19800);let s=e=>{let t=(null==e?void 0:e.substring(1).indexOf("/"))||0;return(null==e?void 0:e.substring(1,t+1))||""};var c=e=>{let{leaf:t,site:a,section:n,host:o}=e,{id:r,__typename:i,title:l="",byline:c="",publishedDate:d,tags:v,contentPath:p,path:g}=t,m=(null==p?void 0:p.slice(0,(null==p?void 0:p.length)-1).map(e=>e.title||""))||[],f=(null==v?void 0:v.map(e=>null==e?void 0:e.name).join(","))||"",h=s(g),w=Object.values(u.Kl[o.key]).filter(e=>e.id===h)[0];return{polopolyid:r,nome_edizione:"",edizione:{capoluogo:!1,externalId:"",key:"",label:"",nofollow:!1,slug:"",url:""},page_type:i||"",subject:(null==n?void 0:n.title)||"",top_subject:(null==n?void 0:n.title)||"",author:c,site:a.id,keywords:f,numTestata:"1",page:t.id,pageCode:w?"monrif.page.".concat(o.key,".").concat(w.id):"monrif.page.qn",ontheio:"",parent:n.id,loginNewsletter:"",aggregatorValues:{datePublished:new Date(d).getTime(),categorization:{people:"",organisations:"",locations:"",tags:f},galleryFotoIndex:0,name:l,creatorId:"",bordero:"",wordCount:0,photoCount:0,contentProperties:"",speed:{code:"",site:o.key,pageType:i||"",department:"nazionale"},imma