1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1943],{81943:(e,t,n)=>{n.r(t),n.d(t,{default:()=>C});var r,i=n(94513),u=n(57005),a=n(94285),o=n(27809),l=n(10843),c=n(9876),f=n(31567),s=n(6459);function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var E=Symbol("$$t");!function(e){e.Get||(e.Get={}),e.test=function(e){},e.areEqual=function(e){}}(r||(r={}));var I={get:function(e,t){return e[t]},concat:function(e,t){return d({},e,t)},fromMaybe:function(e){return null!=e?e:{}},keys:function(e){return Object.keys(e)}},v=function(e){var t=(0,a.useRef)(null);return null===t.current&&(t.current=e()),t.current},T=function(e){throw Error("Invariant: assertNever was called")},y=function(e){var t=I.keys(I.concat(I.fromMaybe(I.get(e.states,e.initial).on),I.fromMaybe(e.on)));return{value:e.initial,context:e.context,event:{type:"$$initial"},nextEvents:t,nextEventsT:t}},b=function(e){var t=g(e);return function(n,r){if("SET_CONTEXT"===r.type){var i=r.updater(n.context);return t("Context update",["Previous Context",n.context],["Next Context",i]),d({},n,{context:i})}if("SEND"===r.type){var u,a=r.sendable,o="string"==typeof a?{type:a}:a,l=n.context,c=I.get(e.states,n.value),f=null!=(u=I.get(I.fromMaybe(c.on),o.type))?u:I.get(I.fromMaybe(e.on),o.type);if(!f)return t("Current state doesn't listen to event type \""+o.type+'".',["Current State",n],["Event",o]),n;var s="string"==typeof f?[f]:void 0===f.guard||f.guard({context:l,event:o})?[f.target]:[f.target,!0],E=s[0],v=s[1];if(void 0!==v&&v)return t('Transition from "'+n.value+'" to "'+E+'" denied by guard',["Event",o],["Context",l]),n;t('Transition from "'+n.value+'" to "'+E+'"',["Event",o]);var y=I.get(e.states,E),b=I.keys(I.concat(I.fromMaybe(y.on),I.fromMaybe(e.on)));return{value:E,context:l,event:o,nextEvents:b,nextEventsT:b}}return T()}},g=function(e){return function(t){e.verbose&&e.console}},S=function(){var e;return(e={})[E]=void 0,e};let N=function(e){var t=(0,a.useReducer)(b(e),y(e)),n=t[0],r=t[1],i=v(function(){return function(e){return r({type:"SEND",sendable:e})}}),u=function(e){return r({type:"SET_CONTEXT",updater:e}),{send:i}};return(0,a.useEffect)(function(){var t=I.get(e.states,n.value).effect,r=null==t?void 0:t({send:i,setContext:u,event:n.event,context:n.context});return"function"==typeof r?function(){return null==r?void 0:r({send:i,setContext:u,event:n.event,context:n.context})}:void 0},[n.value,n.event]),[n,i]},_=async({email:e,userID:t})=>{try{let n=await fetch("/api/iterable/jwt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,userID:t})});if(!n.ok)throw Error(`JWT generation failed: ${n.status}`);let{token:r}=await n.json();return f.q.debug("[Iterable] JWT token generated successfully"),r}catch(e){throw f.q.debug(`[Iterable] Failed to generate JWT: ${e}`),e}},p=()=>{let{session:e}=(0,c.wV)(),t=(0,l.c)(),n=(0,a.useRef)(null),[r,i]=N({initial:"uninitialized",verbose:!1,schema:{events:{INIT_FAILED:S(),IDENTIFY_FAILED:S()}},states:{uninitialized:{on:{START_INIT:"initializing",NO_CONSENT:"uninitialized",NO_API_KEY:"uninitialized"},effect({event:e}){e?.type==="NO_CONSENT"?f.q.debug("[Iterable] No consent - SDK not initialized"):e?.type==="NO_API_KEY"?f.q.debug("[Iterable] API key not configured"):e?.type==="RESET"&&f.q.debug("[Iterable] SDK reset to uninitialized")}},initializing:{on:{INIT_SUCCESS:"ready",INIT_FAILED:"error",RESET:"uninitialized"},effect(){f.q.debug("[Iterable] Attempting to initialize SDK...")}},ready:{on:{START_IDENTIFY:"identifying_user",RESET:"uninitialized"},effect({event:e}){e?.type==="LOGOUT"?f.q.debug("[Iterable] User logged out, SDK ready for re-identification"):f.q.debug("[Iterable] SDK initialized successfully")}},identifying_user:{on:{IDENTIFY_SUCCESS:"user_identified",IDENTIFY_FAILED:"error",RESET:"uninitialized"},effect(){f.q.debug("[Iterable] Calling setEmail() for user identification")}},user_identified:{on:{LOGOUT:"ready",RESET:"uninitialized"},effect(){f.q.debug("[Iterable] User identified successfully")}},error:{on:{RESET:"uninitialized"},effect({event:e}){if(e?.type==="INIT_FAILED"){let t="error"in e?e.error:"Unknown error";f.q.debug(`[Iterable] SDK initialization failed: ${t}`)}else if(e?.type==="IDENTIFY_FAILED"){let t="error"in e?e.error:"Unknown error";
1f.q.debug(`[Iterable] Failed to identify user: ${t}`)}}}}}),u=t.all({purposes:["STORE_AND_ACCESS_INFORMATION_ON_A_DEVICE","MEASURE_CONTENT_PERFORMANCE"]}),d=(0,s.lV)(e)?e.email:null;return(0,a.useEffect)(()=>{if(!u)return void i("NO_CONSENT");let e="ea83a33f2ab34457966006c8f5527e6b";if(!e)return void i("NO_API_KEY");if(!n.current){try{i("START_INIT"),n.current=(0,o.initializeWithConfig)({authToken:e,configOptions:{isEuIterableService:!0},generateJWT:_}),i("INIT_SUCCESS")}catch(e){i({type:"INIT_FAILED",error:e})}return()=>{n.current&&(f.q.debug("[Iterable] Cleaning up SDK instance"),n.current.clearRefresh(),n.current=null),i("RESET")}}},[u,i,d]),(0,a.useEffect)(()=>{if("ready"!==r.value||!n.current)return;let{setEmail:e}=n.current;d&&(i("START_IDENTIFY"),e(d).then(()=>{i("IDENTIFY_SUCCESS")}).catch(e=>{i({type:"IDENTIFY_FAILED",error:e})}))},[d,r.value,i]),(0,a.useEffect)(()=>{"user_identified"===r.value&&n.current&&(d||(f.q.debug("[Iterable] User logged out - clearing SDK identity"),n.current.logout(),i("LOGOUT")))},[d,r.value,i]),null},C=()=>{let{enabled:e,isHydrated:t}=(0,u.PG)();return t&&e?(0,i.jsx)(p,{}):null}}}]);
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.