1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9061],{252:(e,t,n)=>{n.d(t,{s:()=>a});var r=n(5155);function a(e){let{onClose:t,label:n="Close"}=e;return(0,r.jsx)("div",{className:"oq-modal-header",children:(0,r.jsx)("button",{type:"button",className:"oq-modal-close",onClick:t,"aria-label":n,children:(0,r.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M6 6 L18 18 M18 6 L6 18",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})})})}},1273:(e,t,n)=>{n.d(t,{l:()=>d});var r=n(5155),a=n(2115),l=n(252),i=n(5681),o=n(2242),s=n(7435);function d(e){let{onClose:t,onSubmit:n,presentation:d="modal"}=e,c="page"===d,[u,m]=(0,a.useState)(""),[f,h]=(0,a.useState)(""),[p,v]=(0,a.useState)("idle"),b=(0,a.useRef)(null),g=(0,a.useRef)(null);(0,i.y)(!c),(0,s.i)(b,!c);let{arm:y,requestClose:w}=(0,o.z)(!0,()=>{"sending"!==p&&t()});(0,a.useEffect)(()=>{!c&&window.matchMedia("(max-width: 768px)").matches&&y()},[]),(0,a.useEffect)(()=>{let e=e=>{"Escape"===e.key&&"sending"!==p&&w()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p]),(0,a.useEffect)(()=>{if(c)return;let e=setTimeout(()=>{var e;return null==(e=g.current)?void 0:e.focus()},80);return()=>clearTimeout(e)},[c]);let x=async e=>{if(e.preventDefault(),"sending"===p||"sent"===p)return;let t=u.trim().toLowerCase();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t.trim()))return void v("error-format");v("sending");try{await n({email:t,website:f}),v("sent"),setTimeout(w,900)}catch(e){v("error-server")}},j="error-format"===p?"Please enter a valid email address.":"error-server"===p?"Something went wrong. Please try again.":null,k=(0,r.jsx)(r.Fragment,{children:"sent"===p?(0,r.jsxs)("div",{className:"oq-modal-success",children:[(0,r.jsx)("div",{className:"oq-modal-success-mark","aria-hidden":"true",children:(0,r.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",children:[(0,r.jsx)("circle",{cx:"11",cy:"11",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,r.jsx)("path",{d:"M6.5 11.4 L9.5 14.4 L15.5 7.6",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"square",strokeLinejoin:"miter"})]})}),(0,r.jsx)("h2",{className:"oq-modal-title oq-modal-success-title",children:"Your download is starting."}),(0,r.jsx)("p",{className:"oq-modal-success-body",style:{marginBottom:0},children:"Weâll send notes on new articles to your inbox as theyâre published."})]}):(0,r.jsxs)("form",{onSubmit:x,noValidate:!0,children:[(0,r.jsxs)("div",{style:{marginBottom:"var(--sp-5)"},children:[(0,r.jsx)("h2",{id:"pdf-gate-title",className:"oq-modal-title",children:"Download the PDF"}),(0,r.jsx)("p",{className:"oq-modal-lede",style:{marginBottom:0},children:"Add your email to start the download. Weâll also send notes on new articles as theyâre published. Unsubscribe anytime."})]}),(0,r.jsxs)("div",{className:"oq-field",children:[(0,r.jsx)("label",{htmlFor:"pdf-gate-email",className:"oq-label",children:"Email"}),(0,r.jsx)("input",{id:"pdf-gate-email",ref:g,type:"email",value:u,onChange:e=>{m(e.target.value),("error-format"===p||"error-server"===p)&&v("idle")},className:"oq-field-text",autoComplete:"email",inputMode:"email",required:!0,"aria-invalid":"error-format"===p?"true":"false","aria-describedby":j?"pdf-gate-error":void 0,disabled:"sending"===p})]}),(0,r.jsx)("input",{type:"text",name:"website",tabIndex:-1,autoComplete:"off","aria-hidden":"true",value:f,onChange:e=>h(e.target.value),style:{position:"absolute",left:"-9999px",width:1,height:1,opacity:0,pointerEvents:"none"}}),j?(0,r.jsx)("div",{id:"pdf-gate-error",role:"alert",style:{padding:"var(--sp-3)",background:"rgba(122, 31, 35, 0.06)",border:"1px solid rgba(122, 31, 35, 0.2)",borderRadius:"var(--radius-md)",color:"var(--ect-oxblood)",fontSize:"0.875rem",marginBottom:"var(--sp-4)"},children:j}):null,(0,r.jsxs)("div",{className:"oq-actions",children:[(0,r.jsx)("button",{type:"button",className:"oq-btn-secondary",onClick:w,disabled:"sending"===p,children:"Cancel"}),(0,r.jsx)("button",{type:"submit",className:"oq-btn-primary oq-btn-primary--wide",disabled:"sending"===p||!u.trim(),children:"sending"===p?"Starting...":"Download"})]}),(0,r.jsx)("p",{className:"oq-pay-fineprint",style:{textAlign:"center",marginTop:"var(--sp-3)"},children:"Unsubscribe anytime."})]})});return c?(0,r.jsxs)("div",{className:"oq-flow-page",children:[(0,r.jsx)("div",{className:"oq-flow-page__bar",children:"sending"!==p&&
1(0,r.jsx)("button",{type:"button",className:"oq-flow-page__close",onClick:t,"aria-label":"Close",children:(0,r.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M6 6 L18 18 M18 6 L6 18",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})})}),(0,r.jsx)("div",{className:"oq-flow-page__inner",children:k})]}):(0,r.jsx)("div",{ref:b,className:"oq-modal-overlay",onClick:e=>{e.target===b.current&&"sending"!==p&&w()},role:"dialog","aria-modal":"true","aria-labelledby":"pdf-gate-title",children:(0,r.jsxs)("div",{className:"oq-modal oq-modal--narrow",onClick:e=>e.stopPropagation(),children:["sending"!==p&&(0,r.jsx)(l.s,{onClose:w}),k]})})}},1982:(e,t,n)=>{n.d(t,{l:()=>l});var r=n(6003);let a=new Set(["article","response"]);async function l(e){var t,n,l;let{doc:i,email:o,filenameFallback:s="document"}=e;if(!i)return;let d=function(e){let{doc:t,email:n}=e;if(!t||!a.has(t.type))return null;let l=(0,r.T)(t.lang);if("Unknown"===l)return null;let i=new URLSearchParams;n&&i.set("email",n),t.last_publication_date&&i.set("v",t.last_publication_date);let o=i.toString();return"/api/document-pdf/".concat(t.type,"/").concat(l,"/").concat(t.uid).concat(o?"?".concat(o):"")}({doc:i,email:o});if(!d)return;let c=await fetch(d),u=c.headers.get("content-type")||"";if(!c.ok||!u.startsWith("application/pdf")){window.location.href=d;return}let m=await c.blob(),f=window.URL.createObjectURL(m),h=window.document.createElement("a");h.href=f,h.download="".concat((null==(l=i.data)||null==(n=l.title)||null==(t=n[0])?void 0:t.text)||s,".pdf"),window.document.body.appendChild(h),h.click(),window.URL.revokeObjectURL(f),h.remove()}},2242:(e,t,n)=>{n.d(t,{z:()=>a});var r=n(2115);function a(e,t){let n=(0,r.useRef)(!1),a=(0,r.useRef)(!1),l=(0,r.useRef)(t);return l.current=t,(0,r.useEffect)(()=>{if(!e){n.current=!1,a.current=!1;return}let t=()=>{n.current=!1,a.current=!1,l.current({viaHistory:!0})};return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)},[e]),{arm:function(){window.history.pushState({ectSheet:!0},""),n.current=!0},requestClose:function(){if(!a.current){if(n.current){a.current=!0,window.history.back();return}l.current({viaHistory:!1})}}}}},2452:(e,t,n)=>{n.d(t,{s:()=>r});let r="(min-width: 769px)"},3819:(e,t,n)=>{n.d(t,{g5:()=>l,n2:()=>r});let r={en:"en-us",es:"es-es",fr:"fr-fr",pt:"pt-pt",it:"it-it",de:"de-de",pl:"pl-pl",nl:"nl-nl"},a={"en-us":{full:"English",abbr:"EN"},"es-es":{full:"Espa\xf1ol",abbr:"ES"},"fr-fr":{full:"Fran\xe7ais",abbr:"FR"}};function l(e){let t=a[e];if(t)return t;let n=String(e||"").split("-")[0],r=e||"";try{let e=new Intl.DisplayNames([n],{type:"language"}).of(n);e&&e!==n&&(r=e.charAt(0).toLocaleUpperCase(n)+e.slice(1))}catch(e){}return{full:r,abbr:n?n.toUpperCase():String(e||"")}}},5681:(e,t,n)=>{n.d(t,{y:()=>a});var r=n(2115);function a(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];(0,r.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;document.body.style.overflow="hidden";let n=window.visualViewport,r=document.documentElement,a=()=>{n&&(r.style.setProperty("--sheet-h","".concat(Math.round(n.height),"px")),r.style.setProperty("--sheet-top","".concat(Math.round(n.offsetTop),"px")))};return a(),n&&(n.addEventListener("resize",a),n.addEventListener("scroll",a)),()=>{document.body.style.overflow=t,n&&(n.removeEventListener("resize",a),n.removeEventListener("scroll",a)),r.style.removeProperty("--sheet-h"),r.style.removeProperty("--sheet-top")}},[e])}},6003:(e,t,n)=>{n.d(t,{T:()=>a});var r=n(3819);let a=e=>{let t=Object.entries(r.n2).find(t=>{let[n,r]=t;return r==e});return t?t[0]:"en"}},7435:(e,t,n)=>{n.d(t,{i:()=>l});var r=n(2115);let a=e=>e.getClientRects().length>0;function l(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];(0,r.useEffect)(()=>{if(!t)return;let n=e.current;if(!n)return;let r=document.activeElement instanceof HTMLElement?document.activeElement:null,l=()=>Array.from(n.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), iframe, [tabindex]:not
1([tabindex="-1"])')).filter(a);if(!n.contains(document.activeElement)){let e=l()[0];e?e.focus():(n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus())}let i=e=>{if("Tab"!==e.key)return;let t=l();if(0===t.length)return void e.preventDefault();let r=t[0],a=t[t.length-1],i=document.activeElement,o=n.contains(i);e.shiftKey?o&&i!==r||(e.preventDefault(),a.focus()):o&&i!==a||(e.preventDefault(),r.focus())};return document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("keydown",i,!0),r&&document.contains(r)&&r.focus()}},[e,t])}},9869:(e,t,n)=>{n.d(t,{J:()=>o,d:()=>d});var r=n(2115),a=n(63),l=n(1982),i=n(2452);let o="ect.pdfGateEmail";function s(){return localStorage.getItem(o)}function d(){let{doc:e,filenameFallback:t="document",onBeforeGate:n,onError:d}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=(0,a.useRouter)(),[u,m]=(0,r.useState)(!1),[f,h]=(0,r.useState)(!1);async function p(){if(!e)return;let n=s()||"";m(!0);try{await (0,l.l)({doc:e,email:n,filenameFallback:t})}catch(e){d&&d(e)}finally{m(!1)}}return{pdfLoading:u,isGateModalOpen:f,handleClickDownloadPdf:function(){return s()?void p():(n&&n(),!window.matchMedia(i.s).matches&&e)?void c.push(function(){var n,r,a;let l=new URLSearchParams({type:e.type||"",lang:e.lang||"",uid:e.uid||"",fallback:t});e.last_publication_date&&l.set("v",e.last_publication_date);let i=null==(a=e.data)||null==(r=a.title)||null==(n=r[0])?void 0:n.text;return i&&l.set("title",i),"/pdf-gate?".concat(l.toString())}()):void h(!0)},handleGateSubmit:async function e(e){let{email:t,website:n}=e;localStorage.setItem(o,t);try{await fetch("/api/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,tag:"pdf-gate",website:n})})}catch(e){}},handleGateClose:function(){h(!1),s()&&p()}}}}}]);
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.