PageSourceSearch

https://sugary.me/_next/static/chunks/c3f13e1f-a16624db30995591.js

js sugary.me collected 2026-10-01 14:19:50 UTC 65,319 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7807],{69316:(e,t,n)=>{n.d(t,{FK:()=>e_,K_:()=>eN,Md:()=>eB,Zb:()=>j,ep:()=>eF,nj:()=>eM,oo:()=>e$,s9:()=>tc,zU:()=>eT,zy:()=>eP});var o=n(76378),r=n(15439),i=n(58265),s=n(30810);let a=/^\/+/;function l(e,t=null,n=null,o=null){return{data:t,error:n,ok:e,response:o}}function c(e,t=500,n="HANDLER_ERROR",o){return function(e,t=500,n="ERROR",o){return l(!1,null,{message:e,status:t,code:n,cause:o},null)}(e,t,n,o)}async function d(e,t,n){let o=e[t];if(!o){let e=c(`No endpoint handler found for '${String(t)}'`,404,"ENDPOINT_NOT_FOUND");if(n?.throw)throw Error(`No endpoint handler found for '${String(t)}'`);return e}try{let e=await o(n);return{data:e.data,error:e.error,ok:e.ok??!e.error,response:e.response}}catch(t){let e=c(t instanceof Error?t.message:String(t),0,"HANDLER_ERROR",t);if(n?.throw)throw t;return e}}async function u(e,t,n,o){let r=n.replace(a,"").split("/")[0],i=t[n];if(i)try{return await i(o)}catch(e){return c(e instanceof Error?e.message:String(e),0,"HANDLER_ERROR",e)}return r&&r in e?await d(e,r,o):c(`No endpoint handler found for '${n}'`,404,"ENDPOINT_NOT_FOUND")}
1async function f(e,t){let n=("init"in e&&e.init,"init");return await d(e,n,t)}async function g(e,t){return await d(e,"setConsent",t)}class p{endpointHandlers;dynamicHandlers={};constructor(e){this.endpointHandlers=e.endpointHandlers}async init(e){return f(this.endpointHandlers,e)}async setConsent(e){return g(this.endpointHandlers,e)}async identifyUser(e){if(this.endpointHandlers.identifyUser)return this.endpointHandlers.identifyUser(e);let t=e.body?.id;return t?this.$fetch(`/subjects/${t}`,{...e,method:"PATCH"}):{ok:!1,data:null,response:null,error:{message:"Subject ID is required to identify user",status:400,code:"MISSING_SUBJECT_ID"}}}registerHandler(e,t){this.dynamicHandlers[e]=t}async $fetch(e,t){return u(this.endpointHandlers,this.dynamicHandlers,e,t)}}let y=[500,502,503,504],m=[400,401,403,404],h,b=/^(?:[a-z+]+:)?\/\//i,w=()=>{};function C(e){return e?{log:(...e)=>console.log("[c15t]",...e),debug:(...e)=>console.debug("[c15t]",...e)}:{log:w,debug:w}}let S=C(!1),I=e=>new Promise(t=>setTimeout(t,e));function v(e){return e?.subjectId||e?.id}function k(e){let t=e.length;for(;t>0&&"/"===e[t-1];)t--;return e.slice(0,t)}async function E(e,t,n){let o={...e.retryConfig,...n?.retryConfig||{},retryableStatusCodes:n?.retryConfig?.retryableStatusCodes??e.retryConfig.retryableStatusCodes??y,nonRetryableStatusCodes:n?.retryConfig?.nonRetryableStatusCodes??e.retryConfig.nonRetryableStatusCodes??m},{maxRetries:r,initialDelayMs:i,backoffFactor:s,retryableStatusCodes:c,nonRetryableStatusCodes:d,retryOnNetworkError:u}=o,f=0,g=i,p=null;for(;f<=(r??0);){let i,y="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),m=e.customFetch||globalThis.fetch,h=function(e,t){if(b.test(e)){let n=new URL(e),o=k(n.pathname),r=t.replace(a,"");return n.pathname=`${o}/${r}`,n.toString()}let n=k(e),o=t.replace(a,"");return`${n}/${o}`}(e.backendURL,t);try{i=new URL(h)}catch{i=new URL(h,window.location.origin)}if(n?.query)for(let[e,t]of Object.entries(n.query))void 0!==t&&i.searchParams.append(e,String(t));
1let w={method:n?.method||"GET",mode:e.corsMode,credentials:"include",headers:{...e.headers,"X-Request-ID":y,...n?.headers},...n?.fetchOptions};n?.body&&"GET"!==w.method&&(w.body=JSON.stringify(n.body));try{let e=await m(i.toString(),w),a=null,u=null;try{let t=e.headers.get("content-type");t?.includes("application/json")&&204!==e.status&&"0"!==e.headers.get("content-length")?a=await e.json():204===e.status&&(a=null)}catch(e){u=e}if(u){let o=l(!1,null,{message:"Failed to parse response",status:e.status,code:"PARSE_ERROR",cause:u},e);if(n?.onError?.(o,t),n?.throw)throw Error("Failed to parse response");return o}if(e.status>=200&&e.status<300){let t=l(!0,a,null,e);return n?.onSuccess?.(t),t}let y=a,h=l(!1,null,{message:y?.message||`Request failed with status ${e.status}`,status:e.status,code:y?.code||"API_ERROR",details:y?.details||null},e);p=h;let b=!1;if(d?.includes(e.status))S.debug(`Not retrying request to ${t} with status ${e.status} (nonRetryableStatusCodes)`),b=!1;else if("function"==typeof o.shouldRetry)try{b=o.shouldRetry(e,{attemptsMade:f,url:i.toString(),method:w.method||"GET"}),S.debug(`Custom retry strategy for ${t} with status ${e.status}: ${b}`)}catch{b=c?.includes(e.status)??!1,S.debug(`Custom retry strategy failed, falling back to status code check: ${b}`)}else b=c?.includes(e.status)??!1,S.debug(`Standard retry check for ${t} with status ${e.status}: ${b}`);if(!b||f>=(r??0)){if(n?.onError?.(h,t),n?.throw)throw Error(h.error?.message||"Request failed");return h}f++,await I(g??0),g=(g??0)*(s??2)}catch(i){if(i&&"Failed to parse response"===i.message)throw i;let e=!(i instanceof Response),o=l(!1,null,{message:i instanceof Error?i.message:String(i),status:0,code:"NETWORK_ERROR",cause:i},null);if(p=o,!(e&&u)||f>=(r??0)){if(n?.onError?.(o,t),n?.throw)throw i;return o}f++,await I(g??0),g=(g??0)*(s??2)}}let h=p||l(!1,null,{message:`Request failed after ${r} retries`,status:0,code:"MAX_RETRIES_EXCEEDED"},null);if(n?.onError?.(h,t),n?.throw)throw Error(`Request failed after ${r} retries`);return h}function R(e){return{expiryDays:e?.defaultExpiryDays??365,crossSubdomain:e?.crossSubdomain??!1,domain:e?.defaultDomain??"",path:"/",secure:"u">typeof window&&"https:"===window.location.protocol,sameSite:"Lax"}}function L(){if("u"<typeof window)return"";let e=window.location.hostname;if("localhost"===e||/^\d+\.\d+\.\d+\.\d+$/.test(e))return e;let t=e.split(".");return t.length>=2?`.${t.slice(-2).join(".")}`:e}let P={consents:"c",consentInfo:"i",timestamp:"ts",iabCustomVendorConsents:"icv",iabCustomVendorLegitimateInterests:"icvli",time:"t",type:"y",id:"id",subjectId:"sid",externalId:"eid",materialPolicyFingerprint:"mpf",identityProvider:"idp"},x=Object.entries(P).reduce((e,[t,n])=>(e[n]=t,e),{});function A(e,t,n,o){if("u"<typeof document)return;let r={...R(o),...n};r.crossSubdomain&&!n?.domain&&(r.domain=L());try{let n;if("string"==typeof t)n=t;else{var i;let e=function e(t,n=""){let o={};for(let[r,i]of Object.entries(t)){let t=n?`${n}.${r}`:r;null==i?o[t]="":"boolean"==typeof i?i&&(o[t]="1"):"object"!=typeof i||Array.isArray(i)?o[t]=String(i):Object.assign(o,e(i,t))}return o}(t);i=function(e){let t={};for(let[n,o]of Object.entries(e))t[n.split(".").map(e=>P[e]||e).join(".")]=o;return t}(e),n=Object.entries(i).map(([e,t])=>`${e}:${t}`).join(",")}let o=new Date;o.setTime(o.getTime()+24*r.expiryDays*36e5);let s=`expires=${o.toUTCString()}`,a=[`${e}=${n}`,s,`path=${r.path}`];r.domain&&a.push(`domain=${r.domain}`),r.secure&&a.push("secure"),r.sameSite&&a.push(`SameSite=${r.sameSite}`),document.cookie=a.join("; ")}catch(t){console.warn(`Failed to set cookie "${e}":`,t)}}function D(e,t,n){if("u"<typeof document)return;let o={...R(n),...t};o.crossSubdomain&&!t?.domain&&(o.domain=L());try{let t=[`${e}=`,"expires=Thu, 01 Jan 1970 00:00:00 GMT",`path=${o.path}`];o.domain&&t.push(`domain=${o.domain}`),document.cookie=t.join("; ")}catch(t){console.warn(`Failed to delete cookie "${e}":`,t)}}let j={translations:{en:r.I2},defaultLanguage:"en",disableAutoLanguageSwitch:!1},U=[{defaultValue:!0,description:"These trackers are used for activities that are strictly necessary to operate or deliver the service you requested from us and, therefore, do not require you to consent.",disabled:!0,display:!0,gdprType:1,name:"necessary"},{defaultValue:!1,description:"These trackers enable basic interactions and functionalities that allow you to access selected features of our service and facilitate your communication with us.",display:!1,gdprType:2,name:"functionality"},{defaultValue:!1,description:"These trackers help us to measure traffic and analyze your behavior to improve our service.",display:!1,gdprType:4,name:"measurement"},{defaultValue:!1,description:"These trackers help us to improve the quality of your user experience and enable interactions with external 
1content, networks, and platforms.",display:!1,gdprType:3,name:"experience"},{defaultValue:!1,description:"These trackers help us to deliver personalized ads or marketing content to you, and to measure their performance.",display:!1,gdprType:5,name:"marketing"}],O=U.map(e=>e.name),$="c15t",T="privacy-consent-storage",_={debug:!1,config:{pkg:"c15t",version:"2.1.0",mode:"Unknown"},consents:U.reduce((e,t)=>(e[t.name]=t.defaultValue,e),{}),selectedConsents:U.reduce((e,t)=>(e[t.name]=t.defaultValue,e),{}),consentInfo:null,branding:"c15t",activeUI:"none",isLoadingConsentInfo:!1,hasFetchedBanner:!1,lastBannerFetchData:null,consentCategories:["necessary"],callbacks:{},locationInfo:null,overrides:void 0,legalLinks:{},translationConfig:j,user:void 0,networkBlocker:void 0,storageConfig:void 0,includeNonDisplayedConsents:!1,consentTypes:U,iframeBlockerConfig:{disableAutomaticBlocking:!1},scripts:[],loadedScripts:{},scriptIdMap:{},model:"opt-in",policyBanner:{},policyDialog:{},policyCategories:null,policyScopeMode:null,initDataSource:null,initDataSourceDetail:null,iab:null,reloadOnConsentRevoked:!0,ssrDataUsed:!1,ssrSkippedReason:null};function N(e){if("string"!=typeof e)return;let t=e.trim();if(""!==t&&"undefined"!==t&&"null"!==t)return t}function F(e){let t=N(e.externalId),n=N(e.identityProvider);return{...t?{externalId:t}:{},...n?{identityProvider:n}:{}}}function B(e){if(!e)return e;let t={...e},{externalId:n,identityProvider:o}=F({externalId:t.externalId,identityProvider:t.identityProvider});return n?t.externalId=n:delete t.externalId,o?t.identityProvider=o:delete t.identityProvider,t}function M(e,t,n){let o=!1,r=!1,i=n?.storageKey||$,s=q(n),a={...{...s,...e,consentInfo:B(e.consentInfo||s?.consentInfo?{...s?.consentInfo??{},...e.consentInfo??{}}:void 0),iabCustomVendorConsents:e.iabCustomVendorConsents??s?.iabCustomVendorConsents,iabCustomVendorLegitimateInterests:e.iabCustomVendorLegitimateInterests??s?.iabCustomVendorLegitimateInterests}};a.iabCustomVendorConsents&&0!==Object.keys(a.iabCustomVendorConsents).length||delete a.iabCustomVendorConsents,a.iabCustomVendorLegitimateInterests&&0!==Object.keys(a.iabCustomVendorLegitimateInterests).length||delete a.iabCustomVendorLegitimateInterests;try{"u">typeof window&&window.localStorage&&(window.localStorage.setItem(i,JSON.stringify(a)),o=!0)}catch(e){console.warn("Failed to save consent to localStorage:",e)}try{A(i,a,t,n),r=!0}catch(e){console.warn("Failed to save consent to cookie:",e)}if(!o&&!r)throw Error("Failed to save consent to any storage method")}function H(e){let t=e.consents||{},n={...t};for(let e of O)n[e]=t[e]??!1;return{...e,consents:n}}function q(e){!function(e){let t=e?.storageKey||$;if(t!==T)try{if("u">typeof window&&window.localStorage){if(window.localStorage.getItem(t))return void window.localStorage.removeItem(T);let e=window.localStorage.getItem(T);e&&(window.localStorage.setItem(t,e),window.localStorage.removeItem(T),S.log(`Migrated consent data from "${T}" to "${t}"`))}}catch(e){console.warn("[c15t] Failed to migrate legacy storage:",e)}}(e);let t=e?.storageKey||$,n=null,o=null;try{if("u">typeof window&&window.localStorage){let e=window.localStorage.getItem(t);e&&(n=JSON.parse(e))}}catch(e){console.warn("Failed to read consent from localStorage:",e)}try{o=function(e){if("u"<typeof document)return null;try{let t=`${e}=`;for(let e of document.cookie.split(";")){let n=e;for(;" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(t)){let e=n.substring(t.length);if(e.includes(":")){let t=function(e){if(!e)return{};let t={};for(let n of e.split(",")){let e=n.indexOf(":");if(-1===e)continue;let o=n.substring(0,e),r=n.substring(e+1);t[o]=r}return t}(e),n=function(e){let t={};for(let[n,o]of Object.entries(e))t[n.split(".").map(e=>x[e]||e).join(".")]=o;return t}(t);return function(e){let t={};for(let[n,o]of Object.entries(e)){let e=n.split(".");if(0===e.length)continue;let r=t;for(let t=0;t<e.length-1;t++){let n=e[t];void 0!==n&&(r[n]||(r[n]={}),r=r[n])}let i=e[e.length-1];void 0!==i&&("1"===o?r[i]=!0:"0"===o?r[i]=!1:""===o?r[i]=null:Number.isNaN(Number(o))||""===o?r[i]=o:r[i]=Number(o))}return t}(n)}return e}}return null}catch(t){return console.warn(`Failed to get cookie "${e}":`,t),null}}(t)}
1catch(e){console.warn("Failed to read consent from cookie:",e)}let r=null,i=null;if(o?(r=o,i="cookie"):n&&(r=n,i="localStorage"),r&&i){let n=e?.crossSubdomain===!0||!!e?.defaultDomain;if("localStorage"!==i||o){if("cookie"===i)try{if("u">typeof window&&window.localStorage){let e=r;"object"==typeof e&&null!==e&&"consents"in e&&(e=H(e));let o=null;try{let e=window.localStorage.getItem(t);if(e){let t=JSON.parse(e);o="object"==typeof t&&null!==t&&"consents"in t?H(t):t}}catch{o=null}let i=JSON.stringify(e),s=JSON.stringify(o);i!==s&&(window.localStorage.setItem(t,i),o?n?S.log("Updated localStorage with consent from cookie (cross-subdomain mode)"):S.log("Updated localStorage with consent from cookie"):S.log("Synced consent from cookie to localStorage"))}}catch(e){console.warn("[c15t] Failed to sync consent to localStorage:",e)}}else try{A(t,r,void 0,e),S.log("Synced consent from localStorage to cookie")}catch(e){console.warn("[c15t] Failed to sync consent to cookie:",e)}}if(r&&function(e){if("object"!=typeof e||null===e)return!1;let t=e.consentInfo;if(!t||"object"!=typeof t)return!1;let n="string"==typeof t.id,o="string"==typeof t.subjectId;return n&&!o}(r))return S.log("Detected legacy consent format (v1.x). Re-consent required for v2.0."),V(void 0,e),null;if(r&&"object"==typeof r){let e=H(r);return"object"==typeof e&&null!==e&&"consentInfo"in e&&(e.consentInfo=B(e.consentInfo)),e}return r}function V(e,t){let n=t?.storageKey||$;try{"u">typeof window&&window.localStorage&&(window.localStorage.removeItem(n),n!==T&&window.localStorage.removeItem(T))}catch(e){console.warn("Failed to remove consent from localStorage:",e)}try{D(n,e,t),n!==T&&D(T,e,t)}catch(e){console.warn("Failed to remove consent cookie:",e)}}let G="/subjects",J="/subjects";async function z(e,t,n,o,r){try{let i=await E(e,t,{method:n,...o});if(i.ok)return i;return console.warn(`API request failed, falling back to offline mode for ${t}`),r(o)}catch(e){return console.warn(`Error calling ${t}, falling back to offline mode:`,e),r(o)}}async function K(e){let t="c15t-pending-identify-submissions",n=v(e?.body);try{if("u">typeof window&&e?.body&&window.localStorage){let o=[];try{let e=window.localStorage.getItem(t);e&&(o=JSON.parse(e))}catch(e){console.warn("Error parsing pending identify submissions:",e),o=[]}let r=e.body;o.some(e=>v(e)===n&&e.externalId===r.externalId)||(o.push(r),window.localStorage.setItem(t,JSON.stringify(o)),S.log("Queued identify user submission for retry on next page load"))}}catch(e){console.warn("Failed to write to localStorage in identify offline fallback:",e)}let o=l(!0,null,null,null);return e?.onSuccess&&await e.onSuccess(o),o}async function X(e,t,n){let{body:o,...r}=n,i=v(o);if(!o||!i)return{ok:!1,data:null,response:null,error:{message:"Subject ID is required to identify user",status:400,code:"MISSING_SUBJECT_ID"}};let s=q(t);M({consents:s?.consents||{},consentInfo:{...s?.consentInfo,time:s?.consentInfo?.time||Date.now(),subjectId:i,externalId:o.externalId,identityProvider:o.identityProvider}},void 0,t);let{subjectId:a,id:l,...c}=o;return z(e,`${J}/${i}`,"PATCH",{...r,body:c},async e=>{let t={subjectId:i,...e?.body};return K({...e,body:t})})}function Q(e){return e.explicitPolicy?e.explicitPolicy:o.Fw.offlineOptInBanner()}function W(e){let t={jurisdiction:e.jurisdiction??"NONE",location:{countryCode:e.countryCode??null,regionCode:e.regionCode??null},translations:{language:e.language??"en",translations:e.translations??r.I2},branding:"c15t",gvl:e.gvl??null};return e.policy&&(t.policy=e.policy),e.policyDecision&&(t.policyDecision=e.policyDecision),e.policySnapshotToken&&(t.policySnapshotToken=e.policySnapshotToken),t}async function Z(e,t){let n=l(!0,t,null,null);return e?.onSuccess&&await e.onSuccess(n),n}async function Y(e,t){let n=Q({}),o=null;if(t?.enabled&&"iab"===n.model)try{let e=t._module?.fetchGVL;e&&(o=await e(t.vendorIds))}catch(e){console.warn("Failed to fetch GVL in offline fallback:",e)}let r=W({countryCode:e?.headers?.["x-c15t-country"]??null,regionCode:e?.headers?.["x-c15t-region"]??null,gvl:o,policy:n});return Z(e,r)}async function ee(e,t,n){try{let o=await E(e,"/init",{method:"GET",...t});if(o.ok)return o;return console.warn("API request failed, falling back to offline mode for consent banner"),Y(t,n)}catch(e){return console.warn("Error fetching consent banner info, falling back to offline mode:",e),Y(t,n)}}let et="c15t-pending-consent-submissions",en="c15t-pending-identify-submissions";async function eo(e,t){let n=[...t];for(let t=0;t<3&&n.length>0;t++){let o=[];for(let t=0;t<n.length;t++){let r=n[t];
1if(r)try{let{externalId:n,identityProvider:i}=F({externalId:r.externalSubjectId,identityProvider:r.identityProvider}),s={...r,...n?{externalSubjectId:n}:{},...i?{identityProvider:i}:{}};n||delete s.externalSubjectId,i||delete s.identityProvider,S.log("Retrying consent submission:",r),(await E(e,G,{method:"POST",body:s})).ok&&(S.log("Successfully resubmitted consent"),o.push(t))}catch(e){console.warn("Failed to resend consent submission:",e)}}for(let e=o.length-1;e>=0;e--){let t=o[e];void 0!==t&&n.splice(t,1)}if(0===n.length)break;t<2&&await I(1e3*(t+1))}try{"u">typeof window&&window.localStorage&&(n.length>0?(window.localStorage.setItem(et,JSON.stringify(n)),S.log(`${n.length} consent submissions still pending for future retry`)):(window.localStorage.removeItem(et),S.log("All pending consent submissions processed successfully")))}catch(e){console.warn("Error updating pending submissions storage:",e)}}async function er(e,t){let n=[...t];for(let t=0;t<3&&n.length>0;t++){let o=[];for(let t=0;t<n.length;t++){let r=n[t];if(!r)continue;let i=v(r);if(!i){console.warn("Dropping pending identify submission without a subject ID"),o.push(t);continue}if(!r.externalId){console.warn("Dropping pending identify submission without an externalId"),o.push(t);continue}try{S.log("Retrying identify user submission:",r);let n=`${J}/${i}`,{subjectId:s,id:a,...l}=r;(await E(e,n,{method:"PATCH",body:l})).ok&&(S.log("Successfully resubmitted identify user"),o.push(t))}catch(e){console.warn("Failed to resend identify user submission:",e)}}for(let e=o.length-1;e>=0;e--){let t=o[e];void 0!==t&&n.splice(t,1)}if(0===n.length)break;t<2&&await I(1e3*(t+1))}try{"u">typeof window&&window.localStorage&&(n.length>0?(window.localStorage.setItem(en,JSON.stringify(n)),S.log(`${n.length} identify submissions still pending for future retry`)):(window.localStorage.removeItem(en),S.log("All pending identify submissions processed successfully")))}catch(e){console.warn("Error updating pending identify submissions storage:",e)}}async function ei(e,t){let n="c15t-pending-consent-submissions",o=t?.body?.subjectId;try{if("u">typeof window&&(M({consents:t?.body?.preferences||{},consentInfo:{time:Date.now(),subjectId:o,externalId:t?.body?.externalSubjectId,identityProvider:t?.body?.identityProvider}},void 0,e),t?.body&&window.localStorage)){let e=[];try{let t=window.localStorage.getItem(n);t&&(e=JSON.parse(t))}catch(t){console.warn("Error parsing pending submissions:",t),e=[]}let o=t.body;e.some(e=>JSON.stringify(e)===JSON.stringify(o))||(e.push(o),window.localStorage.setItem(n,JSON.stringify(e)),S.log("Queued consent submission for retry on next page load"))}}catch(e){console.warn("Failed to write to localStorage in offline fallback:",e)}let r=l(!0,null,null,null);return t?.onSuccess&&await t.onSuccess(r),r}
1async function es(e,t,n){return M({consents:n?.body?.preferences||{},consentInfo:{time:Date.now(),subjectId:n?.body?.subjectId,externalId:n?.body?.externalSubjectId,identityProvider:n?.body?.identityProvider}},void 0,t),await z(e,G,"POST",n,async e=>ei(t,e))}class ea{backendURL;storageConfig;iabConfig;headers;customFetch;corsMode;retryConfig;fetcherContext;constructor(e){this.backendURL=e.backendURL.endsWith("/")?e.backendURL.slice(0,-1):e.backendURL,this.headers={"Content-Type":"application/json",...e.headers},this.customFetch=e.customFetch,this.corsMode=e.corsMode||"cors",this.storageConfig=e.storageConfig,this.iabConfig=e.iabConfig,this.retryConfig={maxRetries:e.retryConfig?.maxRetries??3??3,initialDelayMs:e.retryConfig?.initialDelayMs??100??100,backoffFactor:e.retryConfig?.backoffFactor??2??2,retryableStatusCodes:e.retryConfig?.retryableStatusCodes??y,nonRetryableStatusCodes:e.retryConfig?.nonRetryableStatusCodes??m,shouldRetry:e.retryConfig?.shouldRetry??h,retryOnNetworkError:e.retryConfig?.retryOnNetworkError??!0},this.fetcherContext={backendURL:this.backendURL,headers:this.headers,customFetch:this.customFetch,corsMode:this.corsMode,retryConfig:this.retryConfig},this.checkPendingConsentSubmissions(),this.checkPendingIdentifySubmissions()}async init(e){return ee(this.fetcherContext,e,this.iabConfig)}async setConsent(e){return es(this.fetcherContext,this.storageConfig,e)}async identifyUser(e){return X(this.fetcherContext,this.storageConfig,e)}async $fetch(e,t){return E(this.fetcherContext,e,t)}checkPendingConsentSubmissions(){!function(e,t){if(!("u"<typeof window)&&window.localStorage)try{window.localStorage.setItem("c15t-storage-test-key","test"),window.localStorage.removeItem("c15t-storage-test-key");let e=window.localStorage.getItem(et);if(!e)return;let n=JSON.parse(e);if(!n.length)return void window.localStorage.removeItem(et);S.log(`Found ${n.length} pending consent submission(s) to retry`),setTimeout(()=>{t(n)},2e3)}catch(e){console.warn("Failed to check for pending consent submissions:",e)}}(this.fetcherContext,e=>this.processPendingConsentSubmissions(e))}async processPendingConsentSubmissions(e){return eo(this.fetcherContext,e)}checkPendingIdentifySubmissions(){!function(e,t){if(!("u"<typeof window)&&window.localStorage)try{let e=window.localStorage.getItem(en);if(!e)return;let n=JSON.parse(e);if(!n.length)return void window.localStorage.removeItem(en);S.log(`Found ${n.length} pending identify user submission(s) to retry`),setTimeout(()=>{t(n)},2500)}catch(e){console.warn("Failed to check for pending identify submissions:",e)}}(this.fetcherContext,e=>this.processPendingIdentifySubmissions(e))}async processPendingIdentifySubmissions(e){return er(this.fetcherContext,e)}}function el(e=null){return l(!0,e)}async function ec(e){let t=el();return e?.onSuccess&&await e.onSuccess(t),t}function ed(e){if(!e)return;let t=e.split(",")[0]?.split(";")[0]?.trim().toLowerCase();if(t)return t.split("-")[0]??void 0}async function eu(e,t,n,s){var a,l,c,d;let u,f,g=t?.headers?.["x-c15t-country"]??"GB",p=t?.headers?.["x-c15t-region"]??null,y=t?.headers?.["accept-language"]??null,m=function(e,t){let n={EU:new Set(["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE"]),EEA:new Set(["IS","NO","LI"]),UK:new Set(["GB"]),CH:new Set(["CH"]),BR:new Set(["BR"]),CA:new Set(["CA"]),AU:new Set(["AU"]),JP:new Set(["JP"]),KR:new Set(["KR"]),CA_QC_REGIONS:new Set(["QC"])},o="NONE";if(e){let r=e.toUpperCase(),i=t&&"string"==typeof t?(t.includes("-")?t.split("-").pop():t).toUpperCase():null;if("CA"===r&&i&&n.CA_QC_REGIONS.has(i))return"QC_LAW25";for(let{sets:e,code:t}of[{sets:[n.EU,n.EEA,n.UK],code:"GDPR"},{sets:[n.CH],code:"CH"},{sets:[n.BR],code:"BR"},{sets:[n.CA],code:"PIPEDA"},{sets:[n.AU],code:"AU"},{sets:[n.JP],code:"APPI"},{sets:[n.KR],code:"PIPA"}])if(e.some(e=>e.has(r))){o=t;break}}return o}(g,p),h=s?.policyPacks,b=s?.policyPacks!==void 0,w=(0,o.VR)({i18n:s?.i18n,policies:h});for(let e of w.warnings)console.warn(`[c15t] offlinePolicy.i18n: ${e}`);if(w.errors.length>0)throw Error(`Invalid offlinePolicy.i18n configuration:
2${w.errors.map(e=>`- ${e}`).join("\n")}`);h&&h.length>0&&(0,o.DP)(h,{iabEnabled:n?.enabled===!0});let C=h&&h.length>
20?await (0,o.ZH)({policies:h,countryCode:g,regionCode:p,jurisdiction:m,iabEnabled:n?.enabled===!0}):void 0,S=!s?.policy&&!C&&!b,I={...s,policy:s?.policy??C?.policy??(b?o.Fw.offlineNoBanner():void 0)??(S?Q({}):void 0),policyDecision:s?.policyDecision??(C?{policyId:C.policy.id,fingerprint:C.fingerprint,matchedBy:C.matchedBy,country:g,region:p,jurisdiction:m}:void 0)};if(s?.i18n?.messages&&Object.keys(s.i18n.messages).length>0){let e,t,n,o,d,g,p,m,h,b,w,C=(t=(l={profiles:e=(a={acceptLanguage:y,i18n:s.i18n,policyI18n:I.policy?.i18n}).i18n.messages??{},defaultProfile:a.i18n.defaultProfile??"default",policyProfile:a.policyI18n?.messageProfile}).policyProfile??l.defaultProfile,n=l.profiles[t]?t:l.defaultProfile,o=Object.keys(e[n]?.translations??{}).sort(),c={profile:e[n]},d=ed(c.profile?.fallbackLanguage)??"en",p=(g=Object.keys(c.profile?.translations??{}).sort()).includes(d)?d:g.includes("en")?"en":g[0]??d,m=ed(a.policyI18n?.language)??(0,i.zi)(o,{header:a.acceptLanguage,fallback:p}),h=e[n]?.translations[m]?m:p,b=r.I2,w=e[n]?.translations[h],{language:h,translations:w?(0,i.Jg)(b,w):b});u=C.language,f=C.translations}else if(e?.translations&&Object.keys(e.translations).length>0){let t,n,o=e.translations,s=Object.keys(o),a=(d=e.defaultLanguage,t=Object.keys(o).sort(),(n=d?.toLowerCase())&&t.includes(n)?n:t.includes("en")?"en":t[0]??"en");u=(0,i.zi)(s,{header:y,fallback:a});let l=r.I2,c=o[u]??{};f=(0,i.Jg)(l,c)}else{let e=Object.keys(j.translations),t=j.defaultLanguage??"en";u=(0,i.zi)(e,{header:y,fallback:t}),f=j.translations[u]}let v=null;if(n?.enabled&&I.policy?.model==="iab")if(n.gvl)v=n.gvl;else try{let e=n._module?.fetchGVL;e&&(v=await e(n.vendorIds))}catch(e){console.warn("Failed to fetch GVL in offline mode:",e)}let k=el(W({jurisdiction:m,countryCode:g,regionCode:p,language:u,translations:f,gvl:v,policy:I.policy,policyDecision:I.policyDecision,policySnapshotToken:I.policySnapshotToken}));return t?.onSuccess&&await t.onSuccess(k),k}async function ef(e,t){let n=t?.body?.subjectId;try{"u">typeof window&&M({consentInfo:{time:Date.now(),subjectId:n,externalId:t?.body?.externalSubjectId,identityProvider:t?.body?.identityProvider},consents:t?.body?.preferences||{}},void 0,e)}catch(e){console.warn("Failed to write to storage:",e)}return await ec(t)}class eg{storageConfig;initialTranslationConfig;iabConfig;policyConfig;constructor(e,t,n,o){this.storageConfig=e,this.initialTranslationConfig=t,this.iabConfig=n,this.policyConfig=o}async init(e){return eu(this.initialTranslationConfig,e,this.iabConfig,this.policyConfig)}async setConsent(e){return ef(this.storageConfig,e)}async identifyUser(e){return console.warn("identifyUser called in offline mode - external ID will not be linked"),ec(e)}async $fetch(e,t){return await ec(t)}}let ep="hosted",ey=!1;function em(e){if("c15t"===e){let e="u">typeof globalThis&&"process"in globalThis?globalThis.process?.env?.NODE_ENV:void 0;return ey||"production"===e||(ey=!0,console.warn("[c15t] `mode: 'c15t'` is deprecated and will be removed in a future major release. Use `mode: 'hosted'` instead.")),ep}return"offline"===e||"custom"===e?e:ep}function eh(e){return void 0!==e.offlinePolicy?e.offlinePolicy:e.store?.offlinePolicy}let eb=new Map;function ew(e){let t,n=function(e){var t;let n=em(e.mode),r=eh(e),i=(t=e.storageConfig)?Object.keys(t).sort().map(e=>{let n=t[e];return null==n?`${e}:null`:`${e}:${String(n)}`}).join("|"):"",s=i?`:storage:${i}`:"";if("offline"===n){let t=e.store?.initialTranslationConfig?.translations,n=e.store?.initialTranslationConfig?.defaultLanguage,i="";i=t?`:translations:${Object.keys(t).sort().join(",")}`:"";let a="";a=n?`:default-language:${n}`:"";let l=e.store?.iab,c="";c=l?.enabled?":iab:enabled":"";let d="";return r&&(d=`:policy:${(0,o.g1)(r)}`),`offline${s}${i}${a}${c}${d}`}if("custom"===n){let t=Object.keys(("endpointHandlers"in e?e.endpointHandlers:void 0)||{}).sort().join(",");return`custom:${t}${s}`}let a="";if("headers"in e&&e.headers){let t=Object.keys(e.headers).sort();a=`:headers:${t.map(t=>`${t}=${e.headers?.[t]}`).join(",")}`}return`hosted:${e.backendURL||""}${a}${s}`}(e);if(eb.has(n)){if("offline"!==e.mode&&"custom"!==e.mode&&"headers"in e&&e.headers){let t=eb.get(n);t instanceof ea&&(t.headers={"Content-Type":"application/json",...e.headers})}let t=eb.get(n);if(t)return new Proxy(t,{get:(e,t)=>e[t]})}let r=em(e.mode);
2switch(r){case"custom":t=new p({endpointHandlers:e.endpointHandlers});break;case"offline":{let n=e.store?.iab,o=eh(e);t=new eg(e.storageConfig,e.store?.initialTranslationConfig,n?{enabled:n.enabled,vendorIds:n.vendors,gvl:n.gvl,_module:n._module}:void 0,o);break}case"hosted":{let n=e.store?.iab;t=new ea({backendURL:e.backendURL||"/api/c15t",headers:e.headers,customFetch:e.customFetch,retryConfig:e.retryConfig,storageConfig:e.storageConfig,iabConfig:n?{enabled:n.enabled,vendorIds:n.vendors,gvl:n.gvl,_module:n._module}:void 0});break}default:t=function(e){throw Error(`Unsupported client mode: ${String(e)}`)}(r)}return eb.set(n,t),t}let eC="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function eS(){let e=crypto.getRandomValues(new Uint8Array(20)),t=Date.now()-17e11,n=Math.floor(t/0x100000000),o=t>>>0;return e[0]=n>>>24&255,e[1]=n>>>16&255,e[2]=n>>>8&255,e[3]=255&n,e[4]=o>>>24&255,e[5]=o>>>16&255,e[6]=o>>>8&255,e[7]=255&o,`sub_${function(e){let t=BigInt(58),n=BigInt(0);for(let t of e)n=n*BigInt(256)+BigInt(t);let o=[];for(;n>0;){let e=n%t;o.unshift(eC.charAt(Number(e))),n/=t}for(let t of e)if(0===t)o.unshift(eC.charAt(0));else break;return o.join("")||eC.charAt(0)}(e)}`}function eI(e){return O.includes(e)}function ev(e,t){if(!t||0===t.length||t.includes("*"))return e;let n=new Set(["necessary",...t]),o={};for(let[t,r]of Object.entries(e))o[t]=!!n.has(t)&&r;return o}function ek(e,t){let n=Array.from(new Set(e));if(!t||0===t.length||t.includes("*"))return n;let o=new Set(["necessary",...t.filter(eI)]),r=n.filter(e=>o.has(e));return r.includes("necessary")||r.unshift("necessary"),r}function eE(e,t="permissive"){return"strict"===t&&Array.isArray(e)&&e.length>0&&!e.includes("*")}function eR(e,t,n="permissive"){return e}function eL(e,t){if(0===e.length)throw TypeError(`${t} condition cannot be empty`)}function eP(e,t,n){return function e(t,n){if("string"==typeof t){var o,r;if(!(t in n))throw Error(`Consent category "${t}" not found in consent state`);return n[t]||!1}if("object"==typeof t&&null!==t){if("and"in t){let r;return o=t.and,eL(r=Array.isArray(o)?o:[o],"AND"),r.every(t=>e(t,n))}if("or"in t){let o;return r=t.or,eL(o=Array.isArray(r)?r:[r],"OR"),o.some(t=>e(t,n))}if("not"in t)return!e(t.not,n)}throw TypeError(`Invalid condition structure: ${JSON.stringify(t)}`)}(e,n?eR(t,n.policyCategories,n.policyScopeMode):t)}function ex(e){let t=new Set;return!function e(n){"string"==typeof n?t.add(n):"object"==typeof n&&null!==n&&("and"in n?(Array.isArray(n.and)?n.and:[n.and]).forEach(e):"or"in n?(Array.isArray(n.or)?n.or:[n.or]).forEach(e):"not"in n&&e(n.not))}(e),Array.from(t)}function eA(e,t){let n=e.getAttribute("data-src"),o=function(e){let t=e.getAttribute("data-category");if(t){if(!O.includes(t))throw Error(`Invalid category attribute "${t}" on iframe. Must be one of: ${O.join(", ")}`);return t}}(e);!o||(eP(o,t)?n&&!e.src&&(e.src=n,e.removeAttribute("data-src")):e.src&&e.removeAttribute("src"))}function eD(){if("u"<typeof document)return[];let e=document.querySelectorAll("iframe[data-category]"),t=new Set;return e?(e.forEach(e=>{let n=e.getAttribute("data-category");if(!n)return;let o=n.trim();O.includes(o)&&t.add(o)}),Array.from(t)):[]}function ej(e){if("u"<typeof document)return;let t=document.querySelectorAll("iframe");t&&t.forEach(t=>{eA(t,e)})}let eU=["reject","accept","customize"];function eO(e){return e&&0!==e.length?[...new Set(e)]:[]}function e$(e){let t=eO(e.allowedActions);return t.length>0?t:[...eU]}function eT(e){let t=eO(e.allowedActions);if(0===t.length)return[];if(!e.layout||0===e.layout.length)return[[...t]];let n=new Set(t),o=[],r=new Set;for(let t of e.layout){let e=eO(Array.isArray(t)?t:[t]).filter(e=>!(!n.has(e)||r.has(e))&&(r.add(e),!0));e.length>0&&o.push(e)}return o.length>0?o:[[...t]]}function e_(e){var t;return(t=eT({allowedActions:e.allowedActions,layout:e.layout}))&&0!==t.length?t.flatMap(e=>Array.isArray(e)?e:[e]):[]}function eN(e){let t=e.orderedActions.includes("customize")?["customize"]:[];if(!e.primaryActions||0===e.primaryActions.length)return t;let n=e.primaryActions.filter(t=>e.orderedActions.includes(t));return n.length>0?n:t}function eF(e){return"column"===e?"column":"row"}function eB(e){var t;let n="balanced"===(t=e.uiProfile)||"compact"===t||"strict"===t?t:"compact",o=new Set(e.actionGroups.flat()).size,r=e.actionGroups.length>1,i="column"===e.direction;return"strict"===n||"balanced"===n&&(o<=2||3===o&&(r||i))}function eM(e){return!!e&&Object.values(e).some(e=>Array.isArray(e)?e.length>0:void 0!==e)}function eH(){if("u"<typeof window)return!1;try{let e=window.navigator.globalPrivacyControl;return!0===e||"1"===e}catch{return!1}}let eq=/^https?:\/\//;function eV(e){let t=e.toString();return t.endsWith("/")?t.slice(0,-1):t}function eG(e){let t=function(e){try{let t="/"===e?e:e.endsWith("/")?e.slice(0,-1):e;if(eq.test(t))return eV(new URL(t));if(!t.startsWith("/"))return;return eV(new URL(t,window.location.origin))}catch{return}}(e.backendURL);if(!t)return;let n=eH();return{backendURL:t,country:e.overrides?.country,region:e.overrides?.region,language:e.overrides?.language,gpc:e.overrides?.gpc??("boolean"==typeof n&&n),credentials:e.credentials??"include"}}function eJ(e,t){return e.backendURL===t.backendURL&&e.gpc===t.gpc&&(void 0===t.country||e.country===t.country)&&(void 0===t.region||e.region===t.region)&&(void 0===t.language||e.language===t.language)&&(void 0===e.credentials||e.credentials===t.credentials)}let ez="__c15tScriptDebugListeners",eK=null;function eX(){if("u">typeof crypto&&crypto.randomUUID)return crypto.randomUUID().replace(/-/g,"").substring(0,8);if("u">typeof crypto&&crypto.getRandomValues){let e=new Uint8Array(4);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(36)).join("").padEnd(8,"0").substring(0,8)}return Math.random().toString(36).substring(2).padEnd(8,"0").substring(0,8)}function eQ(e,t,n){return t?(n[e]||(n[e]=eX()),n[e]):`c15t-script-${e}`}let eW=new Map;function eZ(e){return eW.has(e)}function eY(e){eW.delete(e)}function e0(e,t,n){if(n?.model==="iab"&&n.iabConsent&&(void 0!==e.vendorId||e.iabPurposes||e.iabLegIntPurposes||e.iabSpecialFeatures)){var o=n.iabConsent;if(void 0!==e.vendorId){let t=String(e.vendorId);if(!o.vendorConsents[t])return!1}return(!e.iabPurposes||!(e.iabPurposes.length>0)||!!e.iabPurposes.every(e=>!0===o.purposeConsents[e]))&&(!e.iabLegIntPurposes||!(e.iabLegIntPurposes.length>0)||!!e.iabLegIntPurposes.every(e=>!0===o.purposeLegitimateInterests[e]))&&(!e.iabSpecialFeatures||!(e.iabSpecialFeatures.length>0)||!!e.iabSpecialFeatures.every(e=>!0===o.specialFeatureOptIns[e]))&&!0}return eP(e.category,t)}function e1(e,t,n,o,r){var i={source:"script-loader",scope:"lifecycle",action:t,message:n,scriptId:e.id,elementId:o?.elementId,hasConsent:o?.hasConsent,callback:function(e,t){if("callback_start"===e||"callback_complete"===e||"callback_error"===e)return t?.callback}(t,r),data:r};let s={...i,timestamp:Date.now()};for(let e of function(){if("u"<typeof window)return eK||(eK=new Set),eK;let e=window,t=e[ez];if(t)return t;let n=new Set;return e[ez]=n,n}())try{e(s)}catch(e){console.error("Failed to handle c15t script debug event listener",e)}}function e5(e,t,n,o){if(n){e1(e,"callback_start",`${t} started`,o,{callback:t});try{n(o),e1(e,"callback_complete",`${t} completed`,o,{callback:t})}catch(n){throw e1(e,"callback_error",`${t} failed`,o,{callback:t,error:n instanceof Error?n.message:"string"==typeof n?n:"Unknown error"}),n}}}function e2(e,t,n={},o){let r=[];
2return e.forEach(e=>{var i,s,a;let l=e0(e,t,o);if(!e.alwaysLoad&&!l)return void e1(e,"skipped","Script skipped due to missing consent",{hasConsent:l},{reason:"missing_consent"});if(eZ(e.id)){let o={id:e.id,elementId:eQ(e.id,!1!==e.anonymizeId,n),hasConsent:l,consents:t};e1(e,"already_loaded","Script already loaded; running consent sync",o),e5(e,"onConsentChange",e.onConsentChange,o);return}if(e.src&&e.textContent)throw Error(`Script '${e.id}' cannot have both 'src' and 'textContent'. Choose one.`);if(!e.src&&!e.textContent&&!e.callbackOnly)throw Error(`Script '${e.id}' must have either 'src', 'textContent', or 'callbackOnly' set to true.`);if(!0===e.callbackOnly){let o=!1!==e.anonymizeId,s=eQ(e.id,o,n),a={id:e.id,elementId:s,consents:t,hasConsent:l};e5(e,"onBeforeLoad",e.onBeforeLoad,a),e5(e,"onLoad",e.onLoad,a),i=e.id,eW.set(i,null),r.push(e.id),e1(e,"loaded","Callback-only script marked as loaded",a,{callbackOnly:!0});return}let c=!1!==e.anonymizeId,d=eQ(e.id,c,n);if(!0===e.persistAfterConsentRevoked){let n=document.getElementById(d);if(n){let o={id:e.id,hasConsent:l,elementId:d,consents:t,element:n};e1(e,"already_loaded","Persisted script element already exists; reusing it",o,{reason:"persisted_element"}),e5(e,"onConsentChange",e.onConsentChange,o),e5(e,"onLoad",e.onLoad,o),s=e.id,eW.set(s,n),r.push(e.id),e1(e,"loaded","Existing script element marked as loaded",o,{reusedElement:!0});return}}let u=document.createElement("script");u.id=d,e.src?u.src=e.src:e.textContent&&(u.textContent=e.textContent),e.fetchPriority&&(u.fetchPriority=e.fetchPriority),e.async&&(u.async=!0),e.defer&&(u.defer=!0),e.nonce&&(u.nonce=e.nonce),e.attributes&&Object.entries(e.attributes).forEach(([e,t])=>{u.setAttribute(e,t)});let f={id:e.id,hasConsent:l,elementId:d,consents:t,element:u};e.onLoad&&(e.textContent?setTimeout(()=>{e5(e,"onLoad",e.onLoad,{...f})},0):(e1(e,"load_listener_attached","Attached load listener",f),u.addEventListener("load",()=>{e5(e,"onLoad",e.onLoad,{...f})}))),e.onError&&(e.textContent||(e1(e,"error_listener_attached","Attached error listener",f),u.addEventListener("error",()=>{e5(e,"onError",e.onError,{...f,error:Error(`Failed to load script: ${e.src}`)})}))),e5(e,"onBeforeLoad",e.onBeforeLoad,f);let g=e.target??"head",p="body"===g?document.body:document.head;if(!p)throw Error(`Document ${g} is not available for script injection`);p.appendChild(u),e1(e,"element_appended",`Script element appended to ${g}`,f,{target:g}),a=e.id,eW.set(a,u),r.push(e.id),e1(e,"loaded","Script marked as loaded",f)}),r}let e8="c15t:pending-consent-sync";function e4(e,t,n){let o=new Set(t),r=[],i=[];for(let t of n)o.has(t.name)&&(e[t.name]?r.push(t.name):i.push(t.name));return{allowedCategories:r,deniedCategories:i}}async function e3({manager:e,type:t,get:n,set:r,options:i,emitConsentChanged:s}){let{callbacks:a,selectedConsents:l,consents:c,consentTypes:d,updateScripts:u,updateIframeConsents:f,updateNetworkBlockerConsents:g,consentCategories:p,locationInfo:y,model:m,consentInfo:h,reloadOnConsentRevoked:b,lastBannerFetchData:w}=n(),C={...c},S={...l??c??{}},I=Date.now();if("all"===t)for(let e of d)p.includes(e.name)&&(S[e.name]=!0);else if("necessary"===t)for(let e of d)S[e.name]=!0===e.disabled&&e.defaultValue;let v=w?.policy,k=v?.consent?.categories,E=eE(k,v?.consent?.scopeMode??null),R=E?ev(S,k):S,L=E?function(e,t){if(!t||0===t.length||t.includes("*"))return e;let n=new Set(["necessary",...t]),o={};for(let[t,r]of Object.entries(e))n.has(t)&&(o[t]=r);return o}(R,k):R,P=d.some(e=>C[e.name]!==R[e.name]),x=e4(R,p,d),A=e4(C,p,d),D=P?{preferences:R,previousPreferences:C,allowedCategories:x.allowedCategories,deniedCategories:x.deniedCategories,previousAllowedCategories:A.allowedCategories,previousDeniedCategories:A.deniedCategories}:null,j=w?.policy?await (0,o.UO)(w.policy):void 0,U=h?.subjectId;U||(U=eS());let O=F({externalId:n().consentInfo?.externalId,identityProvider:n().consentInfo?.identityProvider}),$=F({externalId:n().user?.id,identityProvider:n().user?.identityProvider}),T=O.externalId??$.externalId,_=O.identityProvider??$.identityProvider,N={time:I,subjectId:U,materialPolicyFingerprint:j,...T?{externalId:T}:{}
2,..._?{identityProvider:_}:{}},B=function(e,t,n,o,r){if(!o||null===n)return!1;let i=new Set(r.filter(e=>e.disabled).map(e=>e.name));return Object.entries(t).some(([t,n])=>!i.has(t)&&!0===e[t]&&!1===n)}(C,R,h,b,d);if(r({consents:R,selectedConsents:R,activeUI:"none",consentInfo:N}),M({consents:R,consentInfo:N},void 0,n().storageConfig),B){let e={type:t,subjectId:U,preferences:L,givenAt:I,jurisdiction:y?.jurisdiction??void 0,jurisdictionModel:m,domain:window.location.hostname,uiSource:i?.uiSource??"api",policySnapshotToken:w?.policySnapshotToken,...T?{externalId:T}:{},..._?{identityProvider:_}:{}};try{localStorage.setItem(e8,JSON.stringify(e))}catch{}a.onConsentSet?.({preferences:R}),D&&s?.(D),a.onBeforeConsentRevocationReload?.({preferences:R}),window.location.reload();return}await new Promise(e=>setTimeout(e,0)),f(),u(),g(),a.onConsentSet?.({preferences:R}),D&&s?.(D);let H=await e.setConsent({body:{type:"cookie_banner",domain:window.location.hostname,preferences:L,subjectId:U,jurisdiction:y?.jurisdiction??void 0,jurisdictionModel:m??void 0,givenAt:I,uiSource:i?.uiSource??"api",consentAction:t,policySnapshotToken:w?.policySnapshotToken,...T?{externalSubjectId:T}:{},..._?{identityProvider:_}:{}}});if(!H.ok){let e=H.error?.message??"Failed to save consents";a.onError?.({error:e}),a.onError||console.error(e)}}function e6(e,t,n,o,r,i){let s="none"===o?null:o??(null==e||"NONE"===e?null:t&&["UK_GDPR","GDPR"].includes(e)?"iab":["UK_GDPR","GDPR","CH","BR","APPI","PIPA","QC_LAW25"].includes(e)?"opt-in":["CCPA","AU","PIPEDA"].includes(e)?"opt-out":"opt-in"),a=!!(void 0===i||i)&&(void 0!==r?r:eH());return{consentModel:s,autoGrantedConsents:(null===s||"opt-out"===s)&&null===n?{necessary:!0,functionality:!0,experience:!0,marketing:!a,measurement:!a}:null}}async function e7(e,t,n,r,s){let{set:a,get:l}=t,c=l(),d=e.policy?await (0,o.UO)(e.policy):void 0;if(c.consentInfo&&d){let e=c.consentInfo.materialPolicyFingerprint;if(e&&e!==d){let e=c.consentTypes.reduce((e,t)=>(e[t.name]=t.defaultValue,e),{});V(void 0,c.storageConfig),a({consents:e,selectedConsents:e,consentInfo:null})}else if(!e){let e={...c.consentInfo,materialPolicyFingerprint:d};M({consents:c.consents,consentInfo:e},void 0,c.storageConfig),a({consentInfo:e})}}let{consentInfo:u}=l(),f=l().iab;if(t.iabConfig&&!f){let e=t.iabConfig._module;e?(f=e.createIABManager(t.iabConfig,l,a,t.manager),a({iab:f})):console.error('[c15t] IAB config provided without IAB module. Install @c15t/iab and use the iab() wrapper: `import { iab } from "@c15t/iab"; iab({ cmpId: ... })`')}let g=f?.config.enabled&&!r,p=f?.config.enabled&&!g;g&&console.warn("IAB mode disabled: Server returned 200 without GVL. Client IAB settings overridden.");let{consentModel:y,autoGrantedConsents:m}=e6(e.jurisdiction??null,p,u,e.policy?.model,l().overrides?.gpc,e.policy?.consent?.gpc),h=function(e,t,n,o){let{get:r,initialTranslationConfig:s}=t,{consentInfo:a,consentTypes:l}=r(),{translations:c,location:d}=e,{consentModel:u,autoGrantedConsents:f}=e6(e.jurisdiction??null,n,a,e.policy?.model,t.get().overrides?.gpc,e.policy?.consent?.gpc),g={model:u,isLoadingConsentInfo:!1,branding:e.branding??"c15t",hasFetchedBanner:!0,lastBannerFetchData:e,locationInfo:{countryCode:d?.countryCode??null,regionCode:d?.regionCode??null,jurisdiction:e.jurisdiction??null},policyBanner:{allowedActions:e.policy?.ui?.banner?.allowedActions,primaryActions:e.policy?.ui?.banner?.primaryActions,layout:e.policy?.ui?.banner?.layout,direction:e.policy?.ui?.banner?.direction,uiProfile:e.policy?.ui?.banner?.uiProfile,scrollLock:e.policy?.ui?.banner?.scrollLock},policyDialog:{allowedActions:e.policy?.ui?.dialog?.allowedActions,primaryActions:e.policy?.ui?.dialog?.primaryActions,layout:e.policy?.ui?.dialog?.layout,direction:e.policy?.ui?.dialog?.direction,uiProfile:e.policy?.ui?.dialog?.uiProfile,scrollLock:e.policy?.ui?.dialog?.scrollLock},policyCategories:e.policy?.consent?.categories??null,policyScopeMode:e.policy?.consent?.scopeMode??null,initDataSource:o?.initDataSource??null,initDataSourceDetail:o?.initDataSourceDetail??null};null===a&&(e.policy?.ui?.mode?g.activeUI=e.policy.ui.mode:g.activeUI=u?"banner":"none"),f&&(g.consents=f,g.selectedConsents=f);
2let p=e.policy?.consent?.categories,y=eE(p,e.policy?.consent?.scopeMode??null);if(y){let e=ek(O,p);g.consentCategories=e,g.consents=ev(g.consents??r().consents,e),g.selectedConsents=ev(g.selectedConsents??r().selectedConsents,e)}let m=e.policy?.consent?.preselectedCategories;if(null===a&&!f&&Array.isArray(m)&&m.length>0){let e=g.consentCategories??r().consentCategories,t=y?ek(e,p):e,n=new Set(ek(t,m)),o=g.selectedConsents??r().selectedConsents;g.selectedConsents=l.length>0?l.reduce((e,t)=>(e[t.name]=!0===t.disabled?t.defaultValue:n.has(t.name),e),{}):Object.fromEntries(Object.keys(o).map(e=>[e,"necessary"===e||n.has(e)]))}if(c?.language&&c?.translations){let e;e=s?.translations?{translations:s.translations}:void 0,g.translationConfig=(0,i.jj)({translations:{[c.language]:c.translations},disableAutoLanguageSwitch:!0,defaultLanguage:c.language},e)}return g}(e,t,p,s);if(g&&f?h.iab={...f,config:{...f.config,enabled:!1}}:f&&null!=e.cmpId&&(h.iab={...f,config:{...f.config,cmpId:e.cmpId}}),a(h),!function(e,t,n){let{get:o}=t,{callbacks:r}=o(),{translations:i}=e;n&&r?.onConsentSet?.({preferences:n}),i?.language&&i?.translations&&r?.onBannerFetched?.({jurisdiction:e.jurisdiction,location:e.location,translations:{language:i.language,translations:i.translations}})}(e,t,m),l().updateScripts(),p&&"iab"===y&&f){let n=e.customVendors??[],o=f.config.customVendors??[],i=new Set(n.map(e=>e.id)),s=[...n,...o.filter(e=>!i.has(e.id))],c={...f.config,customVendors:s,...null!=e.cmpId&&{cmpId:e.cmpId}},d=t.iabConfig?._module;d&&d.initializeIABMode(c,{set:a,get:l},r).catch(e=>{console.error("Failed to initialize IAB mode in updateStore:",e)})}}async function e9(e){let{get:t,set:n,manager:o}=e,{callbacks:r}=t();if("u"<typeof window)return;let i=function(e){try{if(window.localStorage)return window.localStorage.setItem("c15t-storage-test-key","test"),window.localStorage.removeItem("c15t-storage-test-key"),!0}catch(t){console.warn("localStorage not available, skipping consent banner:",t),e({isLoadingConsentInfo:!1,activeUI:"none"})}return!1}(n);if(!i)return;n({isLoadingConsentInfo:!0}),function(e,t){try{let n=localStorage.getItem(e8);if(!n)return;localStorage.removeItem(e8);let o=JSON.parse(n),{externalId:r,identityProvider:i}=F({externalId:o.externalId,identityProvider:o.identityProvider});e.setConsent({body:{type:"cookie_banner",domain:o.domain,preferences:o.preferences,subjectId:o.subjectId,jurisdiction:o.jurisdiction,jurisdictionModel:o.jurisdictionModel??void 0,givenAt:o.givenAt,uiSource:o.uiSource??"api",policySnapshotToken:o.policySnapshotToken,...r?{externalSubjectId:r}:{},...i?{identityProvider:i}:{}}}).then(e=>{if(!e.ok){let n=e.error?.message??"Failed to sync consent after reload";t.onError?.({error:n}),t.onError||console.error("Failed to sync consent after reload:",n)}}).catch(e=>{let n=e instanceof Error?e.message:"Failed to sync consent after reload";t.onError?.({error:n}),t.onError||console.error("Failed to sync consent after reload:",e)})}catch{}}(o,r);let s=await te(e);return s||tt(e,i,o,r)}async function te(e){let{ssrData:t,set:n}=e;if(!t)return void n({ssrDataUsed:!1,ssrSkippedReason:"no_data"});let o=await t;if(o?.init&&!function(e,t){let n=t.metadata?.requestContext;if(!n||!e.backendURL)return!0;let o=eG({backendURL:e.backendURL,overrides:e.get().overrides,credentials:e.requestCredentials});return!o||eJ(n,o)}(e,o))return void n({ssrDataUsed:!1,ssrSkippedReason:"context_mismatch"});if(o?.init){var r;let t,i,s,a,l=(r=o,t=r.metadata?.cache,i=r.metadata?.requestDurationMs,s=["via=ssr"],t?.detail&&s.push(t.detail),"number"==typeof i&&Number.isFinite(i)&&s.push(`duration=${Math.max(0,Math.round(i))}ms`),a=s.length>0?s.join(", "):null,t?.isHit===!0?{initDataSource:"backend-cache-hit",initDataSourceDetail:a}:t?{initDataSource:"backend",initDataSourceDetail:a}:{initDataSource:"ssr",initDataSourceDetail:a});return await e7(o.init,e,!0,o.gvl,{initDataSource:l.initDataSource,initDataSourceDetail:l.initDataSourceDetail}),n({ssrDataUsed:!0,ssrSkippedReason:null}),o.init}n({ssrDataUsed:!1,ssrSkippedReason:"fetch_failed"})}
2async function tt(e,t,n,o){let{set:r,get:i}=e;try{let{language:r,country:s,region:a}=e.get().overrides??{},l=await n.init({headers:{...r&&{"accept-language":r},...s&&{"x-c15t-country":s},...a&&{"x-c15t-region":a}},onError:o.onError?e=>{o.onError?.({error:e.error?.message||"Unknown error"})}:void 0}),{data:c,error:d}=l;if(d||!c)throw Error(`Failed to fetch consent banner info: ${d?.message}`);let u=function(e,t){let n=e?.response??null;if(n){let e=function(e){let t=null,n=!1;for(let o of["x-vercel-cache","cf-cache-status","x-cache","cache-status"]){let r=e.get(o);if(r){t=`${o}=${r}`,n=/\b(hit|stale|revalidated|updating)\b/i.test(r);break}}let o=e.get("age"),r=o?Number.parseInt(o,10):NaN,i=Number.isFinite(r)&&r>0,s=i?`age=${r}`:null;return{isCacheHit:n||i,detail:t&&s?`${t}, ${s}`:t??s}}(n.headers);return e.isCacheHit?{initDataSource:"backend-cache-hit",initDataSourceDetail:e.detail}:{initDataSource:"backend",initDataSourceDetail:e.detail}}return"offline"===t?{initDataSource:"offline-mode",initDataSourceDetail:null}:"custom"===t?{initDataSource:"custom",initDataSourceDetail:null}:"hosted"===t||"c15t"===t?{initDataSource:"offline-fallback",initDataSourceDetail:null}:{initDataSource:"backend",initDataSourceDetail:null}}(l,i().config.mode);return await e7(c,e,t,c.gvl??void 0,u),c}catch(t){console.error("Error fetching consent banner information:",t),r({isLoadingConsentInfo:!1,activeUI:"none"});let e=t instanceof Error?t.message:"Unknown error fetching consent banner information";o.onError?.({error:e});return}}function tn(e){return e?e.toUpperCase():"GET"}function to(e,t,n){if(!n||!1===n.enabled||!n.rules||0===n.rules.length)return{shouldBlock:!1};let o=function(e){if(!e)return null;try{if("u"<typeof window)return null;return new URL(e,window.location.href)}catch{return null}}(e.url);if(!o)return{shouldBlock:!1};let r=tn(e.method);for(let e of n.rules)if(function(e,t,n){var o;return!!function(e,t){if(!e)return!1;let n=t.domain.trim().toLowerCase(),o=e.trim().toLowerCase();if(!n||!o)return!1;if(o===n)return!0;let r=`.${n}`;return o.endsWith(r)}(e.hostname,n)&&(o=e.pathname,!!("string"!=typeof n.pathIncludes||o&&o.includes(n.pathIncludes))&&!!function(e,t){if(!t.methods||0===t.methods.length)return!0;if(!e)return!1;let n=tn(e);return t.methods.some(e=>tn(e)===n)}(t,n))}(o,r,e)&&!eP(e.category,t))return{shouldBlock:!0,rule:e};return{shouldBlock:!1}}let tr=e=>{if("u"<typeof window)return null;try{return q(e)}catch(e){return console.error("Failed to retrieve stored consent:",e),null}},ti="/api/c15t",ts=new Map,ta=new Map;function tl(e){return"offline"===e||"custom"===e?e:"hosted"}function tc(e,t){var n,o;let r,{mode:a,backendURL:l,store:c,i18n:d,translations:u,storageConfig:f,enabled:g,iab:p,offlinePolicy:y,consentCategories:m,debug:h,headers:b,customFetch:w,retryConfig:I,endpointHandlers:v,...k}=e,{initialI18nConfig:E,initialTranslationConfig:R,ssrData:L,config:P,...x}=k,{initialI18nConfig:A,initialTranslationConfig:D,ssrData:j,config:O,...$}=c??{},T=u??c?.initialTranslationConfig,N=d??c?.initialI18nConfig,B=(0,i.Qe)(T,N),H=B?(0,i.Q0)(B):void 0,q=H?Object.keys(H.messages).sort():[],G=p??$.iab,J=y??$.offlinePolicy,z=f??$.storageConfig,K=g??$.enabled,X=l||ti,Q=L??j,W=(r=!1===(n={mode:a,backendURL:l,endpointHandlers:"endpointHandlers"in e?e.endpointHandlers:void 0,storageConfig:z,defaultLanguage:H?.locale,languageSetKey:q.length>0?q.join(","):void 0,offlinePolicyKey:J?JSON.stringify(J):void 0,enabled:K}).enabled?"disabled":"enabled",[tl(n.mode),n.backendURL??"default",n.endpointHandlers?"custom":"none",n.storageConfig?.storageKey??"default",n.defaultLanguage??"default",n.languageSetKey??"default",n.offlinePolicyKey??"default",r].join(":")),Z=ts.get(W);if(!Z){let t={...$,initialTranslationConfig:B,iab:G,offlinePolicy:J};Z="offline"===a?ew({mode:"offline",store:t,storageConfig:z}):"custom"===a&&"endpointHandlers"in e?ew({mode:"custom",endpointHandlers:e.endpointHandlers,store:t,storageConfig:z}):ew({mode:"c15t"===a?"c15t":"hosted",backendURL:l||ti,store:t,storageConfig:z}),ts.set(W,Z)}let Y=ta.get(W);if(!Y){let n=tl(a),r=O??P,l="hosted"!==n||"u"<typeof window||Q?void 0:(o={backendURL:X,overrides:e.overrides,credentials:"include"},function(e){let t=function(){if(!("u"<typeof window))return window}
2();if(!t)return;let n=eG({backendURL:e.backendURL,overrides:e.overrides,credentials:e.credentials});if(!n)return;let o=Object.values(t.__c15tInitialDataPromises??{}).filter(e=>{let t=e.requestContext;return!!t&&eJ(t,n)});return 1===o.length?o[0]:void 0}(o)?.promise);Y=((e,t={})=>{let{namespace:n="c15tStore",iab:o,ssrData:r,initialConsentCategories:a,initialTranslationConfig:l,initialI18nConfig:c,enabled:d,debug:u,...f}=t,g=l||c?(0,i.Qe)(l,c):void 0;S=C(!0===t.debug);let p=tr(t.storageConfig),y=new Set,m=(0,s.y)((r,i)=>{let s,l,c,d,u,m,h,b,w,C,S,I;return{..._,...f,namespace:n,iab:null,...a&&{consentCategories:a},...p?{consents:p.consents,selectedConsents:p.consents,consentInfo:p.consentInfo,user:p.consentInfo?.externalId?{id:p.consentInfo.externalId,identityProvider:p.consentInfo.identityProvider}:void 0,activeUI:"none",isLoadingConsentInfo:!1}:{activeUI:"none",isLoadingConsentInfo:!0},setActiveUI:(e,t={})=>{if("none"===e||"dialog"===e)return void r({activeUI:e});if(t.force)return void r({activeUI:"banner"});let n=i();tr()||n.consentInfo||n.isLoadingConsentInfo||r({activeUI:"banner"})},setSelectedConsent:(e,t)=>{r(n=>{let o=n.consentTypes.find(t=>t.name===e);return o?.disabled?n:{selectedConsents:{...n.selectedConsents,[e]:t}}})},saveConsents:async(t,n)=>await e3({manager:e,type:t,get:i,set:r,options:n,emitConsentChanged:e=>{for(let t of(i().callbacks.onConsentChanged?.(e),y))t(e)}}),setConsent:(e,t)=>{r(n=>{let o=n.consentTypes.find(t=>t.name===e);return o?.disabled?n:{selectedConsents:{...n.consents,[e]:t}}}),i().saveConsents("custom")},resetConsents:()=>{r(()=>{let e=U.reduce((e,t)=>(e[t.name]=t.defaultValue,e),{});return V(void 0,t.storageConfig),{consents:e,selectedConsents:e,consentInfo:null}})},setConsentCategories:e=>r(()=>{let{policyCategories:t,policyScopeMode:n}=i();return eE(t,n)?{consentCategories:ek(e,t)}:{consentCategories:Array.from(new Set(e))}}),setCallback:(e,t)=>{let n=i();if(r(n=>({callbacks:{...n.callbacks,[e]:t}})),"onConsentSet"===e&&t&&"function"==typeof t&&t?.({preferences:n.consents}),"onBannerFetched"===e&&n.hasFetchedBanner&&n.lastBannerFetchData&&t&&"function"==typeof t){let{lastBannerFetchData:e}=n,o=e.jurisdiction??"NONE";t?.({jurisdiction:{code:o,message:""},location:{countryCode:e.location.countryCode??null,regionCode:e.location.regionCode??null},translations:{language:e.translations.language,translations:e.translations.translations}})}},subscribeToConsentChanges:e=>(y.add(e),()=>{y.delete(e)}),setLocationInfo:e=>r({locationInfo:e}),initConsentManager:()=>e9({manager:e,ssrData:t.ssrData,backendURL:t.__internal?.backendURL,requestCredentials:t.__internal?.requestCredentials,initialTranslationConfig:g,iabConfig:o,get:i,set:r}),getDisplayedConsents:()=>{let{consentCategories:e,consentTypes:t}=i();return t.filter(t=>e.includes(t.name))},hasConsented:()=>{let{consentInfo:e}=i();return null!=e},has:e=>{let{consents:t,policyCategories:n,policyScopeMode:o}=i();return eP(e,t,{policyCategories:n,policyScopeMode:o})},setTranslationConfig:e=>{r({translationConfig:e})},updateConsentCategories:e=>{let{consentCategories:t,policyCategories:n,policyScopeMode:o}=i(),s=new Set([...t,...e]);r({consentCategories:eE(n,o)?ek(Array.from(s),n):Array.from(s)})},identifyUser:async t=>{let n=i().consentInfo,o=n?.subjectId;r({user:t}),o&&(String(n?.externalId)!==String(t.id)||n?.identityProvider!==t.identityProvider)&&(await e.identifyUser({body:{subjectId:o,externalId:t.id,identityProvider:t.identityProvider}}),r({consentInfo:{...n,time:n?.time||Date.now(),subjectId:o,externalId:t.id,identityProvider:t.identityProvider}}))},unstable_acceptPolicyConsent:async t=>{let n=i(),o=n.consentInfo,s=o?.subjectId??eS(),a=F({externalId:o?.externalId,identityProvider:o?.identityProvider}),l=F({externalId:n.user?.id,identityProvider:n.user?.identityProvider}),c=F({externalId:t.externalId,identityProvider:t.identityProvider}),d=c.externalId??a.externalId??l.externalId,u=c.identityProvider??a.identityProvider??l.identityProvider,f=t.givenAt??Date.now(),g=t.domain??("u">typeof window?window.location.hostname:"localhost"),p="privacy_policy"===t.type||"terms_and_conditions"===t.type||"dpa"===t.type,y={};if(p)if(t.documentSnapshotToken)y={documentSnapshotToken:t.documentSnapshotToken};else if(t.policyHash)y={policyHash:t.policyHash};else if(t.policyId)y={policyId:t.policyId};else throw Error("Legal document consent requires documentSnapshotToken, policyHash, or policyId.");let m=await e.setConsent({body:{type:t.type,subjectId:s,domain:g,givenAt:f,uiSource:t.uiSource??"api",...y,...t.metadata?{metadata:t.metadata}:{},...t.preferences?{preferences:t.preferences}:{},...d?{externalSubjectId:d}:{}
2,...u?{identityProvider:u}:{}}});if(!m.ok||!m.data){let e=m.error?.message??"Failed to accept policy consent";i().callbacks.onError?.({error:e});let t=Error(e);throw t.code=m.error?.code,t.details=m.error?.details??null,t.status=m.error?.status,t}let h={...m.data,givenAt:m.data.givenAt instanceof Date?m.data.givenAt:new Date(m.data.givenAt)},b=i(),w={...b.consentInfo,time:f,subjectId:s,...d?{externalId:d}:{},...u?{identityProvider:u}:{}};return r({consentInfo:w,...d?{user:{id:d,identityProvider:u}}:{}}),M({consents:b.consents,consentInfo:w},void 0,b.storageConfig),h},setOverrides:async n=>(r({overrides:{...i().overrides,...n}}),await e9({manager:e,backendURL:t.__internal?.backendURL,requestCredentials:t.__internal?.requestCredentials,initialTranslationConfig:g,get:i,set:r})),setLanguage:async e=>await i().setOverrides({...i().overrides??{},language:e}),...(s=()=>{let{scripts:e,consents:t,scriptIdMap:n,model:o,iab:s,policyCategories:a,policyScopeMode:l}=i(),c=s?.config.enabled?{vendorConsents:s.vendorConsents,vendorLegitimateInterests:s.vendorLegitimateInterests,purposeConsents:s.purposeConsents,purposeLegitimateInterests:s.purposeLegitimateInterests,specialFeatureOptIns:s.specialFeatureOptIns}:void 0,d=function(e,t,n={},o){let r=function(e,t,n={},o){let r=[];return e.forEach(e=>{let i=e0(e,t,o);if(eZ(e.id)&&!e.alwaysLoad&&!i){var s;let o=(s=e.id,eW.get(s)),a={id:e.id,elementId:eQ(e.id,!1!==e.anonymizeId,n),hasConsent:i,consents:t,element:o&&null!==o?o:void 0};!0===e.callbackOnly||null===o?(eY(e.id),r.push(e.id),e1(e,"unloaded","Callback-only script marked as unloaded",a,{callbackOnly:!0})):o&&(e.persistAfterConsentRevoked?(eY(e.id),r.push(e.id),e1(e,"unloaded","Persistent script marked as unloaded without removing element",a,{removedElement:!1,persistAfterConsentRevoked:!0})):(o.remove(),eY(e.id),r.push(e.id),e1(e,"unloaded","Script element removed after consent revocation",a,{removedElement:!0})))}}),r}(e,t,n,o);return{loaded:e2(e,t,n,o),unloaded:r}}(e,eR(t,a,l),n,{model:o,iabConsent:c}),u={...i().loadedScripts};return d.loaded.forEach(e=>{u[e]=!0}),d.unloaded.forEach(e=>{u[e]=!1}),r({loadedScripts:u}),d},{updateScripts:()=>s(),setScripts:e=>{let t=i(),n={...t.scriptIdMap};e.forEach(e=>{!1!==e.anonymizeId&&(n[e.id]=eX())});let o=e.flatMap(e=>ex(e.category));r({scripts:[...t.scripts,...e],scriptIdMap:n}),i().updateConsentCategories(o),s()},removeScript:e=>{let t=i();if(eZ(e)){let t=eW.get(e);t&&(t.remove(),eY(e))}let n={...t.scriptIdMap};delete n[e],r({scripts:t.scripts.filter(t=>t.id!==e),loadedScripts:{...t.loadedScripts,[e]:!1},scriptIdMap:n})},reloadScript:e=>{let t=i(),n=t.iab?.config.enabled?{vendorConsents:t.iab.vendorConsents,vendorLegitimateInterests:t.iab.vendorLegitimateInterests,purposeConsents:t.iab.purposeConsents,purposeLegitimateInterests:t.iab.purposeLegitimateInterests,specialFeatureOptIns:t.iab.specialFeatureOptIns}:void 0,o=eR(t.consents,t.policyCategories,t.policyScopeMode);return function(e,t,n,o={},r){let i=t.find(t=>t.id===e);if(!i)return!1;if(eZ(e)){let t=eW.get(e);!0===i.callbackOnly||null===t?eY(e):t&&(i.persistAfterConsentRevoked||t.remove(),eY(e))}return i.alwaysLoad||e0(i,n,r)?(e2([i],n,o,r),!0):(e1(i,"skipped","Reload skipped due to missing consent",{hasConsent:!1,elementId:eQ(i.id,!1!==i.anonymizeId,o)},{reason:"reload_missing_consent"}),!1)}(e,t.scripts,o,t.scriptIdMap,{model:t.model,iabConsent:n})},isScriptLoaded:e=>eZ(e),getLoadedScriptIds:()=>Array.from(eW.keys())}),...(l=null,c=!1,{initializeIframeBlocker:()=>{var e;let t;if(c||"u"<typeof document)return;let n=i(),o=eR(n.consents,n.policyCategories,n.policyScopeMode);if(n.iframeBlockerConfig?.disableAutomaticBlocking)return;let r=()=>{let e=eD();e.length>0&&i().updateConsentCategories(e)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",r):r(),setTimeout(r,100),ej(o),e=e=>i().updateConsentCategories(e),(t=new MutationObserver(t=>{let n=(()=>{let e=i();return eR(e.consents,e.policyCategories,e.policyScopeMode)})(),o=!1;if(t.forEach(e=>{e.addedNodes.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){e.tagName&&"IFRAME"===e.tagName.toUpperCase()&&(eA(e,n),e.hasAttribute("data-category")&&(o=!0));let t=e.querySelectorAll?.("iframe");t&&t.length>
20&&t.forEach(e=>{eA(e,n),e.hasAttribute("data-category")&&(o=!0)})}})}),o&&e){let t=eD();t.length>0&&e(t)}})).observe(document.body,{childList:!0,subtree:!0}),l=t,c=!0},updateIframeConsents:()=>{if(!c||"u"<typeof document)return;let e=i(),{consents:t,iframeBlockerConfig:n}=e;n?.disableAutomaticBlocking||ej(eR(t,e.policyCategories,e.policyScopeMode))},destroyIframeBlocker:()=>{if(!c||"u"<typeof document)return;let{iframeBlockerConfig:e}=i();e?.disableAutomaticBlocking||(l&&(l.disconnect(),l=null),c=!1)}}),...(d=null,u=null,m=null,h=!1,b=null,w=(e,t)=>{if(e){if(!1!==e.logBlockedRequests){let e=t.rule?.id??"unknown";console.warn("[c15t] Network request blocked by consent manager",{method:t.method,url:t.url,ruleId:e})}e.onRequestBlocked&&e.onRequestBlocked(t)}},C=()=>b||i().consents,S=()=>{"u"<typeof window||"function"!=typeof window.fetch||d||(d=window.fetch,window.fetch=(e,t)=>{let n,o=i().networkBlocker;if(!d)throw Error("Network blocker fetch wrapper not initialized.");if(!(o?.enabled&&o?.rules&&o?.rules.length>0))return d.call(window,e,t);let r="GET";t?.method?r=t.method:e instanceof Request&&(r=e.method);let{shouldBlock:s,rule:a}=to({url:n="string"==typeof e||e instanceof URL?e.toString():e.url,method:r},C(),o);return s?(w(o,{method:r,url:n,rule:a}),Promise.resolve(new Response(null,{status:451,statusText:"Request blocked by consent manager"}))):d.call(window,e,t)})},I=()=>{"u"<typeof window||void 0===window.XMLHttpRequest||"function"!=typeof window.XMLHttpRequest.prototype.open||"function"!=typeof window.XMLHttpRequest.prototype.send||u||m||(u=window.XMLHttpRequest.prototype.open,m=window.XMLHttpRequest.prototype.send,window.XMLHttpRequest.prototype.open=function(e,t,n,o,r){if(this.__c15tMethod=e,this.__c15tUrl=t,!u)throw Error("Network blocker XHR open wrapper not initialized.");return u.call(this,e,t,n??!0,o,r)},window.XMLHttpRequest.prototype.send=function(e){let t=i().networkBlocker;if(t?.enabled!==!1&&t?.rules&&t?.rules.length>0){let e=this.__c15tMethod||"GET",n=this.__c15tUrl||"",{shouldBlock:o,rule:r}=to({url:n,method:e},C(),t);if(o){w(t,{method:e,url:n,rule:r});try{this.abort()}catch{}let o=new ProgressEvent("error");"function"==typeof this.onerror&&this.onerror(o),this.dispatchEvent(o);return}}if(!m)throw Error("Network blocker XHR send wrapper not initialized.");return m.call(this,e)})},{initializeNetworkBlocker:()=>{if(h||"u"<typeof window)return;let e=i(),t=e.networkBlocker;t?.enabled&&t?.rules&&t?.rules.length>0&&(b=e.consents,S(),I(),h=!0)},updateNetworkBlockerConsents:()=>{h&&(b=i().consents)},setNetworkBlocker:e=>{let t=e?.enabled!==!1&&e?.rules&&e?.rules.length>0;if(r({networkBlocker:e}),!t){if(!h||"u"<typeof window)return;d&&(window.fetch=d,d=null),u&&m&&(window.XMLHttpRequest.prototype.open=u,window.XMLHttpRequest.prototype.send=m,u=null,m=null),b=null,h=!1;return}h||(b=i().consents,S(),I(),h=!0)},destroyNetworkBlocker:()=>{!h||"u"<typeof window||(d&&(window.fetch=d,d=null),u&&m&&(window.XMLHttpRequest.prototype.open=u,window.XMLHttpRequest.prototype.send=m,u=null,m=null),b=null,h=!1)}})}});return m.getState().initializeIframeBlocker(),t.networkBlocker&&(m.setState({networkBlocker:t.networkBlocker}),m.getState().initializeNetworkBlocker()),t.scripts&&t.scripts.length>0&&m.getState().updateConsentCategories(t.scripts.flatMap(e=>ex(e.category))),"u">typeof window&&(window[n]=m,m.getState().callbacks.onConsentSet?.({preferences:m.getState().consents}),t.user&&m.getState().identifyUser(t.user),m.getState().initConsentManager()),m})(Z,{config:{...r??{},pkg:t?.pkg||"c15t",version:t?.version||"2.1.0",mode:n,meta:{...r?.meta??{},..."hosted"===n?{backendURL:X,requestCredentials:"include"}:{}}},...x,...$,iab:G,offlinePolicy:J,storageConfig:z,enabled:K,initialTranslationConfig:B,initialConsentCategories:m,ssrData:Q??l,debug:h,__internal:"hosted"===n?{backendURL:X,requestCredentials:"include"}:void 0}),ta.set(W,Y)}return{consentManager:Z,consentStore:Y,cacheKey:W}}}}]);

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.