1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1514],{1514:function(e,t,n){n.r(t),n.d(t,{LanguageFirstContactOverlay:function(){return y},default:function(){return h}});var a=n(9985),r=n(7897),l=n(242),o=n(2183),i=n(556),s=n(8639);let u=/^\/[a-z]{2}(?:-[a-z]+)?(?=\/|$)/i,c={de:"Deutsch",en:"English",fr:"Fran\xe7ais",es:"Espa\xf1ol","pt-br":"Portugu\xeas (Brasil)",nl:"Nederlands"},g=e=>"pt-br"===e?"pt-BR":e;function d(e,t){return"touros.".concat(e,".").concat(t)}function f(e,t){return"touros_".concat(e.replace(/[^a-z0-9]/gi,"_"),"_").concat(t)}function p(e,t){"undefined"!=typeof document&&(document.cookie="".concat(e,"=").concat(encodeURIComponent(t),"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"))}function m(){let e=(0,s.f2)();return null!=e&&(0,i.Vg)(e)}function y(e){var t;let{currentLocale:n,supportedLocales:i,tenantSlug:y,dismissDays:h}=e,b=null!==(t=(0,l.usePathname)())&&void 0!==t?t:"/".concat(n),x=(0,l.useRouter)(),[w,v]=(0,r.useState)(!1),[_,S]=(0,r.useState)("suggested"),[N,I]=(0,r.useState)(null),[j,k]=(0,r.useState)(null),C=null!=N?N:n,O=(0,r.useMemo)(()=>{let e=new Set;for(let t of i)o.R.includes(t)&&e.add(t);return Array.from(e)},[i]),D=(0,r.useMemo)(()=>j?function(e,t){var n;if("undefined"!=typeof Intl&&"function"==typeof Intl.DisplayNames)try{let n=new Intl.DisplayNames([g(t)],{type:"language"}).of(g(e));if(n&&n.length>0)return n}catch(e){}return null!==(n=c[e])&&void 0!==n?n:e.toUpperCase()}(j,C):"",[j,C]);(0,r.useEffect)(()=>{if(!b)return;if(function(e){if("undefined"==typeof document)return null;let t=document.cookie.match(new RegExp("(?:^|; )".concat(e,"=([^;]*)")));return t?decodeURIComponent(t[1]):null}(f(y,"lang_pref"))){v(!1);return}let e=null,t=null;try{e=window.localStorage.getItem(d(y,"lang_overlay_decision")),t=window.localStorage.getItem(d(y,"lang_pref_ts"))}catch(e){}if(e&&!function(e,t){if(!e)return!0;let n=Date.parse(e);return!!Number.isNaN(n)||Date.now()-n>864e5*t}(t,h)){v(!1);return}let a=function(e,t){if(!Array.isArray(e)||0===e.length)return null;for(let n of e){let e=function(e,t){if(!e||0===t.length)return null;let n=e.trim().toLowerCase();if(0===n.length)return null;let a=new Set(t);if("pt-br"===n||n.startsWith("pt-br"))return a.has("pt-br")?"pt-br":null;let r=n.split("-")[0];return a.has(r)?r:"pt"===r&&a.has("pt-br")?"pt-br":null}(n,t);if(e)return e}return null}("undefined"!=typeof navigator&&Array.isArray(navigator.languages)?navigator.languages:"undefined"!=typeof navigator&&"string"==typeof navigator.language?[navigator.language]:[],i);if(I(a),a&&a===n){try{window.localStorage.setItem(d(y,"lang_overlay_decision"),"auto_match_no_overlay"),window.localStorage.setItem(d(y,"lang_pref"),n),window.localStorage.setItem(d(y,"lang_pref_ts"),new Date().toISOString())}catch(e){}v(!1);return}if(a&&a!==n){k(a),S("suggested"),v(!0);return}k(null),S("all"),v(!0)},[b,y,h]),(0,r.useEffect)(()=>{let e=()=>{if(m())try{let e=window.localStorage.getItem(d(y,"lang_pref")),t=window.localStorage.getItem(d(y,"lang_pref_ts"));if(!e||!o.R.includes(e))return;p(f(y,"lang_pref"),e),p(f(y,"lang_pref_ts"),null!=t?t:new Date().toISOString())}catch(e){}},t=t=>{let n=t.detail;(null==n?void 0:n.granted)===!0&&e()};return window.addEventListener(s.L8,t),e(),()=>window.removeEventListener(s.L8,t)},[y]);let L=e=>{let t=new Date().toISOString();try{window.localStorage.setItem(d(y,"lang_pref"),e),window.localStorage.setItem(d(y,"lang_pref_ts"),t),window.localStorage.setItem(d(y,"lang_overlay_decision"),"user_choice")}catch(e){}m()&&(p(f(y,"lang_pref"),e),p(f(y,"lang_pref_ts"),t))},E=e=>{if(L(e),v(!1),e===n)return;let t=function(e,t){if(!e||!e.startsWith("/"))return"/".concat(t);let n=e.replace(u,""),a=n.length>0?n:"";return"/".concat(t).concat(a.startsWith("/")?a:a.length>0?"/".concat(a):"")}(b,e),a=window.location.search;x.push(a?"".concat(t).concat(a):t)},R=()=>{L(n),v(!1)};if(!w)return null;let A=e=>(0,o.t)(C,e),z=A("languageOverlay.suggestedTitle").replace("{language}",D);return(0,a.jsx)("div",{className:"pointer-events-none fixed inset-0 z-[120] flex items-center justify-center bg-black/55 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"tos-lang-overlay-title",children:(0,a.jsx)("div",{className:"pointer-events-auto w-full max-w-lg rounded-xl bg-white p-6 shadow-2xl",children:"suggested"===_&&j?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{id:"tos-lang-overlay-title",className:"mb-3 text-xl font-semibold text-gray-900",children:z}),(0,a.jsx)("p",{className:"mb-6 text-sm text-gray-600",children:A("languageOverlay.suggestedDescription")}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{j&&E(j)},className:"rounded-lg px-4 py-2 text-sm font-semibold text-white",style:{background:"linear-gradient(95deg, #d02732 0%, #2e3677 100%)"},children:A("languageOverlay.switchLabel")}),(0,a.jsx)("button",{type:"button",onClick:R,className:"rounded-lg border border-gray-300 px-4 py-2 text-sm font-semibold text-gray-800 hover:bg-gray-50",children:A("languageOverlay.stayLabel")})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{id:"tos-lang-overlay-title",className:"mb-3 text-xl font-semibold text-gray-900",children:A("languageOverlay.allTitle")}),(0,a.jsx)("p",{className:"mb-6 text-sm text-gray-600",children:A("languageOverlay.allDescription")}),(0,a.jsx)("div",{className:"mb-5 flex flex-wrap items-center gap-2",children:O.map(e=>{var t;let r=e===n;return(0,a.jsx)("button",{type:"button",onClick:()=>E(e),className:"rounded-lg border border-gray-300 px-3 py-2 text-sm hover:bg-gray-50",style:{fontWeight:r?700:500},children:null!==(t=c[e])&&void 0!==t?t:e.toUpperCase()},e)})}),(0,a.jsx)("button",{type:"button",onClick:R,className:"rounded-lg border border-gray-300 px-4 py-2 text-sm font-semibold text-gray-800 hover:bg-gray-50",children:A("languageOverlay.stayLabel")})]})})})}var h=y}}]);
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.