/*! For license information please see sdk.js.LICENSE.txt */ var e,t,i={1111:(e,t,i)=>{var n=i(5948);e.exports=function(e,t){return new Promise((function(i,a){var s,o=t||{};function r(e){a(e||new Error("Aborted"))}function c(e,t){e.bail?r(e):s.retry(e)?o.onRetry&&o.onRetry(e,t):a(s.mainError())}"randomize"in o||(o.randomize=!0),(s=n.operation(o)).attempt((function(t){var n;try{n=e(r,t)}catch(e){return void c(e,t)}Promise.resolve(n).then(i).catch((function(e){c(e,t)}))}))}))}},5948:(e,t,i)=>{e.exports=i(9769)},9769:(e,t,i)=>{var n=i(224);t.operation=function(e){var i=t.timeouts(e);return new n(i,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},t.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var i in e)t[i]=e[i];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],a=0;a{function t(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var i=this._timeouts.shift();if(void 0===i){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),i=this._cachedTimeouts.slice(-1)}var n=this;return this._timer=setTimeout((function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout((function(){n._operationTimeoutCb(n._attempts)}),n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)}),i),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){i._operationTimeoutCb()}),i._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},t.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},t.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,i=0,n=0;n=i&&(t=a,i=o)}return t}},2842:e=>{var t=window.console||{};function i(e,i){for(e=e.split(",");e.length;){var n=e.pop();t[n]||(t[n]=i)}}i("memory",{}),i("assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn",(function(){})),e.exports=t},6291:(e,t,i)=>{i.r(t),i.d(t,{default:()=>n});const n={content:{nodes:[{type:"TEXT",name:"TEXT_MAIN",value:"Enjoy Buyer Protection with Klarna"},{type:"ACTION",name:"ACTION_LEARN_MORE",label:"See payment options",url:""},{type:"ACTION",name:"ACTION_OPEN_BUYERS_PROTECTION_LINK",label:"Buyer Protection",url:"https://www.klarna.com/uk/buyer-protection-description/"}]},impression_url:""}},6353:function(e,t,i){var n;!function(a,s){var o="function",r="undefined",c="object",l="string",d="major",u="model",g="name",b="type",h="vendor",p="version",m="architecture",I="console",C="mobile",f="tablet",x="smarttv",y="wearable",G="embedded",A="Amazon",v="Apple",B="ASUS",Z="BlackBerry",Q="Browser",w="Chrome",X="Firefox",k="Google",W="Huawei",L="LG",N="Microsoft",E="Motorola",F="Opera",U="Samsung",R="Sharp",O="Sony",S="Xiaomi",Y="Zebra",_="Facebook",D="Chromium OS",V="Mac OS",T=function(e){for(var t={},i=0;i0?2===r.length?typeof r[1]==o?this[r[0]]=r[1].call(this,d):this[r[0]]=r[1]:3===r.length?typeof r[1]!==o||r[1].exec&&r[1].test?this[r[0]]=d?d.replace(r[1],r[2]):s:this[r[0]]=d?r[1].call(this,d,r[2]):s:4===r.length&&(this[r[0]]=d?r[3].call(this,d.replace(r[1],r[2])):s):this[r]=d||s;u+=2}},z=function(e,t){for(var i in t)if(typeof t[i]===c&&t[i].length>0){for(var n=0;n2&&(e[u]="iPad",e[b]=f),e},this.getEngine=function(){var e={};return e[g]=s,e[p]=s,j.call(e,n,x.engine),e},this.getOS=function(){var e={};return e[g]=s,e[p]=s,j.call(e,n,x.os),y&&!e[g]&&I&&"Unknown"!=I.platform&&(e[g]=I.platform.replace(/chrome os/i,D).replace(/macos/i,V)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===l&&e.length>500?M(e,500):e,this},this.setUA(n),this};K.VERSION="1.0.37",K.BROWSER=T([g,p,d]),K.CPU=T([m]),K.DEVICE=T([u,h,b,I,C,x,f,y,G]),K.ENGINE=K.OS=T([g,p]),typeof t!==r?(e.exports&&(t=e.exports=K),t.UAParser=K):i.amdO?(n=function(){return K}.call(t,i,t,e))===s||(e.exports=n):typeof a!==r&&(a.UAParser=K);var q=typeof a!==r&&(a.jQuery||a.Zepto);if(q&&!q.ua){var ee=new K;q.ua=ee.getResult(),q.ua.get=function(){return ee.getUA()},q.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var i in t)q.ua[i]=t[i]}}}("object"==typeof window?window:this)},6468:(e,t,i)=>{var n={"./cs-CZ.ts":[1982,1982],"./da-DK.ts":[5939,5939],"./de-AT.ts":[3532,3532],"./de-CH.ts":[5840,6824],"./de-DE.ts":[3175,3175],"./el-GR.ts":[4102,4102],"./en-AT.ts":[719,719],"./en-AU.ts":[1583,1583],"./en-BE.ts":[7449,7449],"./en-CA.ts":[5724,5724],"./en-CH.ts":[5090,5090],"./en-CZ.ts":[8054,8054],"./en-DE.ts":[5907,5907],"./en-DK.ts":[5377,5377],"./en-ES.ts":[1994,1994],"./en-FI.ts":[2590,2590],"./en-FR.ts":[6015,6015],"./en-GB.ts":[6291],"./en-GR.ts":[9626,9626],"./en-HU.ts":[1686,1686],"./en-IE.ts":[5498,5498],"./en-IT.ts":[7212,7212],"./en-MX.ts":[947,947],"./en-NL.ts":[6830,6830],"./en-NO.ts":[6935,6935],"./en-NZ.ts":[6219,6219],"./en-PL.ts":[7256,7256],"./en-PT.ts":[4342,4342],"./en-RO.ts":[9677,9677],"./en-SE.ts":[420,420],"./en-US.ts":[1133,1133],"./es-ES.ts":[2615,2615],"./es-MX.ts":[3083,3083],"./es-US.ts":[2896,2896],"./fi-FI.ts":[3187,3187],"./fr-BE.ts":[2096,5840],"./fr-CA.ts":[7608,7608],"./fr-CH.ts":[9977,9977],"./fr-FR.ts":[2920,2920],"./hu-HU.ts":[9699,9699],"./it-CH.ts":[140,140],"./it-IT.ts":[5707,5707],"./nb-NO.ts":[9844,9844],"./nl-BE.ts":[8410,8410],"./nl-NL.ts":[3120,3120],"./no-NO.ts":[6660,6660],"./pl-PL.ts":[3279,3279],"./pt-PT.ts":[5908,5908],"./ro-RO.ts":[3235,3235],"./sv-FI.ts":[102,102],"./sv-SE.ts":[3104,3104]};function a(e){if(!i.o(n,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=n[e],a=t[0];return Promise.all(t.slice(1).map(i.e)).then((()=>i(a)))}a.keys=()=>Object.keys(n),a.id=6468,e.exports=a},5450:(e,t)=>{var i,n;Object.defineProperty(t,"__esModule",{value:!0}),t.Device=t.IFRAMEID=t.InteractionModes=void 0,function(e){e.DEVICE_BEST="DEVICE_BEST",e.ON_PAGE="ON_PAGE",e.IFRAME="IFRAME",e.REDIRECT="REDIRECT"}(i||(t.InteractionModes=i={})),t.IFRAMEID="klarna-flow-interaction-mode-iframe",function(e){e.MOBILE="MOBILE",e.DESKTOP="DESKTOP",e.WEBVIEW="WEBVIEW",e.UNKNOWN="UNKNOWN"}(n||(t.Device=n={}))},2034:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.updateIframeUrl=t.updatePopupUrl=t.getOpenedWindow=t.closeInteractionMode=t.Popup=t.WindowBlockedError=t.detectDeviceBest=t.triggerOnPage=t.triggerIframe=t.triggerRedirect=t.InteractionModes=void 0;const a=i(5450);Object.defineProperty(t,"InteractionModes",{enumerable:!0,get:function(){return a.InteractionModes}});const s=i(6481);Object.defineProperty(t,"triggerOnPage",{enumerable:!0,get:function(){return s.triggerOnPage}});const o=i(334);Object.defineProperty(t,"triggerIframe",{enumerable:!0,get:function(){return o.triggerIframe}});const r=n(i(300)),c=i(7964);Object.defineProperty(t,"triggerRedirect",{enumerable:!0,get:function(){return c.triggerRedirect}});const l=i(8897);Object.defineProperty(t,"detectDeviceBest",{enumerable:!0,get:function(){return l.detectDeviceBest}});const d=i(4864);Object.defineProperty(t,"Popup",{enumerable:!0,get:function(){return d.Popup}}),Object.defineProperty(t,"WindowBlockedError",{enumerable:!0,get:function(){return d.WindowBlockedError}}),t.closeInteractionMode=function(){r.default.ACTIVE_OVERLAY&&r.default.ACTIVE_OVERLAY.destroy()},t.getOpenedWindow=function(){return r.default.ACTIVE_OVERLAY?.getOpenedWindow()},t.updatePopupUrl=function(){},t.updateIframeUrl=function(){}},6338:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowBlockedError=void 0;class i extends Error{constructor(e){super(e),Object.setPrototypeOf(this,i.prototype)}}t.WindowBlockedError=i},4864:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowBlockedError=t.Popup=void 0;const n=i(6338);Object.defineProperty(t,"WindowBlockedError",{enumerable:!0,get:function(){return n.WindowBlockedError}});const a=i(8078);Object.defineProperty(t,"Popup",{enumerable:!0,get:function(){return a.Popup}})},8078:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Popup=t.DEFAULT_OVERLAY_CONTENT=void 0;const a=i(6338),s=n(i(300)),o=i(103),r=n(i(8890));t.DEFAULT_OVERLAY_CONTENT={text:"Don't see the Klarna window? We'll help you open it to complete your purchase.",buttonLabel:"Continue"};const{maxAppHeight:c,preferredAppWidth:l}=r.default.viewport;t.Popup=class{constructor(e=window){this.openOverlay=(e,{overlayContent:t,previousActiveElement:i,onDestroy:n})=>{new s.default({windowOpener:this.windowOpener,overlayContent:t,onOverlayClick:e,onDestroy:n,previousActiveElement:i}).create()},this.openWindow=(e,{id:t="Klarna",hideOverlay:i=!1,overlayContent:n,previousActiveElement:r,onDestroy:d,styles:{width:u=l,height:g=c}={}})=>{const{top:b,left:h}=((e,t)=>{const i=screen.width,n=screen.height,a=void 0!==window.screenLeft?window.screenLeft:window.screenX;return{top:(n-t)/2+(void 0!==window.screenTop?window.screenTop:window.screenY),left:(i-e)/2+a}})(u,g),p=window.open(e,t,`resizable=yes, width=${u}, height=${g}, top=${b}, left=${h}`);if(!p)throw new a.WindowBlockedError("Popup blocked");if(this.openedWindow=p,"about:blank"===e&&this.injectKlarnaHeartbeat(),this.addListener(),s.default.ACTIVE_OVERLAY&&s.default.ACTIVE_OVERLAY.destroy(),!i){const e=new s.default({windowOpener:this.windowOpener,overlayContent:n,onOverlayClick:()=>this.openedWindow?.focus(),onDestroy:()=>{this.closeOpenedWindow(),d?.()},previousActiveElement:r});e.create();const t=()=>{e.destroy(),this.removeListener()};new o.WindowPoll(this.openedWindow,t).start()}},this.closeOpenedWindow=()=>{this.openedWindow?.closed||this.openedWindow?.close()},this.getOpenedWindow=()=>this.openedWindow,this.updateWindowURL=e=>{this.openedWindow&&!this.openedWindow.closed&&(this.openedWindow.location.href=e)},this.windowOpener=e}addListener(){this.windowOpener.addEventListener("unload",this.closeOpenedWindow)}removeListener(){this.windowOpener.removeEventListener("unload",this.closeOpenedWindow)}injectKlarnaHeartbeat(){this.openedWindow?.document.write('\n \n
\n \n
\n ')}}},103:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowPoll=void 0,t.WindowPoll=class{constructor(e,t){this.start=()=>{this.openedWindowPolling=setInterval((()=>{this.window.closed&&(this.cleanupCallback(),clearInterval(this.openedWindowPolling))}),100)},this.window=e,this.cleanupCallback=t}}},334:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.triggerIframe=void 0;const a=i(5450),s=i(3296),o=n(i(300)),r=i(3371),c=e=>{const t=o.default.ACTIVE_OVERLAY?.getIframe();t&&(t.src=e)};t.triggerIframe=function(e,t){const i=(0,r.useStyles)(),n=t?.id??a.IFRAMEID,l=(0,s.createIframeStyles)(t?.styles),d=document.createElement("iframe");Object.assign(d.style,{...i,...l});for(const[i,a]of Object.entries({scrolling:"no",frameborder:"0",allow:"camera;microphone",src:e,id:n,title:t.title}))i&&a&&d.setAttribute(i,a);o.default.ACTIVE_OVERLAY&&o.default.ACTIVE_OVERLAY.destroy();const u=new o.default({windowOpener:t.fullscreenWindow||window,overlayContent:{...t.overlayContent,iframe:d},onDestroy:t.onClose,onOverlayClick:()=>u.destroy(),previousActiveElement:t.previousActiveElement});return u.create(),{iframe:u.getIframe(),updateUrl:c}}},6481:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.triggerOnPage=void 0;const n=i(4864);t.triggerOnPage=function(e,t){try{const i=new n.Popup(t.fullscreenWindow);return i.openWindow(e,t),{getOpenedWindow:i.getOpenedWindow,updateUrl:i.updateWindowURL}}catch(e){throw e}}},7964:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.triggerRedirect=void 0,t.triggerRedirect=function(e){try{return void(window.location.href=e)}catch(e){throw e}}},9254:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.detectDevice=void 0;const n=i(5450);t.detectDevice=function(){const e=navigator.userAgent;return/((wv|sdk) \([^\)]+\))|WebView/i.test(e)?n.Device.WEBVIEW:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)?n.Device.MOBILE:/Windows|Macintosh|Linux/i.test(e)?n.Device.DESKTOP:n.Device.UNKNOWN}},8897:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.detectDeviceBest=void 0;const n=i(5450),a=i(9254);t.detectDeviceBest=function(){const e=(0,a.detectDevice)();return e===n.Device.MOBILE||e===n.Device.DESKTOP?n.InteractionModes.ON_PAGE:(n.Device.WEBVIEW,n.InteractionModes.REDIRECT)}},3296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createIframeStyles=void 0,t.createIframeStyles=function(e={}){return{display:"block",background:`${e.background??"white"}`,...e.width&&{width:`${e.width}px`},...e.height&&{height:`${e.height}px`},...(e.borderRadius||0===e.borderRadius)&&{borderRadius:`${e.borderRadius}px`}}}},300:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(i(9290));class s{constructor({windowOpener:e,overlayContent:t,onOverlayClick:i,onDestroy:n,previousActiveElement:a}){this.windowOpener=e,this.overlayContent=t,this.onOverlayClick=i,this.onDestroy=n,this.previousActiveElement=a,s.ACTIVE_OVERLAY=this}createShadowRoot(){const e=this.windowOpener.document.createElement("div");e.setAttribute("id","klarna-fullscreen-shadow-dom"),this.windowOpener.document.body.append(e);const t=this.windowOpener.document.createElement("span");return e.append(t),e.attachShadow({mode:"open"})}create(){this.root=this.createShadowRoot(),this.root.innerHTML=(0,a.default)(this.overlayContent?.text,this.overlayContent?.buttonLabel,this.overlayContent?.iframe),this.overlay=this.root.querySelector(".overlay-open");const e=this.overlay.querySelector("#overlay-close-button");document.body.style.overflow="hidden";const t=e=>{e.stopPropagation(),this.destroy()};this.overlay.addEventListener("click",this.onOverlayClick),this.removeOverlayClickListener=()=>{this.overlay?.removeEventListener("click",this.onOverlayClick)},e?.addEventListener("click",(e=>t(e))),this.removeOverlayCloseButtonListener=()=>{e?.removeEventListener("click",(e=>t(e)))}}getIframe(){return this.root?.querySelector("iframe")}destroy(){this.overlay?.classList.add("overlay-close"),this.onDestroy&&this.onDestroy(),this.removeOverlayClickListener&&this.removeOverlayClickListener(),this.removeOverlayCloseButtonListener&&this.removeOverlayCloseButtonListener(),document.body.style.overflow="",setTimeout((()=>{this.root?.host?.parentNode?.removeChild(this.root?.host),this.previousActiveElement?.focus()}),350)}getOpenedWindow(){return this.windowOpener}}s.ACTIVE_OVERLAY=null,t.default=s},1330:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default="\n@keyframes overlay-open-animation {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n \n @keyframes overlay-close-animation {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n \n .overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 2147483647;\n background-image: radial-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.8));\n display: flex;\n justify-content: center;\n align-items: center;\n }\n \n .overlay-open {\n @extend .overlay;\n animation: overlay-open-animation 0.3s linear;\n opacity: 1;\n }\n \n .overlay-close {\n @extend .overlay;\n animation: overlay-close-animation 0.3s linear;\n opacity: 0;\n }\n \n .close-button {\n position: absolute;\n top: 20px;\n right: 20px;\n cursor: pointer;\n }\n \n .content {\n width: 100%;\n max-width: 350px;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n \n .klarna-button {\n background-color: white;\n border: none;\n cursor: pointer;\n outline: 0;\n -webkit-tap-highlight-color: transparent;\n border-radius: 20px;\n height: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 9px 14px 9px 16px;\n color: rgb(23, 23, 23);\n font-family: 'Klarna Text', 'Klarna Sans', Helvetica, Arial, sans-serif;\n font-weight: 500;\n font-size: 14px;\n text-rendering: geometricPrecision;\n -webkit-font-smoothing: antialiased;\n line-height: 20px;\n }\n \n .klarna-logo {\n width: 120px;\n max-width: 100%;\n height: auto;\n }\n \n .text-content {\n color: white;\n font-family: 'Klarna Text', 'Klarna Sans', Helvetica, Arial, sans-serif;\n font-size: 14px;\n text-rendering: geometricPrecision;\n -webkit-font-smoothing: antialiased;\n line-height: 20px;\n text-align: center;\n margin: 20px 0;\n }\n \n"},9290:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(i(1330));t.default=(e,t,i)=>i?`\n\n
\n ${i.outerHTML}\n
\n`:`\n\n
\n
\n \n ${e?`

${e}

`:""}\n ${t?``:""}\n
\n \n \n \n
\n`},3371:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useStyles=void 0;const a=n(i(8890)),{midResolutionHeight:s,lowResolutionWidth:o,preferredAppWidth:r,framedModeMinMargin:c,maxAppHeight:l}=a.default.viewport,d=e=>{const t=window.matchMedia(e);let i=t.matches;const n=e=>{i=e.matches},a=(e=>(e.addEventListener("change",n),()=>{e.removeEventListener("change",n)}))(t);return window.addEventListener("resize",a),i};t.useStyles=()=>{const e=d(`(max-width: ${o}px)`),t=d(`(min-height: ${s}px)`),i=e?"100%":`${r}px`,n=e?"100%":t?"70%":`calc(100% - ${c}px)`,a=d("(orientation: portrait)"),u=e&&a?void 0:l;return{width:i,height:n,maxHeight:u?`${u}px`:void 0,borderRadius:e?"0px":"8px",transition:"height 0.5s ease"}}},8890:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={viewport:{preferredAppWidth:480,minHalfPanelHeight:590,lowResolutionWidth:560,midResolutionHeight:800,highResolutionHeight:1200,framedModeMinMargin:40,maxAppHeight:960}}},8174:(e,t)=>{var i,n;Object.defineProperty(t,"__esModule",{value:!0}),t.Device=t.IFRAMEID=t.InteractionModes=void 0,function(e){e.DEVICE_BEST="DEVICE_BEST",e.ON_PAGE="ON_PAGE",e.IFRAME="IFRAME",e.REDIRECT="REDIRECT"}(i||(t.InteractionModes=i={})),t.IFRAMEID="klarna-flow-interaction-mode-iframe",function(e){e.MOBILE="MOBILE",e.DESKTOP="DESKTOP",e.WEBVIEW="WEBVIEW",e.UNKNOWN="UNKNOWN"}(n||(t.Device=n={}))},4250:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.updateIframeUrl=t.updatePopupUrl=t.getOpenedWindow=t.closeInteractionMode=t.Popup=t.WindowBlockedError=t.detectDeviceBest=t.triggerOnPage=t.triggerIframe=t.triggerRedirect=t.InteractionModes=void 0;const a=i(8174);Object.defineProperty(t,"InteractionModes",{enumerable:!0,get:function(){return a.InteractionModes}});const s=i(4546);Object.defineProperty(t,"triggerOnPage",{enumerable:!0,get:function(){return s.triggerOnPage}});const o=i(3895);Object.defineProperty(t,"triggerIframe",{enumerable:!0,get:function(){return o.triggerIframe}});const r=n(i(839)),c=i(1047);Object.defineProperty(t,"triggerRedirect",{enumerable:!0,get:function(){return c.triggerRedirect}});const l=i(8506);Object.defineProperty(t,"detectDeviceBest",{enumerable:!0,get:function(){return l.detectDeviceBest}});const d=i(698);Object.defineProperty(t,"Popup",{enumerable:!0,get:function(){return d.Popup}}),Object.defineProperty(t,"WindowBlockedError",{enumerable:!0,get:function(){return d.WindowBlockedError}}),t.closeInteractionMode=function(){r.default.ACTIVE_OVERLAY&&r.default.ACTIVE_OVERLAY.destroy()},t.getOpenedWindow=function(){return r.default.ACTIVE_OVERLAY?.getOpenedWindow()},t.updatePopupUrl=function(){},t.updateIframeUrl=function(){}},2468:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowBlockedError=void 0;class i extends Error{constructor(e){super(e),Object.setPrototypeOf(this,i.prototype)}}t.WindowBlockedError=i},698:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowBlockedError=t.Popup=void 0;const n=i(2468);Object.defineProperty(t,"WindowBlockedError",{enumerable:!0,get:function(){return n.WindowBlockedError}});const a=i(4019);Object.defineProperty(t,"Popup",{enumerable:!0,get:function(){return a.Popup}})},4019:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Popup=t.DEFAULT_OVERLAY_CONTENT=void 0;const a=i(2468),s=n(i(839)),o=i(672),r=n(i(4113));t.DEFAULT_OVERLAY_CONTENT={text:"Don't see the Klarna window? We'll help you open it to complete your purchase.",buttonLabel:"Continue"};const{maxAppHeight:c,preferredAppWidth:l}=r.default.viewport;t.Popup=class{constructor(e=window){this.openOverlay=(e,{overlayContent:t,previousActiveElement:i,onDestroy:n})=>{new s.default({windowOpener:this.windowOpener,overlayContent:t,onOverlayClick:e,onDestroy:n,previousActiveElement:i}).create()},this.openWindow=(e,{id:t="Klarna",hideOverlay:i=!1,overlayContent:n,previousActiveElement:r,onDestroy:d,styles:{width:u=l,height:g=c}={}})=>{const{top:b,left:h}=((e,t)=>{const i=screen.width,n=screen.height,a=void 0!==window.screenLeft?window.screenLeft:window.screenX;return{top:(n-t)/2+(void 0!==window.screenTop?window.screenTop:window.screenY),left:(i-e)/2+a}})(u,g),p=window.open(e,t,`resizable=yes, width=${u}, height=${g}, top=${b}, left=${h}`);if(!p)throw new a.WindowBlockedError("Popup blocked");if(this.openedWindow=p,this.addListener(),s.default.ACTIVE_OVERLAY&&s.default.ACTIVE_OVERLAY.destroy(),!i){const e=new s.default({windowOpener:this.windowOpener,overlayContent:n,onOverlayClick:()=>this.openedWindow?.focus(),onDestroy:()=>{this.closeOpenedWindow(),d?.()},previousActiveElement:r});e.create();const t=()=>{e.destroy(),this.removeListener()};new o.WindowPoll(this.openedWindow,t).start()}},this.closeOpenedWindow=()=>{this.openedWindow?.closed||this.openedWindow?.close()},this.getOpenedWindow=()=>this.openedWindow,this.updateWindowURL=e=>{this.openedWindow&&!this.openedWindow.closed&&(this.openedWindow.location.href=e)},this.windowOpener=e}addListener(){this.windowOpener.addEventListener("unload",this.closeOpenedWindow)}removeListener(){this.windowOpener.removeEventListener("unload",this.closeOpenedWindow)}}},672:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowPoll=void 0,t.WindowPoll=class{constructor(e,t){this.start=()=>{this.openedWindowPolling=setInterval((()=>{this.window.closed&&(this.cleanupCallback(),clearInterval(this.openedWindowPolling))}),100)},this.window=e,this.cleanupCallback=t}}},3895:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.triggerIframe=void 0;const a=i(8174),s=i(903),o=n(i(839)),r=i(5024),c=e=>{const t=o.default.ACTIVE_OVERLAY?.getIframe();t&&(t.src=e)};t.triggerIframe=function(e,t){const i=(0,r.useStyles)(),n=t?.id??a.IFRAMEID,l=(0,s.createIframeStyles)(t?.styles),d=document.createElement("iframe");Object.assign(d.style,{...i,...l});for(const[i,a]of Object.entries({scrolling:"no",frameborder:"0",allow:"camera",src:e,id:n,title:t.title}))i&&a&&d.setAttribute(i,a);o.default.ACTIVE_OVERLAY&&o.default.ACTIVE_OVERLAY.destroy();const u=new o.default({windowOpener:t.fullscreenWindow||window,overlayContent:{...t.overlayContent,iframe:d},onDestroy:t.onClose,onOverlayClick:()=>u.destroy(),previousActiveElement:t.previousActiveElement});return u.create(),{iframe:u.getIframe(),updateUrl:c}}},4546:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.triggerOnPage=void 0;const n=i(698);t.triggerOnPage=function(e,t){try{const i=new n.Popup(t.fullscreenWindow);return i.openWindow(e,t),{getOpenedWindow:i.getOpenedWindow,updateUrl:i.updateWindowURL}}catch(e){throw e}}},1047:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.triggerRedirect=void 0,t.triggerRedirect=function(e){try{return void(window.location.href=e)}catch(e){throw e}}},9615:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.detectDevice=void 0;const n=i(8174);t.detectDevice=function(){const e=navigator.userAgent;return/((wv|sdk) \([^\)]+\))|WebView/i.test(e)?n.Device.WEBVIEW:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)?n.Device.MOBILE:/Windows|Macintosh|Linux/i.test(e)?n.Device.DESKTOP:n.Device.UNKNOWN}},8506:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.detectDeviceBest=void 0;const n=i(8174),a=i(9615);t.detectDeviceBest=function(){const e=(0,a.detectDevice)();return e===n.Device.MOBILE||e===n.Device.DESKTOP?n.InteractionModes.ON_PAGE:(n.Device.WEBVIEW,n.InteractionModes.REDIRECT)}},903:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createIframeStyles=void 0,t.createIframeStyles=function(e={}){return{display:"block",background:`${e.background??"white"}`,...e.width&&{width:`${e.width}px`},...e.height&&{height:`${e.height}px`},...(e.borderRadius||0===e.borderRadius)&&{borderRadius:`${e.borderRadius}px`}}}},839:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(i(3430));class s{constructor({windowOpener:e,overlayContent:t,onOverlayClick:i,onDestroy:n,previousActiveElement:a}){this.windowOpener=e,this.overlayContent=t,this.onOverlayClick=i,this.onDestroy=n,this.previousActiveElement=a,s.ACTIVE_OVERLAY=this}createShadowRoot(){const e=this.windowOpener.document.createElement("div");e.setAttribute("id","klarna-fullscreen-shadow-dom"),this.windowOpener.document.body.append(e);const t=this.windowOpener.document.createElement("span");return e.append(t),e.attachShadow({mode:"open"})}create(){this.root=this.createShadowRoot(),this.root.innerHTML=(0,a.default)(this.overlayContent?.text,this.overlayContent?.buttonLabel,this.overlayContent?.iframe),this.overlay=this.root.querySelector(".overlay-open");const e=this.overlay.querySelector("#overlay-close-button");document.body.style.overflow="hidden";const t=e=>{e.stopPropagation(),this.destroy()};this.overlay.addEventListener("click",this.onOverlayClick),this.removeOverlayClickListener=()=>{this.overlay?.removeEventListener("click",this.onOverlayClick)},e?.addEventListener("click",(e=>t(e))),this.removeOverlayCloseButtonListener=()=>{e?.removeEventListener("click",(e=>t(e)))}}getIframe(){return this.root?.querySelector("iframe")}destroy(){this.overlay?.classList.add("overlay-close"),this.onDestroy&&this.onDestroy(),this.removeOverlayClickListener&&this.removeOverlayClickListener(),this.removeOverlayCloseButtonListener&&this.removeOverlayCloseButtonListener(),document.body.style.overflow="",setTimeout((()=>{this.root?.host?.parentNode?.removeChild(this.root?.host),this.previousActiveElement?.focus()}),350)}getOpenedWindow(){return this.windowOpener}}s.ACTIVE_OVERLAY=null,t.default=s},8933:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default="\n@keyframes overlay-open-animation {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n \n @keyframes overlay-close-animation {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n \n .overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 2147483647;\n background-image: radial-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.8));\n display: flex;\n justify-content: center;\n align-items: center;\n }\n \n .overlay-open {\n @extend .overlay;\n animation: overlay-open-animation 0.3s linear;\n opacity: 1;\n }\n \n .overlay-close {\n @extend .overlay;\n animation: overlay-close-animation 0.3s linear;\n opacity: 0;\n }\n \n .close-button {\n position: absolute;\n top: 20px;\n right: 20px;\n cursor: pointer;\n }\n \n .content {\n width: 100%;\n max-width: 350px;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n \n .klarna-button {\n background-color: white;\n border: none;\n cursor: pointer;\n outline: 0;\n -webkit-tap-highlight-color: transparent;\n border-radius: 20px;\n height: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 9px 14px 9px 16px;\n color: rgb(23, 23, 23);\n font-family: 'Klarna Text', 'Klarna Sans', Helvetica, Arial, sans-serif;\n font-weight: 500;\n font-size: 14px;\n text-rendering: geometricPrecision;\n -webkit-font-smoothing: antialiased;\n line-height: 20px;\n }\n \n .klarna-logo {\n width: 120px;\n max-width: 100%;\n height: auto;\n }\n \n .text-content {\n color: white;\n font-family: 'Klarna Text', 'Klarna Sans', Helvetica, Arial, sans-serif;\n font-size: 14px;\n text-rendering: geometricPrecision;\n -webkit-font-smoothing: antialiased;\n line-height: 20px;\n text-align: center;\n margin: 20px 0;\n }\n \n"},3430:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(i(8933));t.default=(e,t,i)=>i?`\n\n
\n ${i.outerHTML}\n
\n`:`\n\n
\n
\n \n ${e?`

${e}

`:""}\n ${t?``:""}\n
\n \n \n \n
\n`},5024:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useStyles=void 0;const a=n(i(4113)),{midResolutionHeight:s,lowResolutionWidth:o,preferredAppWidth:r,framedModeMinMargin:c,maxAppHeight:l}=a.default.viewport,d=e=>{const t=window.matchMedia(e);let i=t.matches;const n=e=>{i=e.matches},a=(e=>(e.addEventListener("change",n),()=>{e.removeEventListener("change",n)}))(t);return window.addEventListener("resize",a),i};t.useStyles=()=>{const e=d(`(max-width: ${o}px)`),t=d(`(min-height: ${s}px)`),i=e?"100%":`${r}px`,n=e?"100%":t?"70%":`calc(100% - ${c}px)`,a=d("(orientation: portrait)"),u=e&&a?void 0:l;return{width:i,height:n,maxHeight:u?`${u}px`:void 0,borderRadius:e?"0px":"8px"}}},4113:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={viewport:{preferredAppWidth:480,minHalfPanelHeight:590,lowResolutionWidth:560,midResolutionHeight:800,highResolutionHeight:1200,framedModeMinMargin:40,maxAppHeight:960}}},9912:(e,t,i)=>{i.d(t,{fl:()=>B,iv:()=>c,Ts:()=>G,Qu:()=>A});const n=globalThis,a=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class r{constructor(e,t,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(a&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=o.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&o.set(t,e))}return e}toString(){return this.cssText}}const c=(e,...t)=>{const i=1===e.length?e[0]:t.reduce(((t,i,n)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[n+1]),e[0]);return new r(i,e,s)},l=(e,t)=>{if(a)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const i of t){const t=document.createElement("style"),a=n.litNonce;void 0!==a&&t.setAttribute("nonce",a),t.textContent=i.cssText,e.appendChild(t)}},d=a?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new r("string"==typeof e?e:e+"",void 0,s))(t)})(e):e,{is:u,defineProperty:g,getOwnPropertyDescriptor:b,getOwnPropertyNames:h,getOwnPropertySymbols:p,getPrototypeOf:m}=Object,I=globalThis,C=I.trustedTypes,f=C?C.emptyScript:"",x=I.reactiveElementPolyfillSupport,y=(e,t)=>e,G={toAttribute(e,t){switch(t){case Boolean:e=e?f:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},A=(e,t)=>!u(e,t),v={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:A};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;class B extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=v){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(e,i,t);void 0!==n&&g(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){const{get:n,set:a}=b(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return n?.call(this)},set(t){const s=n?.call(this);a.call(this,t),this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??v}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const e=m(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const e=this.properties,t=[...h(e),...p(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(d(e))}else void 0!==e&&t.push(d(e));return t}static _$Eu(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$ES??=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$ES?.splice(this._$ES.indexOf(e)>>>0,1)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return l(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$ES?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$ES?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t){const i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(void 0!==n&&!0===i.reflect){const a=(void 0!==i.converter?.toAttribute?i.converter:G).toAttribute(t,i.type);this._$Em=e,null==a?this.removeAttribute(n):this.setAttribute(n,a),this._$Em=null}}_$AK(e,t){const i=this.constructor,n=i._$Eh.get(e);if(void 0!==n&&this._$Em!==n){const e=i.getPropertyOptions(n),a="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:G;this._$Em=n,this[n]=a.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,i,n=!1,a){if(void 0!==e){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??A)(n?a:this[e],t))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e)!0!==i.wrapped||this._$AL.has(t)||void 0===this[t]||this.C(t,this[t],i)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$ES?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$ET()}catch(t){throw e=!1,this._$ET(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$ES?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EO(e,this[e]))),this._$ET()}updated(e){}firstUpdated(e){}}B.elementStyles=[],B.shadowRootOptions={mode:"open"},B[y("elementProperties")]=new Map,B[y("finalized")]=new Map,x?.({ReactiveElement:B}),(I.reactiveElementVersions??=[]).push("2.0.0")},3311:(e,t,i)=>{i.d(t,{Jb:()=>B,Ld:()=>Z,YP:()=>v,dy:()=>A,sY:()=>_});const n=globalThis,a=n.trustedTypes,s=a?a.createPolicy("lit-html",{createHTML:e=>e}):void 0,o="$lit$",r=`lit$${(Math.random()+"").slice(9)}$`,c="?"+r,l=`<${c}>`,d=document,u=()=>d.createComment(""),g=e=>null===e||"object"!=typeof e&&"function"!=typeof e,b=Array.isArray,h="[ \t\n\f\r]",p=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,m=/-->/g,I=/>/g,C=RegExp(`>|${h}(?:([^\\s"'>=/]+)(${h}*=${h}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),f=/'/g,x=/"/g,y=/^(?:script|style|textarea|title)$/i,G=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),A=G(1),v=G(2),B=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),Q=new WeakMap,w=d.createTreeWalker(d,129);function X(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(t):t}const k=(e,t)=>{const i=e.length-1,n=[];let a,s=2===t?"":"",c=p;for(let t=0;t"===u[0]?(c=a??p,g=-1):void 0===u[1]?g=-2:(g=c.lastIndex-u[2].length,d=u[1],c=void 0===u[3]?C:'"'===u[3]?x:f):c===x||c===f?c=C:c===m||c===I?c=p:(c=C,a=void 0);const h=c===C&&e[t+1].startsWith("/>")?" ":"";s+=c===p?i+l:g>=0?(n.push(d),i.slice(0,g)+o+i.slice(g)+r+h):i+r+(-2===g?t:h)}return[X(e,s+(e[i]||"")+(2===t?"":"")),n]};class W{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let s=0,l=0;const d=e.length-1,g=this.parts,[b,h]=k(e,t);if(this.el=W.createElement(b,i),w.currentNode=this.el.content,2===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=w.nextNode())&&g.length0){n.textContent=a?a.emptyScript:"";for(let i=0;ib(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Z&&g(this._$AH)?this._$AA.nextSibling.data=e:this.$(d.createTextNode(e)),this._$AH=e}g(e){const{values:t,_$litType$:i}=e,n="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=W.createElement(X(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(t);else{const e=new N(n,this),i=e.u(this.options);e.p(t),this.$(i),this._$AH=e}}_$AC(e){let t=Q.get(e.strings);return void 0===t&&Q.set(e.strings,t=new W(e)),t}T(e){b(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,n=0;for(const a of e)n===t.length?t.push(i=new E(this.k(u()),this.k(u()),this,this.options)):i=t[n],i._$AI(a),n++;n2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Z}_$AI(e,t=this,i,n){const a=this.strings;let s=!1;if(void 0===a)e=L(this,e,t,0),s=!g(e)||e!==this._$AH&&e!==B,s&&(this._$AH=e);else{const n=e;let o,r;for(e=a[0],o=0;o{const n=i?.renderBefore??t;let a=n._$litPart$;if(void 0===a){const e=i?.renderBefore??null;n._$litPart$=a=new E(t.insertBefore(u(),e),e,void 0,i??{})}return a._$AI(e),a}},9474:(e,t,i)=>{i.d(t,{Mo:()=>n,Cb:()=>r,SB:()=>c});const n=e=>(t,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)};var a=i(9912);const s={attribute:!0,type:String,converter:a.Ts,reflect:!1,hasChanged:a.Qu},o=(e=s,t,i)=>{const{kind:n,metadata:a}=i;let o=globalThis.litPropertyMetadata.get(a);if(void 0===o&&globalThis.litPropertyMetadata.set(a,o=new Map),o.set(i.name,e),"accessor"===n){const{name:n}=i;return{set(i){const a=t.get.call(this);t.set.call(this,i),this.requestUpdate(n,a,e)},init(t){return void 0!==t&&this.C(n,void 0,e),t}}}if("setter"===n){const{name:n}=i;return function(i){const a=this[n];t.call(this,i),this.requestUpdate(n,a,e)}}throw Error("Unsupported decorator location: "+n)};function r(e){return(t,i)=>"object"==typeof i?o(e,t,i):((e,t,i)=>{const n=t.hasOwnProperty(i);return t.constructor.createProperty(i,n?{...e,wrapped:!0}:e),n?Object.getOwnPropertyDescriptor(t,i):void 0})(e,t,i)}function c(e){return r({...e,state:!0,attribute:!1})}},8166:(e,t,i)=>{i.d(t,{oi:()=>s,iv:()=>n.iv,dy:()=>a.dy,YP:()=>a.YP});var n=i(9912),a=i(3311);class s extends n.fl{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=(0,a.sY)(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return a.Jb}}s._$litElement$=!0,s.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:s});const o=globalThis.litElementPolyfillSupport;o?.({LitElement:s}),(globalThis.litElementVersions??=[]).push("4.0.0")}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}};return i[e].call(s.exports,s,s.exports,a),s.exports}a.m=i,a.amdO={},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var i in t)a.o(t,i)&&!a.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,i)=>(a.f[i](e,t),t)),[])),a.u=e=>"0.0.209/"+(3046===e?"klarna-test-drive-badge":e)+".js",a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@klarna-web-sdk/lib:",a.l=(i,n,s,o)=>{if(e[i])e[i].push(n);else{var r,c;if(void 0!==s)for(var l=document.getElementsByTagName("script"),d=0;d{r.onerror=r.onload=null,clearTimeout(b);var a=e[i];if(delete e[i],r.parentNode&&r.parentNode.removeChild(r),a&&a.forEach((e=>e(n))),t)return t(n)},b=setTimeout(g.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=g.bind(null,r.onerror),r.onload=g.bind(null,r.onload),c&&document.head.appendChild(r)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e+"../"})(),(()=>{var e={5630:0};a.f.j=(t,i)=>{var n=a.o(e,t)?e[t]:void 0;if(0!==n)if(n)i.push(n[2]);else{var s=new Promise(((i,a)=>n=e[t]=[i,a]));i.push(n[2]=s);var o=a.p+a.u(t),r=new Error;a.l(o,(i=>{if(a.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var s=i&&("load"===i.type?"missing":i.type),o=i&&i.target&&i.target.src;r.message="Loading chunk "+t+" failed.\n("+s+": "+o+")",r.name="ChunkLoadError",r.type=s,r.request=o,n[1](r)}}),"chunk-"+t,t)}};var t=(t,i)=>{var n,s,[o,r,c]=i,l=0;if(o.some((t=>0!==e[t]))){for(n in r)a.o(r,n)&&(a.m[n]=r[n]);c&&c(a)}for(t&&t(i);l{a.d(s,{Z:()=>ro});var e={};a.r(e),a.d(e,{ALL:()=>c,DEBUG:()=>d,ERROR:()=>b,FATAL:()=>h,INFO:()=>u,OFF:()=>p,TRACE:()=>l,WARN:()=>g});const t={INIT:5,MERCHANT_WARN:5},i=e=>100*Math.random(){o(i,n={},a={})=>e(i,n,a,t);return{configure:({options:e,data:i={},instanceId:a})=>{n=i,f[t]||(f[t]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if("object"!==(void 0===e?"undefined":I(e))||!e)throw new TypeError("expected configuration object");var i=e.baseUrl,n=void 0===i?"https://eu.klarnaevt.com":i,a=e.client,s=e.clientVersion,f=e.sessionId,x=e.commonData,y=void 0===x?{}:x,G=e.instanceId,A=void 0===G?Math.floor(9e3*Math.random())+1e3:G,v=e.logLevel||c;if("string"!=typeof a)throw new TypeError("expected `client` in the configuration object");if("string"!=typeof s)throw new TypeError("expected `clientVersion` in the configuration object");if("string"!=typeof f)throw new TypeError("expected `sessionId` in the configuration object");if("number"!=typeof v||vp)throw new TypeError("invalid `logLevel` ("+v+")");function B(e){return Object.keys(e).sort().map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}function Z(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=arguments[2];if(!(v>(arguments.length>3&&void 0!==arguments[3]?arguments[3]:c))){if(!e)throw new TypeError("expected `name` as first parameter");var d=function(e,t){return""+n+C+a+"/"+s+"/"+e+"?"+B(t)}(e,i=m({},y,i,{iid:A,sid:f,timestamp:i.timestamp||(new Date).getTime()}));try{r.create(t,d,l)}catch(e){l&&(d+="&"+B(l)),o.create(t,d)}}}return{event:Z,trace:function(e,t,i){Z(e,t,i,l)},debug:function(e,t,i){Z(e,t,i,d)},info:function(e,t,i){Z(e,t,i,u)},warn:function(e,t,i){Z(e,t,i,g)},error:function(e,t,i){Z(e,t,i,b)},fatal:function(e,t,i){Z(e,t,i,h)},setLogLevel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;if("number"!=typeof e||ep)throw new TypeError("invalid `logLevel` ("+e+")");v=e},getConfig:function(){return{baseUrl:n,client:a,clientVersion:s,sessionId:f,instanceId:A,logLevel:v}}}}(y({...e,instanceId:a})))},event:a,trace:s(a,l),debug:s(a,d),info:s(a,u),warn:s(a,g),error:s(a,b),fatal:s(a,h),setLogLevel(n="ALL"){try{const a=n.toUpperCase();i=a in e?e[a]:c,f[t]&&f[t].setLogLevel(i)}catch(e){}},removeInstance(){f[t]&&delete f[t]}}}const y=({client:e="sdk",clientVersion:t="",sessionId:i="",instanceId:n,baseUrl:a=""})=>({client:e,clientVersion:t,environment:"production",sessionId:i,instanceId:n,baseUrl:a}),G="Klarna Web SDK:",A="color: black; background-color: #FFB3C7; padding: 2px;";function v(e){console.error(`%c${G} ${e}`,A),x(n.websdk).event("metric_merchant_error",{message:e})}function B(e){console.warn(`%c${G} ${e}`,A),i(t.MERCHANT_WARN)&&x(n.websdk).event("metric_merchant_warn",{message:e})}const Z={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Q;const w=new Uint8Array(16);function X(){if(!Q&&(Q="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Q))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Q(w)}const k=[];for(let e=0;e<256;++e)k.push((e+256).toString(16).slice(1));const W=function(e,t,i){if(Z.randomUUID&&!t&&!e)return Z.randomUUID();const n=(e=e||{}).random||(e.rng||X)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(let e=0;e<16;++e)t[i+e]=n[e];return t}return function(e,t=0){return k[e[t+0]]+k[e[t+1]]+k[e[t+2]]+k[e[t+3]]+"-"+k[e[t+4]]+k[e[t+5]]+"-"+k[e[t+6]]+k[e[t+7]]+"-"+k[e[t+8]]+k[e[t+9]]+"-"+k[e[t+10]]+k[e[t+11]]+k[e[t+12]]+k[e[t+13]]+k[e[t+14]]+k[e[t+15]]}(n)},L="klarna_initialize_messenger_handshake",N="klarna_initialize_messenger_handshake_complete",E=/(\.klarna\.com|\.klarna\.net|^x\.klarnacdn\.net)$/u;var F,U;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const i of e)t[i]=i;return t},e.getValidEnumValues=t=>{const i=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of i)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.push(i);return t},e.find=(e,t)=>{for(const i of e)if(t(i))return i},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(F||(F={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(U||(U={}));const R=F.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),O=e=>{switch(typeof e){case"undefined":return R.undefined;case"string":return R.string;case"number":return isNaN(e)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":return Array.isArray(e)?R.array:null===e?R.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?R.promise:"undefined"!=typeof Map&&e instanceof Map?R.map:"undefined"!=typeof Set&&e instanceof Set?R.set:"undefined"!=typeof Date&&e instanceof Date?R.date:R.object;default:return R.unknown}},S=F.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Y extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},i={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(n);else if("invalid_return_type"===a.code)n(a.returnTypeError);else if("invalid_arguments"===a.code)n(a.argumentsError);else if(0===a.path.length)i._errors.push(t(a));else{let e=i,n=0;for(;ne.message)){const t={},i=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}Y.create=e=>new Y(e);const _=(e,t)=>{let i;switch(e.code){case S.invalid_type:i=e.received===R.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case S.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(e.expected,F.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:i=`Unrecognized key(s) in object: ${F.joinValues(e.keys,", ")}`;break;case S.invalid_union:i="Invalid input";break;case S.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${F.joinValues(e.options)}`;break;case S.invalid_enum_value:i=`Invalid enum value. Expected ${F.joinValues(e.options)}, received '${e.received}'`;break;case S.invalid_arguments:i="Invalid function arguments";break;case S.invalid_return_type:i="Invalid function return type";break;case S.invalid_date:i="Invalid date";break;case S.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(i=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(i=`${i} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?i=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?i=`Invalid input: must end with "${e.validation.endsWith}"`:F.assertNever(e.validation):i="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case S.too_small:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case S.too_big:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case S.custom:i="Invalid input";break;case S.invalid_intersection_types:i="Intersection results could not be merged";break;case S.not_multiple_of:i=`Number must be a multiple of ${e.multipleOf}`;break;case S.not_finite:i="Number must be finite";break;default:i=t.defaultError,F.assertNever(e)}return{message:i}};let D=_;function V(e,t){const i=(e=>{const{data:t,path:i,errorMaps:n,issueData:a}=e,s=[...i,...a.path||[]],o={...a,path:s};let r="";const c=n.filter((e=>!!e)).slice().reverse();for(const e of c)r=e(o,{data:t,defaultError:r}).message;return{...a,path:s,message:a.message||r}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,D,_].filter((e=>!!e))});e.common.issues.push(i)}class T{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const n of t){if("aborted"===n.status)return H;"dirty"===n.status&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const e of t)i.push({key:await e.key,value:await e.value});return T.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const n of t){const{key:t,value:a}=n;if("aborted"===t.status)return H;if("aborted"===a.status)return H;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!n.alwaysSet||(i[t.value]=a.value)}return{status:e.value,value:i}}}const H=Object.freeze({status:"aborted"}),J=e=>({status:"valid",value:e}),M=e=>"aborted"===e.status,j=e=>"dirty"===e.status,z=e=>"valid"===e.status,P=e=>"undefined"!=typeof Promise&&e instanceof Promise;var $;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}($||($={}));class K{constructor(e,t,i,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const q=(e,t)=>{if(z(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Y(e.common.issues);return this._error=t,this._error}}};function ee(e){if(!e)return{};const{errorMap:t,invalid_type_error:i,required_error:n,description:a}=e;if(t&&(i||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:a}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=i?i:t.defaultError},description:a}}class te{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return O(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:O(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new T,ctx:{common:e.parent.common,data:e.data,parsedType:O(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(P(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;const n={common:{issues:[],async:null!==(i=null==t?void 0:t.async)&&void 0!==i&&i,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:O(e)},a=this._parseSync({data:e,path:n.path,parent:n});return q(n,a)}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:O(e)},n=this._parse({data:e,path:i.path,parent:i}),a=await(P(n)?n:Promise.resolve(n));return q(i,a)}refine(e,t){const i=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const a=e(t),s=()=>n.addIssue({code:S.custom,...i(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(s(),!1))):!!a||(s(),!1)}))}refinement(e,t){return this._refinement(((i,n)=>!!e(i)||(n.addIssue("function"==typeof t?t(i,n):t),!1)))}_refinement(e){return new Oe({schema:this,typeName:Me.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Se.create(this,this._def)}nullable(){return Ye.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ae.create(this,this._def)}promise(){return Re.create(this,this._def)}or(e){return Ze.create([this,e],this._def)}and(e){return we.create(this,e,this._def)}transform(e){return new Oe({...ee(this._def),schema:this,typeName:Me.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new _e({...ee(this._def),innerType:this,defaultValue:t,typeName:Me.ZodDefault})}brand(){return new Te({typeName:Me.ZodBranded,type:this,...ee(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new De({...ee(this._def),innerType:this,catchValue:t,typeName:Me.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return He.create(this,e)}readonly(){return Je.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ie=/^c[^\s-]{8,}$/i,ne=/^[a-z][a-z0-9]*$/,ae=/^[0-9A-HJKMNP-TV-Z]{26}$/,se=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,oe=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let re;const ce=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,le=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class de extends te{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==R.string){const t=this._getOrReturnCtx(e);return V(t,{code:S.invalid_type,expected:R.string,received:t.parsedType}),H}const t=new T;let i;for(const o of this._def.checks)if("min"===o.kind)e.data.lengtho.value&&(i=this._getOrReturnCtx(e,i),V(i,{code:S.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),t.dirty());else if("length"===o.kind){const n=e.data.length>o.value,a=e.data.lengthe.test(t)),{validation:t,code:S.invalid_string,...$.errToObj(i)})}_addCheck(e){return new de({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...$.errToObj(e)})}url(e){return this._addCheck({kind:"url",...$.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...$.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...$.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...$.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...$.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...$.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...$.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...$.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...$.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...$.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...$.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...$.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...$.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...$.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...$.errToObj(t)})}nonempty(e){return this.min(1,$.errToObj(e))}trim(){return new de({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new de({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new de({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuen?i:n;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}de.create=e=>{var t;return new de({checks:[],typeName:Me.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...ee(e)})};class ge extends te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==R.number){const t=this._getOrReturnCtx(e);return V(t,{code:S.invalid_type,expected:R.number,received:t.parsedType}),H}let t;const i=new T;for(const n of this._def.checks)"int"===n.kind?F.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),V(t,{code:S.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),V(t,{code:S.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):"multipleOf"===n.kind?0!==ue(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),V(t,{code:S.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),V(t,{code:S.not_finite,message:n.message}),i.dirty()):F.assertNever(n);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,$.toString(t))}gt(e,t){return this.setLimit("min",e,!1,$.toString(t))}lte(e,t){return this.setLimit("max",e,!0,$.toString(t))}lt(e,t){return this.setLimit("max",e,!1,$.toString(t))}setLimit(e,t,i,n){return new ge({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:$.toString(n)}]})}_addCheck(e){return new ge({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:$.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:$.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:$.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&F.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if("finite"===i.kind||"int"===i.kind||"multipleOf"===i.kind)return!0;"min"===i.kind?(null===t||i.value>t)&&(t=i.value):"max"===i.kind&&(null===e||i.valuenew ge({checks:[],typeName:Me.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...ee(e)});class be extends te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==R.bigint){const t=this._getOrReturnCtx(e);return V(t,{code:S.invalid_type,expected:R.bigint,received:t.parsedType}),H}let t;const i=new T;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),V(t,{code:S.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),V(t,{code:S.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):F.assertNever(n);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,$.toString(t))}gt(e,t){return this.setLimit("min",e,!1,$.toString(t))}lte(e,t){return this.setLimit("max",e,!0,$.toString(t))}lt(e,t){return this.setLimit("max",e,!1,$.toString(t))}setLimit(e,t,i,n){return new be({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:$.toString(n)}]})}_addCheck(e){return new be({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:$.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new be({checks:[],typeName:Me.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...ee(e)})};class he extends te{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==R.boolean){const t=this._getOrReturnCtx(e);return V(t,{code:S.invalid_type,expected:R.boolean,received:t.parsedType}),H}return J(e.data)}}he.create=e=>new he({typeName:Me.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...ee(e)});class pe extends te{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==R.date){const t=this._getOrReturnCtx(e);return V(t,{code:S.invalid_type,expected:R.date,received:t.parsedType}),H}if(isNaN(e.data.getTime()))return V(this._getOrReturnCtx(e),{code:S.invalid_date}),H;const t=new T;let i;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()n.value&&(i=this._getOrReturnCtx(e,i),V(i,{code:S.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):F.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new pe({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:$.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:$.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew pe({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Me.ZodDate,...ee(e)});class me extends te{_parse(e){if(this._getType(e)!==R.symbol){const t=this._getOrReturnCtx(e);return V(t,{code:S.invalid_type,expected:R.symbol,received:t.parsedType}),H}return J(e.data)}}me.create=e=>new me({typeName:Me.ZodSymbol,...ee(e)});class Ie extends te{_parse(e){if(this._getType(e)!==R.undefined){const t=this._getOrReturnCtx(e);return V(t,{code:S.invalid_type,expected:R.undefined,received:t.parsedType}),H}return J(e.data)}}Ie.create=e=>new Ie({typeName:Me.ZodUndefined,...ee(e)});class Ce extends te{_parse(e){if(this._getType(e)!==R.null){const t=this._getOrReturnCtx(e);return V(t,{code:S.invalid_type,expected:R.null,received:t.parsedType}),H}return J(e.data)}}Ce.create=e=>new Ce({typeName:Me.ZodNull,...ee(e)});class fe extends te{constructor(){super(...arguments),this._any=!0}_parse(e){return J(e.data)}}fe.create=e=>new fe({typeName:Me.ZodAny,...ee(e)});class xe extends te{constructor(){super(...arguments),this._unknown=!0}_parse(e){return J(e.data)}}xe.create=e=>new xe({typeName:Me.ZodUnknown,...ee(e)});class ye extends te{_parse(e){const t=this._getOrReturnCtx(e);return V(t,{code:S.invalid_type,expected:R.never,received:t.parsedType}),H}}ye.create=e=>new ye({typeName:Me.ZodNever,...ee(e)});class Ge extends te{_parse(e){if(this._getType(e)!==R.undefined){const t=this._getOrReturnCtx(e);return V(t,{code:S.invalid_type,expected:R.void,received:t.parsedType}),H}return J(e.data)}}Ge.create=e=>new Ge({typeName:Me.ZodVoid,...ee(e)});class Ae extends te{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),n=this._def;if(t.parsedType!==R.array)return V(t,{code:S.invalid_type,expected:R.array,received:t.parsedType}),H;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,a=t.data.lengthn.maxLength.value&&(V(t,{code:S.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map(((e,i)=>n.type._parseAsync(new K(t,e,t.path,i))))).then((e=>T.mergeArray(i,e)));const a=[...t.data].map(((e,i)=>n.type._parseSync(new K(t,e,t.path,i))));return T.mergeArray(i,a)}get element(){return this._def.type}min(e,t){return new Ae({...this._def,minLength:{value:e,message:$.toString(t)}})}max(e,t){return new Ae({...this._def,maxLength:{value:e,message:$.toString(t)}})}length(e,t){return new Ae({...this._def,exactLength:{value:e,message:$.toString(t)}})}nonempty(e){return this.min(1,e)}}function ve(e){if(e instanceof Be){const t={};for(const i in e.shape){const n=e.shape[i];t[i]=Se.create(ve(n))}return new Be({...e._def,shape:()=>t})}return e instanceof Ae?new Ae({...e._def,type:ve(e.element)}):e instanceof Se?Se.create(ve(e.unwrap())):e instanceof Ye?Ye.create(ve(e.unwrap())):e instanceof Xe?Xe.create(e.items.map((e=>ve(e)))):e}Ae.create=(e,t)=>new Ae({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Me.ZodArray,...ee(t)});class Be extends te{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=F.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==R.object){const t=this._getOrReturnCtx(e);return V(t,{code:S.invalid_type,expected:R.object,received:t.parsedType}),H}const{status:t,ctx:i}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof ye&&"strip"===this._def.unknownKeys))for(const e in i.data)a.includes(e)||s.push(e);const o=[];for(const e of a){const t=n[e],a=i.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new K(i,a,i.path,e)),alwaysSet:e in i.data})}if(this._def.catchall instanceof ye){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)o.push({key:{status:"valid",value:e},value:{status:"valid",value:i.data[e]}});else if("strict"===e)s.length>0&&(V(i,{code:S.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const n=i.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new K(i,n,i.path,t)),alwaysSet:t in i.data})}}return i.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of o){const i=await t.key;e.push({key:i,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>T.mergeObjectSync(t,e))):T.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return $.errToObj,new Be({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,i)=>{var n,a,s,o;const r=null!==(s=null===(a=(n=this._def).errorMap)||void 0===a?void 0:a.call(n,t,i).message)&&void 0!==s?s:i.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=$.errToObj(e).message)&&void 0!==o?o:r}:{message:r}}}:{}})}strip(){return new Be({...this._def,unknownKeys:"strip"})}passthrough(){return new Be({...this._def,unknownKeys:"passthrough"})}extend(e){return new Be({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Be({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Me.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Be({...this._def,catchall:e})}pick(e){const t={};return F.objectKeys(e).forEach((i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])})),new Be({...this._def,shape:()=>t})}omit(e){const t={};return F.objectKeys(this.shape).forEach((i=>{e[i]||(t[i]=this.shape[i])})),new Be({...this._def,shape:()=>t})}deepPartial(){return ve(this)}partial(e){const t={};return F.objectKeys(this.shape).forEach((i=>{const n=this.shape[i];e&&!e[i]?t[i]=n:t[i]=n.optional()})),new Be({...this._def,shape:()=>t})}required(e){const t={};return F.objectKeys(this.shape).forEach((i=>{if(e&&!e[i])t[i]=this.shape[i];else{let e=this.shape[i];for(;e instanceof Se;)e=e._def.innerType;t[i]=e}})),new Be({...this._def,shape:()=>t})}keyof(){return Ee(F.objectKeys(this.shape))}}Be.create=(e,t)=>new Be({shape:()=>e,unknownKeys:"strip",catchall:ye.create(),typeName:Me.ZodObject,...ee(t)}),Be.strictCreate=(e,t)=>new Be({shape:()=>e,unknownKeys:"strict",catchall:ye.create(),typeName:Me.ZodObject,...ee(t)}),Be.lazycreate=(e,t)=>new Be({shape:e,unknownKeys:"strip",catchall:ye.create(),typeName:Me.ZodObject,...ee(t)});class Ze extends te{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;if(t.common.async)return Promise.all(i.map((async e=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const i of e)if("dirty"===i.result.status)return t.common.issues.push(...i.ctx.common.issues),i.result;const i=e.map((e=>new Y(e.ctx.common.issues)));return V(t,{code:S.invalid_union,unionErrors:i}),H}));{let e;const n=[];for(const a of i){const i={...t,common:{...t.common,issues:[]},parent:null},s=a._parseSync({data:t.data,path:t.path,parent:i});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:i}),i.common.issues.length&&n.push(i.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=n.map((e=>new Y(e)));return V(t,{code:S.invalid_union,unionErrors:a}),H}}get options(){return this._def.options}}function Qe(e,t){const i=O(e),n=O(t);if(e===t)return{valid:!0,data:e};if(i===R.object&&n===R.object){const i=F.objectKeys(t),n=F.objectKeys(e).filter((e=>-1!==i.indexOf(e))),a={...e,...t};for(const i of n){const n=Qe(e[i],t[i]);if(!n.valid)return{valid:!1};a[i]=n.data}return{valid:!0,data:a}}if(i===R.array&&n===R.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let n=0;nnew Ze({options:e,typeName:Me.ZodUnion,...ee(t)});class we extends te{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),n=(e,n)=>{if(M(e)||M(n))return H;const a=Qe(e.value,n.value);return a.valid?((j(e)||j(n))&&t.dirty(),{status:t.value,value:a.data}):(V(i,{code:S.invalid_intersection_types}),H)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}we.create=(e,t,i)=>new we({left:e,right:t,typeName:Me.ZodIntersection,...ee(i)});class Xe extends te{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==R.array)return V(i,{code:S.invalid_type,expected:R.array,received:i.parsedType}),H;if(i.data.lengththis._def.items.length&&(V(i,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...i.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new K(i,e,i.path,t)):null})).filter((e=>!!e));return i.common.async?Promise.all(n).then((e=>T.mergeArray(t,e))):T.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new Xe({...this._def,rest:e})}}Xe.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xe({items:e,typeName:Me.ZodTuple,rest:null,...ee(t)})};class ke extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==R.map)return V(i,{code:S.invalid_type,expected:R.map,received:i.parsedType}),H;const n=this._def.keyType,a=this._def.valueType,s=[...i.data.entries()].map((([e,t],s)=>({key:n._parse(new K(i,e,i.path,[s,"key"])),value:a._parse(new K(i,t,i.path,[s,"value"]))})));if(i.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const i of s){const n=await i.key,a=await i.value;if("aborted"===n.status||"aborted"===a.status)return H;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const i of s){const n=i.key,a=i.value;if("aborted"===n.status||"aborted"===a.status)return H;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}}}ke.create=(e,t,i)=>new ke({valueType:t,keyType:e,typeName:Me.ZodMap,...ee(i)});class We extends te{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==R.set)return V(i,{code:S.invalid_type,expected:R.set,received:i.parsedType}),H;const n=this._def;null!==n.minSize&&i.data.sizen.maxSize.value&&(V(i,{code:S.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function s(e){const i=new Set;for(const n of e){if("aborted"===n.status)return H;"dirty"===n.status&&t.dirty(),i.add(n.value)}return{status:t.value,value:i}}const o=[...i.data.values()].map(((e,t)=>a._parse(new K(i,e,i.path,t))));return i.common.async?Promise.all(o).then((e=>s(e))):s(o)}min(e,t){return new We({...this._def,minSize:{value:e,message:$.toString(t)}})}max(e,t){return new We({...this._def,maxSize:{value:e,message:$.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}We.create=(e,t)=>new We({valueType:e,minSize:null,maxSize:null,typeName:Me.ZodSet,...ee(t)});class Le extends te{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Le.create=(e,t)=>new Le({getter:e,typeName:Me.ZodLazy,...ee(t)});class Ne extends te{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return V(t,{received:t.data,code:S.invalid_literal,expected:this._def.value}),H}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ee(e,t){return new Fe({values:e,typeName:Me.ZodEnum,...ee(t)})}Ne.create=(e,t)=>new Ne({value:e,typeName:Me.ZodLiteral,...ee(t)});class Fe extends te{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),i=this._def.values;return V(t,{expected:F.joinValues(i),received:t.parsedType,code:S.invalid_type}),H}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),i=this._def.values;return V(t,{received:t.data,code:S.invalid_enum_value,options:i}),H}return J(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Fe.create(e)}exclude(e){return Fe.create(this.options.filter((t=>!e.includes(t))))}}Fe.create=Ee;class Ue extends te{_parse(e){const t=F.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==R.string&&i.parsedType!==R.number){const e=F.objectValues(t);return V(i,{expected:F.joinValues(e),received:i.parsedType,code:S.invalid_type}),H}if(-1===t.indexOf(e.data)){const e=F.objectValues(t);return V(i,{received:i.data,code:S.invalid_enum_value,options:e}),H}return J(e.data)}get enum(){return this._def.values}}Ue.create=(e,t)=>new Ue({values:e,typeName:Me.ZodNativeEnum,...ee(t)});class Re extends te{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==R.promise&&!1===t.common.async)return V(t,{code:S.invalid_type,expected:R.promise,received:t.parsedType}),H;const i=t.parsedType===R.promise?t.data:Promise.resolve(t.data);return J(i.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Re.create=(e,t)=>new Re({type:e,typeName:Me.ZodPromise,...ee(t)});class Oe extends te{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Me.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:e=>{V(i,e),e.fatal?t.abort():t.dirty()},get path(){return i.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===n.type){const e=n.transform(i.data,a);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:i.path,parent:i}))):this._def.schema._parseSync({data:e,path:i.path,parent:i})}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,a);if(i.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===i.common.async){const n=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===n.status?H:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((i=>"aborted"===i.status?H:("dirty"===i.status&&t.dirty(),e(i.value).then((()=>({status:t.value,value:i.value}))))))}if("transform"===n.type){if(!1===i.common.async){const e=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!z(e))return e;const s=n.transform(e.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((e=>z(e)?Promise.resolve(n.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}F.assertNever(n)}}Oe.create=(e,t,i)=>new Oe({schema:e,typeName:Me.ZodEffects,effect:t,...ee(i)}),Oe.createWithPreprocess=(e,t,i)=>new Oe({schema:t,effect:{type:"preprocess",transform:e},typeName:Me.ZodEffects,...ee(i)});class Se extends te{_parse(e){return this._getType(e)===R.undefined?J(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Se.create=(e,t)=>new Se({innerType:e,typeName:Me.ZodOptional,...ee(t)});class Ye extends te{_parse(e){return this._getType(e)===R.null?J(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ye.create=(e,t)=>new Ye({innerType:e,typeName:Me.ZodNullable,...ee(t)});class _e extends te{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===R.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}_e.create=(e,t)=>new _e({innerType:e,typeName:Me.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...ee(t)});class De extends te{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return P(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new Y(i.common.issues)},input:i.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new Y(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}De.create=(e,t)=>new De({innerType:e,typeName:Me.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...ee(t)});class Ve extends te{_parse(e){if(this._getType(e)!==R.nan){const t=this._getOrReturnCtx(e);return V(t,{code:S.invalid_type,expected:R.nan,received:t.parsedType}),H}return{status:"valid",value:e.data}}}Ve.create=e=>new Ve({typeName:Me.ZodNaN,...ee(e)}),Symbol("zod_brand");class Te extends te{_parse(e){const{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class He extends te{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?H:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseAsync({data:e.value,path:i.path,parent:i})})();{const e=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?H:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:i.path,parent:i})}}static create(e,t){return new He({in:e,out:t,typeName:Me.ZodPipeline})}}class Je extends te{_parse(e){const t=this._def.innerType._parse(e);return z(t)&&(t.value=Object.freeze(t.value)),t}}var Me;Je.create=(e,t)=>new Je({innerType:e,typeName:Me.ZodReadonly,...ee(t)}),Be.lazycreate,function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Me||(Me={}));const je=de.create,ze=ge.create,Pe=(Ve.create,be.create,he.create),$e=(pe.create,me.create,Ie.create),Ke=(Ce.create,fe.create,xe.create),qe=(ye.create,Ge.create,Ae.create),et=Be.create,tt=(Be.strictCreate,Ze.create),it=(we.create,Xe.create,ke.create,We.create,Le.create,Ne.create);Fe.create,Ue.create,Re.create,Oe.create,Se.create,Ye.create,Oe.createWithPreprocess,He.create;const nt=et({messageId:je(),method:je(),data:Ke()}),at=et({messageId:je(),method:je(),origin:je(),reject:je().or($e()),resolve:Ke().or($e())});class st{static isIframe(e){try{return!!e.contentWindow}catch(e){return!1}}constructor({source:e,target:t}){this.handshakeComplete=!1,this.callbacks=new Map,this.source=e,this.target=t;const{port1:i,port2:n}=new MessageChannel;this.sourcePort=i,this.targetPort=n,this.sourcePort.onmessage=this.onMessageFromTarget.bind(this)}onMessageFromTarget(e){if(e.data===N)return void(this.handshakeComplete=!0);const t=at.safeParse(e.data);if(!t.success)return void v("Invalid data schema received from target");const i=this.callbacks.get(t.data.messageId);if(!i)return void v(`Callback not available for method: ${t.data.method}`);const{reject:n,resolve:a,method:s}=t.data;void 0!==n?i.reject(n):void 0!==a?i.resolve(a):v(`No resolution available for method: ${s}`)}waitForHandshake(){return new Promise(((e,t)=>{const i=setTimeout((()=>{t(new Error("Handshake timeout"))}),5e3),n=setInterval((()=>{this.handshakeComplete&&(clearTimeout(i),clearInterval(n),e(!0))}),100)}))}async postMessageToTarget({method:e,data:t}){const i=W(),n={messageId:i,method:e,data:t};return this.sourcePort.postMessage(n),new Promise(((e,t)=>{this.callbacks.set(i,{resolve:e,reject:t})}))}async initiateHandshake(){st.isIframe(this.target)?this.target.contentWindow?.postMessage({type:L},"*",[this.targetPort]):this.target.postMessage({type:L},"*",[this.targetPort]),await this.waitForHandshake()}destroy(){this.sourcePort.close(),this.targetPort.close()}}class ot{constructor({validateOrigin:e=!0,removeListenerAfterHandshake:t=!0}){this.handlers=new Map,this.handshakeComplete=!1;const i=n=>{n.data.type===L&&n.ports[0]?.postMessage&&(!e||["development","test"].includes("production")||E.test(new URL(n.origin).hostname))&&(this.port=n.ports[0],this.port.postMessage(N),this.port.onmessage=this.onMessageFromSource.bind(this),this.sourceOrigin=n.origin,this.handshakeComplete=!0,t&&window.removeEventListener("message",i))};window.addEventListener("message",i)}waitForHandshake(){return new Promise((e=>{const t=setInterval((()=>{this.handshakeComplete&&(clearInterval(t),e(!0))}),100)}))}async sendMessageToSource(e){this.handshakeComplete||await this.waitForHandshake(),this.port.postMessage(e)}async onMessageFromSource(e){const{messageId:t,method:i,data:n}=nt.parse(e.data),a={messageId:t,method:i,origin:this.sourceOrigin,reject:void 0,resolve:void 0},s=this.handlers.get(i);if(!s)return a.reject=`Unhandled method: ${i}, add appropriate handler.`,void this.sendMessageToSource(a);try{a.resolve=await s({data:n,config:{sourceOrigin:this.sourceOrigin}})}catch(e){a.reject=String(e)}this.sendMessageToSource(a)}registerHandler(e,t){this.handlers.set(e,t)}}const rt="klarna-communication-iframe",ct=new class{constructor(){this.initialized=!1}async createTarget(e){return new Promise(((t,i)=>{try{const i=`${e}backend_bridge_iframe.html`,n=document.querySelector(`#${rt}`);n&&t({target:n,src:i});const a=document.createElement("iframe");a.src=i,a.id=rt,a.style.cssText="display:none!important",document.body.appendChild(a),a.onload=()=>t({target:a,src:i})}catch(e){i(e)}}))}async init(){if(!this.config)throw new Error("BackendBridge: config is missing");try{const{target:e}=await this.createTarget(this.config.baseUrl);this.messenger=new st({source:window,target:e}),await this.messenger.initiateHandshake(),this.initialized=!0,await this.call({method:"paymentApiSetup",data:this.config})}catch(e){throw new Error(`BackendBridge init failed: ${e}`)}}setConfig(e){this.config=e}async call(e){return this.initialized||await this.init(),this.messenger.postMessageToTarget({method:e.method,data:e.data})}};class lt{constructor(e,t){const i=document.createElement(e),n=document.createElement("span");if(i.appendChild(n),t){const{id:e,...n}=t;Object.assign(i.dataset,n),e&&(this.id=e,i.id=e,i.removeAttribute("data-id"))}this.htmlElement=i}mount(e){return this.containerElement="string"==typeof e?document.querySelector(e):e,this.containerElement instanceof HTMLElement?(this.containerElement.appendChild(this.htmlElement),this.getPublicAPI()):(v("Missing valid `container`"),this)}unmount(){return this.containerElement&&this.containerElement.hasChildNodes()?(this.containerElement.removeChild(this.htmlElement),this.getPublicAPI()):(B("Element not mounted"),this.getPublicAPI())}getPublicAPI(){return{mount:this.mount.bind(this),unmount:this.unmount.bind(this),htmlElement:this.htmlElement,id:this.id}}}var dt,ut,gt,bt,ht;!function(e){e.PAYMENT_BUTTON="klarna-payment-button",e.IDENTITY_BUTTON="klarna-identity-button",e.PLACEMENT="klarna-placement"}(dt||(dt={})),function(e){e.IDENTITY="identity",e.PAYMENT="payment"}(ut||(ut={})),function(e){e.DEFAULT="default",e.LIGHT="light",e.DARK="dark"}(gt||(gt={})),function(e){e.DEFAULT="default",e.PILL="pill",e.RECT="rect"}(bt||(bt={})),function(e){e.CHECKOUT="checkout",e.CUSTOM_TYPE_0="custom-type0",e.CUSTOM_TYPE_1="custom-type1",e.CUSTOM_TYPE_0_INLINE="custom-type0-inline",e.CUSTOM_TYPE_2_INLINE="custom-type2-inline",e.CUSTOM_TYPE_3_INLINE="custom-type3-inline",e.CUSTOM_TYPE_1_335_AUTO="custom-type1-335-auto",e.CUSTOM_TYPE_3_335_AUTO="custom-type3-335-auto",e.TOP_STRIP_PROMOTION_AUTO_SIZE="top-strip-promotion-auto-size",e.TOP_STRIP_PROMOTION_STANDARD="top-strip-promotion-standard",e.TOP_STRIP_PROMOTION_BADGE="top-strip-promotion-badge",e.CREDIT_PROMOTION_SMALL="credit-promotion-small",e.CREDIT_PROMOTION_STANDARD="credit-promotion-standard",e.CREDIT_PROMOTION_INLINE="credit-promotion-inline",e.CREDIT_PROMOTION_AUTO_SIZE="credit-promotion-auto-size",e.CREDIT_PROMOTION_BADGE="credit-promotion-badge",e.SIDEBAR_PROMOTION_AUTO_SIZE="sidebar-promotion-auto-size",e.FOOTER_PROMOTION_AUTO_SIZE="footer-promotion-auto-size",e.INFO_PAGE="info-page",e.HOMEPAGE_PROMOTION_TALL="homepage-promotion-tall",e.HOMEPAGE_PROMOTION_WIDE="homepage-promotion-wide",e.HOMEPAGE_PROMOTION_BOX="homepage-promotion-box"}(ht||(ht={}));const pt={production:"https://js.klarna.com",playground:"https://js.playground.klarna.com",staging:"https://x.nonprod.us1.js.klarna.net",development:"https://x.nonprod.us1.js.klarna.net"};var mt;!function(e){e.fatal="fatal",e.error="error",e.warning="warning",e.log="log",e.info="info",e.debug="debug",e.critical="critical"}(mt||(mt={}));const It=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ct=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,ft=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,xt="?",yt=/^(?:(\w+):)\/\/(?:([\w-]+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Gt(e){return(e&&e.message||"No error message").split("\n").filter((e=>!!e))[0]}function At(e){try{const t=function(e){if(!e.stack)return null;const t=[],i=e.stack.split("\n");let n,a;for(let s=0;s{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),sdk:{name:"micro-sentry.javascript.core",version:"0.0.0"},timestamp:Date.now()/1e3,environment:this.environment}}}function Bt(e,t){return"[object RegExp]"===Object.prototype.toString.call(t)?t.test(e):"string"==typeof t&&-1!==e.indexOf(t)}function Zt(){return window}class Qt extends vt{constructor(e,t=Zt()){super(e),this.options=e,this.window=t,this.destroyed=!1,this._state={};const{plugins:i=[],beforeSend:n=(e=>e),beforeBreadcrumb:a=(e=>e),blacklistUrls:s=[],ignoreErrors:o=[],release:r}=this.options||{};this.plugins=i.map((e=>new e(this))),this.beforeSend=n,this.beforeBreadcrumb=a,this.blacklistUrls=s,this.ignoreErrors=o,this.release=r}get state(){return this._state}clearState(){this._state={}}setTags(e){return this.setKeyState("tags",{...e}),this}setTag(e,t){return this.extendState({tags:{[e]:t}}),this}setExtra(e,t){return this.extendState({extra:{[e]:t}}),this}setExtras(e){return this.setKeyState("extra",{...e}),this}setUser(e){return this.setKeyState("user",{...e}),this}clone(){const e=new Qt({...this.options,plugins:[]});return e.extendState(this.state),e}withScope(e){const t=this.clone();e(t),t.destroy(),this.setBreadcrumbs(void 0)}addBreadcrumb(e){this.extendState({breadcrumbs:[{timestamp:Date.now()/1e3,...this.beforeBreadcrumb(e)}]})}setBreadcrumbs(e){this.setKeyState("breadcrumbs",e)}captureMessage(e,t){this.send({...this.getRequestBlank(),message:e,level:t})}destroy(){this.destroyed=!0,this.plugins.forEach((e=>{e.destroy&&e.destroy()}))}isIgnoredError(e){return!!this.ignoreErrors.length&&this.getPossibleEventMessages(e).some((e=>this.ignoreErrors.some((t=>Bt(e,t)))))}getRequestBlank(){return{request:{url:this.window.location.toString(),headers:{"User-Agent":this.window.navigator.userAgent}},...super.getRequestBlank(),sdk:{name:"micro-sentry.javascript.browser",version:"0.0.0"},...this.state}}send(e){this.destroyed||this.isDeniedUrl(e)||this.isIgnoredError(e)||(super.send(this.beforeSend({release:this.release,...e})),this.setBreadcrumbs(void 0))}getPossibleEventMessages(e){if(e.message)return[e.message];if(e.exception)try{const{type:t="",value:i=""}=e.exception.values&&e.exception.values[0]||{};return[`${i}`,`${t}: ${i}`]}catch(e){return[]}return[]}isDeniedUrl(e){if(!this.blacklistUrls.length)return!1;const t=this.getEventFilterUrl(e);return!!t&&this.blacklistUrls.some((e=>Bt(t,e)))}getEventFilterUrl(e){try{if(e.exception){const t=e.exception.values&&e.exception.values[0].stacktrace&&e.exception.values[0].stacktrace.frames;return t&&t[t.length-1].filename||null}return null}catch(e){return null}}extendState(e){this._state=Object.keys(e).reduce(((t,i)=>{const n=this._state[i],a=Array.isArray(n)?n:null,s=e[i],o=Array.isArray(s)?s:null;return{...t,[i]:a||o?[...a||[],...o||[]]:{..."string"!=typeof n?n:{},..."string"!=typeof s?s:{}}}}),this._state)}setKeyState(e,t){this._state[e]=t}}var wt,Xt;!function(e){e.SENTRY_NOT_CONFIGURED="sentry_not_configured"}(wt||(wt={})),function(e){e.sessionStorageNotSupported="sessionStorage-not-supported",e.localStorageNotSupported="localStorage-not-supported",e.dynamicImportFailed="dynamic-import-failed",e.multipleCustomElementsWithSameTagName="multiple-custom-elements-same-tag-name",e.unexpectedTokenMethodParamsList="unexpected-token-method-params-list",e.missingColonAfterPropertyId="missing-colon-after-property-id",e.unexpectedTokenEqual="unexpected-token-equal",e.expectedExpressionGotEqual="expected-expression-got-equal"}(Xt||(Xt={}));const kt=["https://s3.int.klarna.net","https://js.klarna.com","https://x.klarnacdn.net","https://x.nonprod.us1.js.klarna.net","https://osm.klarnaservices.com","https://eu-assets.playground.klarnaservices.com","https://na-assets.playground.klarnaservices.com","https://ap-assets.playground.klarnaservices.com"],Wt=e=>kt.some((t=>e.startsWith(t))),Lt=["Unexpected token '","Storage type: ","Failed to fetch dynamically imported module","Missing runtime config","Failed to execute 'define","Importing a module script failed.","NetworkError when attempting to fetch resource"];let Nt;const Et={report:console.log,setTags:()=>{},setTag:()=>{}},Ft=({version:e,environment:t,tags:n})=>("staging"===t?Nt=Et:Nt||(Nt=new Qt({dsn:"https://6fdc8e6e634d4a998b6f0dbfd7b025e1@o24547.ingest.sentry.io/4505471301713920",release:e,environment:t,beforeSend:e=>{e.exception?.values?.forEach((({value:t})=>{e.fingerprint=(e=>{switch(e){case"Storage type: sessionStorage not supported":return[Xt.sessionStorageNotSupported];case"Storage type: localStorage not supported":return[Xt.localStorageNotSupported];case"Cannot define multiple custom elements with the same tag name":return[Xt.multipleCustomElementsWithSameTagName];case"Unexpected token ';'. Expected an opening '(' before a method's parameter list.":return[Xt.unexpectedTokenMethodParamsList];case e.match(/Failed to fetch dynamically imported module/)?.input:return[Xt.dynamicImportFailed];case e.match("missing : after property id")?.input:return[Xt.missingColonAfterPropertyId];case e.match("Unexpected token '='")?.input:return[Xt.unexpectedTokenEqual];case e.match("expected expression, got '='")?.input:return[Xt.expectedExpressionGotEqual];case e.match(/error loading dynamically imported module/)?.input:return[Xt.dynamicImportFailed]}})(t)}));const t=(e=>{let t=!0;return e.exception?.values?.forEach((({stacktrace:e})=>{e?.frames?.forEach((({filename:e})=>{t=!Wt(e)}))})),t?null:e})(e);return t?(e=>{let t=!0;return e.exception?.values?.forEach((({value:e})=>{Lt.forEach((n=>{e.includes(n)&&(t=i(5))}))})),t?e:null})(t):null},blacklistUrls:[/pagead\/js/i,/graph\.facebook\.com/i,/connect\.facebook\.net\/en_US\/all\.js/i,/extensions\//i,/^chrome:\/\//i,/metrics\.itunes\.apple\.com\.edgesuite\.net\//i]})),n&&Object.entries(n).forEach((([e,t])=>{t&&Nt.setTag(e,t.toString())})),Nt),Ut=()=>Nt||(((e,t,i=n.websdk)=>{const a=x(i);try{a.event("error",{message:t,name_1:e})}catch{}})(wt.SENTRY_NOT_CONFIGURED,"Sentry client not initialized"),Et);function Rt(e){const t="string"==typeof e?new Error(e):e;Ut().report(t)}const Ot="__klarna_sdk_";var St;!function(e){e.localStorage="localStorage",e.sessionStorage="sessionStorage",e.klarnaIframeStorage="klarnaIframeStorage"}(St||(St={}));const Yt=e=>{const t=`${Ot}${e}`;try{return function(e,t=window){if(!t?.sessionStorage)throw new Error(`client does not support ${St.sessionStorage}`);const i=()=>JSON.parse(t.sessionStorage.getItem(e)||"{}"),n={get:e=>{const t=i(),n=t?.[e];return n||null},set:(n,a)=>{const s=i();return null===a?delete s[n]:s[n]=a,t.sessionStorage.setItem(e,JSON.stringify(s))},remove:e=>n.set(e,null),flush:()=>t.sessionStorage.removeItem(e)};return n}(t)}catch{Rt("Storage type: sessionStorage not supported")}},_t={at:"eu",au:"oc",be:"eu",ca:"na",ch:"eu",cz:"eu",de:"eu",dk:"eu",es:"eu",fi:"eu",fr:"eu",gb:"eu",gr:"eu",ie:"eu",it:"eu",mx:"na",nl:"eu",no:"eu",nz:"oc",pl:"eu",pt:"eu",ro:"eu",se:"eu",us:"na"};function Dt(e){return Object.keys(_t).filter((t=>_t[t]===e.toLowerCase())).map((e=>e.toUpperCase()))}const Vt={development:{EU:{oidc:{idpUrl:"https://login.nonprod.klarna.net/eu/lp/idp",issuerUrl:"https://login.nonprod.klarna.net"},tracker:{url:"https://frontend-event-router-eu.staging.c2c.klarna.net",enabled:!1},availableMarkets:Dt("EU")},NA:{oidc:{idpUrl:"https://login.nonprod.klarna.net/na/lp/idp",issuerUrl:"https://login.nonprod.klarna.net"},tracker:{url:"https://frontend-event-router-us.staging.c2c.klarna.net",enabled:!1},availableMarkets:Dt("NA")},OC:{oidc:{idpUrl:"",issuerUrl:""},tracker:{url:"",enabled:!1},availableMarkets:[]}},staging:{EU:{oidc:{idpUrl:"https://login.nonprod.klarna.net/eu/lp/idp",issuerUrl:"https://login.nonprod.klarna.net"},tracker:{url:"https://frontend-event-router-eu.staging.c2c.klarna.net",enabled:!0},availableMarkets:Dt("EU")},NA:{oidc:{idpUrl:"https://login.nonprod.klarna.net/na/lp/idp",issuerUrl:"https://login.nonprod.klarna.net"},tracker:{url:"https://frontend-event-router-us.staging.c2c.klarna.net",enabled:!0},availableMarkets:Dt("NA")},OC:{oidc:{idpUrl:"",issuerUrl:""},tracker:{url:"",enabled:!1},availableMarkets:[]}},playground:{EU:{oidc:{idpUrl:"https://login.playground.klarna.com/eu/lp/idp",issuerUrl:"https://login.playground.klarna.com"},tracker:{url:"https://eu.playground.klarnaevt.com",enabled:!0},availableMarkets:Dt("EU")},NA:{oidc:{idpUrl:"https://login.playground.klarna.com/na/lp/idp",issuerUrl:"https://login.playground.klarna.com"},tracker:{url:"https://na.playground.klarnaevt.com",enabled:!0},availableMarkets:Dt("NA")},OC:{oidc:{idpUrl:"",issuerUrl:""},tracker:{url:"",enabled:!1},availableMarkets:[]}},production:{EU:{oidc:{idpUrl:"https://login.klarna.com/eu/lp/idp",issuerUrl:"https://login.klarna.com"},tracker:{url:"https://eu.klarnaevt.com",enabled:!0},availableMarkets:["CH","AT","DE","BE","CZ","DK","FI","FR","GR","GB","IE","IT","NL","PL","PT","ES","SE","RO"]},NA:{oidc:{idpUrl:"https://login.klarna.com/na/lp/idp",issuerUrl:"https://login.klarna.com"},tracker:{url:"https://na.klarnaevt.com",enabled:!0},availableMarkets:["US","CA","MX"]},OC:{oidc:{idpUrl:"",issuerUrl:""},tracker:{url:"",enabled:!1},availableMarkets:[]}}};var Tt,Ht;!function(e){e.CHECKOUT="checkout",e.CONTINUE="continue",e.CONNECT="connect",e.DONATE="donate",e.SIGNIN="signin",e.SIGNUP="signup",e.SUBSCRIBE="subscribe",e.PAY="pay"}(Tt||(Tt={})),function(e){e.Left="left",e.Center="center",e.Right="right"}(Ht||(Ht={}));const Jt={LOCALE:"en-US",OVERLAY:!0,SHAPE:bt.DEFAULT,THEME:gt.DEFAULT,LOGO:Ht.Left,INTERACTION_MODE:void 0,LABEL:Tt.CONTINUE},Mt="identity-api",jt=class{constructor(){this.events=new Map}on(e,t){e&&t?(this.events.get(e)||this.events.set(e,[]),this.events.get(e)?.push(t)):B("Event name or callback is not provided")}off(e,t){if(e&&t){const i=this.events.get(e);i&&this.events.set(e,i.filter((e=>e!==t)))}else B("Event name or callback is not provided")}emit(e,t){const i=this.events.get(e);i?.forEach((e=>{"function"==typeof e&&e(t)}))}of(e){if(e)return this.events.get(e);B("Event name is not provided")}once(e,t){if(e&&t){const i=n=>{t(n),this.off(e,i)};this.on(e,i)}else B("Event name or callback is not provided")}};class zt extends jt{constructor(){super()}static getInstance(){return zt.instance||(zt.instance=new zt),zt.instance}}const Pt=zt,$t={africa:"eu",america:"na",antarctica:"na",arctic:"na",asia:"oc",atlantic:"na",australia:"oc",europe:"eu",indian:"oc",pacific:"na"},Kt="eu";function qt(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e){const t=e.split("/")[0].toLowerCase();if(t in $t)return $t[t]}return B(`Provided region is not supported - defaulting region to ${Kt}`),Kt}const ei=["en-AU","en-NZ","en-AT","de-AT","nl-BE","en-BE","fr-BE","en-CH","de-CH","it-CH","fr-CH","en-CZ","cs-CZ","de-DE","en-DE","da-DK","en-DK","es-ES","en-ES","fi-FI","sv-FI","en-FI","fr-FR","en-FR","en-GB","en-GR","el-GR","en-IE","en-IT","it-IT","nl-NL","en-NL","no-NO","nb-NO","en-NO","en-PL","pl-PL","en-PT","pt-PT","en-RO","ro-RO","sv-SE","en-SE","en-CA","fr-CA","es-MX","en-MX","en-US","es-US","en-HU","hu-HU"].map((e=>e.toLowerCase())),ti=["top-strip-promotion-standard","credit-promotion-standard","credit-promotion-small","info-page-standard","info-page-auto-size"],ii={[ht.FOOTER_PROMOTION_AUTO_SIZE]:"static",[ht.SIDEBAR_PROMOTION_AUTO_SIZE]:"static",[ht.CHECKOUT]:"json",[ht.CREDIT_PROMOTION_AUTO_SIZE]:"json",[ht.CREDIT_PROMOTION_BADGE]:"json",[ht.CREDIT_PROMOTION_STANDARD]:"json",[ht.CREDIT_PROMOTION_SMALL]:"json",[ht.TOP_STRIP_PROMOTION_BADGE]:"json",[ht.HOMEPAGE_PROMOTION_TALL]:"json",[ht.HOMEPAGE_PROMOTION_WIDE]:"json",[ht.HOMEPAGE_PROMOTION_BOX]:"json",[ht.TOP_STRIP_PROMOTION_AUTO_SIZE]:"json",[ht.TOP_STRIP_PROMOTION_STANDARD]:"json",[ht.INFO_PAGE]:"json",[ht.CUSTOM_TYPE_0]:"json",[ht.CUSTOM_TYPE_1]:"json",[ht.CUSTOM_TYPE_1_335_AUTO]:"json",[ht.CREDIT_PROMOTION_INLINE]:"html",[ht.CUSTOM_TYPE_2_INLINE]:"html",[ht.CUSTOM_TYPE_3_INLINE]:"html",[ht.CUSTOM_TYPE_0_INLINE]:"html",[ht.CUSTOM_TYPE_3_335_AUTO]:"html"},ni=["default","dark","custom","light"],ai={production:{oc:"https://osm.klarnaservices.com",eu:"https://osm.klarnaservices.com",na:"https://osm.klarnaservices.com"},playground:{oc:"https://oc-assets.playground.klarnaservices.com",eu:"https://eu-assets.playground.klarnaservices.com",na:"https://na-assets.playground.klarnaservices.com"},staging:{oc:"https://s3.int.klarna.net/pre-purchase/library/global",eu:"https://s3.int.klarna.net/pre-purchase/library/global",na:"https://s3.int.klarna.net/pre-purchase/library/global"},development:{oc:"https://oc-assets.klarnaservices.com",eu:"https://eu-assets.klarnaservices.com",na:"https://na-assets.klarnaservices.com"}},si=["2353e544-2ff2-59c2-b212-1bf4f3464e4c","8881c1ea-b112-5bac-af6e-8d7673373121","69ae9909-fa83-5679-9b79-e3152d192025","8a9301af-27eb-579f-9680-ce15f71b6b0a","1e91f355-200d-5918-9a94-e89ab9989159","55253bbc-5618-57c1-9537-dcb976a96121","90182b69-f31b-5041-8277-82b3a07eae17","5c1f8dc6-5298-5c13-abef-6a253ea06ea5","da5a1c6d-c02c-514c-b40d-73b0d676d464","67a23d03-8270-5475-a8a0-babe4ba86687","4f39e2bc-5713-52f1-8c90-570f7ddd4781","a9e8fb36-aa4e-589d-bd62-7c8c99e46092","14573f95-97e7-52f1-b7f2-a903accb435b","cce1bc9a-2ba6-59ab-88ea-ba0b767aab8b","e8880bde-72dd-5de0-8876-4dc28a556ff9","a9c619b7-b577-54d7-aa7b-adeadc7fc5ee","e81bcf70-038a-546b-8bd6-0c08ea4733e2","ce4123ca-9676-51b5-8db5-76d854d54c88","723d3bf3-0a90-5aae-8140-310d9fa478bd","78384c12-9830-508f-9046-f45b93ede7a1","52de8130-3107-59f9-aaa1-5a90bf0cdf13","ecb0e555-fd5f-554e-966a-bf58f1f72a8e","c6406cbf-893d-59c1-816d-086e9ca7c5c7","76424947-b4c8-5f11-9125-46bff698a0f8","58a92553-dc92-5af4-af7e-65693266e81c","a84c8537-64a5-5f76-a0ff-6d9b934088ec","1fb43ba0-2264-5dd0-9ccd-7d6a889613bf","601ee633-997e-5b4e-867a-a5a13c4c5f63","c782324b-2ee6-5130-9606-c7f112a0fe23","78bdf5e2-8292-54ee-9e27-dea8fb4aacf6","fc432336-af8d-571e-8a4c-15d0efcf7f67","663643dc-79c8-5ecd-ba91-86403fef3965","67472e2d-1d9a-5311-87ef-9e93ea03f399","fce97b2a-8c6a-5ba5-a107-948485bc2e83","0b42169a-608f-5c81-b17a-29900c8c66a4","ca810ec7-49ec-5b63-9183-accae4bf3307","c68e9833-599c-5e14-bc57-f78c822b12ad","bfd35799-3d4c-5582-b71b-c3e963568427","1a13d8c3-3c33-51ee-a722-e45955c20fa6","ad0754c5-71a6-54ac-96c0-f941a0bb7f5c","d3e8cc9b-a1ad-51b9-96a7-05fe230edce3","062884b5-df83-531b-828c-d3118de89b06","49a82178-2eba-54ce-b8c1-2531a004a138","71d3225b-aa87-5f0e-9904-876af56d6c66","e4708f00-bd5a-5e18-bd66-f4621c238887","aad339e0-64b3-54d8-8982-a6df9322269e","f6186bbc-da96-57ed-affd-c0978a613268","2bc7b9f0-0433-5989-9ee0-a4b375bf929c","991fe595-2850-5cbc-adba-989fc270713f","1afa0d69-128e-56cf-8879-328f60a66c65","3a543f47-e295-5ea0-93ab-61dfb0dae37a","6ca24f4c-0c64-5517-adb2-fd5eda9701aa","cbca9c58-53b0-522a-a432-a6103901733c","19e055a1-5941-513a-8d5f-676b6d10b013","738bf438-6a08-50db-92e1-acfdc06706c2","9ce697be-c972-53b9-88bb-cac352b69f47","a897c548-029d-5d34-9b59-813ceb9d7264","998bc69d-b942-5eff-9edf-b1b1e81ae391","c7a1c0da-0b49-5732-913b-0a47a3e1a60e","9ee94060-75f8-5f0e-99bb-3954fcf3a62f","db8aa4d5-8069-5218-933c-de7e3b494f89","a264dbba-6c2d-59b9-9167-c3f4a9791f21","008032f1-657e-5cca-a105-f3edd2bbe84f","af16f814-4a20-5c20-ad2d-942ad93f3590","e36cb7cd-c699-555c-a80d-0fcd56d7f303","ba76a301-1323-5e62-aac3-6b3ce95623ee","0904ad5a-0fb5-5069-bca9-12dbae8d8e5d","6b01ee08-344c-5e9b-ae46-b31a477259f0","f53b110c-50fa-5540-8225-bad651221124","23aec4ae-cd98-5f0a-b4d5-0df5c4a223c6","17e2e730-3d33-585a-b9e7-c5a75e966127","203b5252-c6b6-56a1-8e9d-d0caafebb88c","63ae67c6-ab0e-575e-9f1c-712b9027cc6c","a17591c7-36f9-526b-92a5-f2ff0449a3fc","9766ad09-9605-58a9-aed8-0cd3011da25e","fd6d2432-21c6-5928-86ad-eb0566325c12","48de90a6-1bce-576b-a8eb-6d649c96b55c","0403e8ae-1038-580c-be1c-c38d38837f01","32198a5b-390c-59f6-b1b8-b318f945a14f","d8a32f56-c17e-5e88-bc50-b9b35b9ced2d","6600934b-c14a-54d5-a447-6dc4b146f321","7cfbaac4-729a-5930-ba1a-ad3504155e8e","614d55ad-6cb6-5670-9879-49fd2cac64bf","f46705b8-e9e5-5070-80c6-389dcc32f0d4","6d98ac83-11a1-584b-9aa4-e4374ea442e6","19cf327c-7c49-5b82-853b-83d93c0fa116"];function oi(e,t=ei){return!!e&&t.includes(e.toLowerCase())}const ri={eu:"en-GB",na:"en-US",oc:"en-AU"};function ci(e="",t=window,i=!0){e&&(e=e.replace("_","-"));const n=e.split("-");if(oi(e=n.length>1?`${n[0].toLowerCase()}-${n[1].toUpperCase()}`:""))return e;if(!i)return;const a=t.navigator?.language;if(oi(a))return a;const s=qt();return ri[s]}var li,di;!function(e){e.DA="da",e.DE="de",e.EN="en",e.ES="es",e.FI="fi",e.FR="fr",e.IT="it",e.NL="nl",e.NB="nb",e.PL="pl",e.PT="pt",e.SV="sv"}(li||(li={})),function(e){e.PayWith="pay_with",e.ContinueWith="continue_with",e.OverlayContentText="overlay_content_text",e.OverlayContentButtonLabel="overlay_content_button_label"}(di||(di={}));const ui=e=>Object.values(li).includes(e),gi=e=>e.substring(0,2)?.toLowerCase(),bi=()=>{const e=window.navigator.language,t=ci();if(t){const e=gi(t);if(ui(e))return e}if(e){const t=gi(e);if(ui(t))return t}return li.EN},hi=(e,t)=>{let i=0;return e.split(/{{?([a-zA-Z]+ )?[a-z]+.[a-z]*}}/).map((e=>{if(void 0===e){const e=t?.[i];return i++,e}return e}))},pi={[di.ContinueWith]:{[li.DA]:"Fortsæt med {{klarna}}",[li.DE]:"Weiter mit {{klarna}}",[li.EN]:"Continue with {{klarna}}",[li.ES]:"Continuar con {{klarna}}",[li.FI]:"Jatka Klarnalla",[li.FR]:"Continuer avec {{klarna}}",[li.IT]:"Continua con {{klarna}}",[li.NL]:"Verdergaan met {{klarna}}",[li.NB]:"Fortsett med {{klarna}}",[li.PL]:"Kontynuuj z {{klarna}}",[li.PT]:"Continuar com {{klarna}}",[li.SV]:"Fortsätt med {{klarna}}"},[di.PayWith]:{[li.DA]:"Betal med {{klarna}}",[li.DE]:"Bezahlen mit {{klarna}}",[li.EN]:"Pay with {{klarna}}",[li.ES]:"Pagar con {{klarna}}",[li.FI]:"Maksa käyttäen {{klarna}}",[li.FR]:"Payer avec {{klarna}}",[li.IT]:"Paga con {{klarna}}",[li.NL]:"Betalen met {{klarna}}",[li.NB]:"Betal med {{klarna}}",[li.PL]:"Zapłać za pomocą {{klarna}}",[li.PT]:"Pagar com {{klarna}}",[li.SV]:"Betala med {{klarna}}"},[di.OverlayContentText]:{[li.DA]:"Ser du ikke Klarna-vinduet? Vi hjælper dig med at åbne det for at fuldføre din tilmelding.",[li.DE]:"Sie sehen das Klarna-Fenster nicht? Wir helfen Ihnen dabei, es zu öffnen, um Ihre Anmeldung abzuschließen.",[li.EN]:"Don't see the Klarna window? We'll help you open it to complete your sign in.",[li.ES]:"¿No ves la ventana de Klarna? Te ayudaremos a abrirla para completar tu inicio de sesión.",[li.FI]:"Et näe Klarnan ikkunaa? Autamme sinua avaamaan sen ja kirjautumaan sisään.",[li.FR]:"Vous ne voyez pas la fenêtre Klarna ? Nous vous aiderons à l'ouvrir pour finaliser votre connexion.",[li.IT]:"Non vedi la finestra di Klarna? Ti aiuteremo ad aprirla per completare l'accesso.",[li.NL]:"Zie je het Klarna-venster niet? We helpen je het te openen om je aanmelding te voltooien.",[li.NB]:"Ser du ikke Klarna-vinduet? Vi hjelper deg med å åpne det for å fullføre innloggingen din.",[li.PL]:"Nie widzisz okna Klarna? Pomożemy je otworzyć, aby zakończyć proces logowania.",[li.PT]:"Não está vendo a janela do Klarna? Vamos ajudar a abri-la para concluir seu login.",[li.SV]:"Öppnas inte Klarnas fönster automatiskt? Klicka här så hjälper vi dig att logga in."},[di.OverlayContentButtonLabel]:{[li.DA]:"Fortsæt",[li.DE]:"Weiter",[li.EN]:"Continue",[li.ES]:"Continuar",[li.FI]:"Jatka",[li.FR]:"Continuer",[li.IT]:"Continua",[li.NL]:"Doorgaan",[li.NB]:"Fortsett",[li.PL]:"Kontynuuj",[li.PT]:"Continuar",[li.SV]:"Fortsätt"}},mi=(e,{locale:t,params:i}={})=>{const n=t||bi();let a=pi[e][n];return i&&a&&(a=hi(a,i).join("")),a},Ii=(e,t)=>t===ut.IDENTITY?(e===Tt.CONNECT||e===Tt.SIGNIN||Tt.SIGNUP,di.ContinueWith):t===ut.PAYMENT?e===Tt.CONTINUE?di.ContinueWith:e===Tt.CHECKOUT?di.PayWith:e===Tt.SUBSCRIBE||e===Tt.DONATE?di.ContinueWith:di.PayWith:di.ContinueWith;var Ci=a(8166),fi=a(9474);const xi=Ci.dy` `,yi=Ci.iv`:root{--current-gap: 0px}:host{width:335px;height:48px;display:inline-block}#klarna-identity-button{container-type:inline-size;container-name:identity-button-content;position:relative;height:inherit;width:inherit;min-height:35px;max-height:60px;padding:0;outline:none;border:0;margin:0;background-color:rgba(0,0,0,0)}#klarna-identity-button:focus #klarna-identity-button__outline{position:absolute;inset:-4px;border:2px solid #0d0e0f;border-radius:8px;min-height:inherit;max-height:64px;margin:auto 0}#klarna-identity-button #klarna-identity-button__inner-container{display:inline-block;min-height:inherit;max-height:inherit;min-width:min-content;width:inherit;height:inherit;cursor:pointer;transition:background-color .2s ease;box-sizing:border-box;border-radius:8px}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text{font-family:"-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Arial","sans-serif";font-weight:500;height:inherit;font-size:16px;opacity:1;transition:color .2s ease;text-rendering:optimizeLegibility;white-space:nowrap;max-height:inherit;min-height:inherit;position:relative;display:flex;justify-content:center;align-items:center;--current-gap: 14px;gap:var(--current-gap);margin:0 var(--current-gap) 0 var(--current-gap)}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #logo{width:20px;height:20px}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#0e0e0f;width:inherit;height:inherit}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #copy{flex:1 1 0%;margin-right:calc(var(--current-gap) + 20px)}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #copy--center{flex:0 1 0%}#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #copy--right{flex:1 1 0%;margin-left:calc(var(--current-gap) + 20px)}@container identity-button-content (width < 250px){#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text{font-size:12px;--current-gap: 8px}}@container identity-button-content (width < 195px){#klarna-identity-button #klarna-identity-button__inner-container #klarna-identity-button__text #copy{font-size:12px;margin-right:0px}}#klarna-identity-button.theme-light #klarna-identity-button__inner-container{color:#0e0e0f;background-color:#fff;border:1px solid #0e0e0f}#klarna-identity-button.theme-light #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#0e0e0f}#klarna-identity-button.theme-light:hover #klarna-identity-button__inner-container{background-color:#f1f1f1;color:#333536}#klarna-identity-button.theme-light:hover #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#333536}#klarna-identity-button.theme-light:focus #klarna-identity-button__outline{inset:-5px}#klarna-identity-button.theme-light:focus #klarna-identity-button__outline #klarna-identity-button__text #logo svg{fill:#0d0e0f}#klarna-identity-button.theme-light:active #klarna-identity-button__inner-container{background-color:#e2e2e2;color:#0d0e0f}#klarna-identity-button.theme-default #klarna-identity-button__inner-container{color:#0e0e0f;background-color:#ffb3c7;border:none}#klarna-identity-button.theme-default #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#0e0e0f}#klarna-identity-button.theme-default:hover #klarna-identity-button__inner-container{background-color:#f0a5b7;color:#333536}#klarna-identity-button.theme-default:hover #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#333536}#klarna-identity-button.theme-default:active #klarna-identity-button__inner-container{background-color:#feb3c7;color:#0d0e0f}#klarna-identity-button.theme-default:active #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#0d0e0f}#klarna-identity-button.theme-dark #klarna-identity-button__inner-container{color:#fff;background-color:#0e0e0f;border:none}#klarna-identity-button.theme-dark #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#fff}#klarna-identity-button.theme-dark:hover #klarna-identity-button__inner-container{background-color:#333536;color:#f1f1f1}#klarna-identity-button.theme-dark:hover #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#f1f1f1}#klarna-identity-button.theme-dark:active #klarna-identity-button__inner-container{background-color:#0d0e0f;color:#e2e2e2}#klarna-identity-button.theme-dark:active #klarna-identity-button__inner-container #klarna-identity-button__text #logo svg{fill:#e2e2e2}#klarna-identity-button.shape-rect #klarna-identity-button__inner-container{border-radius:0}#klarna-identity-button.shape-rect:focus #klarna-identity-button__outline{border-radius:0}#klarna-identity-button.shape-pill #klarna-identity-button__inner-container{border-radius:35px}#klarna-identity-button.shape-pill:focus #klarna-identity-button__outline{border-radius:35px}#klarna-identity-button.copy-default-en{min-width:165px} /*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uLy4uL2tsYXJuYS1pZGVudGl0eS9zcmMva2xhcm5hSWRlbnRpdHlCdXR0b24vc3R5bGUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF3QkEsTUFDRSxrQkFBQSxDQUtGLE1BQ0UsV0FBQSxDQUNBLFdBQUEsQ0FDQSxvQkFBQSxDQUlGLHdCQUNFLDBCQUFBLENBQ0Esc0NBQUEsQ0FDQSxpQkFBQSxDQUNBLGNBQUEsQ0FDQSxhQUFBLENBQ0EsZUFBQSxDQUNBLGVBQUEsQ0FDQSxTQUFBLENBQ0EsWUFBQSxDQUNBLFFBQUEsQ0FDQSxRQUFBLENBQ0EsOEJBQUEsQ0FHRSwrREFDRSxpQkFBQSxDQUNBLFVBQUEsQ0FDQSx3QkFBQSxDQUNBLGlCQXBDVyxDQXFDWCxrQkFBQSxDQUNBLGVBQUEsQ0FDQSxhQUFBLENBSUosaUVBQ0Usb0JBQUEsQ0FDQSxrQkFBQSxDQUNBLGtCQUFBLENBQ0EscUJBQUEsQ0FDQSxhQUFBLENBQ0EsY0FBQSxDQUNBLGNBQUEsQ0FDQSxvQ0FBQSxDQUNBLHFCQUFBLENBQ0EsaUJBckRhLENBdURiLCtGQUNFLHlGQUFBLENBRUEsZUFBQSxDQUNBLGNBQUEsQ0FDQSxjQUFBLENBQ0EsU0FBQSxDQUNBLHlCQUFBLENBQ0EsaUNBQUEsQ0FDQSxrQkFBQSxDQUNBLGtCQUFBLENBQ0Esa0JBQUEsQ0FDQSxpQkFBQSxDQUNBLFlBQUEsQ0FDQSxzQkFBQSxDQUNBLGtCQUFBLENBQ0EsbUJBQUEsQ0FDQSxzQkFBQSxDQUNBLGdEQUFBLENBRUEscUdBQ0UsVUFBQSxDQUNBLFdBQUEsQ0FFQSx5R0FDRSxZQS9GTSxDQWdHTixhQUFBLENBQ0EsY0FBQSxDQUlKLHFHQUNFLFdBQUEsQ0FDQSw0Q0FBQSxDQUVBLDZHQUNFLFdBQUEsQ0FHRiw0R0FDRSxXQUFBLENBQ0EsMkNBQUEsQ0FRVixtREFHTSwrRkFDRSxjQUFBLENBQ0Esa0JBQUEsQ0FBQSxDQU1SLG1EQUlRLHFHQUNFLGNBQUEsQ0FDQSxnQkFBQSxDQUFBLENBU1IsNkVBQ0UsYUFsSlksQ0FtSloscUJBeklZLENBMElaLHdCQUFBLENBSUkscUhBQ0UsWUF6Sk0sQ0FnS1osbUZBQ0Usd0JBdEpRLENBdUpSLGFBaktRLENBcUtKLDJIQUNFLFlBdEtFLENBOEtWLDJFQUNFLFVBQUEsQ0FJSSxtSEFDRSxZQW5MRyxDQTJMWCxvRkFDRSx3QkFsTFMsQ0FtTFQsYUE3TFMsQ0FtTWIsK0VBQ0UsYUF0TVksQ0F1TVosd0JBbE1XLENBbU1YLFdBQUEsQ0FJSSx1SEFDRSxZQTdNTSxDQW9OWixxRkFDRSx3QkEvTU8sQ0FnTlAsYUFyTlEsQ0F5TkosNkhBQ0UsWUExTkUsQ0FrT1Ysc0ZBQ0Usd0JBN05RLENBOE5SLGFBbk9TLENBdU9MLDhIQUNFLFlBeE9HLENBaVBiLDRFQUNFLFVBMU9ZLENBMk9aLHdCQXJQWSxDQXNQWixXQUFBLENBSUksb0hBQ0UsU0FqUE0sQ0F3UFosa0ZBQ0Usd0JBbFFRLENBbVFSLGFBelBRLENBNlBKLDBIQUNFLFlBOVBFLENBc1FWLG1GQUNFLHdCQWhSUyxDQWlSVCxhQXZRUyxDQTJRTCwySEFDRSxZQTVRRyxDQXNSYiw0RUFDRSxlQW5SVSxDQXNSWiwwRUFDRSxlQXZSVSxDQTRSWiw0RUFDRSxrQkE1UlUsQ0ErUlosMEVBQ0Usa0JBaFNVLENBcVNkLHdDQUNFLGVBQUEiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBWYXJpYWJsZXMgZm9yIGVhc2Ugb2YgY2hhbmdlXG5cbi8vIENvbG9yc1xuXG4vLyBCbGFja1xuJHJlZ3VsYXJfYmxhY2s6ICMwZTBlMGY7XG4kaG92ZXJfYmxhY2s6ICMzMzM1MzY7XG4kYWN0aXZlX2JsYWNrOiAjMGQwZTBmO1xuXG4vLyBQaW5rXG4kcmVndWxhcl9waW5rOiAjZmZiM2M3O1xuJGhvdmVyX3Bpbms6ICNmMGE1Yjc7XG4kYWN0aXZlX3Bpbms6ICNmZWIzYzc7IC8vIFRPRE86IEdldCBwcm9wZXIgY29sb3JcblxuLy8gV2hpdGVcbiRyZWd1bGFyX3doaXRlOiAjZmZmZmZmO1xuJGhvdmVyX3doaXRlOiAjZjFmMWYxO1xuJGFjdGl2ZV93aGl0ZTogI2UyZTJlMjtcblxuLy8gU2hhcGVcbiRyYWRpdXNfZGVmYXVsdDogOHB4O1xuJHJhZGl1c19yZWN0OiAwO1xuJHJhZGl1c19waWxsOiAzNXB4O1xuXG46cm9vdCB7XG4gIC0tY3VycmVudC1nYXA6IDBweDtcbn1cblxuLy8gSGVyZSB3ZSBzZXQgdGhlIGtsYXJuYS1pZGVudGl0eS1idXR0b24gY29udGFpbmVyIHRvIGhhdmUgaXRzIGRlZmF1bHQgaGVpZ2h0IGFuZCB3aWR0aC5cbi8vIE1lcmNoYW50cyBjYW4gb3ZlcndyaXRlIHRob3NlIHN0eWxlcyBieSBkZWZpbmluZyBhIG1vcmUgc3BlY2lmaWMgc2VsZWN0b3IsIGUuZy4gYSBjbGFzc1xuOmhvc3Qge1xuICB3aWR0aDogMzM1cHg7XG4gIGhlaWdodDogNDhweDtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xufVxuXG4vLyBEZWZhdWx0IEJ1dHRvblxuI2tsYXJuYS1pZGVudGl0eS1idXR0b24ge1xuICBjb250YWluZXItdHlwZTogaW5saW5lLXNpemU7XG4gIGNvbnRhaW5lci1uYW1lOiBpZGVudGl0eS1idXR0b24tY29udGVudDtcbiAgcG9zaXRpb246IHJlbGF0aXZlO1xuICBoZWlnaHQ6IGluaGVyaXQ7XG4gIHdpZHRoOiBpbmhlcml0O1xuICBtaW4taGVpZ2h0OiAzNXB4O1xuICBtYXgtaGVpZ2h0OiA2MHB4O1xuICBwYWRkaW5nOiAwO1xuICBvdXRsaW5lOiBub25lO1xuICBib3JkZXI6IDA7XG4gIG1hcmdpbjogMDtcbiAgYmFja2dyb3VuZC1jb2xvcjogdHJhbnNwYXJlbnQ7XG5cbiAgJjpmb2N1cyB7XG4gICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX291dGxpbmUge1xuICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgaW5zZXQ6IC00cHg7XG4gICAgICBib3JkZXI6IDJweCBzb2xpZCAkYWN0aXZlX2JsYWNrO1xuICAgICAgYm9yZGVyLXJhZGl1czogJHJhZGl1c19kZWZhdWx0O1xuICAgICAgbWluLWhlaWdodDogaW5oZXJpdDtcbiAgICAgIG1heC1oZWlnaHQ6IDY0cHg7XG4gICAgICBtYXJnaW46IGF1dG8gMDtcbiAgICB9XG4gIH1cblxuICAja2xhcm5hLWlkZW50aXR5LWJ1dHRvbl9faW5uZXItY29udGFpbmVyIHtcbiAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gICAgbWluLWhlaWdodDogaW5oZXJpdDtcbiAgICBtYXgtaGVpZ2h0OiBpbmhlcml0O1xuICAgIG1pbi13aWR0aDogbWluLWNvbnRlbnQ7XG4gICAgd2lkdGg6IGluaGVyaXQ7XG4gICAgaGVpZ2h0OiBpbmhlcml0O1xuICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICB0cmFuc2l0aW9uOiBiYWNrZ3JvdW5kLWNvbG9yIDAuMnMgZWFzZTtcbiAgICBib3gtc2l6aW5nOiBib3JkZXItYm94O1xuICAgIGJvcmRlci1yYWRpdXM6ICRyYWRpdXNfZGVmYXVsdDtcblxuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX190ZXh0IHtcbiAgICAgIGZvbnQtZmFtaWx5OiAnLWFwcGxlLXN5c3RlbScsICdCbGlua01hY1N5c3RlbUZvbnQnLCAnU2Vnb2UgVUknLCAnUm9ib3RvJywgJ0FyaWFsJyxcbiAgICAgICAgJ3NhbnMtc2VyaWYnO1xuICAgICAgZm9udC13ZWlnaHQ6IDUwMDtcbiAgICAgIGhlaWdodDogaW5oZXJpdDtcbiAgICAgIGZvbnQtc2l6ZTogMTZweDtcbiAgICAgIG9wYWNpdHk6IDE7XG4gICAgICB0cmFuc2l0aW9uOiBjb2xvciAwLjJzIGVhc2U7XG4gICAgICB0ZXh0LXJlbmRlcmluZzogb3B0aW1pemVMZWdpYmlsaXR5O1xuICAgICAgd2hpdGUtc3BhY2U6IG5vd3JhcDtcbiAgICAgIG1heC1oZWlnaHQ6IGluaGVyaXQ7XG4gICAgICBtaW4taGVpZ2h0OiBpbmhlcml0O1xuICAgICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICAgIC0tY3VycmVudC1nYXA6IDE0cHg7XG4gICAgICBnYXA6IHZhcigtLWN1cnJlbnQtZ2FwKTtcbiAgICAgIG1hcmdpbjogMCB2YXIoLS1jdXJyZW50LWdhcCkgMCB2YXIoLS1jdXJyZW50LWdhcCk7XG5cbiAgICAgICNsb2dvIHtcbiAgICAgICAgd2lkdGg6IDIwcHg7XG4gICAgICAgIGhlaWdodDogMjBweDtcblxuICAgICAgICBzdmcge1xuICAgICAgICAgIGZpbGw6ICRyZWd1bGFyX2JsYWNrO1xuICAgICAgICAgIHdpZHRoOiBpbmhlcml0O1xuICAgICAgICAgIGhlaWdodDogaW5oZXJpdDtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAjY29weSB7XG4gICAgICAgIGZsZXg6IDEgMSAwJTtcbiAgICAgICAgbWFyZ2luLXJpZ2h0OiBjYWxjKHZhcigtLWN1cnJlbnQtZ2FwKSArIDIwcHgpO1xuXG4gICAgICAgICYtLWNlbnRlciB7XG4gICAgICAgICAgZmxleDogMCAxIDAlO1xuICAgICAgICB9XG5cbiAgICAgICAgJi0tcmlnaHQge1xuICAgICAgICAgIGZsZXg6IDEgMSAwJTtcbiAgICAgICAgICBtYXJnaW4tbGVmdDogY2FsYyh2YXIoLS1jdXJyZW50LWdhcCkgKyAyMHB4KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxufVxuXG4vLyBCcmVha3BvaW50XG5AY29udGFpbmVyIGlkZW50aXR5LWJ1dHRvbi1jb250ZW50ICh3aWR0aCA8IDI1MHB4KSB7XG4gICNrbGFybmEtaWRlbnRpdHktYnV0dG9uIHtcbiAgICAja2xhcm5hLWlkZW50aXR5LWJ1dHRvbl9faW5uZXItY29udGFpbmVyIHtcbiAgICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX190ZXh0IHtcbiAgICAgICAgZm9udC1zaXplOiAxMnB4O1xuICAgICAgICAtLWN1cnJlbnQtZ2FwOiA4cHg7XG4gICAgICB9XG4gICAgfVxuICB9XG59XG5cbkBjb250YWluZXIgaWRlbnRpdHktYnV0dG9uLWNvbnRlbnQgKHdpZHRoIDwgMTk1cHgpIHtcbiAgI2tsYXJuYS1pZGVudGl0eS1idXR0b24ge1xuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX19pbm5lci1jb250YWluZXIge1xuICAgICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX3RleHQge1xuICAgICAgICAjY29weSB7XG4gICAgICAgICAgZm9udC1zaXplOiAxMnB4O1xuICAgICAgICAgIG1hcmdpbi1yaWdodDogMHB4O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG59XG5cbi8vIFRoZW1lXG4ja2xhcm5hLWlkZW50aXR5LWJ1dHRvbi50aGVtZS1saWdodCB7XG4gICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX19pbm5lci1jb250YWluZXIge1xuICAgIGNvbG9yOiAkcmVndWxhcl9ibGFjaztcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiAkcmVndWxhcl93aGl0ZTtcbiAgICBib3JkZXI6IDFweCBzb2xpZCAkcmVndWxhcl9ibGFjaztcblxuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX190ZXh0IHtcbiAgICAgICNsb2dvIHtcbiAgICAgICAgc3ZnIHtcbiAgICAgICAgICBmaWxsOiAkcmVndWxhcl9ibGFjaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gICY6aG92ZXIge1xuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX19pbm5lci1jb250YWluZXIge1xuICAgICAgYmFja2dyb3VuZC1jb2xvcjogJGhvdmVyX3doaXRlO1xuICAgICAgY29sb3I6ICRob3Zlcl9ibGFjaztcblxuICAgICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX3RleHQge1xuICAgICAgICAjbG9nbyB7XG4gICAgICAgICAgc3ZnIHtcbiAgICAgICAgICAgIGZpbGw6ICRob3Zlcl9ibGFjaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAmOmZvY3VzIHtcbiAgICAja2xhcm5hLWlkZW50aXR5LWJ1dHRvbl9fb3V0bGluZSB7XG4gICAgICBpbnNldDogLTVweDtcblxuICAgICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX3RleHQge1xuICAgICAgICAjbG9nbyB7XG4gICAgICAgICAgc3ZnIHtcbiAgICAgICAgICAgIGZpbGw6ICRhY3RpdmVfYmxhY2s7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgJjphY3RpdmUge1xuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX19pbm5lci1jb250YWluZXIge1xuICAgICAgYmFja2dyb3VuZC1jb2xvcjogJGFjdGl2ZV93aGl0ZTtcbiAgICAgIGNvbG9yOiAkYWN0aXZlX2JsYWNrO1xuICAgIH1cbiAgfVxufVxuXG4ja2xhcm5hLWlkZW50aXR5LWJ1dHRvbi50aGVtZS1kZWZhdWx0IHtcbiAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX2lubmVyLWNvbnRhaW5lciB7XG4gICAgY29sb3I6ICRyZWd1bGFyX2JsYWNrO1xuICAgIGJhY2tncm91bmQtY29sb3I6ICRyZWd1bGFyX3Bpbms7XG4gICAgYm9yZGVyOiBub25lO1xuXG4gICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX3RleHQge1xuICAgICAgI2xvZ28ge1xuICAgICAgICBzdmcge1xuICAgICAgICAgIGZpbGw6ICRyZWd1bGFyX2JsYWNrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgJjpob3ZlciB7XG4gICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX2lubmVyLWNvbnRhaW5lciB7XG4gICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAkaG92ZXJfcGluaztcbiAgICAgIGNvbG9yOiAkaG92ZXJfYmxhY2s7XG5cbiAgICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX190ZXh0IHtcbiAgICAgICAgI2xvZ28ge1xuICAgICAgICAgIHN2ZyB7XG4gICAgICAgICAgICBmaWxsOiAkaG92ZXJfYmxhY2s7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgJjphY3RpdmUge1xuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX19pbm5lci1jb250YWluZXIge1xuICAgICAgYmFja2dyb3VuZC1jb2xvcjogJGFjdGl2ZV9waW5rO1xuICAgICAgY29sb3I6ICRhY3RpdmVfYmxhY2s7XG5cbiAgICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX190ZXh0IHtcbiAgICAgICAgI2xvZ28ge1xuICAgICAgICAgIHN2ZyB7XG4gICAgICAgICAgICBmaWxsOiAkYWN0aXZlX2JsYWNrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxufVxuXG4ja2xhcm5hLWlkZW50aXR5LWJ1dHRvbi50aGVtZS1kYXJrIHtcbiAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX2lubmVyLWNvbnRhaW5lciB7XG4gICAgY29sb3I6ICRyZWd1bGFyX3doaXRlO1xuICAgIGJhY2tncm91bmQtY29sb3I6ICRyZWd1bGFyX2JsYWNrO1xuICAgIGJvcmRlcjogbm9uZTtcblxuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX190ZXh0IHtcbiAgICAgICNsb2dvIHtcbiAgICAgICAgc3ZnIHtcbiAgICAgICAgICBmaWxsOiAkcmVndWxhcl93aGl0ZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gICY6aG92ZXIge1xuICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX19pbm5lci1jb250YWluZXIge1xuICAgICAgYmFja2dyb3VuZC1jb2xvcjogJGhvdmVyX2JsYWNrO1xuICAgICAgY29sb3I6ICRob3Zlcl93aGl0ZTtcblxuICAgICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX3RleHQge1xuICAgICAgICAjbG9nbyB7XG4gICAgICAgICAgc3ZnIHtcbiAgICAgICAgICAgIGZpbGw6ICRob3Zlcl93aGl0ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAmOmFjdGl2ZSB7XG4gICAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX2lubmVyLWNvbnRhaW5lciB7XG4gICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAkYWN0aXZlX2JsYWNrO1xuICAgICAgY29sb3I6ICRhY3RpdmVfd2hpdGU7XG5cbiAgICAgICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX190ZXh0IHtcbiAgICAgICAgI2xvZ28ge1xuICAgICAgICAgIHN2ZyB7XG4gICAgICAgICAgICBmaWxsOiAkYWN0aXZlX3doaXRlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxufVxuXG4vLyBTaGFwZVxuI2tsYXJuYS1pZGVudGl0eS1idXR0b24uc2hhcGUtcmVjdCB7XG4gICNrbGFybmEtaWRlbnRpdHktYnV0dG9uX19pbm5lci1jb250YWluZXIge1xuICAgIGJvcmRlci1yYWRpdXM6ICRyYWRpdXNfcmVjdDtcbiAgfVxuXG4gICY6Zm9jdXMgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX291dGxpbmUge1xuICAgIGJvcmRlci1yYWRpdXM6ICRyYWRpdXNfcmVjdDtcbiAgfVxufVxuXG4ja2xhcm5hLWlkZW50aXR5LWJ1dHRvbi5zaGFwZS1waWxsIHtcbiAgI2tsYXJuYS1pZGVudGl0eS1idXR0b25fX2lubmVyLWNvbnRhaW5lciB7XG4gICAgYm9yZGVyLXJhZGl1czogJHJhZGl1c19waWxsO1xuICB9XG5cbiAgJjpmb2N1cyAja2xhcm5hLWlkZW50aXR5LWJ1dHRvbl9fb3V0bGluZSB7XG4gICAgYm9yZGVyLXJhZGl1czogJHJhZGl1c19waWxsO1xuICB9XG59XG5cbi8vIENvcHlcbiNrbGFybmEtaWRlbnRpdHktYnV0dG9uLmNvcHktZGVmYXVsdC1lbiB7XG4gIG1pbi13aWR0aDogMTY1cHg7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9 */`;var Gi=function(e,t,i,n){var a,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var r=e.length-1;r>=0;r--)(a=e[r])&&(o=(s<3?a(o):s>3?a(t,i,o):a(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o};const Ai=dt.IDENTITY_BUTTON;var vi=a(4250),Bi=a(2842),Zi=a.n(Bi);class Qi{static addListener(e,t){window.removeEventListener?window.addEventListener("message",t,!1):window.attachEvent("on"+e,t,!1)}static removeListener(e,t){window.removeEventListener?window.removeEventListener("message",t):window.detachEvent("on"+e,t)}constructor(e){this.origin=e.origin,this.target=e.target,this.frame=e.frame,this.debug=e.debug,this.console=e.console||console,this.sendPlainObject=e.sendPlainObject,this.sourceID=e.sourceID||"unknown",this.disableMessageSourceCheck=!!e.disableMessageSourceCheck,this._listener=null,this.onMessage=function(){throw new Error("Missing `onMessage` callback")},this.bindToMessage(this.onPostMessage,this)}getTarget(){return this.frame?"function"==typeof this.frame?this.frame():this.frame.contentWindow:this.target}hasTarget(){try{return!!this.getTarget()}catch(e){return!1}}onPostMessage(e){let t;try{if(!this.disableMessageSourceCheck&&this.hasTarget()&&!wi(e.srcElement)&&!Xi(e.srcElement)&&e.source!==this.getTarget())return void(this.debug&&this.console.warn("[Posten(%s)] ignored message:",this.sourceID,e));if("*"!==this.origin&&e.origin!==this.origin)return void(this.debug&&this.console.warn("[Posten(%s)] rejected message from "+e.origin+", expecting "+this.origin+". Target window:",this.sourceID,this.getTarget()));t=this.sendPlainObject?e.data:JSON.parse(e.data),this.debug&&this.console.info("%c [Posten(%s) <- %s] message received:","color: #16a085",this.sourceID,e.origin||"unknown",t),this.onMessage(null,t,e)}catch(e){this.onMessage(e)}}send(e){if(!this.sendPlainObject)for(var t in e)if(e[t]&&e[t].toJSON)try{e[t].toJSON=null}catch(e){}let i;wi(e.port)&&(i=e.port,delete e.port);const n=this.getTarget(),a=this.sendPlainObject?e:JSON.stringify(e);wi(n)||Xi(n)?n.postMessage(a):n.postMessage(a,this.origin,i?[i]:[]),this.debug&&this.console.info("%c [Posten -> %s] sending message:","color: #16a085",this.origin,e)}bindToMessage(e,t){this._listener=function(){e.apply(t,arguments)};const i=this.getTarget();wi(i)||Xi(i)?i.onmessage=this._listener:Qi.addListener("message",this._listener)}unbind(){if(!this._listener)return;const e=this.getTarget();wi(e)||Xi(e)?e.onmessage=null:Qi.removeListener("message",this._listener),this._listener=null}}const wi=e=>"MessagePort"in window&&e instanceof window.MessagePort,Xi=e=>"BroadcastChannel"in window&&e instanceof window.BroadcastChannel;class ki{static createPosten({src:e=window,target:t,origin:i="*",debug:n,sourceID:a,disableMessageSourceCheck:s}){const o={src:e,origin:i,console:Zi(),debug:n,sourceID:a,disableMessageSourceCheck:s};return t.url&&(o.origin=ki.getOriginFromURL(t.url)),t.window?o.target=t.window:t.frame&&(o.frame=t.frame),new Qi(o)}static getOriginFromURL(e=""){const t=e.match(/^[a-z]+:\/\/[a-z0-9A-Z\.:\-]+/);if(t)return t[0]}constructor(e={}){if(!e.target)throw new Error("Property `options.target` is required.");"[object Object]"===Object.prototype.toString.call(e.debug)?(this.debug=!!e.debug.logs,this.logErrors=!!e.debug.errors):(this.debug=!!e.debug,this.logErrors=this.debug),this.posten=ki.createPosten({...e,debug:this.debug}),this.posten.onMessage=(...e)=>{this.posten&&this.posten.hasTarget()&&this.onMessage(...e)},this.messageHandlers={},this.queue=e.queue||[],this.sourceID=e.sourceID||"NO NAME",this.targetIsReady=e.targetIsReady,this.shouldBuffer=!this.targetIsReady,this.autoSyncOnStart=null!=e.autoSyncOnStart?e.autoSyncOnStart:!this.targetIsReady,this.addMessageHandler("@@messenger/ready",this.onReadyMessage.bind(this)),this.addMessageHandler("@@messenger/SYN",this.onSyncMessage.bind(this)),this.addMessageHandler("@@messenger/SYN-ACK",this.onAcknowledgeSyncMessage.bind(this)),this.addMessageHandler("@@messenger/ACK",this.onAcknowledgeMessage.bind(this)),this.addMessageHandler("@@messenger/transferPort",this.onTransferPort.bind(this)),this.startTargetExistenceCheckPolling(e.targetExistenceCheckInterval),this.targetIsReady?this.ready():this.autoSyncOnStart&&this.sync()}log(...e){this.debug&&Zi().log("[Messenger(%s)]",this.sourceID,...e)}logError(...e){this.debug&&this.logErrors&&Zi().error("[Messenger(%s)]",this.sourceID,...e)}hasTarget(){return this.posten&&this.posten.hasTarget()}startTargetExistenceCheckPolling(e=100){this.existenceCheckPoller=setInterval((()=>{this.shouldBuffer||this.hasTarget()||(this.log("Target no longer exists. Start buffering."),this.shouldBuffer=!0)}),e)}sync(){this.hasTarget()&&(this.posten.send({action:"@@messenger/SYN"}),this.log("SYN"))}acknowledgeSync(){this.hasTarget()&&(this.posten.send({action:"@@messenger/SYN-ACK"}),this.log("SYN-ACK"))}acknowledge(){this.hasTarget()&&(this.posten.send({action:"@@messenger/ACK"}),this.log("ACK"))}addMessageHandler(e,t){return this.messageHandlers[e]=t,()=>{delete this.messageHandlers[e]}}transferPort(e){this.log("Transfer port:",e),this.send({action:"@@messenger/transferPort",port:e})}getPort(){return this.port?Promise.resolve(this.port):new Promise((e=>{this.resolvePortPromise=e}))}send(e){!this.shouldBuffer&&this.hasTarget()?this.posten.send({...e,__sourceID:this.sourceID}):(this.log("Buffering message:",e),this.queue.push(e))}ready({fromPostMessage:e=!1}={}){this.hasTarget()&&(this.log("Ready to receive messages."),this.shouldBuffer=!1,e||this.send({action:"@@messenger/ready"}),this.flush(this.queue,this.send))}flush(){for(this.log("Flushing buffer:",[].concat(this.queue));this.queue.length>0;)this.send(this.queue.shift())}pause(){this.shouldBuffer=!0}destroy(){clearInterval(this.existenceCheckPoller),this.posten&&this.posten.unbind(),delete this.posten}onMessage(e,t,i){if(e)return void this.logError(e);const n=this.messageHandlers[t.action];"function"==typeof n&&n(t,i)}onReadyMessage(){this.ready({fromPostMessage:!0})}onSyncMessage(e){this.acknowledgeSync()}onAcknowledgeSyncMessage(e){this.ready({fromPostMessage:!0}),this.acknowledge()}onAcknowledgeMessage(e){this.ready({fromPostMessage:!0})}onTransferPort(e,t){const i=t.ports[0];this.log("Received port:",i),!this.port&&this.resolvePortPromise&&this.resolvePortPromise(i),this.port=i}}var Wi=a(6353);const Li=()=>{const e=(0,Wi.UAParser)(window.navigator.userAgent);return{browserName:e.browser.name,browserVersion:e.browser.version,osName:e.os.name,osVersion:e.os.version,deviceModel:e.device.model,deviceType:e.device.type,deviceVendor:e.device.vendor,engineName:e.engine.name,engineVersion:e.engine.version,userAgent:e.ua}},Ni=n.identitySdk;class Ei{constructor(){this.configure=(e,t,i,n)=>{this.tracker.configure({options:{client:Ni,clientVersion:"v1",sessionId:e,baseUrl:n.url},data:{clientId:t,environment:i,sdk:"websdk",commonData:{...Li(),sessionId:e}},instanceId:Ni})}}static getInstance(){return Ei.instance||(Ei.instance=new Ei,Ei.instance.tracker=x(Ni)),Ei.instance}sendEvent({name:e,options:t}){this.tracker.event(e,{},t)}}var Fi,Ui,Ri;!function(e){e.CodeVerifier="klarna-sign-in-code-verifier",e.Nonce="klarna-sign-in-nonce",e.State="klarna-sign-in-state",e.SessionId="klarna-sign-in-session-id"}(Fi||(Fi={})),function(e){e.ButtonClicked="button_clicked",e.ButtonRendered="button_rendered",e.RedirectHandlerTriggered="redirect_handler_triggered",e.LoginSuccess="login_success",e.LoginFailure="login_failure",e.LoginCancelled="login_cancelled",e.SdkInitialized="sdk_initialized",e.UnavailableMarket="unavailable_market",e.UnexpectedError="unexpected_error"}(Ui||(Ui={})),function(e){e.Redirect="redirect"}(Ri||(Ri={}));class Oi extends Error{}const Si=(e,t)=>{const i=(e=>{if("object"==typeof(t=e)&&null!==t&&"message"in t&&"stack"in t&&"name"in t)return e;var t;try{return new Error(JSON.stringify(e))}catch{return new Error(String(e))}})(e),n=Yt(Mt).get(Fi.SessionId);if(i instanceof Oi)v(i.message);else{{const e=Ut();t&&e.setExtras(t),e.setExtra("sessionId",n),e.report(i),Ei.getInstance().sendEvent({name:Ui.UnexpectedError,options:{error:i.message}})}i.message}};class Yi extends Error{}var _i=a(1111),Di=a.n(_i);let Vi;function Ti(e,t){if(null==e)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}"undefined"!=typeof navigator&&navigator.userAgent?.startsWith?.("Mozilla/5.0 ")||(Vi="oauth4webapi/v2.8.1");const Hi=Symbol(),Ji=Symbol(),Mi=Symbol(),ji=Symbol(),zi=new TextEncoder,Pi=new TextDecoder;function $i(e){return"string"==typeof e?zi.encode(e):Pi.decode(e)}const Ki=32768;function qi(e){return"string"==typeof e?function(e){try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),i=new Uint8Array(t.length);for(let e=0;e=this.maxSize&&(this._cache=this.cache,this.cache=new Map)}}(100);function sn(e){return e instanceof CryptoKey}function on(e){return sn(e)&&"private"===e.type}function rn(e){try{if(e.headers.has("dpop-nonce")){const t=new URL(e.url);an.set(t.origin,e.headers.get("dpop-nonce"))}}finally{return e}}function cn(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function ln(e){Ti(e,Headers)&&(e=Object.fromEntries(e.entries()));const t=new Headers(e);if(Vi&&!t.has("user-agent")&&t.set("user-agent",Vi),t.has("authorization"))throw new TypeError('"options.headers" must not include the "authorization" header name');if(t.has("dpop"))throw new TypeError('"options.headers" must not include the "dpop" header name');return t}function dn(e){if("function"==typeof e&&(e=e()),!(e instanceof AbortSignal))throw new TypeError('"options.signal" must return or be an instance of AbortSignal');return e}function un(e){return"string"==typeof e&&0!==e.length}function gn(){return qi(crypto.getRandomValues(new Uint8Array(32)))}function bn(e){return encodeURIComponent(e).replace(/%20/g,"+")}function hn(e){switch(e.algorithm.name){case"RSA-PSS":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new en("unsupported RsaHashedKeyAlgorithm hash name")}}(e);case"RSASSA-PKCS1-v1_5":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new en("unsupported RsaHashedKeyAlgorithm hash name")}}(e);case"ECDSA":return function(e){switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new en("unsupported EcKeyAlgorithm namedCurve")}}(e);case"Ed25519":case"Ed448":return"EdDSA";default:throw new en("unsupported CryptoKey algorithm name")}}function pn(e){return e&&Hi in e&&Number.isFinite(e[Hi])?e[Hi]:0}function mn(e){if(e&&Ji in e){const t=e[Ji];if(Number.isFinite(t)&&-1!==Math.sign(t))return t}return 30}function In(){return Math.floor(Date.now()/1e3)}function Cn(e){if("object"!=typeof e||null===e)throw new TypeError('"as" must be an object');if(!un(e.issuer))throw new TypeError('"as.issuer" property must be a non-empty string');return!0}function fn(e){if("object"!=typeof e||null===e)throw new TypeError('"client" must be an object');if(!un(e.client_id))throw new TypeError('"client.client_id" property must be a non-empty string');return!0}function xn(e){if(!un(e))throw new TypeError('"client.client_secret" property must be a non-empty string');return e}function yn(e,t){if(void 0!==t)throw new TypeError(`"options.clientPrivateKey" property must not be provided when ${e} client authentication method is used.`)}function Gn(e,t){if(void 0!==t)throw new TypeError(`"client.client_secret" property must not be provided when ${e} client authentication method is used.`)}async function An(e,t,i,n,a){switch(i.delete("client_secret"),i.delete("client_assertion_type"),i.delete("client_assertion"),t.token_endpoint_auth_method){case void 0:case"client_secret_basic":yn("client_secret_basic",a),n.set("authorization",function(e,t){const i=bn(e),n=bn(t);return`Basic ${btoa(`${i}:${n}`)}`}(t.client_id,xn(t.client_secret)));break;case"client_secret_post":yn("client_secret_post",a),i.set("client_id",t.client_id),i.set("client_secret",xn(t.client_secret));break;case"private_key_jwt":{if(Gn("private_key_jwt",t.client_secret),void 0===a)throw new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');const{key:n,kid:s}=function(e){if(e instanceof CryptoKey)return{key:e};if(!(e?.key instanceof CryptoKey))return{};if(void 0!==e.kid&&!un(e.kid))throw new TypeError('"kid" must be a non-empty string');return{key:e.key,kid:e.kid}}(a);if(!on(n))throw new TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');i.set("client_id",t.client_id),i.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),i.set("client_assertion",await async function(e,t,i,n){return vn({alg:hn(i),kid:n},function(e,t){const i=In()+pn(t);return{jti:gn(),aud:[e.issuer,e.token_endpoint],exp:i+60,iat:i,nbf:i,iss:t.client_id,sub:t.client_id}}(e,t),i)}(e,t,n,s));break}case"tls_client_auth":case"self_signed_tls_client_auth":case"none":Gn(t.token_endpoint_auth_method,t.client_secret),yn(t.token_endpoint_auth_method,a),i.set("client_id",t.client_id);break;default:throw new en("unsupported client token_endpoint_auth_method")}}async function vn(e,t,i){if(!i.usages.includes("sign"))throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');const n=`${qi($i(JSON.stringify(e)))}.${qi($i(JSON.stringify(t)))}`;return`${n}.${qi(await crypto.subtle.sign(Dn(i),i,$i(n)))}`}let Bn;async function Zn(e){if(Bn||(Bn=new WeakMap),Bn.has(e))return Bn.get(e);const{kty:t,e:i,n,x:a,y:s,crv:o}=await crypto.subtle.exportKey("jwk",e),r={kty:t,e:i,n,x:a,y:s,crv:o};return Bn.set(e,r),r}function Qn(e,t,i){if("string"!=typeof e)throw i?.[ji]?new TypeError(`"as.mtls_endpoint_aliases.${t}" must be a string`):new TypeError(`"as.${t}" must be a string`);return new URL(e)}function wn(e){const t=e;return"object"==typeof t&&!Array.isArray(t)&&null!==t&&void 0!==t.error}async function Xn(e,t,i,n,a){const s=function(e,t,i){return i?.[ji]&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?Qn(e.mtls_endpoint_aliases[t],t,i):Qn(e[t],t)}(e,"token_endpoint",a);n.set("grant_type",i);const o=ln(a?.headers);return o.set("accept","application/json"),void 0!==a?.DPoP&&await async function(e,t,i,n,a,s){const{privateKey:o,publicKey:r,nonce:c=an.get(i.origin)}=t;if(!on(o))throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');if(!sn(l=r)||"public"!==l.type)throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');var l;if(void 0!==c&&!un(c))throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');if(!r.extractable)throw new TypeError('"DPoP.publicKey.extractable" must be true');const d=In()+a,u=await vn({alg:hn(o),typ:"dpop+jwt",jwk:await Zn(r)},{iat:d,jti:gn(),htm:n,nonce:c,htu:`${i.origin}${i.pathname}`,ath:s?qi(await crypto.subtle.digest("SHA-256",$i(s))):void 0},o);e.set("dpop",u)}(o,a.DPoP,s,"POST",pn(t)),async function(e,t,i,n,a,s,o){return await An(e,t,a,s,o?.clientPrivateKey),s.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),(o?.[Mi]||fetch)(n.href,{body:a,headers:Object.fromEntries(s.entries()),method:i,redirect:"manual",signal:o?.signal?dn(o.signal):null}).then(rn)}(e,t,"POST",s,n,o,a)}Symbol();const kn=new WeakMap;async function Wn(e,t,i,n=!1,a=!1){if(Cn(e),fn(t),!Ti(i,Response))throw new TypeError('"response" must be an instance of Response');if(200!==i.status){let e;if(e=await async function(e){if(e.status>399&&e.status<500){Sn(e);try{const t=await e.json();if(cn(t)&&"string"==typeof t.error&&t.error.length)return void 0!==t.error_description&&"string"!=typeof t.error_description&&delete t.error_description,void 0!==t.error_uri&&"string"!=typeof t.error_uri&&delete t.error_uri,void 0!==t.algs&&"string"!=typeof t.algs&&delete t.algs,void 0!==t.scope&&"string"!=typeof t.scope&&delete t.scope,t}catch{}}}(i))return e;throw new nn('"response" is not a conform Token Endpoint response')}let s;Sn(i);try{s=await i.json()}catch(e){throw new nn('failed to parse "response" body as JSON',{cause:e})}if(!cn(s))throw new nn('"response" body must be a top level object');if(!un(s.access_token))throw new nn('"response" body "access_token" property must be a non-empty string');if(!un(s.token_type))throw new nn('"response" body "token_type" property must be a non-empty string');if(s.token_type=s.token_type.toLowerCase(),"dpop"!==s.token_type&&"bearer"!==s.token_type)throw new en("unsupported `token_type` value");if(void 0!==s.expires_in&&("number"!=typeof s.expires_in||s.expires_in<=0))throw new nn('"response" body "expires_in" property must be a positive number');if(!a&&void 0!==s.refresh_token&&!un(s.refresh_token))throw new nn('"response" body "refresh_token" property must be a non-empty string');if(void 0!==s.scope&&"string"!=typeof s.scope)throw new nn('"response" body "scope" property must be a string');if(!n){if(void 0!==s.id_token&&!un(s.id_token))throw new nn('"response" body "id_token" property must be a non-empty string');if(s.id_token){const{claims:i}=await async function(e,t,i,n,a){const{0:s,1:o,2:r,length:c}=e.split(".");if(5===c)throw new en("JWE structure JWTs are not supported");if(3!==c)throw new nn("Invalid JWT");let l;try{l=JSON.parse($i(qi(s)))}catch(e){throw new nn("failed to parse JWT Header body as base64url encoded JSON",{cause:e})}if(!cn(l))throw new nn("JWT Header must be a top level object");if(t(l),void 0!==l.crit)throw new nn('unexpected JWT "crit" header parameter');const d=qi(r);let u,g;if(i!==Vn){u=await i(l);const e=`${s}.${o}`;if(!await crypto.subtle.verify(Dn(u),u,d,$i(e)))throw new nn("JWT signature verification failed")}try{g=JSON.parse($i(qi(o)))}catch(e){throw new nn("failed to parse JWT Payload body as base64url encoded JSON",{cause:e})}if(!cn(g))throw new nn("JWT Payload must be a top level object");const b=In()+n;if(void 0!==g.exp){if("number"!=typeof g.exp)throw new nn('unexpected JWT "exp" (expiration time) claim type');if(g.exp<=b-a)throw new nn('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()')}if(void 0!==g.iat&&"number"!=typeof g.iat)throw new nn('unexpected JWT "iat" (issued at) claim type');if(void 0!==g.iss&&"string"!=typeof g.iss)throw new nn('unexpected JWT "iss" (issuer) claim type');if(void 0!==g.nbf){if("number"!=typeof g.nbf)throw new nn('unexpected JWT "nbf" (not before) claim type');if(g.nbf>b+a)throw new nn('unexpected JWT "nbf" (not before) claim value, timestamp is > now()')}if(void 0!==g.aud&&"string"!=typeof g.aud&&!Array.isArray(g.aud))throw new nn('unexpected JWT "aud" (audience) claim type');return{header:l,claims:g,signature:d,key:u}}(s.id_token,Tn.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported),Vn,pn(t),mn(t)).then(Un.bind(void 0,["aud","exp","iat","iss","sub"])).then(Nn.bind(void 0,e.issuer)).then(Ln.bind(void 0,t.client_id));if(Array.isArray(i.aud)&&1!==i.aud.length&&i.azp!==t.client_id)throw new nn('unexpected ID Token "azp" (authorized party) claim value');if(t.require_auth_time&&"number"!=typeof i.auth_time)throw new nn('unexpected ID Token "auth_time" (authentication time) claim value');kn.set(s,i)}}return s}function Ln(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw new nn('unexpected JWT "aud" (audience) claim value')}else if(t.claims.aud!==e)throw new nn('unexpected JWT "aud" (audience) claim value');return t}function Nn(e,t){if(t.claims.iss!==e)throw new nn('unexpected JWT "iss" (issuer) claim value');return t}const En=new WeakSet,Fn={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation"};function Un(e,t){for(const i of e)if(void 0===t.claims[i])throw new nn(`JWT "${i}" (${Fn[i]}) claim missing`);return t}const Rn=Symbol(),On=Symbol();function Sn(e){if(e.bodyUsed)throw new TypeError('"response" body has been used already')}function Yn(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new nn(`${e.name} modulusLength must be at least 2048 bits`)}function _n(e){switch(e){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new en}}function Dn(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:_n(e.algorithm.namedCurve)};case"RSA-PSS":switch(Yn(e.algorithm),e.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:e.algorithm.name,saltLength:parseInt(e.algorithm.hash.name.slice(-3),10)>>3};default:throw new en}case"RSASSA-PKCS1-v1_5":return Yn(e.algorithm),e.algorithm.name;case"Ed448":case"Ed25519":return e.algorithm.name}throw new en}const Vn=Symbol();function Tn(e,t,i){if(void 0===e){if(Array.isArray(t)){if(!t.includes(i.alg))throw new nn('unexpected JWT "alg" header parameter')}else if("RS256"!==i.alg)throw new nn('unexpected JWT "alg" header parameter')}else if(i.alg!==e)throw new nn('unexpected JWT "alg" header parameter')}function Hn(e,t){const{0:i,length:n}=e.getAll(t);if(n>1)throw new nn(`"${t}" parameter must be provided only once`);return i}const Jn=Symbol(),Mn=Symbol();class jn{constructor(e,t){this.storage=Yt(Mt),this.init=async()=>{await this.getOrCreateAuthorizationServer()},this.getOrCreateAuthorizationServer=async()=>{if(!this.authorizationServer){const e=await Di()((async()=>async function(e,t){if(!(e instanceof URL))throw new TypeError('"issuerIdentifier" must be an instance of URL');if("https:"!==e.protocol&&"http:"!==e.protocol)throw new TypeError('"issuer.protocol" must be "https:" or "http:"');const i=new URL(e.href);i.pathname=`${i.pathname}/.well-known/openid-configuration`.replace("//","/");const n=ln(t?.headers);return n.set("accept","application/json"),fetch(i.href,{headers:Object.fromEntries(n.entries()),method:"GET",redirect:"manual",signal:null}).then(rn)}(new URL(this.oidc.idpUrl))),{retries:3,minTimeout:100,maxTimeout:200,maxRetryTime:1e3,onRetry:(e,t)=>{Si(e,{attempt:t})}});if(this.authorizationServer=await async function(e,t){if(!(e instanceof URL))throw new TypeError('"expectedIssuer" must be an instance of URL');if(!Ti(t,Response))throw new TypeError('"response" must be an instance of Response');if(200!==t.status)throw new nn('"response" is not a conform Authorization Server Metadata response');let i;Sn(t);try{i=await t.json()}catch(e){throw new nn('failed to parse "response" body as JSON',{cause:e})}if(!cn(i))throw new nn('"response" body must be a top level object');if(!un(i.issuer))throw new nn('"response" body "issuer" property must be a non-empty string');if(new URL(i.issuer).href!==e.href)throw new nn('"response" body "issuer" does not match "expectedIssuer"');return i}(new URL(this.oidc.issuerUrl),e),!0!==this.authorizationServer.code_challenge_methods_supported?.includes("S256"))throw new Error("Code challenge method not supported")}return this.authorizationServer},this.getRedirectURI=()=>`${new URL(this.oidc.idpUrl).origin}/popup/callback/${window.btoa(window.location.origin)}`,this.constructOIDCAuthorizationUrl=async(e,t,i,n,a)=>{if(!this.authorizationServer.authorization_endpoint)throw new Error("Authorization Endpoint not present");const s=gn(),o=await async function(e){if(!un(e))throw new TypeError('"codeVerifier" must be a non-empty string');return qi(await crypto.subtle.digest("SHA-256",$i(e)))}(s),r=gn(),c=gn();this.storage.set(Fi.CodeVerifier,s),this.storage.set(Fi.Nonce,r),this.storage.set(Fi.State,c);const l=new URLSearchParams({client_id:this.clientId,code_challenge:o,code_challenge_method:"S256",redirect_uri:a||this.getRedirectURI(),state:c,nonce:r,response_type:"code",scope:t.join(" "),market:e,session_id:i}),d=new URLSearchParams(window.location.search).get("klarna-auth-prompt");d&&l.set("prompt",d),n&&l.set("ui_locales",n);const u=new URL(this.authorizationServer.authorization_endpoint);return u.search=l.toString(),u},this.handleRedirect=async e=>{const t=Pt.getInstance(),i={client_id:this.clientId,token_endpoint_auth_method:"none"},n=this.storage.get(Fi.State);if(!n)throw new Error("state missing");const a=this.storage.get(Fi.CodeVerifier);if(!a)throw new Error("codeVerifier missing");const s=this.storage.get(Fi.Nonce);if(!s)throw new Error("nonce missing");const o=new URL(e),r=function(e,t,i,n){if(Cn(e),fn(t),i instanceof URL&&(i=i.searchParams),!(i instanceof URLSearchParams))throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');if(Hn(i,"response"))throw new nn('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');const a=Hn(i,"iss"),s=Hn(i,"state");if(!a&&e.authorization_response_iss_parameter_supported)throw new nn('response parameter "iss" (issuer) missing');if(a&&a!==e.issuer)throw new nn('unexpected "iss" (issuer) response parameter value');switch(n){case void 0:case Mn:if(void 0!==s)throw new nn('unexpected "state" response parameter encountered');break;case Jn:break;default:if(!un(n))throw new nn('"expectedState" must be a non-empty string');if(void 0===s)throw new nn('response parameter "state" missing');if(s!==n)throw new nn('unexpected "state" response parameter value')}const o=Hn(i,"error");if(o)return{error:o,error_description:Hn(i,"error_description"),error_uri:Hn(i,"error_uri")};const r=Hn(i,"id_token"),c=Hn(i,"token");if(void 0!==r||void 0!==c)throw new en("implicit and hybrid flows are not supported");return l=new URLSearchParams(i),En.add(l),l;var l}(this.authorizationServer,i,o,n);if(wn(r))throw t.emit("error",r),"Login cancelled by user"===r.error_description&&this.tracker.sendEvent({name:Ui.LoginCancelled}),new Error(JSON.stringify(r));let c;try{c=await Di()((async()=>async function(e,t,i,n,a,s){if(Cn(e),fn(t),!En.has(i))throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');if(!un(n))throw new TypeError('"redirectUri" must be a non-empty string');if(!un(a))throw new TypeError('"codeVerifier" must be a non-empty string');const o=Hn(i,"code");if(!o)throw new nn('no authorization code in "callbackParameters"');const r=new URLSearchParams(s?.additionalParameters);return r.set("redirect_uri",n),r.set("code_verifier",a),r.set("code",o),Xn(e,t,"authorization_code",r,s)}(this.authorizationServer,i,r,o.origin+o.pathname,a)),{retries:3,minTimeout:100,maxTimeout:200,maxRetryTime:1e3,onRetry:(e,t)=>{Si(e,{attempt:t})}})}catch(e){throw new Yi(`Token Exchange failed. Reason: ${e}`)}const l=await async function(e,t,i,n,a){const s=await Wn(e,t,i);if(wn(s))return s;if(!un(s.id_token))throw new nn('"response" body "id_token" property must be a non-empty string');a??(a=t.default_max_age??On);const o=function(e){if(!e.id_token)return;const t=kn.get(e);if(!t)throw new TypeError('"ref" was already garbage collected or did not resolve from the proper sources');return t}(s);if((t.require_auth_time||a!==On)&&void 0===o.auth_time)throw new nn('ID Token "auth_time" (authentication time) claim missing');if(a!==On){if("number"!=typeof a||a<0)throw new TypeError('"options.max_age" must be a non-negative number');const e=In()+pn(t),i=mn(t);if(o.auth_time+a{this.messenger.addMessageHandler(e,t)},this.initializeAuthServer=async()=>{try{this.authorizationServer=new jn(this.oidc,this.authConfig.clientId),await this.authorizationServer.init()}catch(e){this.redirectToErrorScreen(),Si(e)}},this.getIdpOrigin=()=>new URL(this.oidc.idpUrl).origin,this.setupMessenger=()=>{this.messenger=new ki({target:{window:this.openedPopup},origin:this.getIdpOrigin(),sourceID:"SIWK-to-OIDC"}),this.addListener(Ri.Redirect,this.redirectMessageHandler())},this.redirectToErrorScreen=()=>{if(this.openedPopup){const e=`${this.getIdpOrigin()}/error`;this.openedPopup.location.href=e}},this.start=async e=>{e=e||this.authConfig.interactionMode||(0,vi.detectDeviceBest)();const t=(await this.getOidcAuthorizationUrl(this.authConfig.redirectUri)).toString();if(e!==vi.InteractionModes.REDIRECT)await this.startOnPageMode(t);else{if(!this.authConfig.redirectUri)throw new Error("redirectUri is not provided!");(0,vi.triggerRedirect)(t)}},this.setupPopupWindow=e=>{if(!this.openedPopup)throw new Error("Popup is not opened");this.setLoadingScreen(),this.setupMessenger(),this.updatePopupUrl(e)},this.updatePopupUrl=e=>this.openedPopup.location.href=e,this.getOidcAuthorizationUrl=async e=>{const t=[...new Set(["openid",...this.authConfig.scope.split(" ")])];return this.authorizationServer.constructOIDCAuthorizationUrl(this.authConfig.market,t,this.authConfig.sessionId,this.authConfig.locale,e)},this.setLoadingScreen=()=>this.openedPopup.document.body.innerHTML='\n\n\n \n \n \n \n \n Klarna\n \n