/* esm.sh - @schibsted/account-sdk-browser@5.2.3 */
var Q=["boolean","number","string"],h=class extends Error{constructor(e,t){if(super(e),this.name="SDKError",typeof t=="object")try{Object.assign(this,t)}catch{}}toString(){let e=`${this.name}: ${this.message}`,t=Object.keys(this).filter(s=>s!=="name"&&Q.includes(typeof this[s])).map(s=>`    ${s}: ${this[s]}`).join(`
`);return t?`${e}
${t}`:e}};function o(i,e="Assertion failed"){if(!i)throw new h(e)}function m(i){return typeof i=="string"}function p(i){return typeof i=="string"&&i.length>0}function f(i){return typeof i=="object"&&i!==null}function R(i){return f(i)&&Object.keys(i).length>0}function d(i,...e){try{let t=new URL(i);return e.every(s=>t[s])}catch{return!1}}function U(i){return typeof i=="function"}function L(i,e,t=!1){let s=r=>m(r)&&i.toUpperCase()===r.toUpperCase();return m(i)&&Array.isArray(e)?t?e.indexOf(i)!==-1:e.some(s):!1}function E(...i){let e={};if(!(i&&i.length))throw new h("No objects to clone");return i.forEach(t=>{o(f(t)),R(t)&&Object.entries(t).forEach(([s,r])=>{typeof r<"u"&&(e[s]=f(r)?j(r):r)})}),e}function j(i){return o(typeof i=="object",`obj should be an object (even null) but it is ${i}`),JSON.parse(JSON.stringify(i))||i}function S(i,e){return o(p(i),`"url" param must be a non empty string: ${typeof i}`),R(e)&&d(e[i])?e[i]:(o(d(i,"hostname"),`Bad URL given: '${i}'`),i)}var q={ENDPOINTS:{SPiD:{LOCAL:"http://id.localhost",DEV:"https://identity-dev.schibsted.com",PRE:"https://identity-pre.schibsted.com",PRO:"https://login.schibsted.com",PRO_NO:"https://payment.schibsted.no",PRO_FI:"https://login.schibsted.fi",PRO_DK:"https://login.schibsted.dk"},BFF:{LOCAL:"http://id.localhost/authn/",DEV:"https://identity-dev.schibsted.com/authn/",PRE:"https://identity-pre.schibsted.com/authn/",PRO:"https://login.schibsted.com/authn/",PRO_NO:"https://payment.schibsted.no/authn/",PRO_FI:"https://login.schibsted.fi/authn/",PRO_DK:"https://login.schibsted.dk/authn/"},SESSION_SERVICE:{LOCAL:"http://session-service.id.localhost",DEV:"https://session-service.identity-dev.schibsted.com",PRE:"https://session-service.identity-pre.schibsted.com",PRO:"https://session-service.login.schibsted.com",PRO_NO:"https://session-service.payment.schibsted.no",PRO_FI:"https://session-service.login.schibsted.fi",PRO_DK:"https://session-service.login.schibsted.dk"}},NAMESPACE:{LOCAL:"id.localhost",DEV:"schibsted.com",PRE:"schibsted.com",PRO:"schibsted.com",PRO_NO:"spid.no",PRO_FI:"schibsted.fi",PRO_DK:"schibsted.dk"}};var w=q.ENDPOINTS,N=q.NAMESPACE;import ne from"/tiny-emitter@^2.1.0?target=es2020";function X(i){if(!i)return!1;try{let e=i(),t="x-x-x-x".replace(/x/g,()=>Math.random()),s="TEST-VALUE";e.setItem(t,s);let r=e.getItem(t);return e.removeItem(t),r===s}catch{return!1}}var A=class{constructor(e){this.store=e,this.get=t=>this.store.getItem(t),this.set=(t,s)=>this.store.setItem(t,s),this.delete=t=>this.store.removeItem(t)}},F=class{constructor(){this.store={},this.get=e=>this.store[e],this.set=(e,t)=>this.store[e]=t,this.delete=e=>delete this.store[e]}},Z=Math.pow(2,31)-1,y=class{constructor(e){X(e)?(this.cache=new A(e()),this.type="WebStorage"):(this.cache=new F,this.type="ObjectLiteralStorage")}get(e){function t(s){try{return JSON.parse(s)}catch{return null}}try{let s=this.cache.get(e),r=t(s);return r&&Number.isInteger(r.expiresOn)&&r.expiresOn>Date.now()?r.value:(this.delete(e),null)}catch(s){throw new h(s)}}set(e,t,s=0){if(!(s<=0)){s=Math.min(Z,s);try{let r=Math.floor(Date.now()+s);this.cache.set(e,JSON.stringify({expiresOn:r,value:t})),setTimeout(()=>this.delete(e),s)}catch(r){throw new h(r)}}}delete(e){try{this.cache.delete(e)}catch(t){throw new h(t)}}};function ee(i){return o(f(i),`Object must be an object but it is '${i}'`),Object.keys(i).map(e=>`${e}=${i[e]}`).join(",")}var te={scrollbars:"yes",location:"yes",status:"no",menubar:"no",toolbar:"no",resizable:"yes"};function T(i,e,t="",s={}){o(f(i),`window was supposed to be an object but it is ${i}`),o(f(i.screen),"window should be a valid Window object but it lacks a 'screen' property"),o(U(i.open),"window should be a valid Window object but it lacks an 'open' function"),o(d(e),"Invalid URL for popup");let{height:r,width:n}=i.screen,a=E(te,s);Number.isFinite(a.width)&&Number.isFinite(n)&&(a.left=(n-a.width)/2),Number.isFinite(a.height)&&Number.isFinite(r)&&(a.top=(r-a.height)/2);let l=ee(a);return i.open(e,t,l)}var se=i=>i.map(e=>f(e)?JSON.stringify(e,null,2):e).join(" "),D=(i,...e)=>typeof i=="function"&&i(se(e));function Y(i){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,t=>e[t])}var ie=()=>window.fetch&&window.fetch.bind(window),B=class i{constructor({serverUrl:e="PRE",envDic:t,fetch:s=ie(),log:r,defaultParams:n={}}){o(f(n),"defaultParams should be a non-null object");let a=S(e,t),l=a.endsWith("/")?a:`${a}/`;this.url=new URL(l),this.defaultParams=n,r&&(o(U(r),`log must be a function but it is ${r}`),this.log=r),s&&(o(U(s),"Fetch should be a function"),this.fetch=s)}async go({method:e,headers:t,pathname:s,data:r={},useDefaultParams:n=!0,fetchOptions:a={method:e,credentials:"include"}}){o(U(this.fetch),"Can't make a call. The reference to fetch is missing or not a function."),o(p(e),`Method must be a non empty string but it is "${e}"`),o(p(s),`Pathname must be string but it is "${s}"`),o(f(r),"data must be a non-null object"),a.headers=f(t)?E(t):{};let l=this.makeUrl(s,r,n);D(this.log,"Request:",a.method.toUpperCase(),l),D(this.log,"Request Headers:",a.headers),D(this.log,"Request Body:",a.body);try{let c=await this.fetch(l,a);if(D(this.log,"Response Code:",c.status,c.statusText),!c.ok)throw new h(c.statusText,{code:c.status});let u=await c.json();return D(this.log,"Response Parsed:",u),u}catch(c){let u=m(c)?c:"Unknown RESTClient error";throw f(c)&&m(c.message)&&(u=c.message),new h(`Failed to '${e}' '${l}': '${u}'`,c)}}makeUrl(e="",t={},s=!0){let r=e.startsWith("/")?e.slice(1):e,n=new URL(r,this.url);return n.search=i.search(t,s,this.defaultParams),n.href}get(e,t){return this.go({method:"get",pathname:e,data:t})}static search(e,t,s){let r=t?E(s,e):E(e);return Object.keys(r).filter(n=>r[n]!=="").map(n=>`${Y(n)}=${Y(r[n])}`).join("&")}},_=B;function P(i){(i.SPiD===null||typeof i.SPiD!="object")&&(i.SPiD={}),(i.SPiD.Talk===null||typeof i.SPiD.Talk!="object")&&(i.SPiD.Talk={}),U(i.SPiD.Talk.response)||(i.SPiD.Talk.response=(e,t)=>i[e](t))}var re="5.2.3",k=re;var x="hasSession-cache",M="sessionCallBlocked-cache",oe=1e3*60*5,G="tab-id-cache",z=Math.floor(Math.random()*1e5),ae=1e3*60*60*24*30,ce=()=>window,V=class extends ne{constructor({clientId:e,redirectUri:t,sessionDomain:s,env:r="PRE",log:n,window:a=ce(),callbackBeforeRedirect:l=()=>{}}){super(),o(p(e),"clientId parameter is required"),o(f(a),"The reference to window is missing"),o(!t||d(t),"redirectUri parameter is invalid"),o(s&&d(s),"sessionDomain parameter is not a valid URL"),P(a),this._sessionInitiatedSent=!1,this.window=a,this.clientId=e,this.sessionStorageCache=new y(()=>this.window&&this.window.sessionStorage),this.localStorageCache=new y(()=>this.window&&this.window.localStorage),this.redirectUri=t,this.env=r,this.log=n,this.callbackBeforeRedirect=l,this._sessionDomain=s,this._enableSessionCaching=!0,this._session={},this._setSessionServiceUrl(s),this._usedSessionServiceGetSessionEndpoint=this._sessionService.url.pathname&&this._sessionService.url.pathname.length<=1?"v2/session":"session",this._setSpidServerUrl(r),this._setBffServerUrl(r),this._setOauthServerUrl(r),this._setGlobalSessionServiceUrl(r),this._unblockSessionCall()}_getTabId(){if(this._enableSessionCaching){let e=this.sessionStorageCache.get(G);return e||(this.sessionStorageCache.set(G,z,ae),z)}}_isSessionCallBlocked(){return this.localStorageCache.get(M)}_blockSessionCall(){this.localStorageCache.set(M,!0,oe)}_unblockSessionCall(){this.localStorageCache.delete(M)}_setSpidServerUrl(e){o(m(e),`url parameter is invalid: ${e}`),this._spid=new _({serverUrl:S(e,w.SPiD),log:this.log,defaultParams:{client_id:this.clientId,redirect_uri:this.redirectUri}})}_setOauthServerUrl(e){o(m(e),`url parameter is invalid: ${e}`),this._oauthService=new _({serverUrl:S(e,w.SPiD),log:this.log,defaultParams:{client_id:this.clientId,redirect_uri:this.redirectUri}})}_setBffServerUrl(e){o(m(e),`url parameter is invalid: ${e}`),this._bffService=new _({serverUrl:S(e,w.BFF),log:this.log,defaultParams:{client_id:this.clientId,redirect_uri:this.redirectUri}})}_setSessionServiceUrl(e){o(m(e),`domain parameter is invalid: ${e}`);let t=`sdrn:${N[this.env]}:client:${this.clientId}`;this._sessionService=new _({serverUrl:e,log:this.log,defaultParams:{client_sdrn:t,redirect_uri:this.redirectUri,sdk_version:k}})}_setGlobalSessionServiceUrl(e){o(m(e),`url parameter is invalid: ${e}`);let t=`sdrn:${N[this.env]}:client:${this.clientId}`;this._globalSessionService=new _({serverUrl:S(e,w.SESSION_SERVICE),log:this.log,defaultParams:{client_sdrn:t,sdk_version:k}})}_emitSessionEvent(e,t){t.userId&&this.emit("login",t),e.userId&&!t.userId&&this.emit("logout",t),e.userId&&t.userId&&e.userId!==t.userId&&this.emit("userChange",t),e.userId||t.userId?this.emit("sessionChange",t):this.emit("notLoggedin",t),t.userId&&!this._sessionInitiatedSent&&(this._sessionInitiatedSent=!0,this.emit("sessionInit",t)),e.userStatus!==t.userStatus&&this.emit("statusChange",t)}_closePopup(){this.popup&&(this.popup.closed||this.popup.close(),this.popup=null)}enableVarnishCookie(e){let t=0,s;Number.isInteger(e)?t=e:typeof e=="object"&&(t=e.expiresIn||t,s=e.domain||s),o(Number.isInteger(t),"'expiresIn' must be an integer"),o(t>=0,"'expiresIn' cannot be negative"),this.setVarnishCookie=!0,this.varnishExpiresIn=t,this.varnishCookieDomain=s}_maybeSetVarnishCookie(e){if(!this.setVarnishCookie)return;let t=new Date;if(this.varnishExpiresIn||typeof e.expiresIn=="number"&&e.expiresIn>0){let a=this.varnishExpiresIn||e.expiresIn;t.setTime(t.getTime()+a*1e3)}else t.setTime(0);let r=this.varnishCookieDomain||(typeof e.baseDomain=="string"?e.baseDomain:document.domain)||"",n=[`SP_ID=${e.sp_id}`,`expires=${t.toUTCString()}`,"path=/",`domain=.${r}`].join("; ");document.cookie=n}_maybeClearVarnishCookie(){this.setVarnishCookie&&this._clearVarnishCookie()}_clearVarnishCookie(){let e=this._session&&typeof this._session.baseDomain=="string"?this._session.baseDomain:document.domain,t=this.varnishCookieDomain||e||"";document.cookie=`SP_ID=nothing; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${t}`}logSettings(){if(!this.log&&!window.console)throw new h("You have to provide log method in constructor");let e=this.log||console.log,t={clientId:this.clientId,redirectUri:this.redirectUri,env:this.env,sessionDomain:this._sessionDomain,sdkVersion:k};e(`Schibsted account SDK for browsers settings: 
${JSON.stringify(t,null,2)}`)}hasSession(){if(this._isSessionCallBlocked())return this._session;if(this._hasSessionInProgress)return this._hasSessionInProgress;let t=n=>{if(n.error)throw new h("HasSession failed",n.error);return this._maybeSetVarnishCookie(n),this._emitSessionEvent(this._session,n),this._session=n,n},s=(n={})=>{let a=Object.keys(n);return a.length===1&&a[0]==="redirectURL"},r=async()=>{if(this._enableSessionCaching){let a=this.sessionStorageCache.get(x);if(a)return t(a)}let n=null;try{n=await this._sessionService.get(this._usedSessionServiceGetSessionEndpoint,{tabId:this._getTabId()})}catch(a){if(a&&a.code===400&&this._enableSessionCaching){let l=1e3*(a.expiresIn||300);this.sessionStorageCache.set(x,{error:a},l)}throw a}if(n){if(s(n))return this._blockSessionCall(),await this.callbackBeforeRedirect(),this._sessionService.makeUrl(n.redirectURL,{tabId:this._getTabId()});if(this._enableSessionCaching){let a=1e3*(n.expiresIn||300);this.sessionStorageCache.set(x,n,a)}}return t(n)};return this._hasSessionInProgress=r().then(n=>(this._hasSessionInProgress=!1,d(n)?this.window.location.href=n:n),n=>{throw this.emit("error",n),this._hasSessionInProgress=!1,new h("HasSession failed",n)}),this._hasSessionInProgress}async isLoggedIn(){try{return"result"in await this.hasSession()}catch{return!1}}clearCachedUserSession(){this.sessionStorageCache.delete(x)}async isConnected(){try{return!!(await this.hasSession()).result}catch{return!1}}async getUser(){let e=await this.hasSession();if(!e.result)throw new h("The user is not connected to this merchant");return j(e)}async getUserId(){let e=await this.hasSession();if(e.userId&&e.result)return e.userId;throw new h("The user is not connected to this merchant")}async getExternalId(e,t=""){let{pairId:s}=await this.hasSession();if(!s)throw new h("pairId missing in user session!");if(!e||e.length===0)throw new h("externalParty cannot be empty");let r=c=>Array.from(new Uint8Array(c)).map(g=>g.toString(16).padStart(2,"0")).join(""),n=c=>crypto.subtle.digest("SHA-256",c);return(async c=>{let u=new TextEncoder().encode(c);return n(u).then(g=>r(g))})(((c,u,g)=>g?`${c}:${u}:${g}`:`${c}:${u}`)(s,e,t))}async getUserSDRN(){let{sdrn:e}=await this.hasSession();if(e)return e;throw new h("Failed to get SDRN from user session")}async getUserUuid(){let e=await this.hasSession();if(e.uuid&&e.result)return e.uuid;throw new h("The user is not connected to this merchant")}async getUserContextData(){try{return await this._globalSessionService.get("user-context")}catch{return null}}login({state:e,acrValues:t="",scope:s="openid",redirectUri:r=this.redirectUri,preferPopup:n=!1,loginHint:a="",tag:l="",teaser:c="",maxAge:u="",locale:g="",oneStepLogin:v=!1,prompt:I="select_account",xDomainId:C="",xEnvironmentId:b="",originCampaign:O=""}){this._closePopup(),this.sessionStorageCache.delete(x);let $=this.loginUrl({state:e,acrValues:t,scope:s,redirectUri:r,loginHint:a,tag:l,teaser:c,maxAge:u,locale:g,oneStepLogin:v,prompt:I,xDomainId:C,xEnvironmentId:b,originCampaign:O});return n&&(this.popup=T(this.window,$,"Schibsted account",{width:360,height:570}),this.popup)?this.popup:(this.window.location.href=$,null)}async getSpId(){try{return(await this.hasSession()).sp_id||null}catch{return null}}logout(e=this.redirectUri){this.sessionStorageCache.delete(x),this._maybeClearVarnishCookie(),this.emit("logout"),this.window.location.href=this.logoutUrl(e)}loginUrl({state:e,acrValues:t="",scope:s="openid",redirectUri:r=this.redirectUri,loginHint:n="",tag:a="",teaser:l="",maxAge:c="",locale:u="",oneStepLogin:g=!1,prompt:v="select_account",xDomainId:I="",xEnvironmentId:C="",originCampaign:b=""}){typeof arguments[0]!="object"&&(e=arguments[0],t=arguments[1],s=arguments[2]||s,r=arguments[3]||r,n=arguments[4]||n,a=arguments[5]||a,l=arguments[6]||l,c=isNaN(arguments[7])?c:arguments[7]);let O=$=>L($,["password","otp","sms","eid-dk","eid-no","eid-se","eid-fi","eid"],!0);return o(!t||L(t,["","otp-email"],!0)||t.split(" ").every(O),`The acrValues parameter is not acceptable: ${t}`),o(d(r),`loginUrl(): redirectUri must be a valid url but is ${r}`),o(p(e),`the state parameter should be a non empty string but it is ${e}`),this._oauthService.makeUrl("oauth/authorize",{response_type:"code",redirect_uri:r,scope:s,state:e,acr_values:t,login_hint:n,tag:a,teaser:l,max_age:c,locale:u,one_step_login:g||"",prompt:t?"":v,x_domain_id:I,x_env_id:C,utm_campaign:b})}logoutUrl(e=this.redirectUri){o(d(e),"logoutUrl(): redirectUri is invalid");let t={redirect_uri:e};return this._sessionService.makeUrl("logout",t)}accountUrl(e=this.redirectUri){return this._spid.makeUrl("profile-pages",{response_type:"code",redirect_uri:e})}phonesUrl(e=this.redirectUri){return this._spid.makeUrl("profile-pages/about-you/phone",{response_type:"code",redirect_uri:e})}async showSimplifiedLoginWidget(e,t){let s=await this.getUserContextData(),r={client_id:this.clientId};t&&t.encoding&&(r.encoding=t.encoding);let n=this._bffService.makeUrl("simplified-login-widget",r,!1),a=async l=>(typeof l.state=="function"&&(l.state=await l.state()),l);return new Promise((l,c)=>{if(!s||!s.display_text||!s.identifier)return c(new h("Missing user data"));let u={displayText:s.display_text,env:this.env,clientName:s.client_name,clientId:this.clientId,providerId:s.provider_id,windowWidth:()=>window.innerWidth,windowOnResize:O=>{window.onresize=O}};t&&t.locale&&(u.locale=t.locale);let g=async()=>{this.login(Object.assign(await a(e),{loginHint:s.identifier}))},v=async()=>{this.login(Object.assign(await a(e),{loginHint:s.identifier,prompt:"login"}))},I=()=>{this.emit("simplifiedLoginOpened")},C=()=>{this.emit("simplifiedLoginCancelled")};if(window.openSimplifiedLoginWidget)return window.openSimplifiedLoginWidget(u,g,v,I,C),l(!0);let b=document.createElement("script");b.type="text/javascript",b.src=n,b.onload=()=>{window.openSimplifiedLoginWidget(u,g,v,I,C),l(!0)},b.onerror=()=>{c(new h("Error when loading simplified login widget content"))},document.getElementsByTagName("body")[0].appendChild(b)})}};import he from"/tiny-emitter@^2.1.0?target=es2020";var le=()=>window,H=class extends he{constructor({clientId:e,redirectUri:t,env:s="PRE",sessionDomain:r,window:n=le()}){super(),P(n),o(p(e),"clientId parameter is required"),this.cache=new y(()=>n&&n.sessionStorage),this.clientId=e,this.env=s,this.redirectUri=t,this._setSpidServerUrl(s),r&&(o(d(r),"sessionDomain parameter is not a valid URL"),this._setSessionServiceUrl(r))}_setSpidServerUrl(e){o(m(e),`url parameter is invalid: ${e}`),this._spid=new _({serverUrl:S(e,w.SPiD),defaultParams:{client_id:this.clientId,redirect_uri:this.redirectUri}})}_setSessionServiceUrl(e){o(m(e),`domain parameter is invalid: ${e}`);let t=`sdrn:${N[this.env]}:client:${this.clientId}`;this._sessionService=new _({serverUrl:e,log:this.log,defaultParams:{client_sdrn:t,redirect_uri:this.redirectUri,sdk_version:k}})}async hasAccess(e,t){if(!this._sessionService)throw new h("hasAccess can only be called if 'sessionDomain' is configured");if(!t)throw new h("'userId' must be specified");if(!Array.isArray(e))throw new h("'productIds' must be an array");let s=e.sort(),r=this._accessCacheKey(e,t),n=this.cache.get(r);if(!n){n=await this._sessionService.get(`/hasAccess/${s.join(",")}`);let a=n.ttl;this.cache.set(r,n,a*1e3)}return n.entitled?(this.emit("hasAccess",{ids:s,data:n}),n):null}clearCachedAccessResult(e,t){this.cache.delete(this._accessCacheKey(e,t))}_accessCacheKey(e,t){return`prd_${e.sort()}_${t}`}subscriptionsUrl(e=this.redirectUri){return o(d(e),"subscriptionsUrl(): redirectUri is invalid"),this._spid.makeUrl("account/subscriptions",{redirect_uri:e})}productsUrl(e=this.redirectUri){return o(d(e),"productsUrl(): redirectUri is invalid"),this._spid.makeUrl("account/products",{redirect_uri:e})}};var de=()=>window,W=class{constructor({clientId:e,redirectUri:t,env:s="PRE",publisher:r,window:n=de()}){P(n),o(p(e),"clientId parameter is required"),this.clientId=e,this.redirectUri=t,this.window=n,this.publisher=r,this._setSpidServerUrl(s),this._setBffServerUrl(s)}_setSpidServerUrl(e){o(m(e),`url parameter is invalid: ${e}`),this._spid=new _({serverUrl:S(e,w.SPiD),defaultParams:{client_id:this.clientId,redirect_uri:this.redirectUri}})}_setBffServerUrl(e){o(m(e),`url parameter is invalid: ${e}`),this._bff=new _({serverUrl:S(e,w.BFF),defaultParams:{client_id:this.clientId,redirect_uri:this.redirectUri}})}_closePopup(){this.popup&&(this.popup.closed||this.popup.close(),this.popup=null)}payWithPaylink({paylink:e,preferPopup:t,redirectUri:s=this.redirectUri}){o(d(s),"payWithPaylink(): redirectUri is invalid"),this._closePopup();let r=this.purchasePaylinkUrl(e,s);return t&&(this.popup=T(this.window,r,"Schibsted account",{width:360,height:570}),this.popup)?this.popup:(this.window.location.href=r,null)}purchaseHistoryUrl(e=this.redirectUri){return o(d(e),"purchaseHistoryUrl(): redirectUri is invalid"),this._spid.makeUrl("account/purchasehistory",{redirect_uri:e})}redeemUrl(e,t=this.redirectUri){return o(d(t),"redeemUrl(): redirectUri is invalid"),this._spid.makeUrl("account/redeem",{voucher_code:e})}purchasePaylinkUrl(e,t=this.redirectUri){return o(d(t),"purchasePaylinkUrl(): redirectUri is invalid"),o(p(e),"purchasePaylinkUrl(): paylinkId is required"),this._bff.makeUrl("payment/purchase",{paylink:e,redirect_uri:t})}purchaseProductFlowUrl(e,t=this.redirectUri){return o(d(t),"purchaseProductUrl(): redirectUri is invalid"),o(p(e),"purchaseProductFlowUrl(): productId is required"),this._bff.makeUrl("flow/checkout",{response_type:"code",flow:"payment",product_id:e,redirect_uri:t})}purchaseCampaignFlowUrl(e,t,s,r=this.redirectUri){return o(d(r),"purchaseCampaignFlowUrl(): redirectUri is invalid"),o(p(e),"purchaseCampaignFlowUrl(): campaignId is required"),o(p(t),"purchaseCampaignFlowUrl(): productId is required"),this._bff.makeUrl("flow/checkout",{response_type:"code",flow:"payment",campaign_id:e,product_id:t,voucher_code:s,redirect_uri:r})}purchasePromoCodeProductFlowUrl(e,t="",s=this.redirectUri){return o(d(s),"purchasePromoCodeProductFlowUrl(): redirectUri is invalid"),o(p(e),"purchasePromoCodeProductFlowUrl(): code is required"),o(p(this.publisher),"purchasePromoCodeProductFlowUrl(): publisher is required in the constructor"),this._bff.makeUrl("payment/purchase/code",{code:e,publisher:this.publisher,state:t,redirect_uri:s})}};export{V as Identity,H as Monetization,W as Payment};
//# sourceMappingURL=account-sdk-browser.mjs.map