import{r as e,h as i,g as t}from"./p-890a2f7e.js";import{d as s}from"./p-067f8cb2.js";import{a as o}from"./p-dc46d6c3.js";import{p as r}from"./p-da3bdb97.js";import{d as n}from"./p-9f421a09.js";const c={"The selected invoice choice costs $0.":"Avgiften för den valda fakturan är $0.","Due within $0 days":"Betalas inom $0 dagar.","Due before $0.":"Betalas före $0"},a=class{constructor(i){e(this,i)}async componentWillLoad(){this.t=n.create({sv:c},this.element)}async getPayment(e,i){let t;return this.option&&this.selected&&(e.items&&e.currency&&e.customer?t={type:this.option.type,terms:this.selected,verify:{mode:"iframe",parent:window.location.origin}}:console.log("Error: must have items, currency, customer")),t}render(){const e=this.t;return!this.selected&&this.option&&(this.selected=this.option.terms[0]),[this.option?this.option.terms.map((t=>i("smoothly-radio",{onSmoothlySelected:()=>this.selected=t,checked:this.selected==t,name:"invoice-terms",value:t.due.toString()},e("number"==typeof t.due?"Due within $0 days":"Due before $0.",t.due)))):[],this.selected?i("p",null,e("The selected invoice choice costs $0.",s.format(this.selected.fee,"price",this.currency))):[]]}get element(){return t(this)}};r("invoice",(e=>{const t={type:"invoice",name:"Invoice",brand:e.service,component:i("ig-invoice-details",{option:o(e)?e:void 0,currency:e.currency,ref:e=>t.element=e})};return t})),a.style=".sc-ig-invoice-details-h>p.sc-ig-invoice-details{padding-left:0.4em;padding-right:0.4em}smoothly-radio.sc-ig-invoice-details{width:calc(100% - 2px)}";export{a as I}