1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{16174:(e,t,n)=>{"use strict";n.d(t,{ThemeProvider:()=>s});var a=n(95155);n(12115);var r=n(5379);function s(e){let{children:t,...n}=e;return(0,a.jsx)(r.N,{...n,children:t})}},21447:(e,t,n)=>{"use strict";n.d(t,{Integrations:()=>o});var a=n(95155),r=n(68321),s=n(82714);function o(){let e=(0,s.S)(),{publication:t,host:n}=(0,s._)(),o=null==t?void 0:t.integrations;if(!o)return null;let i=o.fbPixelID?"\n !function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;t.defer=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window,document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '".concat(encodeURI(o.fbPixelID),"');\n "):null,l=o.hotjarSiteID?"\n (function(h,o,t,j,a,r){\n h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n h._hjSettings={hjid:".concat(encodeURI(o.hotjarSiteID),",hjsv:6};\n a=o.getElementsByTagName('head')[0];\n r=o.createElement('script');r.async=1;r.defer=1;\n r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n a.appendChild(r);\n })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\n "):null,c=o.matomoURL&&o.matomoSiteID?"\n var _paq = window._paq = window._paq || [];\n _paq.push(['trackPageView']);\n _paq.push(['enableLinkTracking']);\n (function() {\n var u=\"https://".concat(encodeURI(o.matomoURL),"/\";\n _paq.push(['setTrackerUrl', u+'matomo.php']);\n _paq.push(['setSiteId', '").concat(encodeURI(o.matomoSiteID),"']);\n var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];\n g.type='text/javascript'; g.async=true; g.defer=true; g.src='//cdn.matomo.cloud/").concat(encodeURI(o.matomoURL),"/matomo.js'; s.parentNode.insertBefore(g,s);\n })();\n "):null,d=o.gTagManagerID?"\n (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;
1j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer', '".concat(o.gTagManagerID,"');\n "):null,u=o.koalaPublicKey?'\n !function(t){if(window.ko)return;window.ko=[],\n ["identify","track","removeListeners","on","off","qualify","ready"]\n .forEach(function(t){ko[t]=function(){var n=[].slice.call(arguments);return n.unshift(t),ko.push(n),ko}});\n var n=document.createElement("script");\n n.async=!0,n.setAttribute("src","https://cdn.getkoala.com/v1/'.concat(encodeURI(o.koalaPublicKey),'/sdk.js"),\n (document.body || document.head).appendChild(n)}();\n '):null,m=o.msClarityID?'\n (function(c,l,a,r,i,t,y){\n c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\n t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;\n y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\n })(window, document, "clarity", "script", \''.concat(o.msClarityID,"');\n "):null,g=o.openPanelClientId&&/^[A-Za-z0-9-]{1,64}$/.test(o.openPanelClientId)?"\n window.op = window.op || function(){(window.op.q = window.op.q || []).push(arguments);};\n window.op('init', {\n clientId: '".concat(o.openPanelClientId,"',\n trackScreenViews: true,\n trackOutgoingLinks: true,\n trackAttributes: true,\n });\n "):null,h=o.gaTrackingID?"\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat(encodeURI(o.gaTrackingID),"');\n "):null;return(0,a.jsxs)(a.Fragment,{children:[e.marketing&&i&&(0,a.jsx)(r.default,{id:"fb-pixel",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:i}}),e.analytics&&o.fathomSiteID&&(0,a.jsx)(r.default,{id:"fathom",strategy:"afterInteractive",src:o.fathomCustomDomainEnabled&&o.fathomCustomDomain?"https://".concat(o.fathomCustomDomain,"/script.js"):"https://cdn.usefathom.com/script.js","data-spa":"auto","data-site":o.fathomSiteID}),e.analytics&&l&&(0,a.jsx)(r.default,{id:"hotjar",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:l}}),e.analytics&&c&&(0,a.jsx)(r.default,{id:"matomo",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:c}}),e.marketing&&d&&(0,a.jsx)(r.default,{id:"gtm",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:d}}),e.analytics&&o.gaTrackingID&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.default,{id:"ga-script",strategy:"afterInteractive",src:"https://www.googletagmanager.com/gtag/js?id=".concat(encodeURI(o.gaTrackingID))}),(0,a.jsx)(r.default,{id:"ga-config",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:h}})]}),e.marketing&&u&&(0,a.jsx)(r.default,{id:"koala",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:u}}),e.analytics&&m&&(0,a.jsx)(r.default,{id:"ms-clarity",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:m}}),e.analytics&&g&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.default,{id:"openpanel-init",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:g}}),(0,a.jsx)(r.default,{id:"openpanel-sdk",strategy:"afterInteractive",src:"https://openpanel.dev/op1.js"})]}),e.analytics&&o.plausibleAnalyticsEnabled&&(0,a.jsx)(r.default,{id:"plausible",strategy:"afterInteractive","data-domain":n,src:"https://plausible.io/js/plausible.js"}),o.wmPaymentPointer&&(0,a.jsx)("meta",{name:"monetization",content:o.wmPaymentPointer})]})}},35514:(e,t,n)=>{"use strict";n.d(t,{Analytics:()=>u});var a=n(3648),r=n(12115),s=n(20063),o=n(62044),i=n(34329),l=n(82714);function c(){let e=(0,a._)(["\n query AnalyticsPage($host: String!, $slug: String!) {\n publication(host: $host) {\n post(slug: $slug) {\n id\n }\n series(slug: $slug) {\n id\n }\n staticPage(slug: $slug) {\n id\n }\n }\n }\n"]);return c=function(){return e},e}let d=(0,i.J1)(c());function u(){var e,t,n,a,i,c;let{postId:u,seriesId:m,staticPageId:g}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},h=(0,l.S)(),{publication:p,host:f}=(0,l._)(),y=(0,s.usePathname)(),b=(0,r.useRef)(!1),x=(0,r.useRef)(""),v=(0,r.useMemo)(()=>(function(e){if("/"===e||["/api/","/archive","/members","/newsletter","/recommendations"].some(t=>e.startsWith(t)))return null;let t=e.match(/^\/(page|series|tag)\/([^/]+)/);if(t)return t[2];
1let n=e.split("/").filter(Boolean);return n.length>0?n[0]:null})(y),[y]),j=(0,r.useMemo)(()=>y.startsWith("/series/")?"series":y.startsWith("/page/")?"page":y.startsWith("/tag/")?"tag":"/"===y||y.startsWith("/archive")||y.startsWith("/members")||y.startsWith("/newsletter")||y.startsWith("/recommendations")||y.startsWith("/api/")?"other":"post",[y]),w=v&&("post"===j||"series"===j||"page"===j),[{data:k}]=(0,o.IT)({query:d,variables:{host:f,slug:v||""},pause:!f||!w}),_=null==p?void 0:p.id,I="G-72XG3F8LNJ",S=u||(null==k||null==(t=k.publication)||null==(e=t.post)?void 0:e.id)||null,N=m||(null==k||null==(a=k.publication)||null==(n=a.series)?void 0:n.id)||null,P=g||(null==k||null==(c=k.publication)||null==(i=c.staticPage)?void 0:i.id)||null;return(0,r.useEffect)(()=>{_&&h.analytics&&(!w||k)&&(b.current&&y===x.current||(!function(e){let{publicationId:t,postId:n,seriesId:a,staticPageId:r}=e;if(!t)return;let s=new Blob([JSON.stringify({events:[{payload:{publicationId:t,postId:n||null,seriesId:a||null,pageId:r||null,url:window.location.href,referrer:document.referrer||null,language:navigator.language,screen:"".concat(window.screen.width,"x").concat(window.screen.height)},type:"pageview"}]})],{type:"application/json; charset=UTF-8"}),o=!1;try{navigator.sendBeacon&&(o=navigator.sendBeacon("/api/track",s))}catch(e){}o||fetch("/api/track",{method:"POST",body:s,credentials:"omit",keepalive:!0}).catch(()=>{})}({publicationId:_,postId:S,seriesId:N,staticPageId:P}),function(e){if(!window.gtag)return;let t=e||"G-72XG3F8LNJ";t&&window.gtag("config",t,{transport_url:"https://ping.hashnode.com",first_party_collection:!0}
1)}(I),b.current=!0,x.current=y))},[_,I,y,S,N,P,w,k,h.analytics]),null}},41290:()=>{},63851:(e,t,n)=>{"use strict";n.d(t,{UrqlProvider:()=>l});var a=n(95155),r=n(12115),s=n(62044),o=n(34329);n(95704);let i=(0,o.OP)({isClient:!0,initialState:window.__URQL_DATA__});function l(e){let{children:t}=e,n=(0,r.useMemo)(()=>(0,o.UU)({...{url:"/api/graphql",exchanges:[o.WG,i,o.cI]},requestPolicy:"network-only",fetchOptions:{headers:{...!1,...!1}}}),[]);return(0,a.jsx)(s.Kq,{value:n,children:t})}},63896:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,41290,23)),Promise.resolve().then(n.t.bind(n,77998,23)),Promise.resolve().then(n.bind(n,35514)),Promise.resolve().then(n.bind(n,82714)),Promise.resolve().then(n.bind(n,21447)),Promise.resolve().then(n.bind(n,16174)),Promise.resolve().then(n.bind(n,82180)),Promise.resolve().then(n.bind(n,63851)),Promise.resolve().then(n.t.bind(n,27007,23)),Promise.resolve().then(n.t.bind(n,23763,23)),Promise.resolve().then(n.t.bind(n,73075,23)),Promise.resolve().then(n.t.bind(n,53994,23))},77998:()=>{},82180:(e,t,n)=>{"use strict";n.d(t,{TooltipProvider:()=>o,ZI:()=>c,k$:()=>l,m_:()=>i});var a=n(95155);n(12115);var r=n(69216),s=n(25016);function o(e){let{delayDuration:t=0,...n}=e;return(0,a.jsx)(r.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...n})}function i(e){let{...t}=e;return(0,a.jsx)(r.bL,{"data-slot":"tooltip",...t})}function l(e){let{...t}=e;return(0,a.jsx)(r.l9,{"data-slot":"tooltip-trigger",...t})}function c(e){let{className:t,sideOffset:n=0,children:o,...i}=e;return(0,a.jsx)(r.ZL,{children:(0,a.jsxs)(r.UC,{"data-slot":"tooltip-content",sideOffset:n,className:(0,s.cn)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...i,children:[o,(0,a.jsx)(r.i3,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},82714:(e,t,n)=>{"use strict";n.d(t,{ConsentManager:()=>f,S:()=>p,_:()=>m});var a=n(95155),r=n(68321),s=n(20063),o=n(12115),i=n(62044),l=n(26614),c=n(16602);let d=(0,o.createContext)({analytics:!0,marketing:!0,isRequired:!1}),u=(0,o.createContext)({publication:void 0,host:"",fetching:!0});function m(){return(0,o.useContext)(u)}function g(){let e=window.location.hostname.split("."),t=e.map((t,n)=>".".concat(e.slice(n).join("."))),n=["_ga","_fbp","_hj","_clck","_clsk","_gcl","mp_","ph_"];document.cookie.split(";").forEach(e=>{var a;let r=null==(a=e.split("=")[0])?void 0:a.trim();r&&n.some(e=>r.startsWith(e))&&(document.cookie="".concat(r,"=; Max-Age=0; path=/; SameSite=Lax"),t.forEach(e=>{document.cookie="".concat(r,"=; Max-Age=0; path=/; domain=").concat(e,"; SameSite=Lax")}))});try{Object.keys(localStorage).filter(e=>e.startsWith("ph_")||e.startsWith("__ph_")||e.startsWith("_gcl")).forEach(e=>localStorage.removeItem(e))}catch(e){}}function h(){let e=!1;try{e=null!==localStorage.getItem("hashnode-analytics-consent"),localStorage.removeItem("hashnode-analytics-consent")}catch(e){}e&&(l.Ay.__loaded&&!l.Ay.has_opted_out_capturing()&&(l.Ay.opt_out_capturing(),l.Ay.set_config({persistence:"memory"})),g())}function p(){return(0,o.useContext)(d)}function f(e){var t,n,m;let{children:p}=e,f=(0,s.usePathname)(),[y,b]=(0,o.useState)(""),[x,v]=(0,o.useState)({analytics:!1,marketing:!1}),[j,w]=(0,o.useState)({analytics:!1,marketing:!1}),[k,_]=(0,o.useState)(!1),[I,S]=(0,o.useState)(!1),[N,P]=(0,o.useState)(!1);(0,o.useEffect)(()=>{var e;b((e=new URLSearchParams(window.location.search).get("x-host")||window.location.host).endsWith(".beta.hashnode.dev")?e.replace(".beta.hashnode.dev",".hashnode.dev"):e.endsWith(".app.localhost")?e.replace(".app.localhost",".hashnode.dev"):e)},[f]);let[{data:C,fetching:L}]=(0,i.IT)({query:c.Ew,variables:{host:y},pause:!y}),q=null==C?void 0:C.publication,T=null==q||null==(t=q.integrations)?void 0:t.consentManagement,E=[null==q||null==(n=q.domainInfo.domain)?void 0:n.host,null==q||null==(m
1=q.domainInfo.wwwPrefixedDomain)?void 0:m.host].filter(Boolean),D=!!((null==T?void 0:T.enabled)&&E.includes(y)),A=(null==q?void 0:q.id)?"hashnode-consent:".concat(q.id):null;(0,o.useEffect)(()=>{if(D&&A&&T){try{let e=localStorage.getItem(A),t=e?JSON.parse(e):null;if(t&&t.version===T.version){let e={analytics:!0===t.analytics,marketing:!0===t.marketing};v(e),w(e),_(!0),e.analytics&&e.marketing||g()}else v({analytics:!1,marketing:!1}),w({analytics:!1,marketing:!1}),_(!1),h()}catch(e){v({analytics:!1,marketing:!1}),w({analytics:!1,marketing:!1}),_(!1),h()}P(!0)}},[T,D,A]);let U=(0,o.useMemo)(()=>L||!q?{analytics:!1,marketing:!1}:D?j:{analytics:!0,marketing:!0},[L,D,j,q]);(0,o.useEffect)(()=>{if(!L&&q&&l.Ay.__loaded&&(!D||N))if(U.analytics){try{localStorage.setItem("hashnode-analytics-consent","granted")}catch(e){}l.Ay.has_opted_out_capturing()&&(l.Ay.set_config({persistence:"localStorage+cookie"}),l.Ay.opt_in_capturing())}else{try{localStorage.removeItem("hashnode-analytics-consent")}catch(e){}l.Ay.has_opted_out_capturing()||(l.Ay.opt_out_capturing(),l.Ay.set_config({persistence:"memory"}))}},[N,U.analytics,L,D,q]);let M=e=>{if(!A||!T)return;let t=j.analytics&&!e.analytics||j.marketing&&!e.marketing;if(localStorage.setItem(A,JSON.stringify({...e,version:T.version})),v(e),w(e),_(!0),S(!1),t){if(!e.analytics)try{localStorage.removeItem("hashnode-analytics-consent")}catch(e){}g(),window.location.reload()}},R="G-72XG3F8LNJ",W=(0,o.useMemo)(()=>({publication:q,host:y,fetching:L}),[q,y,L]);return(0,a.jsx)(u.Provider,{value:W,children:(0,a.jsxs)(d.Provider,{value:{...U,isRequired:D},children:[U.analytics&&R&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.default,{id:"hashnode-ga-script",strategy:"afterInteractive",src:"https://ping.hashnode.com/gtag/js?id=".concat(encodeURIComponent(R))}),(0,a.jsx)(r.default,{id:"hashnode-ga-config",strategy:"afterInteractive",children:"window.dataLayer = window.dataLayer || []; function gtag(){window.dataLayer.push(arguments);} gtag('js', new Date());"})]}),p,D&&!k&&(0,a.jsxs)("section",{"aria-label":"Cookie consent",className:"fixed inset-x-4 bottom-4 z-[100] mx-auto max-w-3xl rounded-xl border border-border bg-background p-5 text-foreground shadow-2xl",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Your privacy choices"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"We use optional analytics and marketing technologies only with your consent. You can change your choice at any time."}),(null==T?void 0:T.privacyPolicyURL)&&(0,a.jsx)("a",{className:"mt-2 inline-block text-sm font-medium underline underline-offset-4",href:T.privacyPolicyURL,target:"_blank",rel:"noreferrer",children:"Read the privacy policy"}),(0,a.jsxs)("div",{className:"mt-4 grid gap-2 sm:grid-cols-3",children:[(0,a.jsx)("button",{className:"rounded-md border border-border px-4 py-2 text-sm font-medium",onClick:()=>M({analytics:!1,marketing:!1}),type:"button",children:"Reject optional"}),(0,a.jsx)("button",{className:"rounded-md border border-border px-4 py-2 text-sm font-medium",onClick:()=>S(!0),type:"button",children:"Customize"}),(0,a.jsx)("button",{className:"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",onClick:()=>M({analytics:!0,marketing:!0}),type:"button",children:"Accept optional"})]})]}),D&&k&&!I&&(0,a.jsx)("button",{className:"fixed bottom-4 left-4 z-[99] rounded-md border border-border bg-background px-3 py-2 text-xs font-medium text-foreground shadow-lg",onClick:()=>S(!0),type:"button",children:"Cookie settings"}),D&&I&&(0,a.jsx)("div",{className:"fixed inset-0 z-[101] flex items-end justify-center bg-black/50 p-4 sm:items-center",children:(0,a.jsxs)("section",{"aria-labelledby":"consent-preferences-title","aria-modal":"true",className:"w-full max-w-lg rounded-xl border border-border bg-background p-5 text-foreground shadow-2xl",role:"dialog",children:[(0,a.jsx)("h2",{id:"consent-preferences-title",className:"text-lg font-semibold",children:"Cookie preferences"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Essential storage is always active because it is needed for the site to work."}),(0,a.jsxs)("label",{className:"mt-5 flex items-start gap-3 rounded-md border border-border p-3",children:[(0,a.jsx)("input",{checked:x.analytics,className:"mt-1",onChange:e=>v(t=>
1({...t,analytics:e.target.checked})),type:"checkbox"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"block text-sm font-medium",children:"Analytics"}),(0,a.jsx)("span",{className:"block text-sm text-muted-foreground",children:"Helps measure readership and improve the publication."})]})]}),(0,a.jsxs)("label",{className:"mt-3 flex items-start gap-3 rounded-md border border-border p-3",children:[(0,a.jsx)("input",{checked:x.marketing,className:"mt-1",onChange:e=>v(t=>({...t,marketing:e.target.checked})),type:"checkbox"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"block text-sm font-medium",children:"Marketing"}),(0,a.jsx)("span",{className:"block text-sm text-muted-foreground",children:"Enables advertising, tag management, and audience tools."})]})]}),(0,a.jsxs)("div",{className:"mt-5 flex justify-end gap-2",children:[k&&(0,a.jsx)("button",{className:"rounded-md border border-border px-4 py-2 text-sm font-medium",onClick:()=>S(!1),type:"button",children:"Cancel"}),(0,a.jsx)("button",{className:"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",onClick:()=>M(x),type:"button",children:"Save choices"})]})]})})]})})}}},e=>{e.O(0,[1741,5961,2888,5512,4554,7563,9216,2810,3091,8441,8229,1255,7358],()=>e(e.s=63896)),_N_E=e.O()}]);
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.