PageSourceSearch

https://www.italiaatavola.net/public-auth.js?v=20260726_recipecls_1

js italiaatavola.net collected 2026-09-24 09:12:23 UTC 27,488 bytes, 20 lines download raw bytes

1!function(){"use strict";var e="IL MIO PROFILO",t=null,n=!1,pendingAuthIntent=null;function i(e,t){return(t||document).querySelector(e)}function a(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function r(e,t,n){e&&a('input[name="'+t+'"]',e).forEach(function(e){e.checked=e.value===n})}async function o(e,t){var n=await fetch(e,Object.assign({credentials:"include",headers:{"Content-Type":"application/json"}},t||{})),i={};try{i=await n.json()}catch(e){}if(!n.ok)throw new Error(i.error||"Richiesta non riuscita");return i}var l=null,s=!1,c={profilo:function(e){return/area-personale\.html#profilo/.test(e)},newsletter:function(e){return/area-personale\.html#newsletter/.test(e)},archivio:function(e){return/\/mio-archivio(?:[\/?#]|$)/.test(e)},commenti:function(e){return/\/i-miei-commenti(?:[\/?#]|$)/.test(e)}};function d(){var e=i("#accountModal .iat-account-links");if(e)if(l){l.forEach(function(t){var n=function(e,t){var n=c[t];if(!n)return null;for(var i=e.getElementsByTagName("a"),a=0;a<i.length;a++)if("iatEditArticleLink"!==i[a].id&&"iatEditHomeLink"!==i[a].id&&"iatSocialPostLink"!==i[a].id&&n(i[a].getAttribute("href")||""))return i[a];return null}(e,t&&t.key);n&&(!1===t.visible?n.style.setProperty("display","none","important"):n.style.removeProperty("display"),e.appendChild(n))});var sp=document.getElementById("iatSocialPostLink");sp&&e.insertBefore(sp,e.firstChild);var t=document.getElementById("iatEditArticleLink");t&&e.insertBefore(t,e.firstChild);var n=document.getElementById("iatEditHomeLink");n&&e.insertBefore(n,e.firstChild)}else s||(s=!0,o("/api/public/account-pages").then(function(e){l=e&&e.pages||[],s=!1,d()}).catch(function(){s=!1}))}function u(e,t,n){e&&(e.textContent=t||"",e.hidden=!t,e.classList.toggle("is-error","error"===n),e.classList.toggle("is-success","success"===n))}function p(e){e&&(e.classList.add("open"),e.setAttribute("aria-hidden","false"),document.body.classList.add("modal-open-lock"))}function m(e){e&&(e.classList.remove("open"),e.setAttribute("aria-hidden","true"),document.querySelector(".modal.open")||document.body.classList.remove("modal-open-lock"))}function f(){m(i("#loginModal")),m(i("#accountModal"))}function g(){document.documentElement.classList.toggle("iat-public-auth-pending",!n),document.documentElement.classList.toggle("iat-public-auth-likely-authenticated",!!t),document.body.classList.toggle("iat-public-authenticated",!!t);try{t?localStorage.setItem("iatPublicAuthHint","1"):n&&localStorage.removeItem("iatPublicAuthHint")}catch(e){}var l,s=t?(l=t.nickname||t.profile&&t.profile.nickname,String(l||"").replace(/\s+/g,"").slice(0,11)||e):"Accedi";a(".login-trigger").forEach(function(e){e.setAttribute("aria-label",t?"Apri il mio profilo":"Accedi"),e.classList.toggle("is-public-authenticated",!!t);var n=e.querySelector("span");n&&(n.textContent=s),("IMG"===e.tagName?[e]:a("img",e)).forEach(function(e){e.src=t?"https://www.italiaatavola.net/images/contenutiarticoli/icona-utente-loggato.png":"https://www.italiaatavola.net/images/contenutiarticoli/user-head-iat-accedi.png",e.alt=t?"profilo":"user"})});var c=t&&(t.displayName||t.name||t.email)||e,u=t?t.email:"";a("[data-public-account-name]").forEach(function(t){t.textContent=c||e}),a("[data-public-account-email]").forEach(function(e){e.textContent=u}),function(){var e=i("#accountModal .iat-account-links");if(e){var n=i("#iatSocialPostLink"),a=document.querySelector("[data-article-id]"),r=a?a.getAttribute("data-article-id"):"";if(t&&t.editor&&r){var o="https://desk.italiaatavola.net/archivio-articoli.html?social="+encodeURIComponent(r);if(n)n.setAttribute("href",o);else{var l=document.createElement("a");l.id="iatSocialPostLink",l.href=o,l.target="_blank",l.rel="noopener",l.innerHTML='<span class="iat-account-link-icon" aria-hidden="true"><svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><path d="M8.6 13.5l6.8 3.9M15.4 6.6L8.6 10.5"/></svg></span><span class="iat-account-link-text"><span>Crea post social</span><small>Facebook, LinkedIn, X</small></span><svg class="iat-account-chevron" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>',e.insertBefore(l,e.firstChild)}}else n&&n.parentNode.removeChild(n)}}(),function(){var e=i("#accountModal .iat-account-links");if(e){var n=i("#iatEditArticleLink"),a=document.querySelector("[data-article-id]"),r=a?a.getAttribute("data-article-id"):"";if(!!(t&&t.editor&&r)){var o="https://desk.italiaatavola.net/gestionale-articolo.html?id="+encodeURIComponent(r);if(n)n.setAttribute("href",o);else{var l=document.createElement("a");l.id="iatEditArticleLink",l.href=o,l.target="_blank",l.rel="noopener",l.innerHTML='<span class="iat-account-link-icon" aria-hidden="true"><svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"/><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"/></svg></span><span class="iat-account-link-text"><span>Modifica articolo</span><small>Apri nel gestionale</small></span><svg class="iat-account-chevron" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>',e.insertBefore(l,e.firstChild)}}else n&&n.parentNode.removeChild(n)}}(),function(){var e=i("#accountModal .iat-account-links");if(e){var n=i("#iatEditHomeLink"),a=location.pathname||"/",r="/"===a||"/index.html"===a;if(!!(t&&t.editor&&r)){var o="https://desk.italiaatavola.net/gestione-home.html";if(n)n.setAttribute("href",o);else{var l=document.createElement("a");l.id="iatEditHomeLink",l.href=o,l.target="_blank",l.rel="noopener",l.innerHTML='<span class="iat-account-link-icon" aria-hidden="true"><svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/><polyline points="9 22 9 12 15 12 15 22"/></svg></span><span class="iat-account-link-text"><span>
1Modifica Home</span><small>Apri nel gestionale</small></span><svg class="iat-account-chevron" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>',e.insertBefore(l,e.firstChild)}}else n&&n.parentNode.removeChild(n)}}(),d();var p=i("[data-public-profile-form]");if(p&&t){var m=t.profile||{};t.newsletters;p.email&&(p.email.value=t.email||""),["firstName","lastName","birthDate","nickname","phone","mobile","country","address","postalCode","city","province","company","website","profession","sector"].forEach(function(e){p[e]&&(p[e].value=m[e]||"")}),r(p,"gender",m.gender||""),r(p,"privacyConsent",(t.consents||{}).privacyMarketing||""),r(p,"profilingConsent",(t.consents||{}).profiling||""),r(p,"partnerConsent",(t.consents||{}).partners||"")}var f=i("[data-public-newsletter-form]");if(f&&t&&(x(f,t.newsletters||{}),o("/api/public-auth/newsletters").then(function(e){e&&e.status&&x(f,e.status,e.pending)}).catch(function(){})),t&&t.onboardingRequired)!function(e){if(document.getElementById("iatOnboardingGate"))return;!function(){if(document.getElementById("iatOnboardingGateStyles"))return;var e=document.createElement("style");e.id="iatOnboardingGateStyles",e.textContent=".iat-onboarding-locked{overflow:hidden!important;}#iatOnboardingGate{position:fixed;inset:0;z-index:2147483646;background:rgba(20,20,25,.82);display:flex;align-items:flex-start;justify-content:center;overflow:auto;padding:24px 16px;}#iatOnboardingGate .ob-box{background:#fff;max-width:520px;width:100%;border-radius:14px;padding:26px 24px;box-shadow:0 18px 60px rgba(0,0,0,.45);font-family:inherit;margin:auto;}#iatOnboardingGate h2{margin:0 0 6px;font-size:1.35rem;}#iatOnboardingGate p.ob-sub{margin:0 0 16px;color:#555;font-size:.92rem;line-height:1.4;}#iatOnboardingGate label.ob-field{display:block;margin:0 0 12px;font-size:.85rem;font-weight:600;color:#333;}#iatOnboardingGate label.ob-field input[type=text]{display:block;width:100%;box-sizing:border-box;margin-top:5px;padding:10px 12px;border:1px solid #ccc;border-radius:8px;font-size:1rem;font-weight:400;}#iatOnboardingGate fieldset.ob-nl{border:1px solid #e3e3e3;border-radius:10px;padding:12px 14px;margin:6px 0 14px;}#iatOnboardingGate fieldset.ob-nl legend{font-size:.8rem;font-weight:700;color:#444;padding:0 6px;}#iatOnboardingGate .ob-nl label{display:flex;align-items:center;gap:9px;font-size:.9rem;font-weight:400;padding:5px 0;cursor:pointer;}#iatOnboardingGate label.ob-ack{display:flex;align-items:flex-start;gap:9px;font-size:.86rem;color:#333;margin:0 0 16px;cursor:pointer;}#iatOnboardingGate button.ob-submit{width:100%;padding:12px;border:0;border-radius:9px;background:#c8102e;color:#fff;font-size:1rem;font-weight:700;cursor:pointer;}#iatOnboardingGate button.ob-submit:disabled{opacity:.6;cursor:default;}#iatOnboardingGate .ob-msg{min-height:18px;margin:0 0 10px;font-size:.85rem;color:#c8102e;font-weight:600;}",document.head.appendChild(e)}();var n=e.profile||{},i=v.map(function(e){return'<label><input type="checkbox" data-ob-nl="'+e[0]+'"><span>'+b(e[1])+"</span></label>"}).join(""),a=document.createElement("div");a.id="iatOnboardingGate",a.innerHTML='<div class="ob-box" role="dialog" aria-modal="true" aria-labelledby="obTitle"><h2 id="obTitle">Completa la registrazione</h2><p class="ob-sub">Ti sei registrato con un account social: per continuare conferma nome, cognome e scegli un nickname. Indica anche se vuoi ricevere le nostre newsletter.</p><div class="ob-msg" data-ob-msg></div><label class="ob-field">Nome*<input type="text" data-ob="firstName" value="'+b(n.firstName)+'" maxlength="80" autocomplete="given-name"></label><label class="ob-field">Cognome*<input type="text" data-ob="lastName" value="'+b(n.lastName)+'" maxlength="80" autocomplete="family-name"></label><label class="ob-field">Nickname* (max 11 caratteri, senza spazi)<input type="text" data-ob="nickname" value="'+b(n.nickname)+'" maxlength="11"></label><fieldset class="ob-nl"><legend>Newsletter</legend><div class="ob-nl">'+i+'</div></fieldset><label class="ob-ack"><input type="checkbox" data-ob="ack"><span>Ho scelto le mie preferenze newsletter (posso anche non selezionarne nessuna).*</span></label><button type="button" class="ob-submit" data-ob-submit>Completa e continua</button></div>',document.body.appendChild(a),document.body.classList.add("iat-onboarding-locked");var r=a.querySelector('[data-ob="firstName"]');
1if(r)try{r.focus()}catch(e){}a.querySelector("[data-ob-submit]").addEventListener("click",function(){!async function(e){var n=e.querySelector("[data-ob-msg]"),i=e.querySelector("[data-ob-submit]"),a=function(t){var n=e.querySelector('[data-ob="'+t+'"]');return n?String(n.value||"").trim():""},r=a("firstName"),l=a("lastName"),s=a("nickname"),c=e.querySelector('[data-ob="ack"]').checked;if(n.textContent="",!r)return void(n.textContent="Inserisci il nome.");if(!l)return void(n.textContent="Inserisci il cognome.");if(!s||/\s/.test(s)||s.length>11)return void(n.textContent="Il nickname deve avere massimo 11 caratteri e non può contenere spazi.");if(!c)return void(n.textContent="Conferma la scelta sulle newsletter per continuare.");var d={};v.forEach(function(t){var n=e.querySelector('[data-ob-nl="'+t[0]+'"]');d[t[0]]=!(!n||!n.checked)}),i.disabled=!0;try{var u=await o("/api/public-auth/profile",{method:"PUT",body:JSON.stringify({firstName:r,lastName:l,nickname:s,name:r+" "+l})}),p=await o("/api/public-auth/newsletters",{method:"POST",body:JSON.stringify(d)});t=p&&p.user||u&&u.user||t,h(),g()}catch(e){n.textContent=e&&e.message||"Salvataggio non riuscito, riprova.",i.disabled=!1}}(a)})}(t);else{h();var w=t&&!(t.profile&&t.profile.nickname),y=/[?&]completa=1/.test(location.search);if((w||y)&&t){var k=i(".iat-public-account-main");if(k&&!i(".iat-onboarding-banner")){var C=document.createElement("div");C.className="iat-onboarding-banner",C.innerHTML="<strong>Completa il tuo profilo</strong> — scegli un <b>nickname</b> (serve per pubblicare commenti) e attiva le newsletter che vuoi ricevere. Gli altri campi sono facoltativi.",k.insertBefore(C,k.firstChild);var S=i('[data-public-profile-form] [name="nickname"]');
1if(w&&S)try{S.focus()}catch(e){}}}}}var v=[["newsletterWeekly","Il meglio della settimana"],["newsletterProfessional","Aggiornamento Professionale"],["newsletterWine","WiNE"],["newsletterCheckin","CHECK-IN"],["newsletterRivista","Rivista Italia a Tavola"],["newsletterDem","Italia a Tavola consiglia..."]];function b(e){return String(null==e?"":e).replace(/[&<>"']/g,function(e){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]})}function h(){var e=document.getElementById("iatOnboardingGate");e&&e.parentNode.removeChild(e),document.body.classList.remove("iat-onboarding-locked")}async function w(){try{var e=("undefined"!=typeof window&&window.__publicAuthMe?await window.__publicAuthMe:await o("/api/public-auth/me"))||{};t=e.authenticated?e.user:null}catch(e){t=null}finally{n=!0,setTimeout(g,0)}return t}function consumeAuthIntent(u_){var it=pendingAuthIntent;pendingAuthIntent=null;try{document.dispatchEvent(new CustomEvent("iat:public-login",{detail:{user:u_||null,intent:it}}))}catch(_e){}return it}function y(intent){pendingAuthIntent="string"==typeof intent?intent:null;u(i("[data-public-login-message]"),"");var e=i("#loginModal");p(e),e&&window.setTimeout(function(){var t=i(".modal-dialog",e)||e;t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0})},80)}function k(){m(i("#loginModal")),g(),p(i("#accountModal"))}function C(e){return e&&(e.preventDefault(),"function"==typeof e.stopImmediatePropagation&&e.stopImmediatePropagation(),e.stopPropagation()),t?(k(),!0):n?(y(),!0):(y(),w().then(function(e){e&&(m(i("#loginModal")),k())}),!0)}var S={newsletterWeekly:"weekly",newsletterProfessional:"professional",newsletterWine:"wine",newsletterCheckin:"checkin",newsletterRivista:"rivista",newsletterDem:"dem"};function x(e,t,n){t=t||{},n=n||[],Object.keys(S).forEach(function(i){var a=e.elements&&e.elements[i]||e[i];if(a){var r=S[i];a.checked=!!t[r];var o=a.closest?a.closest(".iat-nl-row"):null;if(o){var l=n.indexOf(r)>=0;o.classList.toggle("is-pending",l);var s=o.querySelector(".iat-nl-info"),c=s?s.querySelector(".iat-nl-pending"):null;l&&s&&!c?((c=document.createElement("small")).className="iat-nl-pending",c.textContent="In attesa di conferma",s.appendChild(c)):!l&&c&&c.parentNode.removeChild(c)}}})}async function E(){u(i("[data-public-account-message]"),"");try{await o("/api/public-auth/logout",{method:"POST",body:"{}"})}catch(e){}t=null,g(),f(),N()?window.location.replace("/"):window.location.reload()}function L(){N()&&w().then(function(e){var t=i("[data-public-account-gate]"),n=i("[data-public-account-content]");e?(t&&(t.hidden=!0),n&&(n.hidden=!1)):(t&&(t.hidden=!1),n&&(n.hidden=!0),window.location.replace("/"))})}function N(){return document.body.classList.contains("public-account-page")}function O(e){var t=e&&e.querySelector('[name="g-recaptcha-response"]');if(t&&t.value)return t.value;if(window.grecaptcha&&"function"==typeof window.grecaptcha.getResponse)try{return window.grecaptcha.getResponse()}catch(e){}return""}function A(){g(),a(".login-trigger").forEach(function(e){e.addEventListener("click",C)}),a("#loginModal .modal-close, #accountModal .modal-close").forEach(function(e){e.addEventListener("click",function(){m(e.closest(".modal"))})}),a("#loginModal, #accountModal").forEach(function(e){e.addEventListener("click",function(t){t.target===e&&m(e)})}),document.addEventListener("keydown",function(e){"Escape"===e.key&&f()});var e=i("[data-public-login-form]")||i("#loginModal .login-form");e&&e.addEventListener("submit",function(n){n.preventDefault(),async function(e){var n=e.querySelector('button[type="submit"]'),a=i("[data-public-login-message]"),r={email:String(e.email&&e.email.value||"").trim(),password:String(e.password&&e.password.value||""),remember:!(!e.remember||!e.remember.checked)};u(a,""),n&&(n.disabled=!0,n.textContent="Accesso...");try{var l=await o("/api/public-auth/login",{method:"POST",body:JSON.stringify(r)});t=l.user||null,g(),m(i("#loginModal")),e.reset(),"comment"!==consumeAuthIntent(t)&&k()}catch(e){u(a,e.message||"Credenziali non valide","error")}finally{n&&(n.disabled=!1,n.textContent="ACCEDI")}}(e)});var n=i("[data-public-register-form]");n&&n.addEventListener("submit",function(e){e.preventDefault(),async function(e){var n=e.querySelector('button[type="submit"]'),a=i("[data-public-register-message]"),r={firstName:String(e.firstName&&e.firstName.value||"").trim(),lastName:String(e.lastName&&e.lastName.value||"").trim(),birthDate:String(e.birthDate&&e.birthDate.value||"").trim(),gender:String(e.gender&&e.gender.value||"").trim(),nickname:String(e.nickname&&e.nickname.value||"").trim(),phone:String(e.phone&&e.phone.value||"").trim(),mobile:String(e.mobile&&e.mobile.value||"").trim(),country:String(e.country&&e.country.value||"").trim(),address:String(e.address&&e.address.value||"").trim(),postalCode:String(e.postalCode&&e.postalCode.value||"").trim(),city:String(e.city&&e.city.value||"").trim(),province:String(e.province&&e.province.value||"").trim(),company:String(e.company&&e.company.value||"").trim(),website:String(e.website&&e.website.value||"").trim(),profession:String(e.profession&&e.profession.value||"").trim(),sector:String(e.sector&&e.sector.value||"").trim(),email:String(e.email&&e.email.value||"").trim(),password:String(e.password&&e.password.value||""),passwordConfirm:String(e.passwordConfirm&&e.passwordConfirm.value||""),privacyConsent:String(e.privacyConsent&&e.privacyConsent.value||"").trim(),profilingConsent:String(e.profilingConsent&&e.profilingConsent.value||"").trim(),partnerConsent:String(e.partnerConsent&&e.partnerConsent.value||"").trim(),newsletterWeekly:!(!e.newsletterWeekly||!e.newsletterWeekly.checked),newsletterProfessional:!(!e.newsletterProfessional||!e.newsletterProfessional.checked),newsletterWine:!(!e.newsletterWine||!e.newsletterWine.checked),newsletterCheckin:!(!e.newsletterCheckin||!e.newsletterCheckin.checked),newsletterRivista:!(!e.newsletterRivista||!e.newsletterRivista.checked),newsletterDem:!(!e.newsletterDem||!e.newsletterDem.checked),termsAccepted:!(!e.termsAccepted||!e.termsAccepted.checked),recaptchaToken:O(e)};
1if(r.name=[r.firstName,r.lastName].filter(Boolean).join(" "),r.newsletter=r.newsletterWeekly||r.newsletterProfessional||r.newsletterWine||r.newsletterCheckin||r.newsletterRivista||r.newsletterDem,u(a,""),r.password!==r.passwordConfirm)return u(a,"Le password inserite non coincidono.","error"),void(e.passwordConfirm&&e.passwordConfirm.focus());if(/\s/.test(r.nickname)||r.nickname.length>11)return u(a,"Il nickname deve avere massimo 11 caratteri e non può contenere spazi.","error"),void(e.nickname&&e.nickname.focus());n&&(n.disabled=!0,n.textContent="Creazione...");try{var l=await o("/api/public-auth/register",{method:"POST",body:JSON.stringify(r)});l.pendingVerification?(u(a,l.message||"Ti abbiamo inviato un'email di conferma: apri il link nella mail per attivare l'account.","success"),e.reset()):(t=l.user||null,g(),u(a,"Registrazione completata. Ora puoi usare la tua area personale.","success"),e.reset(),"comment"!==consumeAuthIntent(t)&&window.setTimeout(k,450))}catch(e){u(a,e.message||"Registrazione non riuscita","error")}finally{n&&(n.disabled=!1,n.textContent="Crea account")}}(n)}),async function(){var e=i("[data-public-recaptcha]");if(e)try{var t=await o("/api/public-auth/config");if(!t.recaptchaSiteKey)return void(e.innerHTML='<div class="iat-recaptcha-placeholder">reCAPTCHA verrà attivato appena saranno configurate le chiavi Google.</div>');if(e.classList.add("g-recaptcha"),e.setAttribute("data-sitekey",t.recaptchaSiteKey),window.grecaptcha&&"function"==typeof window.grecaptcha.render)return void window.grecaptcha.render(e,{sitekey:t.recaptchaSiteKey});var n=document.createElement("script");n.src="https://www.google.com/recaptcha/api.js",n.async=!0,n.defer=!0,document.head.appendChild(n)}catch(t){e.innerHTML='<div class="iat-recaptcha-placeholder">reCAPTCHA temporaneamente non disponibile.</div>'}}();var r=(location.search.match(/[?&]social_error=([^&]+)/)||[])[1];r&&u(i("[data-public-register-message]")||i("[data-public-login-message]"),decodeURIComponent(r.replace(/\+/g," ")),"error");var l=i("[data-public-profile-form]");l&&l.addEventListener("submit",function(e){e.preventDefault(),async function(e){var n=e.querySelector('button[type="submit"]'),a=i("[data-public-profile-message]"),r={firstName:String(e.firstName&&e.firstName.value||"").trim(),lastName:String(e.lastName&&e.lastName.value||"").trim(),birthDate:String(e.birthDate&&e.birthDate.value||"").trim(),gender:String(e.gender&&e.gender.value||"").trim(),nickname:String(e.nickname&&e.nickname.value||"").trim(),phone:String(e.phone&&e.phone.value||"").trim(),mobile:String(e.mobile&&e.mobile.value||"").trim(),country:String(e.country&&e.country.value||"").trim(),address:String(e.address&&e.address.value||"").trim(),postalCode:String(e.postalCode&&e.postalCode.value||"").trim(),city:String(e.city&&e.city.value||"").trim(),province:String(e.province&&e.province.value||"").trim(),company:String(e.company&&e.company.value||"").trim(),website:String(e.website&&e.website.value||"").trim(),profession:String(e.profession&&e.profession.value||"").trim(),sector:String(e.sector&&e.sector.value||"").trim(),privacyConsent:String(e.privacyConsent&&e.privacyConsent.value||"").trim(),profilingConsent:String(e.profilingConsent&&e.profilingConsent.value||"").trim(),partnerConsent:String(e.partnerConsent&&e.partnerConsent.value||"").trim(),newsletterWeekly:!(!e.newsletterWeekly||!e.newsletterWeekly.checked),newsletterProfessional:!(!e.newsletterProfessional||!e.newsletterProfessional.checked),newsletterWine:!(!e.newsletterWine||!e.newsletterWine.checked),newsletterCheckin:!(!e.newsletterCheckin||!e.newsletterCheckin.checked),newsletterRivista:!(!e.newsletterRivista||!e.newsletterRivista.checked),newsletterDem:!(!e.newsletterDem||!e.newsletterDem.checked)};if(r.name=[r.firstName,r.lastName].filter(Boolean).join(" "),r.newsletter=r.newsletterWeekly||r.newsletterProfessional||r.newsletterWine||r.newsletterCheckin||r.newsletterRivista||r.newsletterDem,u(a,""),/\s/.test(r.nickname)||r.nickname.length>11)return u(a,"Il nickname deve avere massimo 11 caratteri e non può contenere spazi.","error"),void(e.nickname&&e.nickname.focus());n&&(n.disabled=!0);try{var l=await o("/api/public-auth/profile",{method:"PUT",body:JSON.stringify(r)});t=l.user||t,g(),u(a,"Profilo aggiornato.","success")}catch(e){u(a,e.message||"Salvataggio non riuscito","error")}finally{n&&(n.disabled=!1)}}(l)});var s=i("[data-public-newsletter-form]");s&&s.addEventListener("submit",function(e){e.preventDefault(),async function(e){var n=i("[data-public-newsletter-message]"),a=e.querySelector('button[type="submit"]'),r={};
1Object.keys(S).forEach(function(t){r[t]=!(!e[t]||!e[t].checked)}),u(n,""),a&&(a.disabled=!0);try{var l=await o("/api/public-auth/newsletters",{method:"POST",body:JSON.stringify(r)});l&&l.user&&(t=l.user),u(n,"Preferenze salvate. Per le liste con conferma riceverai una mail di verifica.","success")}catch(e){u(n,e&&e.message||"Errore nel salvataggio.","error")}finally{a&&(a.disabled=!1)}}(s)}),a("[data-public-oauth]").forEach(function(e){e.addEventListener("click",function(t){t.preventDefault(),async function(e){var t=i("[data-public-login-message]")||i("[data-public-register-message]");u(t,"");try{var n=await o("/api/public-auth/oauth/"+encodeURIComponent(e)+"/start");if(n.redirectUrl)return void(window.location.href=n.redirectUrl);u(t,n.error||"Provider non ancora configurato","error")}catch(e){u(t,e.message||"Provider non ancora configurato","error")}}(e.getAttribute("data-public-oauth"))})}),a("[data-public-logout]").forEach(function(e){e.addEventListener("click",function(e){e.preventDefault(),E()})}),a("[data-public-auth-placeholder]").forEach(function(e){e.addEventListener("click",function(t){t.preventDefault();var n=i("[data-public-login-message]"),a=i("#loginEmail"),r=a?String(a.value||"").trim():"";if(!r)return u(n,'Inserisci la tua email qui sopra, poi clicca di nuovo "Ho dimenticato la password".',"error"),void(a&&a.focus());e.style.pointerEvents="none";var l="Se l'email è registrata, ti abbiamo inviato un link per reimpostare la password.";o("/api/public-auth/forgot",{method:"POST",body:JSON.stringify({email:r})}).then(function(e){u(n,e&&e.message||l,"success")}).catch(function(){u(n,l,"success")}).finally(function(){e.style.pointerEvents=""})})}),a("[data-public-open-login]").forEach(function(e){e.addEventListener("click",function(e){e.preventDefault(),y()})}),w().then(L)}function P(){(window.__iatModalsReady||Promise.resolve()).then(A)}window.IatPublicAuth={sync:w,openLogin:y,openAccount:k,openFromTrigger:C,logout:E,getUser:function(){return t},escapeText:function(e){return String(e||"").replace(/[&<>"']/g,function(e){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]})}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",P,{once:!0}):P()}();
2/* 2026-07-12 social-first + ritorno-all'articolo (append: NON toccare il minificato sopra).
3   1) Bottoni social del loginModal a tutta larghezza con etichetta testuale.
4   2) Link "registrati" porta ?next=<pagina corrente> → il server lo conserva (Referer
5      della POST register) e /verify-email riporta l'utente dov'era. */
6;(function(){"use strict";function f(){try{
7var m=document.getElementById("loginModal");if(!m||m.getAttribute("data-iat-social-first"))return;m.setAttribute("data-iat-social-first","1");
8var L={google:"Continua con Google",facebook:"Continua con Facebook",linkedin:"Continua con LinkedIn"};
9var s=m.querySelector(".social-login");
10if(s){s.style.display="flex";s.style.flexDirection="column";s.style.gap="10px";
11Object.keys(L).forEach(function(p){var b=s.querySelector('[data-public-oauth="'+p+'"]');if(!b)return;
12b.style.display="flex";b.style.alignItems="center";b.style.justifyContent="center";b.style.gap="10px";b.style.width="100%";b.style.minHeight="46px";b.style.fontWeight="700";b.style.fontSize="15px";b.style.borderRadius="9px";
13var i=b.querySelector("img,svg");if(i){i.style.width="22px";i.style.height="22px";}
14if(!b.querySelector(".iat-social-label")){var t=document.createElement("span");t.className="iat-social-label";t.textContent=L[p];b.appendChild(t);}});}
15var r=m.querySelector(".register-link");
16if(r){var p=location.pathname+location.search;if(p.indexOf("/registrazione")!==0&&p.indexOf("/reset-password")!==0){r.setAttribute("href","/registrazione.html?next="+encodeURIComponent(p));}}
17}catch(e){}}
18if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",f,{once:true});}else{f();}})();
19
20;(function(){/*remember-default-20260724*/function f(){var r=document.getElementById("remember");r&&(r.checked=!0)}if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",f,{once:true});}else{f();}})();

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.