@revenuecat/purchases-js 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Purchases.es.js +775 -775
- package/dist/Purchases.umd.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/Purchases.umd.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(L,V){typeof exports=="object"&&typeof module<"u"?V(exports):typeof define=="function"&&define.amd?define(["exports"],V):(L=typeof globalThis<"u"?globalThis:L||self,V(L.Purchases={}))})(this,function(L){"use strict";var Ts=Object.defineProperty;var Rs=(L,V,re)=>V in L?Ts(L,V,{enumerable:!0,configurable:!0,writable:!0,value:re}):L[V]=re;var C=(L,V,re)=>(Rs(L,typeof V!="symbol"?V+"":V,re),re);function V(t){return t!=null}var re=(t=>(t.Unknown="unknown",t.Custom="custom",t.Lifetime="$rc_lifetime",t.Annual="$rc_annual",t.SixMonth="$rc_six_month",t.ThreeMonth="$rc_three_month",t.TwoMonth="$rc_two_month",t.Monthly="$rc_monthly",t.Weekly="$rc_weekly",t))(re||{});const xt=(t,e)=>({identifier:t.identifier,displayName:t.title,currentPrice:t.current_price,normalPeriodDuration:t.normal_period_duration,presentedOfferingIdentifier:e}),Gt=(t,e,r)=>{const n=r[e.platform_product_identifier];return n===void 0?null:{identifier:e.identifier,rcBillingProduct:xt(n,t),packageType:Yt(e.identifier)}},et=(t,e)=>{const r=t.packages.map(i=>Gt(t.identifier,i,e)).filter(V),n={};for(const i of r)i!=null&&(n[i.identifier]=i);return r.length==0?null:{identifier:t.identifier,serverDescription:t.description,metadata:t.metadata,packagesById:n,availablePackages:r,lifetime:n.$rc_lifetime??null,annual:n.$rc_annual??null,sixMonth:n.$rc_six_month??null,threeMonth:n.$rc_three_month??null,twoMonth:n.$rc_two_month??null,monthly:n.$rc_monthly??null,weekly:n.$rc_weekly??null}};function Yt(t){switch(t){case"$rc_lifetime":return"$rc_lifetime";case"$rc_annual":return"$rc_annual";case"$rc_six_month":return"$rc_six_month";case"$rc_three_month":return"$rc_three_month";case"$rc_two_month":return"$rc_two_month";case"$rc_monthly":return"$rc_monthly";case"$rc_weekly":return"$rc_weekly";default:return t.startsWith("$rc_")?"unknown":"custom"}}function v(){}function Ht(t,e){for(const r in e)t[r]=e[r];return t}function tt(t){return t()}function nt(){return Object.create(null)}function pe(t){t.forEach(tt)}function le(t){return typeof t=="function"}function P(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let De;function ee(t,e){return t===e?!0:(De||(De=document.createElement("a")),De.href=e,t===De.href)}function rt(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function qt(t,e){const r=rt(t.srcset),n=rt(e||"");return n.length===r.length&&n.every(([i,s],o)=>s===r[o][1]&&(ee(r[o][0],i)||ee(i,r[o][0])))}function Kt(t){return Object.keys(t).length===0}function G(t,e,r,n){if(t){const i=it(t,e,r,n);return t[0](i)}}function it(t,e,r,n){return t[1]&&n?Ht(r.ctx.slice(),t[1](n(e))):r.ctx}function Y(t,e,r,n){if(t[2]&&n){const i=t[2](n(r));if(e.dirty===void 0)return i;if(typeof i=="object"){const s=[],o=Math.max(e.dirty.length,i.length);for(let l=0;l<o;l+=1)s[l]=e.dirty[l]|i[l];return s}return e.dirty|i}return e.dirty}function H(t,e,r,n,i,s){if(i){const o=it(e,r,n,s);t.p(o,i)}}function q(t){if(t.ctx.length>32){const e=[],r=t.ctx.length/32;for(let n=0;n<r;n++)e[n]=-1;return e}return-1}function Ae(t){return t??""}function D(t,e){t.appendChild(e)}function S(t,e,r){const n=jt(t);if(!n.getElementById(e)){const i=k("style");i.id=e,i.textContent=r,Jt(n,i)}}function jt(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function Jt(t,e){return D(t.head||t,e),e.sheet}function p(t,e,r){t.insertBefore(e,r||null)}function g(t){t.parentNode&&t.parentNode.removeChild(t)}function k(t){return document.createElement(t)}function N(t){return document.createTextNode(t)}function T(){return N(" ")}function te(){return N("")}function _e(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function st(t){return function(e){return e.preventDefault(),t.call(this,e)}}function A(t,e,r){r==null?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}const Vt=["width","height"];function Wt(t,e){const r=Object.getOwnPropertyDescriptors(t.__proto__);for(const n in e)e[n]==null?t.removeAttribute(n):n==="style"?t.style.cssText=e[n]:n==="__value"?t.value=t[n]=e[n]:r[n]&&r[n].set&&Vt.indexOf(n)===-1?t[n]=e[n]:A(t,n,e[n])}function zt(t,e){Object.keys(e).forEach(r=>{Xt(t,r,e[r])})}function Xt(t,e,r){const n=e.toLowerCase();n in t?t[n]=typeof t[n]=="boolean"&&r===""?!0:r:e in t?t[e]=typeof t[e]=="boolean"&&r===""?!0:r:A(t,e,r)}function Zt(t){return/-/.test(t)?zt:Wt}function en(t){return Array.from(t.childNodes)}function ie(t,e){e=""+e,t.data!==e&&(t.data=e)}function ot(t,e){t.value=e??""}function tn(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}let he;function Ee(t){he=t}function Me(){if(!he)throw new Error("Function called outside component initialization");return he}function Qe(t){Me().$$.on_mount.push(t)}function nn(){const t=Me();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const s=tn(e,r,{cancelable:n});return i.slice().forEach(o=>{o.call(t,s)}),!s.defaultPrevented}return!0}}function rn(t,e){return Me().$$.context.set(t,e),e}function sn(t){return Me().$$.context.get(t)}function lt(t,e){const r=t.$$.callbacks[e.type];r&&r.slice().forEach(n=>n.call(this,e))}const ce=[],Ce=[];let ae=[];const Ge=[],on=Promise.resolve();let Ye=!1;function ln(){Ye||(Ye=!0,on.then(ct))}function He(t){ae.push(t)}function cn(t){Ge.push(t)}const qe=new Set;let ue=0;function ct(){if(ue!==0)return;const t=he;do{try{for(;ue<ce.length;){const e=ce[ue];ue++,Ee(e),an(e.$$)}}catch(e){throw ce.length=0,ue=0,e}for(Ee(null),ce.length=0,ue=0;Ce.length;)Ce.pop()();for(let e=0;e<ae.length;e+=1){const r=ae[e];qe.has(r)||(qe.add(r),r())}ae.length=0}while(ce.length);for(;Ge.length;)Ge.pop()();Ye=!1,qe.clear(),Ee(t)}function an(t){if(t.fragment!==null){t.update(),pe(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(He)}}function un(t){const e=[],r=[];ae.forEach(n=>t.indexOf(n)===-1?e.push(n):r.push(n)),r.forEach(n=>n()),ae=e}const Pe=new Set;let se;function F(){se={r:0,c:[],p:se}}function x(){se.r||pe(se.c),se=se.p}function u(t,e){t&&t.i&&(Pe.delete(t),t.i(e))}function d(t,e,r,n){if(t&&t.o){if(Pe.has(t))return;Pe.add(t),se.c.push(()=>{Pe.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}function fn(t,e,r){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=r,r(t.$$.ctx[n]))}function w(t){t&&t.c()}function I(t,e,r){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,r),He(()=>{const s=t.$$.on_mount.map(tt).filter(le);t.$$.on_destroy?t.$$.on_destroy.push(...s):pe(s),t.$$.on_mount=[]}),i.forEach(He)}function b(t,e){const r=t.$$;r.fragment!==null&&(un(r.after_update),pe(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function dn(t,e){t.$$.dirty[0]===-1&&(ce.push(t),ln(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function R(t,e,r,n,i,s,o=null,l=[-1]){const c=he;Ee(t);const a=t.$$={fragment:null,ctx:[],props:s,update:v,not_equal:i,bound:nt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:nt(),dirty:l,skip_bound:!1,root:e.target||c.$$.root};o&&o(a.root);let f=!1;if(a.ctx=r?r(t,e.props||{},(m,E,...y)=>{const _=y.length?y[0]:E;return a.ctx&&i(a.ctx[m],a.ctx[m]=_)&&(!a.skip_bound&&a.bound[m]&&a.bound[m](_),f&&dn(t,m)),E}):[],a.update(),f=!0,pe(a.before_update),a.fragment=n?n(a.ctx):!1,e.target){if(e.hydrate){const m=en(e.target);a.fragment&&a.fragment.l(m),m.forEach(g)}else a.fragment&&a.fragment.c();e.intro&&u(t.$$.fragment),I(t,e.target,e.anchor),ct()}Ee(c)}class U{constructor(){C(this,"$$");C(this,"$$set")}$destroy(){b(this,1),this.$destroy=v}$on(e,r){if(!le(r))return v;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!Kt(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const mn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(mn);function gn(t){S(t,"svelte-1bzqb13",".rcb-modal-section.svelte-1bzqb13{padding:8px 0px;display:flex}section.rcb-modal-section.svelte-1bzqb13{flex-grow:1}.rcb-modal-section.svelte-1bzqb13:last-of-type{padding:0}")}function Ke(t){let e,r;const n=t[2].default,i=G(n,t,t[1],null);return{c(){e=k(t[0]),i&&i.c(),Zt(t[0])(e,{class:Ae("rcb-modal-section")+" svelte-1bzqb13"})},m(s,o){p(s,e,o),i&&i.m(e,null),r=!0},p(s,o){i&&i.p&&(!r||o&2)&&H(i,n,s,s[1],r?Y(n,s[1],o,null):q(s[1]),null)},i(s){r||(u(i,s),r=!0)},o(s){d(i,s),r=!1},d(s){s&&g(e),i&&i.d(s)}}}function pn(t){let e=t[0],r,n,i=t[0]&&Ke(t);return{c(){i&&i.c(),r=te()},m(s,o){i&&i.m(s,o),p(s,r,o),n=!0},p(s,[o]){s[0]?e?P(e,s[0])?(i.d(1),i=Ke(s),e=s[0],i.c(),i.m(r.parentNode,r)):i.p(s,o):(i=Ke(s),e=s[0],i.c(),i.m(r.parentNode,r)):e&&(i.d(1),i=null,e=s[0])},i(s){n||(u(i,s),n=!0)},o(s){d(i,s),n=!1},d(s){s&&g(r),i&&i.d(s)}}}function An(t,e,r){let{$$slots:n={},$$scope:i}=e,{as:s="section"}=e;return t.$$set=o=>{"as"in o&&r(0,s=o.as),"$$scope"in o&&r(1,i=o.$$scope)},[s,i,n]}class fe extends U{constructor(e){super(),R(this,e,An,pn,P,{as:0},gn)}}var K=(t=>(t[t.Silent=0]="Silent",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug",t[t.Verbose=5]="Verbose",t))(K||{});class W{static setLogLevel(e){this.logLevel=e}static log(e,r=this.logLevel){const n=`[Purchases] ${e}`;if(!(this.logLevel<r||r===K.Silent))switch(r){case K.Error:console.error(n);break;case K.Warn:console.warn(n);break;case K.Info:console.info(n);break;case K.Debug:console.debug(n);break;case K.Verbose:console.debug(n);break}}static errorLog(e){this.log(e,K.Error)}static warnLog(e){this.log(e,K.Warn)}static infoLog(e){this.log(e,K.Info)}static debugLog(e){this.log(e,K.Debug)}static verboseLog(e){this.log(e,K.Verbose)}}C(W,"logLevel",K.Silent);var Ie=(t=>(t.Year="year",t.Month="month",t.Week="week",t.Day="day",t))(Ie||{});function _n(t){const e=t.match(/^PT?([0-9]+)([MDYW])$/);if(!e||e.length<3)return W.errorLog(`Invalid ISO 8601 duration format: ${t}`),null;const r=parseInt(e[1]);switch(e[2]){case"Y":return{number:r,unit:"year"};case"M":return{number:r,unit:"month"};case"W":return{number:r,unit:"week"};case"D":return{number:r,unit:"day"};default:return W.errorLog(`Invalid ISO 8601 unit duration format: ${t}`),null}}const at=(t,e)=>{const r=t/100;return new Intl.NumberFormat("en-US",{style:"currency",currency:e}).format(r)},ut=t=>{const e=_n(t);if(!e)return"unknown";const r=e.number;if(r===1)switch(e.unit){case Ie.Year:return"yearly";case Ie.Month:return"monthly";case Ie.Week:return"weekly";case Ie.Day:return"daily"}else return`every ${r} ${e.unit}s`};function hn(t){S(t,"svelte-i5dq8q",".rcb-pricing-info.svelte-i5dq8q{display:flex;flex-direction:column;margin-top:102px;font-weight:500}.rcb-product-price.svelte-i5dq8q{font-size:24px;margin:12px 0px}.rcb-product-details.svelte-i5dq8q{opacity:0.6;list-style-type:disc;list-style-position:inside;margin:0px;padding:0px}@media screen and (max-width: 960px){.rcb-pricing-info.svelte-i5dq8q{margin-top:48px}}")}function En(t){let e,r,n=t[0].displayName+"",i,s,o,l=t[0].currentPrice.currency+"",c,a=" ",f,m=at(t[0].currentPrice.amount,t[0].currentPrice.currency)+"",E,y,_,Q,h,B=ut(t[0].normalPeriodDuration)+"",J,$,Be,xe,ge;return{c(){e=k("div"),r=k("span"),i=N(n),s=T(),o=k("span"),c=N(l),f=N(a),E=N(m),y=T(),_=k("ul"),Q=k("li"),h=N("Billed "),J=N(B),$=T(),Be=k("li"),Be.textContent="Plan continues until cancelled",xe=T(),ge=k("li"),ge.textContent="Cancel anytime",A(o,"class","rcb-product-price svelte-i5dq8q"),A(_,"class","rcb-product-details svelte-i5dq8q"),A(e,"class","rcb-pricing-info svelte-i5dq8q")},m(Z,X){p(Z,e,X),D(e,r),D(r,i),D(e,s),D(e,o),D(o,c),D(o,f),D(o,E),D(e,y),D(e,_),D(_,Q),D(Q,h),D(Q,J),D(_,$),D(_,Be),D(_,xe),D(_,ge)},p(Z,X){X&1&&n!==(n=Z[0].displayName+"")&&ie(i,n),X&1&&l!==(l=Z[0].currentPrice.currency+"")&&ie(c,l),X&1&&m!==(m=at(Z[0].currentPrice.amount,Z[0].currentPrice.currency)+"")&&ie(E,m),X&1&&B!==(B=ut(Z[0].normalPeriodDuration)+"")&&ie(J,B)},d(Z){Z&&g(e)}}}function In(t){let e,r;return e=new fe({props:{$$slots:{default:[En]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const s={};i&3&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function bn(t,e,r){let{productDetails:n}=e;return t.$$set=i=>{"productDetails"in i&&r(0,n=i.productDetails)},[n]}class ft extends U{constructor(e){super(),R(this,e,bn,In,P,{productDetails:0},hn)}}const wn="data:image/gif;base64,R0lGODlhMgAyAPcBAAAAAAD/AAMDAwcHBxERERUVFSoqKi0tLTAwMDg4OD09PURERElJSUtLS1BQUFJSUlVVVVdXV1paWl9fX2NjY2ZmZmlpaWxsbG1tbXNzc3t7e39/f4GBgYKCgoSEhIaGhoeHh4iIiIuLi5KSkpSUlJaWlp2dnaGhoaOjo6SkpKWlpaenp6ioqKqqqqurq6ysrLCwsLGxsbS0tLa2tri4uLm5ub29vb6+vsDAwMHBwcLCwsXFxcjIyMnJyc3Nzc7OztPT09TU1NXV1dfX19nZ2dra2tvb29zc3N7e3uDg4OHh4eLi4uPj4+fn5+np6ezs7O7u7vDw8PHx8fLy8vPz8/X19fb29vj4+Pn5+fz8/P39/f7+/v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFBAABACwAAAAAMgAyAIcAAAAA/wADAwMHBwcREREVFRUqKiotLS0wMDA4ODg9PT1ERERJSUlLS0tQUFBSUlJVVVVXV1daWlpfX19jY2NmZmZpaWlsbGxtbW1zc3N7e3t/f3+BgYGCgoKEhISGhoaHh4eIiIiLi4uSkpKUlJSWlpadnZ2hoaGjo6OkpKSlpaWnp6eoqKiqqqqrq6usrKywsLCxsbG0tLS2tra4uLi5ubm9vb2+vr7AwMDBwcHCwsLFxcXIyMjJycnNzc3Ozs7T09PU1NTV1dXX19fZ2dna2trb29vc3Nze3t7g4ODh4eHi4uLj4+Pn5+fp6ens7Ozu7u7w8PDx8fHy8vLz8/P19fX29vb4+Pj5+fn8/Pz9/f3+/v7///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8I/wCzcBFIcKDBgggPKkzIcCEXLlq4bIEokeLEiBcrYrTIcaNHjRobinQ4sqRCkBlTdtR44MBKlR9TmjQJQMBMkgZfdpwSMSYAACgpRtHpcSYSFUIa1mz448UQnAWDfmzSooUVmD9XVnnBwglMlDdvvMjhcOlCHit23CSqcUrVJiizpnTC4sXQmB1vZvmxwgYWhWYLznjRA+rJryqvxGhxxGNLjkVcwMCCN6ZeLkNevDCcRYYKJJfZptyCQwdiijl0CDxdlLPryw2lymY9WzTs17ijVq69mzbM28Bd8x7u23bu46F7i16uXEvw5ziJM5duGbl1k9OLN5cKvfvh7OC3b0jxTv6h+PDUy3unzl67RPXXc56fnz4+/PbofcOHnr9/5f3x4UeffvYVqJuACP5m4IIJ+gfWgusN6KCCAN7WoITVVXjchBxqERAAIfkEBQQAAQAsDQADACAAEAAACKcAAwgcSDDAAwcFEypcSNDAAYYQA2DZstCAAYZOKCqM8uNJxYcKa3DYsVBKECBYFFpU+MTDhiIMkQxBohJkwRYaUkDEEiQIlYQrCyLZ0MFJRCdAkgC1OZBEBxgRJRIBAqXgwYI8NoCwEjWAkyFDoorQ4KOrQCRLoqbQuZCKR7NdqzD5MaQKXIhZmAwBIqTJ3YVYogQZ8oMJ178Kk/A1YhfxQiRHjBYMCAAh+QQFBQABACwNAAMAIAAQAAAInQADCBxIMECGDAU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{c(){e=k("img"),ee(e.src,r=wn)||A(e,"src",r),A(e,"alt","spinner")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class $n extends U{constructor(e){super(),R(this,e,null,kn,P,{})}}function vn(t){S(t,"svelte-1mxx341",".rcb-modal-loader.svelte-1mxx341{width:100%;flex-grow:1;min-height:100%;display:flex;justify-content:center;align-items:center}")}function yn(t){let e,r,n;return r=new $n({}),{c(){e=k("div"),w(r.$$.fragment),A(e,"class","rcb-modal-loader svelte-1mxx341")},m(i,s){p(i,e,s),I(r,e,null),n=!0},p:v,i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}class je extends U{constructor(e){super(),R(this,e,null,yn,P,{},vn)}}var be=(t=>(t.Started="started",t.InProgress="in_progress",t.Succeeded="succeeded",t.Failed="failed",t))(be||{}),Te=(t=>(t[t.SetupIntentCreationFailed=1]="SetupIntentCreationFailed",t[t.PaymentMethodCreationFailed=2]="PaymentMethodCreationFailed",t[t.PaymentChargeFailed=3]="PaymentChargeFailed",t))(Te||{}),O=(t=>(t[t.ErrorSettingUpPurchase=0]="ErrorSettingUpPurchase",t[t.ErrorChargingPayment=1]="ErrorChargingPayment",t[t.UnknownError=2]="UnknownError",t[t.NetworkError=3]="NetworkError",t[t.StripeError=4]="StripeError",t[t.MissingEmailError=5]="MissingEmailError",t))(O||{});class j extends Error{constructor(e,r,n){super(r),this.errorCode=e,this.underlyingErrorMessage=n}}class Bn{constructor(e,r=10){C(this,"operationSessionId",null);C(this,"backend");C(this,"maxNumberAttempts");C(this,"waitMSBetweenAttempts",1e3);this.backend=e,this.maxNumberAttempts=r}async startPurchase(e,r,n,i){const s=await this.backend.postSubscribe(e,r,n,i);return this.operationSessionId=s.operation_session_id,s}async pollCurrentPurchaseForCompletion(){const e=this.operationSessionId;if(!e)throw new j(0,"No purchase in progress");return new Promise((r,n)=>{const i=(s=1)=>{if(s>this.maxNumberAttempts){this.clearPurchaseInProgress(),n(new j(2,"Max attempts reached trying to get successful purchase status"));return}this.backend.getCheckoutStatus(e).then(o=>{switch(o.operation.status){case be.Started:case be.InProgress:setTimeout(()=>i(s+1),this.waitMSBetweenAttempts);break;case be.Succeeded:this.clearPurchaseInProgress(),r();return;case be.Failed:this.clearPurchaseInProgress(),this.handlePaymentError(o.operation.error,n)}}).catch(o=>{n(new j(3,o.message))})};i()})}clearPurchaseInProgress(){this.operationSessionId=null}handlePaymentError(e,r){if(e==null){r(new j(2,"Got an error status but error field is empty."));return}switch(e.code){case Te.SetupIntentCreationFailed:r(new j(0,"Setup intent creation failed"));return;case Te.PaymentMethodCreationFailed:r(new j(0,"Payment method creation failed"));return;case Te.PaymentChargeFailed:r(new j(1,"Payment charge failed"));return}}}const Dn="data:image/svg+xml,%3csvg%20width='124'%20height='124'%20viewBox='0%200%20124%20124'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='62'%20cy='62'%20r='62'%20fill='%23767676'/%3e%3cpath%20d='M87.6668%2041.504L82.4968%2036.334L62.0002%2056.8307L41.5035%2036.334L36.3335%2041.504L56.8302%2062.0006L36.3335%2082.4973L41.5035%2087.6673L62.0002%2067.1706L82.4968%2087.6673L87.6668%2082.4973L67.1702%2062.0006L87.6668%2041.504Z'%20fill='white'/%3e%3c/svg%3e";function Mn(t){S(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Qn(t){let e,r;return{c(){e=k("img"),ee(e.src,r=Dn)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class Cn extends U{constructor(e){super(),R(this,e,null,Qn,P,{},Mn)}}function Pn(t){S(t,"svelte-1rmxk7q","button.svelte-1rmxk7q{border:none;border-radius:56px;font-size:16px;cursor:pointer;height:56px;color:var(--rc-color-grey-text-dark);background-color:var(--rc-color-grey-ui-dark);display:flex;align-items:center;justify-content:center}button.intent-primary.svelte-1rmxk7q{background-color:var(--rc-color-grey-text-dark);color:var(--rc-color-white);font-size:16px}button.svelte-1rmxk7q:disabled{color:var(--rc-color-grey-text-light)}button.intent-primary.svelte-1rmxk7q:disabled{color:var(--rc-color-grey-text-light)}")}function Tn(t){let e,r,n,i,s;const o=t[3].default,l=G(o,t,t[2],null);return{c(){e=k("button"),l&&l.c(),A(e,"class",r=Ae(`intent-${t[0]}`)+" svelte-1rmxk7q"),e.disabled=t[1]},m(c,a){p(c,e,a),l&&l.m(e,null),n=!0,i||(s=_e(e,"click",t[4]),i=!0)},p(c,[a]){l&&l.p&&(!n||a&4)&&H(l,o,c,c[2],n?Y(o,c[2],a,null):q(c[2]),null),(!n||a&1&&r!==(r=Ae(`intent-${c[0]}`)+" svelte-1rmxk7q"))&&A(e,"class",r),(!n||a&2)&&(e.disabled=c[1])},i(c){n||(u(l,c),n=!0)},o(c){d(l,c),n=!1},d(c){c&&g(e),l&&l.d(c),i=!1,s()}}}function Rn(t,e,r){let{$$slots:n={},$$scope:i}=e,{intent:s="primary"}=e,{disabled:o=!1}=e;function l(c){lt.call(this,t,c)}return t.$$set=c=>{"intent"in c&&r(0,s=c.intent),"disabled"in c&&r(1,o=c.disabled),"$$scope"in c&&r(2,i=c.$$scope)},[s,o,i,n,l]}class we extends U{constructor(e){super(),R(this,e,Rn,Tn,P,{intent:0,disabled:1},Pn)}}function Un(t){S(t,"svelte-1f9z0o8","footer.svelte-1f9z0o8{display:flex;flex-direction:column}")}function Nn(t){let e,r;const n=t[1].default,i=G(n,t,t[0],null);return{c(){e=k("footer"),i&&i.c(),A(e,"class","rcb-modal-footer svelte-1f9z0o8")},m(s,o){p(s,e,o),i&&i.m(e,null),r=!0},p(s,[o]){i&&i.p&&(!r||o&1)&&H(i,n,s,s[0],r?Y(n,s[0],o,null):q(s[0]),null)},i(s){r||(u(i,s),r=!0)},o(s){d(i,s),r=!1},d(s){s&&g(e),i&&i.d(s)}}}function Sn(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=s=>{"$$scope"in s&&r(0,i=s.$$scope)},[i,n]}class Je extends U{constructor(e){super(),R(this,e,Sn,Nn,P,{},Un)}}function On(t){S(t,"svelte-6o8e90",'.column.svelte-6o8e90{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "8px");flex-grow:1}')}function Ln(t){let e,r,n;const i=t[2].default,s=G(i,t,t[1],null);return{c(){e=k("div"),s&&s.c(),A(e,"class","column svelte-6o8e90"),A(e,"style",r=`--gap:${t[0]};`)},m(o,l){p(o,e,l),s&&s.m(e,null),n=!0},p(o,[l]){s&&s.p&&(!n||l&2)&&H(s,i,o,o[1],n?Y(i,o[1],l,null):q(o[1]),null),(!n||l&1&&r!==(r=`--gap:${o[0]};`))&&A(e,"style",r)},i(o){n||(u(s,o),n=!0)},o(o){d(s,o),n=!1},d(o){o&&g(e),s&&s.d(o)}}}function Fn(t,e,r){let{$$slots:n={},$$scope:i}=e,{gutter:s="8px"}=e;return t.$$set=o=>{"gutter"in o&&r(0,s=o.gutter),"$$scope"in o&&r(1,i=o.$$scope)},[s,i,n]}class ke extends U{constructor(e){super(),R(this,e,Fn,Ln,P,{gutter:0},On)}}const xn="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='mdi_close'%3e%3cpath%20id='Vector'%20d='M19%206.41L17.59%205L12%2010.59L6.41%205L5%206.41L10.59%2012L5%2017.59L6.41%2019L12%2013.41L17.59%2019L19%2017.59L13.41%2012L19%206.41Z'%20fill='%23767676'/%3e%3c/g%3e%3c/svg%3e";function Gn(t){S(t,"svelte-14xreta",".close-button.svelte-14xreta{border:none;cursor:pointer;background-color:transparent;padding:0px}")}function Yn(t){let e,r,n,i,s;return{c(){e=k("button"),r=k("img"),ee(r.src,n=xn)||A(r,"src",n),A(r,"alt","close"),A(e,"class","close-button svelte-14xreta"),e.disabled=t[0]},m(o,l){p(o,e,l),D(e,r),i||(s=_e(e,"click",t[1]),i=!0)},p(o,[l]){l&1&&(e.disabled=o[0])},i:v,o:v,d(o){o&&g(e),i=!1,s()}}}function Hn(t,e,r){let{disabled:n=!1}=e;function i(s){lt.call(this,t,s)}return t.$$set=s=>{"disabled"in s&&r(0,n=s.disabled)},[n,i]}class qn extends U{constructor(e){super(),R(this,e,Hn,Yn,P,{disabled:0},Gn)}}function Kn(t){S(t,"svelte-44qpq9",".rcb-app-icon.svelte-44qpq9{width:40px;height:40px;border-radius:12px;box-shadow:0px 1px 10px 0px rgba(0, 0, 0, 0.1);margin-right:16px}.rcb-app-icon-picture-container.svelte-44qpq9{height:40px}.rcb-app-icon.loading.svelte-44qpq9{background-color:gray}")}function jn(t){let e;return{c(){e=k("div"),A(e,"class","rcb-app-icon loading svelte-44qpq9")},m(r,n){p(r,e,n)},p:v,d(r){r&&g(e)}}}function Jn(t){let e,r,n,i,s,o;return{c(){e=k("picture"),r=k("source"),i=T(),s=k("img"),A(r,"type","image/webp"),qt(r,n=t[1])||A(r,"srcset",n),A(s,"class","rcb-app-icon svelte-44qpq9"),ee(s.src,o=t[0])||A(s,"src",o),A(s,"alt","App icon"),A(e,"class","rcb-app-icon-picture-container svelte-44qpq9")},m(l,c){p(l,e,c),D(e,r),D(e,i),D(e,s)},p(l,c){c&2&&n!==(n=l[1])&&A(r,"srcset",n),c&1&&!ee(s.src,o=l[0])&&A(s,"src",o)},d(l){l&&g(e)}}}function Vn(t){let e;function r(s,o){return s[0]!==null?Jn:jn}let n=r(t),i=n(t);return{c(){i.c(),e=te()},m(s,o){i.m(s,o),p(s,e,o)},p(s,[o]){n===(n=r(s))&&i?i.p(s,o):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},i:v,o:v,d(s){s&&g(e),i.d(s)}}}function Wn(t,e,r){let{src:n=null}=e,{srcWebp:i=null}=e;return t.$$set=s=>{"src"in s&&r(0,n=s.src),"srcWebp"in s&&r(1,i=s.srcWebp)},[n,i]}class dt extends U{constructor(e){super(),R(this,e,Wn,Vn,P,{src:0,srcWebp:1},Kn)}}const Re=t=>`https://da08ctfrofx1b.cloudfront.net/${t}`;function zn(t){S(t,"svelte-10uf5fq",".app-title.svelte-10uf5fq{font-weight:500;margin:8px 0;font-size:16px}.rcb-header-layout__business-info.svelte-10uf5fq{display:flex;align-items:center}")}function Xn(t){let e,r;return e=new dt({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Zn(t){let e,r,n=t[0].seller_company_name+"",i,s,o=t[0].app_icon_webp!==null&&t[0].app_icon!==null&&mt(t);return{c(){o&&o.c(),e=T(),r=k("span"),i=N(n),A(r,"class","app-title svelte-10uf5fq")},m(l,c){o&&o.m(l,c),p(l,e,c),p(l,r,c),D(r,i),s=!0},p(l,c){l[0].app_icon_webp!==null&&l[0].app_icon!==null?o?(o.p(l,c),c&1&&u(o,1)):(o=mt(l),o.c(),u(o,1),o.m(e.parentNode,e)):o&&(F(),d(o,1,1,()=>{o=null}),x()),(!s||c&1)&&n!==(n=l[0].seller_company_name+"")&&ie(i,n)},i(l){s||(u(o),s=!0)},o(l){d(o),s=!1},d(l){l&&(g(e),g(r)),o&&o.d(l)}}}function mt(t){let e,r;return e=new dt({props:{src:Re(t[0].app_icon),srcWebp:Re(t[0].app_icon_webp)}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const s={};i&1&&(s.src=Re(n[0].app_icon)),i&1&&(s.srcWebp=Re(n[0].app_icon_webp)),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function er(t){let e,r,n,i;const s=[Zn,Xn],o=[];function l(c,a){return c[0]!==null?0:1}return r=l(t),n=o[r]=s[r](t),{c(){e=k("div"),n.c(),A(e,"class","rcb-header-layout__business-info svelte-10uf5fq")},m(c,a){p(c,e,a),o[r].m(e,null),i=!0},p(c,[a]){let f=r;r=l(c),r===f?o[r].p(c,a):(F(),d(o[f],1,1,()=>{o[f]=null}),x(),n=o[r],n?n.p(c,a):(n=o[r]=s[r](c),n.c()),u(n,1),n.m(e,null))},i(c){i||(u(n),i=!0)},o(c){d(n),i=!1},d(c){c&&g(e),o[r].d()}}}function tr(t,e,r){let{brandingInfo:n=null}=e;return t.$$set=i=>{"brandingInfo"in i&&r(0,n=i.brandingInfo)},[n]}class gt extends U{constructor(e){super(),R(this,e,tr,er,P,{brandingInfo:0},zn)}}function nr(t){S(t,"svelte-17puakv",".rcb-post-purchase-header-layout.svelte-17puakv{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:-4px}")}function rr(t){let e,r,n,i,s;return r=new gt({props:{brandingInfo:t[0]}}),i=new qn({}),i.$on("click",function(){le(t[1])&&t[1].apply(this,arguments)}),{c(){e=k("div"),w(r.$$.fragment),n=T(),w(i.$$.fragment),A(e,"class","rcb-post-purchase-header-layout svelte-17puakv")},m(o,l){p(o,e,l),I(r,e,null),D(e,n),I(i,e,null),s=!0},p(o,l){t=o;const c={};l&1&&(c.brandingInfo=t[0]),r.$set(c)},i(o){s||(u(r.$$.fragment,o),u(i.$$.fragment,o),s=!0)},o(o){d(r.$$.fragment,o),d(i.$$.fragment,o),s=!1},d(o){o&&g(e),b(r),b(i)}}}function ir(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[rr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const s={};i&7&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function sr(t,e,r){let{brandingInfo:n=null}=e,{onClose:i}=e;return t.$$set=s=>{"brandingInfo"in s&&r(0,n=s.brandingInfo),"onClose"in s&&r(1,i=s.onClose)},[n,i]}class or extends U{constructor(e){super(),R(this,e,sr,ir,P,{brandingInfo:0,onClose:1},nr)}}function lr(t){S(t,"svelte-10pcqja",".rcb-modal-message.svelte-10pcqja{width:100%;min-height:160px;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center}.title.svelte-10pcqja{font-size:24px;line-height:1.25em}.subtitle.svelte-10pcqja{font-size:16px;line-height:1.25em;overflow-wrap:anywhere}")}const cr=t=>({}),pt=t=>({});function ar(t){let e,r,n,i,s;const o=t[4].default,l=G(o,t,t[5],null);return{c(){e=k("span"),r=N(t[2]),n=T(),i=k("span"),l&&l.c(),A(e,"class","title svelte-10pcqja"),A(i,"class","subtitle svelte-10pcqja")},m(c,a){p(c,e,a),D(e,r),p(c,n,a),p(c,i,a),l&&l.m(i,null),s=!0},p(c,a){(!s||a&4)&&ie(r,c[2]),l&&l.p&&(!s||a&32)&&H(l,o,c,c[5],s?Y(o,c[5],a,null):q(c[5]),null)},i(c){s||(u(l,c),s=!0)},o(c){d(l,c),s=!1},d(c){c&&(g(e),g(n),g(i)),l&&l.d(c)}}}function ur(t){let e,r,n;const i=t[4].icon,s=G(i,t,t[5],pt);return r=new ke({props:{gutter:"16px",$$slots:{default:[ar]},$$scope:{ctx:t}}}),{c(){s&&s.c(),e=T(),w(r.$$.fragment)},m(o,l){s&&s.m(o,l),p(o,e,l),I(r,o,l),n=!0},p(o,l){s&&s.p&&(!n||l&32)&&H(s,i,o,o[5],n?Y(i,o[5],l,cr):q(o[5]),pt);const c={};l&36&&(c.$$scope={dirty:l,ctx:o}),r.$set(c)},i(o){n||(u(s,o),u(r.$$.fragment,o),n=!0)},o(o){d(s,o),d(r.$$.fragment,o),n=!1},d(o){o&&g(e),s&&s.d(o),b(r,o)}}}function fr(t){let e,r,n;return r=new ke({props:{gutter:"16px",$$slots:{default:[ur]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),A(e,"class","rcb-modal-message svelte-10pcqja"),A(e,"data-type",t[3])},m(i,s){p(i,e,s),I(r,e,null),n=!0},p(i,s){const o={};s&36&&(o.$$scope={dirty:s,ctx:i}),r.$set(o),(!n||s&8)&&A(e,"data-type",i[3])},i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function dr(t){let e;return{c(){e=N("Go back to app")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function mr(t){let e,r;return e=new we({props:{$$slots:{default:[dr]},$$scope:{ctx:t}}}),e.$on("click",function(){le(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){t=n;const s={};i&32&&(s.$$scope={dirty:i,ctx:t}),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function gr(t){let e,r,n,i,s,o;return e=new or({props:{brandingInfo:t[0],onClose:t[1]}}),n=new fe({props:{$$slots:{default:[fr]},$$scope:{ctx:t}}}),s=new Je({props:{$$slots:{default:[mr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment),i=T(),w(s.$$.fragment)},m(l,c){I(e,l,c),p(l,r,c),I(n,l,c),p(l,i,c),I(s,l,c),o=!0},p(l,c){const a={};c&1&&(a.brandingInfo=l[0]),c&2&&(a.onClose=l[1]),e.$set(a);const f={};c&44&&(f.$$scope={dirty:c,ctx:l}),n.$set(f);const m={};c&34&&(m.$$scope={dirty:c,ctx:l}),s.$set(m)},i(l){o||(u(e.$$.fragment,l),u(n.$$.fragment,l),u(s.$$.fragment,l),o=!0)},o(l){d(e.$$.fragment,l),d(n.$$.fragment,l),d(s.$$.fragment,l),o=!1},d(l){l&&(g(r),g(i)),b(e,l),b(n,l),b(s,l)}}}function pr(t){let e,r;return e=new ke({props:{gutter:"32px",$$slots:{default:[gr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const s={};i&47&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ar(t,e,r){let{$$slots:n={},$$scope:i}=e,{brandingInfo:s=null}=e,{onContinue:o}=e,{title:l}=e,{type:c}=e;return t.$$set=a=>{"brandingInfo"in a&&r(0,s=a.brandingInfo),"onContinue"in a&&r(1,o=a.onContinue),"title"in a&&r(2,l=a.title),"type"in a&&r(3,c=a.type),"$$scope"in a&&r(5,i=a.$$scope)},[s,o,l,c,n,i]}class At extends U{constructor(e){super(),R(this,e,Ar,pr,P,{brandingInfo:0,onContinue:1,title:2,type:3},lr)}}function _t(t){let e,r,n,i,s;return{c(){e=N("If this error persists, please contact "),r=k("a"),n=N(t[1]),s=N("."),A(r,"href",i="mailto:"+t[1])},m(o,l){p(o,e,l),p(o,r,l),D(r,n),p(o,s,l)},p(o,l){l&2&&ie(n,o[1]),l&2&&i!==(i="mailto:"+o[1])&&A(r,"href",i)},d(o){o&&(g(e),g(r),g(s))}}}function _r(t){let e=t[3]()+"",r,n,i,s=t[1]&&_t(t);return{c(){r=N(e),n=T(),s&&s.c(),i=te()},m(o,l){p(o,r,l),p(o,n,l),s&&s.m(o,l),p(o,i,l)},p(o,l){o[1]?s?s.p(o,l):(s=_t(o),s.c(),s.m(i.parentNode,i)):s&&(s.d(1),s=null)},d(o){o&&(g(r),g(n),g(i)),s&&s.d(o)}}}function hr(t){let e,r;return e=new Cn({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Er(t){let e,r;return e=new At({props:{title:"Something went wrong",brandingInfo:t[0],onContinue:t[2],type:"error",$$slots:{icon:[hr],default:[_r]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const s={};i&1&&(s.brandingInfo=n[0]),i&4&&(s.onContinue=n[2]),i&34&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ir(t,e,r){let{brandingInfo:n=null}=e,{lastError:i}=e,{supportEmail:s=null}=e,{onContinue:o}=e;Qe(()=>{W.errorLog(`Displayed error: ${O[i.errorCode]}. Message: ${i.message??"None"}. Underlying error: ${i.underlyingErrorMessage??"None"}`)});function l(){switch(i.errorCode){case O.UnknownError:return"An unknown error occurred.";case O.ErrorSettingUpPurchase:return"Purchase not started due to an error.";case O.ErrorChargingPayment:return"Payment failed.";case O.NetworkError:return"Network error. Please check your internet connection.";case O.StripeError:return i.message;case O.MissingEmailError:return"Email is required to complete the purchase."}return i.message}return t.$$set=c=>{"brandingInfo"in c&&r(0,n=c.brandingInfo),"lastError"in c&&r(4,i=c.lastError),"supportEmail"in c&&r(1,s=c.supportEmail),"onContinue"in c&&r(2,o=c.onContinue)},[n,s,o,l,i]}class br extends U{constructor(e){super(),R(this,e,Ir,Er,P,{brandingInfo:0,lastError:4,supportEmail:1,onContinue:2})}}const wr="data:image/svg+xml,%3csvg%20width='124'%20height='124'%20viewBox='0%200%20124%20124'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='62'%20cy='62'%20r='62'%20fill='%23576CDB'/%3e%3crect%20x='44.1116'%20y='56'%20width='27.5'%20height='11'%20transform='rotate(45%2044.1116%2056)'%20fill='white'/%3e%3crect%20x='79.1133'%20y='44.334'%20width='11'%20height='44'%20transform='rotate(45%2079.1133%2044.334)'%20fill='white'/%3e%3c/svg%3e";function kr(t){S(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function $r(t){let e,r;return{c(){e=k("img"),ee(e.src,r=wr)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class vr extends U{constructor(e){super(),R(this,e,null,$r,P,{},kr)}}function yr(t){let e;return{c(){e=N("Your plan is now active.")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function Br(t){let e,r;return e=new vr({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Dr(t){let e,r;return e=new At({props:{type:"success",title:"Purchase successful",brandingInfo:t[0],onContinue:t[1],$$slots:{icon:[Br],default:[yr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const s={};i&1&&(s.brandingInfo=n[0]),i&2&&(s.onContinue=n[1]),i&4&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Mr(t,e,r){let{brandingInfo:n=null}=e,{onContinue:i}=e;return t.$$set=s=>{"brandingInfo"in s&&r(0,n=s.brandingInfo),"onContinue"in s&&r(1,i=s.onContinue)},[n,i]}class Qr extends U{constructor(e){super(),R(this,e,Mr,Dr,P,{brandingInfo:0,onContinue:1})}}function Cr(t,e,r,n,i={}){const s=r.create(e,i);return s.mount(t),s.on("change",o=>n("change",o)),s.on("ready",o=>n("ready",o)),s.on("focus",o=>n("focus",o)),s.on("blur",o=>n("blur",o)),s.on("escape",o=>n("escape",o)),s.on("click",o=>n("click",o)),s.on("loaderror",o=>n("loaderror",o)),s.on("loaderstart",o=>n("loaderstart",o)),s.on("networkschange",o=>n("networkschange",o)),s}const Pr=typeof window>"u";function Tr(t){if(!Pr)return t.registerAppInfo({name:"svelte-stripe-js",url:"https://svelte-stripe-js.vercel.app"})}function Rr(t){let e;return{c(){e=k("div")},m(r,n){p(r,e,n),t[6](e)},p:v,i:v,o:v,d(r){r&&g(e),t[6](null)}}}function Ur(t,e,r){let n,i;const s=nn(),{elements:o}=sn("stripe");let{options:l=void 0}=e;Qe(()=>(n=Cr(i,"payment",o,s,l),()=>n.destroy()));function c(){n.blur()}function a(){n.clear()}function f(){n.destroy()}function m(){n.focus()}function E(y){Ce[y?"unshift":"push"](()=>{i=y,r(0,i)})}return t.$$set=y=>{"options"in y&&r(1,l=y.options)},[i,l,c,a,f,m,E]}class Nr extends U{constructor(e){super(),R(this,e,Ur,Rr,P,{options:1,blur:2,clear:3,destroy:4,focus:5})}get blur(){return this.$$.ctx[2]}get clear(){return this.$$.ctx[3]}get destroy(){return this.$$.ctx[4]}get focus(){return this.$$.ctx[5]}}function ht(t){let e;const r=t[15].default,n=G(r,t,t[14],null);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s&16384)&&H(n,r,i,i[14],e?Y(r,i[14],s,null):q(i[14]),null)},i(i){e||(u(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function Sr(t){let e,r,n=t[1]&&t[0]&&ht(t);return{c(){n&&n.c(),e=te()},m(i,s){n&&n.m(i,s),p(i,e,s),r=!0},p(i,[s]){i[1]&&i[0]?n?(n.p(i,s),s&3&&u(n,1)):(n=ht(i),n.c(),u(n,1),n.m(e.parentNode,e)):n&&(F(),d(n,1,1,()=>{n=null}),x())},i(i){r||(u(n),r=!0)},o(i){d(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function Or(t,e,r){let n,{$$slots:i={},$$scope:s}=e,{stripe:o}=e,{mode:l=void 0}=e,{theme:c="stripe"}=e,{variables:a={}}=e,{rules:f={}}=e,{labels:m="above"}=e,{loader:E="auto"}=e,{fonts:y=[]}=e,{locale:_="auto"}=e,{currency:Q=void 0}=e,{amount:h=void 0}=e,{clientSecret:B=void 0}=e,{elements:J=null}=e;return t.$$set=$=>{"stripe"in $&&r(1,o=$.stripe),"mode"in $&&r(2,l=$.mode),"theme"in $&&r(3,c=$.theme),"variables"in $&&r(4,a=$.variables),"rules"in $&&r(5,f=$.rules),"labels"in $&&r(6,m=$.labels),"loader"in $&&r(7,E=$.loader),"fonts"in $&&r(8,y=$.fonts),"locale"in $&&r(9,_=$.locale),"currency"in $&&r(10,Q=$.currency),"amount"in $&&r(11,h=$.amount),"clientSecret"in $&&r(12,B=$.clientSecret),"elements"in $&&r(0,J=$.elements),"$$scope"in $&&r(14,s=$.$$scope)},t.$$.update=()=>{t.$$.dirty&120&&r(13,n={theme:c,variables:a,rules:f,labels:m}),t.$$.dirty&16263&&o&&!J&&(r(0,J=o.elements({mode:l,currency:Q,amount:h,appearance:n,clientSecret:B,fonts:y,loader:E,locale:_})),Tr(o),rn("stripe",{stripe:o,elements:J})),t.$$.dirty&8705&&J&&J.update({appearance:n,locale:_})},[J,o,l,c,a,f,m,E,y,_,Q,h,B,n,s,i]}class Lr extends U{constructor(e){super(),R(this,e,Or,Sr,P,{stripe:1,mode:2,theme:3,variables:4,rules:5,labels:6,loader:7,fonts:8,locale:9,currency:10,amount:11,clientSecret:12,elements:0})}}var Et="https://js.stripe.com/v3",Fr=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,It="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",xr=function(){for(var e=document.querySelectorAll('script[src^="'.concat(Et,'"]')),r=0;r<e.length;r++){var n=e[r];if(Fr.test(n.src))return n}return null},bt=function(e){var r=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(Et).concat(r);var i=document.head||document.body;if(!i)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return i.appendChild(n),n},Gr=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"2.3.0",startTime:r})},$e=null,Ue=null,Ne=null,Yr=function(e){return function(){e(new Error("Failed to load Stripe.js"))}},Hr=function(e,r){return function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))}},qr=function(e){return $e!==null?$e:($e=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&e&&console.warn(It),window.Stripe){r(window.Stripe);return}try{var i=xr();if(i&&e)console.warn(It);else if(!i)i=bt(e);else if(i&&Ne!==null&&Ue!==null){var s;i.removeEventListener("load",Ne),i.removeEventListener("error",Ue),(s=i.parentNode)===null||s===void 0||s.removeChild(i),i=bt(e)}Ne=Hr(r,n),Ue=Yr(n),i.addEventListener("load",Ne),i.addEventListener("error",Ue)}catch(o){n(o);return}}),$e.catch(function(r){return $e=null,Promise.reject(r)}))},Kr=function(e,r,n){if(e===null)return null;var i=e.apply(void 0,r);return Gr(i,n),i},ve,wt=!1,kt=function(){return ve||(ve=qr(null).catch(function(e){return ve=null,Promise.reject(e)}),ve)};Promise.resolve().then(function(){return kt()}).catch(function(t){wt||console.warn(t)});var jr=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];wt=!0;var i=Date.now();return kt().then(function(s){return Kr(s,r,i)})};function Jr(t){S(t,"svelte-1xe711j",".rcb-header-layout.svelte-1xe711j{display:flex;justify-content:space-between;align-items:center;width:100%;font-size:24px;margin:0;font-weight:500}")}function Vr(t){let e,r;const n=t[0].default,i=G(n,t,t[1],null);return{c(){e=k("div"),i&&i.c(),A(e,"class","rcb-header-layout svelte-1xe711j")},m(s,o){p(s,e,o),i&&i.m(e,null),r=!0},p(s,o){i&&i.p&&(!r||o&2)&&H(i,n,s,s[1],r?Y(n,s[1],o,null):q(s[1]),null)},i(s){r||(u(i,s),r=!0)},o(s){d(i,s),r=!1},d(s){s&&g(e),i&&i.d(s)}}}function Wr(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[Vr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const s={};i&2&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function zr(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=s=>{"$$scope"in s&&r(1,i=s.$$scope)},[n,i]}class Ve extends U{constructor(e){super(),R(this,e,zr,Wr,P,{},Jr)}}const Xr="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18%208H17V6C17%203.24%2014.76%201%2012%201C9.24%201%207%203.24%207%206V8H6C4.9%208%204%208.9%204%2010V20C4%2021.1%204.9%2022%206%2022H18C19.1%2022%2020%2021.1%2020%2020V10C20%208.9%2019.1%208%2018%208ZM12%2017C10.9%2017%2010%2016.1%2010%2015C10%2013.9%2010.9%2013%2012%2013C13.1%2013%2014%2013.9%2014%2015C14%2016.1%2013.1%2017%2012%2017ZM15.1%208H8.9V6C8.9%204.29%2010.29%202.9%2012%202.9C13.71%202.9%2015.1%204.29%2015.1%206V8Z'%20fill='%2311D483'/%3e%3c/svg%3e";function Zr(t){let e,r;return{c(){e=k("img"),ee(e.src,r=Xr)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class ei extends U{constructor(e){super(),R(this,e,null,Zr,P,{})}}const ye={error:"#f2545b",warning:"#f4e971",focus:"#000080","grey-text-dark":"#000000","grey-text-light":"#767676","grey-ui-dark":"#dfdfdf",white:"#ffffff"};function ti(t){S(t,"svelte-rjmul6",`.processing.svelte-rjmul6{width:12px;aspect-ratio:1;border-radius:50%;animation:svelte-rjmul6-l5 1.5s infinite linear}@keyframes svelte-rjmul6-l5{0%{box-shadow:20px 0 #fff2,
|
|
1
|
+
(function(L,V){typeof exports=="object"&&typeof module<"u"?V(exports):typeof define=="function"&&define.amd?define(["exports"],V):(L=typeof globalThis<"u"?globalThis:L||self,V(L.Purchases={}))})(this,function(L){"use strict";var Ro=Object.defineProperty;var Uo=(L,V,re)=>V in L?Ro(L,V,{enumerable:!0,configurable:!0,writable:!0,value:re}):L[V]=re;var C=(L,V,re)=>(Uo(L,typeof V!="symbol"?V+"":V,re),re);function V(t){return t!=null}var re=(t=>(t.Unknown="unknown",t.Custom="custom",t.Lifetime="$rc_lifetime",t.Annual="$rc_annual",t.SixMonth="$rc_six_month",t.ThreeMonth="$rc_three_month",t.TwoMonth="$rc_two_month",t.Monthly="$rc_monthly",t.Weekly="$rc_weekly",t))(re||{});const Ft=(t,e)=>({identifier:t.identifier,displayName:t.title,currentPrice:t.current_price,normalPeriodDuration:t.normal_period_duration,presentedOfferingIdentifier:e}),Gt=(t,e,r)=>{const n=r[e.platform_product_identifier];return n===void 0?null:{identifier:e.identifier,rcBillingProduct:Ft(n,t),packageType:Yt(e.identifier)}},et=(t,e)=>{const r=t.packages.map(i=>Gt(t.identifier,i,e)).filter(V),n={};for(const i of r)i!=null&&(n[i.identifier]=i);return r.length==0?null:{identifier:t.identifier,serverDescription:t.description,metadata:t.metadata,packagesById:n,availablePackages:r,lifetime:n.$rc_lifetime??null,annual:n.$rc_annual??null,sixMonth:n.$rc_six_month??null,threeMonth:n.$rc_three_month??null,twoMonth:n.$rc_two_month??null,monthly:n.$rc_monthly??null,weekly:n.$rc_weekly??null}};function Yt(t){switch(t){case"$rc_lifetime":return"$rc_lifetime";case"$rc_annual":return"$rc_annual";case"$rc_six_month":return"$rc_six_month";case"$rc_three_month":return"$rc_three_month";case"$rc_two_month":return"$rc_two_month";case"$rc_monthly":return"$rc_monthly";case"$rc_weekly":return"$rc_weekly";default:return t.startsWith("$rc_")?"unknown":"custom"}}function v(){}function Ht(t,e){for(const r in e)t[r]=e[r];return t}function tt(t){return t()}function nt(){return Object.create(null)}function pe(t){t.forEach(tt)}function le(t){return typeof t=="function"}function P(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let De;function ee(t,e){return t===e?!0:(De||(De=document.createElement("a")),De.href=e,t===De.href)}function rt(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function Kt(t,e){const r=rt(t.srcset),n=rt(e||"");return n.length===r.length&&n.every(([i,o],s)=>o===r[s][1]&&(ee(r[s][0],i)||ee(i,r[s][0])))}function qt(t){return Object.keys(t).length===0}function G(t,e,r,n){if(t){const i=it(t,e,r,n);return t[0](i)}}function it(t,e,r,n){return t[1]&&n?Ht(r.ctx.slice(),t[1](n(e))):r.ctx}function Y(t,e,r,n){if(t[2]&&n){const i=t[2](n(r));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(e.dirty.length,i.length);for(let l=0;l<s;l+=1)o[l]=e.dirty[l]|i[l];return o}return e.dirty|i}return e.dirty}function H(t,e,r,n,i,o){if(i){const s=it(e,r,n,o);t.p(s,i)}}function K(t){if(t.ctx.length>32){const e=[],r=t.ctx.length/32;for(let n=0;n<r;n++)e[n]=-1;return e}return-1}function Ae(t){return t??""}function D(t,e){t.appendChild(e)}function S(t,e,r){const n=jt(t);if(!n.getElementById(e)){const i=k("style");i.id=e,i.textContent=r,Jt(n,i)}}function jt(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function Jt(t,e){return D(t.head||t,e),e.sheet}function p(t,e,r){t.insertBefore(e,r||null)}function g(t){t.parentNode&&t.parentNode.removeChild(t)}function k(t){return document.createElement(t)}function N(t){return document.createTextNode(t)}function T(){return N(" ")}function te(){return N("")}function _e(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function ot(t){return function(e){return e.preventDefault(),t.call(this,e)}}function A(t,e,r){r==null?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}const Vt=["width","height"];function Wt(t,e){const r=Object.getOwnPropertyDescriptors(t.__proto__);for(const n in e)e[n]==null?t.removeAttribute(n):n==="style"?t.style.cssText=e[n]:n==="__value"?t.value=t[n]=e[n]:r[n]&&r[n].set&&Vt.indexOf(n)===-1?t[n]=e[n]:A(t,n,e[n])}function zt(t,e){Object.keys(e).forEach(r=>{Xt(t,r,e[r])})}function Xt(t,e,r){const n=e.toLowerCase();n in t?t[n]=typeof t[n]=="boolean"&&r===""?!0:r:e in t?t[e]=typeof t[e]=="boolean"&&r===""?!0:r:A(t,e,r)}function Zt(t){return/-/.test(t)?zt:Wt}function en(t){return Array.from(t.childNodes)}function ie(t,e){e=""+e,t.data!==e&&(t.data=e)}function st(t,e){t.value=e??""}function tn(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}let he;function Ee(t){he=t}function Me(){if(!he)throw new Error("Function called outside component initialization");return he}function Qe(t){Me().$$.on_mount.push(t)}function nn(){const t=Me();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=tn(e,r,{cancelable:n});return i.slice().forEach(s=>{s.call(t,o)}),!o.defaultPrevented}return!0}}function rn(t,e){return Me().$$.context.set(t,e),e}function on(t){return Me().$$.context.get(t)}function lt(t,e){const r=t.$$.callbacks[e.type];r&&r.slice().forEach(n=>n.call(this,e))}const ce=[],Ce=[];let ae=[];const Ge=[],sn=Promise.resolve();let Ye=!1;function ln(){Ye||(Ye=!0,sn.then(ct))}function He(t){ae.push(t)}function cn(t){Ge.push(t)}const Ke=new Set;let ue=0;function ct(){if(ue!==0)return;const t=he;do{try{for(;ue<ce.length;){const e=ce[ue];ue++,Ee(e),an(e.$$)}}catch(e){throw ce.length=0,ue=0,e}for(Ee(null),ce.length=0,ue=0;Ce.length;)Ce.pop()();for(let e=0;e<ae.length;e+=1){const r=ae[e];Ke.has(r)||(Ke.add(r),r())}ae.length=0}while(ce.length);for(;Ge.length;)Ge.pop()();Ye=!1,Ke.clear(),Ee(t)}function an(t){if(t.fragment!==null){t.update(),pe(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(He)}}function un(t){const e=[],r=[];ae.forEach(n=>t.indexOf(n)===-1?e.push(n):r.push(n)),r.forEach(n=>n()),ae=e}const Pe=new Set;let oe;function x(){oe={r:0,c:[],p:oe}}function F(){oe.r||pe(oe.c),oe=oe.p}function u(t,e){t&&t.i&&(Pe.delete(t),t.i(e))}function d(t,e,r,n){if(t&&t.o){if(Pe.has(t))return;Pe.add(t),oe.c.push(()=>{Pe.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}function fn(t,e,r){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=r,r(t.$$.ctx[n]))}function w(t){t&&t.c()}function I(t,e,r){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,r),He(()=>{const o=t.$$.on_mount.map(tt).filter(le);t.$$.on_destroy?t.$$.on_destroy.push(...o):pe(o),t.$$.on_mount=[]}),i.forEach(He)}function b(t,e){const r=t.$$;r.fragment!==null&&(un(r.after_update),pe(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function dn(t,e){t.$$.dirty[0]===-1&&(ce.push(t),ln(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function R(t,e,r,n,i,o,s=null,l=[-1]){const c=he;Ee(t);const a=t.$$={fragment:null,ctx:[],props:o,update:v,not_equal:i,bound:nt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:nt(),dirty:l,skip_bound:!1,root:e.target||c.$$.root};s&&s(a.root);let f=!1;if(a.ctx=r?r(t,e.props||{},(m,E,...y)=>{const _=y.length?y[0]:E;return a.ctx&&i(a.ctx[m],a.ctx[m]=_)&&(!a.skip_bound&&a.bound[m]&&a.bound[m](_),f&&dn(t,m)),E}):[],a.update(),f=!0,pe(a.before_update),a.fragment=n?n(a.ctx):!1,e.target){if(e.hydrate){const m=en(e.target);a.fragment&&a.fragment.l(m),m.forEach(g)}else a.fragment&&a.fragment.c();e.intro&&u(t.$$.fragment),I(t,e.target,e.anchor),ct()}Ee(c)}class U{constructor(){C(this,"$$");C(this,"$$set")}$destroy(){b(this,1),this.$destroy=v}$on(e,r){if(!le(r))return v;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!qt(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const mn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(mn);function gn(t){S(t,"svelte-1bzqb13",".rcb-modal-section.svelte-1bzqb13{padding:8px 0px;display:flex}section.rcb-modal-section.svelte-1bzqb13{flex-grow:1}.rcb-modal-section.svelte-1bzqb13:last-of-type{padding:0}")}function qe(t){let e,r;const n=t[2].default,i=G(n,t,t[1],null);return{c(){e=k(t[0]),i&&i.c(),Zt(t[0])(e,{class:Ae("rcb-modal-section")+" svelte-1bzqb13"})},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&H(i,n,o,o[1],r?Y(n,o[1],s,null):K(o[1]),null)},i(o){r||(u(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function pn(t){let e=t[0],r,n,i=t[0]&&qe(t);return{c(){i&&i.c(),r=te()},m(o,s){i&&i.m(o,s),p(o,r,s),n=!0},p(o,[s]){o[0]?e?P(e,o[0])?(i.d(1),i=qe(o),e=o[0],i.c(),i.m(r.parentNode,r)):i.p(o,s):(i=qe(o),e=o[0],i.c(),i.m(r.parentNode,r)):e&&(i.d(1),i=null,e=o[0])},i(o){n||(u(i,o),n=!0)},o(o){d(i,o),n=!1},d(o){o&&g(r),i&&i.d(o)}}}function An(t,e,r){let{$$slots:n={},$$scope:i}=e,{as:o="section"}=e;return t.$$set=s=>{"as"in s&&r(0,o=s.as),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class fe extends U{constructor(e){super(),R(this,e,An,pn,P,{as:0},gn)}}var q=(t=>(t[t.Silent=0]="Silent",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug",t[t.Verbose=5]="Verbose",t))(q||{});class W{static setLogLevel(e){this.logLevel=e}static log(e,r=this.logLevel){const n=`[Purchases] ${e}`;if(!(this.logLevel<r||r===q.Silent))switch(r){case q.Error:console.error(n);break;case q.Warn:console.warn(n);break;case q.Info:console.info(n);break;case q.Debug:console.debug(n);break;case q.Verbose:console.debug(n);break}}static errorLog(e){this.log(e,q.Error)}static warnLog(e){this.log(e,q.Warn)}static infoLog(e){this.log(e,q.Info)}static debugLog(e){this.log(e,q.Debug)}static verboseLog(e){this.log(e,q.Verbose)}}C(W,"logLevel",q.Silent);var Ie=(t=>(t.Year="year",t.Month="month",t.Week="week",t.Day="day",t))(Ie||{});function _n(t){const e=t.match(/^PT?([0-9]+)([MDYW])$/);if(!e||e.length<3)return W.errorLog(`Invalid ISO 8601 duration format: ${t}`),null;const r=parseInt(e[1]);switch(e[2]){case"Y":return{number:r,unit:"year"};case"M":return{number:r,unit:"month"};case"W":return{number:r,unit:"week"};case"D":return{number:r,unit:"day"};default:return W.errorLog(`Invalid ISO 8601 unit duration format: ${t}`),null}}const at=(t,e)=>{const r=t/100;return new Intl.NumberFormat("en-US",{style:"currency",currency:e}).format(r)},ut=t=>{const e=_n(t);if(!e)return"unknown";const r=e.number;if(r===1)switch(e.unit){case Ie.Year:return"yearly";case Ie.Month:return"monthly";case Ie.Week:return"weekly";case Ie.Day:return"daily"}else return`every ${r} ${e.unit}s`};function hn(t){S(t,"svelte-i5dq8q",".rcb-pricing-info.svelte-i5dq8q{display:flex;flex-direction:column;margin-top:102px;font-weight:500}.rcb-product-price.svelte-i5dq8q{font-size:24px;margin:12px 0px}.rcb-product-details.svelte-i5dq8q{opacity:0.6;list-style-type:disc;list-style-position:inside;margin:0px;padding:0px}@media screen and (max-width: 960px){.rcb-pricing-info.svelte-i5dq8q{margin-top:48px}}")}function En(t){let e,r,n=t[0].displayName+"",i,o,s,l=t[0].currentPrice.currency+"",c,a=" ",f,m=at(t[0].currentPrice.amount,t[0].currentPrice.currency)+"",E,y,_,Q,h,B=ut(t[0].normalPeriodDuration)+"",J,$,Be,Fe,ge;return{c(){e=k("div"),r=k("span"),i=N(n),o=T(),s=k("span"),c=N(l),f=N(a),E=N(m),y=T(),_=k("ul"),Q=k("li"),h=N("Billed "),J=N(B),$=T(),Be=k("li"),Be.textContent="Continues until canceled",Fe=T(),ge=k("li"),ge.textContent="Cancel anytime",A(s,"class","rcb-product-price svelte-i5dq8q"),A(_,"class","rcb-product-details svelte-i5dq8q"),A(e,"class","rcb-pricing-info svelte-i5dq8q")},m(Z,X){p(Z,e,X),D(e,r),D(r,i),D(e,o),D(e,s),D(s,c),D(s,f),D(s,E),D(e,y),D(e,_),D(_,Q),D(Q,h),D(Q,J),D(_,$),D(_,Be),D(_,Fe),D(_,ge)},p(Z,X){X&1&&n!==(n=Z[0].displayName+"")&&ie(i,n),X&1&&l!==(l=Z[0].currentPrice.currency+"")&&ie(c,l),X&1&&m!==(m=at(Z[0].currentPrice.amount,Z[0].currentPrice.currency)+"")&&ie(E,m),X&1&&B!==(B=ut(Z[0].normalPeriodDuration)+"")&&ie(J,B)},d(Z){Z&&g(e)}}}function In(t){let e,r;return e=new fe({props:{$$slots:{default:[En]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&3&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function bn(t,e,r){let{productDetails:n}=e;return t.$$set=i=>{"productDetails"in i&&r(0,n=i.productDetails)},[n]}class ft extends U{constructor(e){super(),R(this,e,bn,In,P,{productDetails:0},hn)}}const wn="data:image/gif;base64,R0lGODlhMgAyAPcBAAAAAAD/AAMDAwcHBxERERUVFSoqKi0tLTAwMDg4OD09PURERElJSUtLS1BQUFJSUlVVVVdXV1paWl9fX2NjY2ZmZmlpaWxsbG1tbXNzc3t7e39/f4GBgYKCgoSEhIaGhoeHh4iIiIuLi5KSkpSUlJaWlp2dnaGhoaOjo6SkpKWlpaenp6ioqKqqqqurq6ysrLCwsLGxsbS0tLa2tri4uLm5ub29vb6+vsDAwMHBwcLCwsXFxcjIyMnJyc3Nzc7OztPT09TU1NXV1dfX19nZ2dra2tvb29zc3N7e3uDg4OHh4eLi4uPj4+fn5+np6ezs7O7u7vDw8PHx8fLy8vPz8/X19fb29vj4+Pn5+fz8/P39/f7+/v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFBAABACwAAAAAMgAyAIcAAAAA/wADAwMHBwcREREVFRUqKiotLS0wMDA4ODg9PT1ERERJSUlLS0tQUFBSUlJVVVVXV1daWlpfX19jY2NmZmZpaWlsbGxtbW1zc3N7e3t/f3+BgYGCgoKEhISGhoaHh4eIiIiLi4uSkpKUlJSWlpadnZ2hoaGjo6OkpKSlpaWnp6eoqKiqqqqrq6usrKywsLCxsbG0tLS2tra4uLi5ubm9vb2+vr7AwMDBwcHCwsLFxcXIyMjJycnNzc3Ozs7T09PU1NTV1dXX19fZ2dna2trb29vc3Nze3t7g4ODh4eHi4uLj4+Pn5+fp6ens7Ozu7u7w8PDx8fHy8vLz8/P19fX29vb4+Pj5+fn8/Pz9/f3+/v7///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8I/wCzcBFIcKDBgggPKkzIcCEXLlq4bIEokeLEiBcrYrTIcaNHjRobinQ4sqRCkBlTdtR44MBKlR9TmjQJQMBMkgZfdpwSMSYAACgpRtHpcSYSFUIa1mz448UQnAWDfmzSooUVmD9XVnnBwglMlDdvvMjhcOlCHit23CSqcUrVJiizpnTC4sXQmB1vZvmxwgYWhWYLznjRA+rJryqvxGhxxGNLjkVcwMCCN6ZeLkNevDCcRYYKJJfZptyCQwdiijl0CDxdlLPryw2lymY9WzTs17ijVq69mzbM28Bd8x7u23bu46F7i16uXEvw5ziJM5duGbl1k9OLN5cKvfvh7OC3b0jxTv6h+PDUy3unzl67RPXXc56fnz4+/PbofcOHnr9/5f3x4UeffvYVqJuACP5m4IIJ+gfWgusN6KCCAN7WoITVVXjchBxqERAAIfkEBQQAAQAsDQADACAAEAAACKcAAwgcSDDAAwcFEypcSNDAAYYQA2DZstCAAYZOKCqM8uNJxYcKa3DYsVBKECBYFFpU+MTDhiIMkQxBohJkwRYaUkDEEiQIlYQrCyLZ0MFJRCdAkgC1OZBEBxgRJRIBAqXgwYI8NoCwEjWAkyFDoorQ4KOrQCRLoqbQuZCKR7NdqzD5MaQKXIhZmAwBIqTJ3YVYogQZ8oMJ178Kk/A1YhfxQiRHjBYMCAAh+QQFBQABACwNAAMAIAAQAAAInQADCBxIMECGDAUTKlxI8EEEhhADcGEI4QFDJQy5ZJmo0OFCFBFkLNzCRQvHghEgKHQi4cEPhhuzdHyYUMQDDxC5kNSSsGLCIA4x5oxZ0GNBDBFKRAxgkmTBgwVpRJhAZWkAohErPKhhVaLJpR8+YFnohEjXrlB2qHgB5SxELD5etHgBxC1DJC9eqOAxxe5CHSxc0HDilyEOGWYLBgQAIfkEBQQAAQAsGAADABcAFwAACJYAS5AIQLCgwYMINXBAyLDhhg0NtxRpWFBDh4YiDpygGOAhwyUIDOTgqJAhBgMVOHaEeLCHgQMTSV40uKXBAZYcBR5UYSBB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x5MuCIXLVy2vOWShTEXsVsOJz6stbHlx1ojI1b8tvHbgAAAIfkEBQQAAQAsAwADABcAFwAACJQAAwgcSLCgwRIkDCpcqIHDwoFHHm7Y8DCACgMJFWroUBGHgQNMFE6sGGDCAQsaHVY8csAAD4MjSX4w8MDgRpIBoCQwsKIgQpwBUBxIULEHkYcUUC580tDEE6AGbXSYKKMKVIJSUnDQIGIHl6sQS0w8AZagjxAsyqpdy7at24pJfgwBMkQukCRQjQQBIgTIXiFGoAYEACH5BAUFAAEALAMAAwAXABcAAAiVAAMIHEiwoMEMGQwqXPggwsKBTLQshPDgYYAaD1owdPjQB4QIThRGgGAxwIYIIBQ2LMlkJBCDFEsGOPEgA5aCK0tKmQChRkGEMgPIiDDhoRYjTR56CPGwiooXN6oENQikhYsWP65MJXglx4sVMoZsJdikRosWOMYSRPJih9q3cOPKnWuRSxa7eO9O3cJFCxe+frdMDQgAIfkEBQUAAQAsBQADACAAEAAACKYAAwgcSLAgwQcODCpcyNDAAYYQAzhpaIDhFYY+NOBY6HAhkyETFRLZ0CGKQgMVDV4RAoQKQxMdUpx8aJAJECYQnWzYcMQgSoNVgAy5CHGGhhI+aRIkMgRnxCohNvQoiLDgEyFDskQUuINDiK1Hfpgc+ETKQi0nVGxNkkSrwCw/hiBxu7XuFidAhARpgqWu3yxIhgApEtLvVipIgARBYthvlKaNFQYEADs=";function kn(t){let e,r;return{c(){e=k("img"),ee(e.src,r=wn)||A(e,"src",r),A(e,"alt","spinner")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class $n extends U{constructor(e){super(),R(this,e,null,kn,P,{})}}function vn(t){S(t,"svelte-1mxx341",".rcb-modal-loader.svelte-1mxx341{width:100%;flex-grow:1;min-height:100%;display:flex;justify-content:center;align-items:center}")}function yn(t){let e,r,n;return r=new $n({}),{c(){e=k("div"),w(r.$$.fragment),A(e,"class","rcb-modal-loader svelte-1mxx341")},m(i,o){p(i,e,o),I(r,e,null),n=!0},p:v,i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}class je extends U{constructor(e){super(),R(this,e,null,yn,P,{},vn)}}var be=(t=>(t.Started="started",t.InProgress="in_progress",t.Succeeded="succeeded",t.Failed="failed",t))(be||{}),Te=(t=>(t[t.SetupIntentCreationFailed=1]="SetupIntentCreationFailed",t[t.PaymentMethodCreationFailed=2]="PaymentMethodCreationFailed",t[t.PaymentChargeFailed=3]="PaymentChargeFailed",t))(Te||{}),O=(t=>(t[t.ErrorSettingUpPurchase=0]="ErrorSettingUpPurchase",t[t.ErrorChargingPayment=1]="ErrorChargingPayment",t[t.UnknownError=2]="UnknownError",t[t.NetworkError=3]="NetworkError",t[t.StripeError=4]="StripeError",t[t.MissingEmailError=5]="MissingEmailError",t))(O||{});class j extends Error{constructor(e,r,n){super(r),this.errorCode=e,this.underlyingErrorMessage=n}}class Bn{constructor(e,r=10){C(this,"operationSessionId",null);C(this,"backend");C(this,"maxNumberAttempts");C(this,"waitMSBetweenAttempts",1e3);this.backend=e,this.maxNumberAttempts=r}async startPurchase(e,r,n,i){const o=await this.backend.postSubscribe(e,r,n,i);return this.operationSessionId=o.operation_session_id,o}async pollCurrentPurchaseForCompletion(){const e=this.operationSessionId;if(!e)throw new j(0,"No purchase in progress");return new Promise((r,n)=>{const i=(o=1)=>{if(o>this.maxNumberAttempts){this.clearPurchaseInProgress(),n(new j(2,"Max attempts reached trying to get successful purchase status"));return}this.backend.getCheckoutStatus(e).then(s=>{switch(s.operation.status){case be.Started:case be.InProgress:setTimeout(()=>i(o+1),this.waitMSBetweenAttempts);break;case be.Succeeded:this.clearPurchaseInProgress(),r();return;case be.Failed:this.clearPurchaseInProgress(),this.handlePaymentError(s.operation.error,n)}}).catch(s=>{n(new j(3,s.message))})};i()})}clearPurchaseInProgress(){this.operationSessionId=null}handlePaymentError(e,r){if(e==null){r(new j(2,"Got an error status but error field is empty."));return}switch(e.code){case Te.SetupIntentCreationFailed:r(new j(0,"Setup intent creation failed"));return;case Te.PaymentMethodCreationFailed:r(new j(0,"Payment method creation failed"));return;case Te.PaymentChargeFailed:r(new j(1,"Payment charge failed"));return}}}const Dn="data:image/svg+xml,%3csvg%20width='124'%20height='124'%20viewBox='0%200%20124%20124'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='62'%20cy='62'%20r='62'%20fill='%23767676'/%3e%3cpath%20d='M87.6668%2041.504L82.4968%2036.334L62.0002%2056.8307L41.5035%2036.334L36.3335%2041.504L56.8302%2062.0006L36.3335%2082.4973L41.5035%2087.6673L62.0002%2067.1706L82.4968%2087.6673L87.6668%2082.4973L67.1702%2062.0006L87.6668%2041.504Z'%20fill='white'/%3e%3c/svg%3e";function Mn(t){S(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Qn(t){let e,r;return{c(){e=k("img"),ee(e.src,r=Dn)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class Cn extends U{constructor(e){super(),R(this,e,null,Qn,P,{},Mn)}}function Pn(t){S(t,"svelte-1rmxk7q","button.svelte-1rmxk7q{border:none;border-radius:56px;font-size:16px;cursor:pointer;height:56px;color:var(--rc-color-grey-text-dark);background-color:var(--rc-color-grey-ui-dark);display:flex;align-items:center;justify-content:center}button.intent-primary.svelte-1rmxk7q{background-color:var(--rc-color-grey-text-dark);color:var(--rc-color-white);font-size:16px}button.svelte-1rmxk7q:disabled{color:var(--rc-color-grey-text-light)}button.intent-primary.svelte-1rmxk7q:disabled{color:var(--rc-color-grey-text-light)}")}function Tn(t){let e,r,n,i,o;const s=t[3].default,l=G(s,t,t[2],null);return{c(){e=k("button"),l&&l.c(),A(e,"class",r=Ae(`intent-${t[0]}`)+" svelte-1rmxk7q"),e.disabled=t[1]},m(c,a){p(c,e,a),l&&l.m(e,null),n=!0,i||(o=_e(e,"click",t[4]),i=!0)},p(c,[a]){l&&l.p&&(!n||a&4)&&H(l,s,c,c[2],n?Y(s,c[2],a,null):K(c[2]),null),(!n||a&1&&r!==(r=Ae(`intent-${c[0]}`)+" svelte-1rmxk7q"))&&A(e,"class",r),(!n||a&2)&&(e.disabled=c[1])},i(c){n||(u(l,c),n=!0)},o(c){d(l,c),n=!1},d(c){c&&g(e),l&&l.d(c),i=!1,o()}}}function Rn(t,e,r){let{$$slots:n={},$$scope:i}=e,{intent:o="primary"}=e,{disabled:s=!1}=e;function l(c){lt.call(this,t,c)}return t.$$set=c=>{"intent"in c&&r(0,o=c.intent),"disabled"in c&&r(1,s=c.disabled),"$$scope"in c&&r(2,i=c.$$scope)},[o,s,i,n,l]}class we extends U{constructor(e){super(),R(this,e,Rn,Tn,P,{intent:0,disabled:1},Pn)}}function Un(t){S(t,"svelte-1f9z0o8","footer.svelte-1f9z0o8{display:flex;flex-direction:column}")}function Nn(t){let e,r;const n=t[1].default,i=G(n,t,t[0],null);return{c(){e=k("footer"),i&&i.c(),A(e,"class","rcb-modal-footer svelte-1f9z0o8")},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&H(i,n,o,o[0],r?Y(n,o[0],s,null):K(o[0]),null)},i(o){r||(u(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function Sn(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class Je extends U{constructor(e){super(),R(this,e,Sn,Nn,P,{},Un)}}function On(t){S(t,"svelte-6o8e90",'.column.svelte-6o8e90{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "8px");flex-grow:1}')}function Ln(t){let e,r,n;const i=t[2].default,o=G(i,t,t[1],null);return{c(){e=k("div"),o&&o.c(),A(e,"class","column svelte-6o8e90"),A(e,"style",r=`--gap:${t[0]};`)},m(s,l){p(s,e,l),o&&o.m(e,null),n=!0},p(s,[l]){o&&o.p&&(!n||l&2)&&H(o,i,s,s[1],n?Y(i,s[1],l,null):K(s[1]),null),(!n||l&1&&r!==(r=`--gap:${s[0]};`))&&A(e,"style",r)},i(s){n||(u(o,s),n=!0)},o(s){d(o,s),n=!1},d(s){s&&g(e),o&&o.d(s)}}}function xn(t,e,r){let{$$slots:n={},$$scope:i}=e,{gutter:o="8px"}=e;return t.$$set=s=>{"gutter"in s&&r(0,o=s.gutter),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class ke extends U{constructor(e){super(),R(this,e,xn,Ln,P,{gutter:0},On)}}const Fn="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='mdi_close'%3e%3cpath%20id='Vector'%20d='M19%206.41L17.59%205L12%2010.59L6.41%205L5%206.41L10.59%2012L5%2017.59L6.41%2019L12%2013.41L17.59%2019L19%2017.59L13.41%2012L19%206.41Z'%20fill='%23767676'/%3e%3c/g%3e%3c/svg%3e";function Gn(t){S(t,"svelte-14xreta",".close-button.svelte-14xreta{border:none;cursor:pointer;background-color:transparent;padding:0px}")}function Yn(t){let e,r,n,i,o;return{c(){e=k("button"),r=k("img"),ee(r.src,n=Fn)||A(r,"src",n),A(r,"alt","close"),A(e,"class","close-button svelte-14xreta"),e.disabled=t[0]},m(s,l){p(s,e,l),D(e,r),i||(o=_e(e,"click",t[1]),i=!0)},p(s,[l]){l&1&&(e.disabled=s[0])},i:v,o:v,d(s){s&&g(e),i=!1,o()}}}function Hn(t,e,r){let{disabled:n=!1}=e;function i(o){lt.call(this,t,o)}return t.$$set=o=>{"disabled"in o&&r(0,n=o.disabled)},[n,i]}class Kn extends U{constructor(e){super(),R(this,e,Hn,Yn,P,{disabled:0},Gn)}}function qn(t){S(t,"svelte-44qpq9",".rcb-app-icon.svelte-44qpq9{width:40px;height:40px;border-radius:12px;box-shadow:0px 1px 10px 0px rgba(0, 0, 0, 0.1);margin-right:16px}.rcb-app-icon-picture-container.svelte-44qpq9{height:40px}.rcb-app-icon.loading.svelte-44qpq9{background-color:gray}")}function jn(t){let e;return{c(){e=k("div"),A(e,"class","rcb-app-icon loading svelte-44qpq9")},m(r,n){p(r,e,n)},p:v,d(r){r&&g(e)}}}function Jn(t){let e,r,n,i,o,s;return{c(){e=k("picture"),r=k("source"),i=T(),o=k("img"),A(r,"type","image/webp"),Kt(r,n=t[1])||A(r,"srcset",n),A(o,"class","rcb-app-icon svelte-44qpq9"),ee(o.src,s=t[0])||A(o,"src",s),A(o,"alt","App icon"),A(e,"class","rcb-app-icon-picture-container svelte-44qpq9")},m(l,c){p(l,e,c),D(e,r),D(e,i),D(e,o)},p(l,c){c&2&&n!==(n=l[1])&&A(r,"srcset",n),c&1&&!ee(o.src,s=l[0])&&A(o,"src",s)},d(l){l&&g(e)}}}function Vn(t){let e;function r(o,s){return o[0]!==null?Jn:jn}let n=r(t),i=n(t);return{c(){i.c(),e=te()},m(o,s){i.m(o,s),p(o,e,s)},p(o,[s]){n===(n=r(o))&&i?i.p(o,s):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:v,o:v,d(o){o&&g(e),i.d(o)}}}function Wn(t,e,r){let{src:n=null}=e,{srcWebp:i=null}=e;return t.$$set=o=>{"src"in o&&r(0,n=o.src),"srcWebp"in o&&r(1,i=o.srcWebp)},[n,i]}class dt extends U{constructor(e){super(),R(this,e,Wn,Vn,P,{src:0,srcWebp:1},qn)}}const Re=t=>`https://da08ctfrofx1b.cloudfront.net/${t}`;function zn(t){S(t,"svelte-10uf5fq",".app-title.svelte-10uf5fq{font-weight:500;margin:8px 0;font-size:16px}.rcb-header-layout__business-info.svelte-10uf5fq{display:flex;align-items:center}")}function Xn(t){let e,r;return e=new dt({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Zn(t){let e,r,n=t[0].seller_company_name+"",i,o,s=t[0].app_icon_webp!==null&&t[0].app_icon!==null&&mt(t);return{c(){s&&s.c(),e=T(),r=k("span"),i=N(n),A(r,"class","app-title svelte-10uf5fq")},m(l,c){s&&s.m(l,c),p(l,e,c),p(l,r,c),D(r,i),o=!0},p(l,c){l[0].app_icon_webp!==null&&l[0].app_icon!==null?s?(s.p(l,c),c&1&&u(s,1)):(s=mt(l),s.c(),u(s,1),s.m(e.parentNode,e)):s&&(x(),d(s,1,1,()=>{s=null}),F()),(!o||c&1)&&n!==(n=l[0].seller_company_name+"")&&ie(i,n)},i(l){o||(u(s),o=!0)},o(l){d(s),o=!1},d(l){l&&(g(e),g(r)),s&&s.d(l)}}}function mt(t){let e,r;return e=new dt({props:{src:Re(t[0].app_icon),srcWebp:Re(t[0].app_icon_webp)}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.src=Re(n[0].app_icon)),i&1&&(o.srcWebp=Re(n[0].app_icon_webp)),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function er(t){let e,r,n,i;const o=[Zn,Xn],s=[];function l(c,a){return c[0]!==null?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=k("div"),n.c(),A(e,"class","rcb-header-layout__business-info svelte-10uf5fq")},m(c,a){p(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let f=r;r=l(c),r===f?s[r].p(c,a):(x(),d(s[f],1,1,()=>{s[f]=null}),F(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),u(n,1),n.m(e,null))},i(c){i||(u(n),i=!0)},o(c){d(n),i=!1},d(c){c&&g(e),s[r].d()}}}function tr(t,e,r){let{brandingInfo:n=null}=e;return t.$$set=i=>{"brandingInfo"in i&&r(0,n=i.brandingInfo)},[n]}class gt extends U{constructor(e){super(),R(this,e,tr,er,P,{brandingInfo:0},zn)}}function nr(t){S(t,"svelte-17puakv",".rcb-post-purchase-header-layout.svelte-17puakv{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:-4px}")}function rr(t){let e,r,n,i,o;return r=new gt({props:{brandingInfo:t[0]}}),i=new Kn({}),i.$on("click",function(){le(t[1])&&t[1].apply(this,arguments)}),{c(){e=k("div"),w(r.$$.fragment),n=T(),w(i.$$.fragment),A(e,"class","rcb-post-purchase-header-layout svelte-17puakv")},m(s,l){p(s,e,l),I(r,e,null),D(e,n),I(i,e,null),o=!0},p(s,l){t=s;const c={};l&1&&(c.brandingInfo=t[0]),r.$set(c)},i(s){o||(u(r.$$.fragment,s),u(i.$$.fragment,s),o=!0)},o(s){d(r.$$.fragment,s),d(i.$$.fragment,s),o=!1},d(s){s&&g(e),b(r),b(i)}}}function ir(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[rr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&7&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function or(t,e,r){let{brandingInfo:n=null}=e,{onClose:i}=e;return t.$$set=o=>{"brandingInfo"in o&&r(0,n=o.brandingInfo),"onClose"in o&&r(1,i=o.onClose)},[n,i]}class sr extends U{constructor(e){super(),R(this,e,or,ir,P,{brandingInfo:0,onClose:1},nr)}}function lr(t){S(t,"svelte-10pcqja",".rcb-modal-message.svelte-10pcqja{width:100%;min-height:160px;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center}.title.svelte-10pcqja{font-size:24px;line-height:1.25em}.subtitle.svelte-10pcqja{font-size:16px;line-height:1.25em;overflow-wrap:anywhere}")}const cr=t=>({}),pt=t=>({});function ar(t){let e,r,n,i,o;const s=t[4].default,l=G(s,t,t[5],null);return{c(){e=k("span"),r=N(t[2]),n=T(),i=k("span"),l&&l.c(),A(e,"class","title svelte-10pcqja"),A(i,"class","subtitle svelte-10pcqja")},m(c,a){p(c,e,a),D(e,r),p(c,n,a),p(c,i,a),l&&l.m(i,null),o=!0},p(c,a){(!o||a&4)&&ie(r,c[2]),l&&l.p&&(!o||a&32)&&H(l,s,c,c[5],o?Y(s,c[5],a,null):K(c[5]),null)},i(c){o||(u(l,c),o=!0)},o(c){d(l,c),o=!1},d(c){c&&(g(e),g(n),g(i)),l&&l.d(c)}}}function ur(t){let e,r,n;const i=t[4].icon,o=G(i,t,t[5],pt);return r=new ke({props:{gutter:"16px",$$slots:{default:[ar]},$$scope:{ctx:t}}}),{c(){o&&o.c(),e=T(),w(r.$$.fragment)},m(s,l){o&&o.m(s,l),p(s,e,l),I(r,s,l),n=!0},p(s,l){o&&o.p&&(!n||l&32)&&H(o,i,s,s[5],n?Y(i,s[5],l,cr):K(s[5]),pt);const c={};l&36&&(c.$$scope={dirty:l,ctx:s}),r.$set(c)},i(s){n||(u(o,s),u(r.$$.fragment,s),n=!0)},o(s){d(o,s),d(r.$$.fragment,s),n=!1},d(s){s&&g(e),o&&o.d(s),b(r,s)}}}function fr(t){let e,r,n;return r=new ke({props:{gutter:"16px",$$slots:{default:[ur]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),A(e,"class","rcb-modal-message svelte-10pcqja"),A(e,"data-type",t[3])},m(i,o){p(i,e,o),I(r,e,null),n=!0},p(i,o){const s={};o&36&&(s.$$scope={dirty:o,ctx:i}),r.$set(s),(!n||o&8)&&A(e,"data-type",i[3])},i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function dr(t){let e;return{c(){e=N("Go back to app")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function mr(t){let e,r;return e=new we({props:{$$slots:{default:[dr]},$$scope:{ctx:t}}}),e.$on("click",function(){le(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){t=n;const o={};i&32&&(o.$$scope={dirty:i,ctx:t}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function gr(t){let e,r,n,i,o,s;return e=new sr({props:{brandingInfo:t[0],onClose:t[1]}}),n=new fe({props:{$$slots:{default:[fr]},$$scope:{ctx:t}}}),o=new Je({props:{$$slots:{default:[mr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment),i=T(),w(o.$$.fragment)},m(l,c){I(e,l,c),p(l,r,c),I(n,l,c),p(l,i,c),I(o,l,c),s=!0},p(l,c){const a={};c&1&&(a.brandingInfo=l[0]),c&2&&(a.onClose=l[1]),e.$set(a);const f={};c&44&&(f.$$scope={dirty:c,ctx:l}),n.$set(f);const m={};c&34&&(m.$$scope={dirty:c,ctx:l}),o.$set(m)},i(l){s||(u(e.$$.fragment,l),u(n.$$.fragment,l),u(o.$$.fragment,l),s=!0)},o(l){d(e.$$.fragment,l),d(n.$$.fragment,l),d(o.$$.fragment,l),s=!1},d(l){l&&(g(r),g(i)),b(e,l),b(n,l),b(o,l)}}}function pr(t){let e,r;return e=new ke({props:{gutter:"32px",$$slots:{default:[gr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&47&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ar(t,e,r){let{$$slots:n={},$$scope:i}=e,{brandingInfo:o=null}=e,{onContinue:s}=e,{title:l}=e,{type:c}=e;return t.$$set=a=>{"brandingInfo"in a&&r(0,o=a.brandingInfo),"onContinue"in a&&r(1,s=a.onContinue),"title"in a&&r(2,l=a.title),"type"in a&&r(3,c=a.type),"$$scope"in a&&r(5,i=a.$$scope)},[o,s,l,c,n,i]}class At extends U{constructor(e){super(),R(this,e,Ar,pr,P,{brandingInfo:0,onContinue:1,title:2,type:3},lr)}}function _t(t){let e,r,n,i,o;return{c(){e=N("If this error persists, please contact "),r=k("a"),n=N(t[1]),o=N("."),A(r,"href",i="mailto:"+t[1])},m(s,l){p(s,e,l),p(s,r,l),D(r,n),p(s,o,l)},p(s,l){l&2&&ie(n,s[1]),l&2&&i!==(i="mailto:"+s[1])&&A(r,"href",i)},d(s){s&&(g(e),g(r),g(o))}}}function _r(t){let e=t[3]()+"",r,n,i,o=t[1]&&_t(t);return{c(){r=N(e),n=T(),o&&o.c(),i=te()},m(s,l){p(s,r,l),p(s,n,l),o&&o.m(s,l),p(s,i,l)},p(s,l){s[1]?o?o.p(s,l):(o=_t(s),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null)},d(s){s&&(g(r),g(n),g(i)),o&&o.d(s)}}}function hr(t){let e,r;return e=new Cn({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Er(t){let e,r;return e=new At({props:{title:"Something went wrong",brandingInfo:t[0],onContinue:t[2],type:"error",$$slots:{icon:[hr],default:[_r]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&4&&(o.onContinue=n[2]),i&34&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ir(t,e,r){let{brandingInfo:n=null}=e,{lastError:i}=e,{supportEmail:o=null}=e,{onContinue:s}=e;Qe(()=>{W.errorLog(`Displayed error: ${O[i.errorCode]}. Message: ${i.message??"None"}. Underlying error: ${i.underlyingErrorMessage??"None"}`)});function l(){switch(i.errorCode){case O.UnknownError:return"An unknown error occurred.";case O.ErrorSettingUpPurchase:return"Purchase not started due to an error.";case O.ErrorChargingPayment:return"Payment failed.";case O.NetworkError:return"Network error. Please check your internet connection.";case O.StripeError:return i.message;case O.MissingEmailError:return"Email is required to complete the purchase."}return i.message}return t.$$set=c=>{"brandingInfo"in c&&r(0,n=c.brandingInfo),"lastError"in c&&r(4,i=c.lastError),"supportEmail"in c&&r(1,o=c.supportEmail),"onContinue"in c&&r(2,s=c.onContinue)},[n,o,s,l,i]}class br extends U{constructor(e){super(),R(this,e,Ir,Er,P,{brandingInfo:0,lastError:4,supportEmail:1,onContinue:2})}}const wr="data:image/svg+xml,%3csvg%20width='124'%20height='124'%20viewBox='0%200%20124%20124'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='62'%20cy='62'%20r='62'%20fill='%23576CDB'/%3e%3crect%20x='44.1116'%20y='56'%20width='27.5'%20height='11'%20transform='rotate(45%2044.1116%2056)'%20fill='white'/%3e%3crect%20x='79.1133'%20y='44.334'%20width='11'%20height='44'%20transform='rotate(45%2079.1133%2044.334)'%20fill='white'/%3e%3c/svg%3e";function kr(t){S(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function $r(t){let e,r;return{c(){e=k("img"),ee(e.src,r=wr)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class vr extends U{constructor(e){super(),R(this,e,null,$r,P,{},kr)}}function yr(t){let e;return{c(){e=N("Your plan is now active.")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function Br(t){let e,r;return e=new vr({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Dr(t){let e,r;return e=new At({props:{type:"success",title:"Purchase successful",brandingInfo:t[0],onContinue:t[1],$$slots:{icon:[Br],default:[yr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&2&&(o.onContinue=n[1]),i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Mr(t,e,r){let{brandingInfo:n=null}=e,{onContinue:i}=e;return t.$$set=o=>{"brandingInfo"in o&&r(0,n=o.brandingInfo),"onContinue"in o&&r(1,i=o.onContinue)},[n,i]}class Qr extends U{constructor(e){super(),R(this,e,Mr,Dr,P,{brandingInfo:0,onContinue:1})}}function Cr(t,e,r,n,i={}){const o=r.create(e,i);return o.mount(t),o.on("change",s=>n("change",s)),o.on("ready",s=>n("ready",s)),o.on("focus",s=>n("focus",s)),o.on("blur",s=>n("blur",s)),o.on("escape",s=>n("escape",s)),o.on("click",s=>n("click",s)),o.on("loaderror",s=>n("loaderror",s)),o.on("loaderstart",s=>n("loaderstart",s)),o.on("networkschange",s=>n("networkschange",s)),o}const Pr=typeof window>"u";function Tr(t){if(!Pr)return t.registerAppInfo({name:"svelte-stripe-js",url:"https://svelte-stripe-js.vercel.app"})}function Rr(t){let e;return{c(){e=k("div")},m(r,n){p(r,e,n),t[6](e)},p:v,i:v,o:v,d(r){r&&g(e),t[6](null)}}}function Ur(t,e,r){let n,i;const o=nn(),{elements:s}=on("stripe");let{options:l=void 0}=e;Qe(()=>(n=Cr(i,"payment",s,o,l),()=>n.destroy()));function c(){n.blur()}function a(){n.clear()}function f(){n.destroy()}function m(){n.focus()}function E(y){Ce[y?"unshift":"push"](()=>{i=y,r(0,i)})}return t.$$set=y=>{"options"in y&&r(1,l=y.options)},[i,l,c,a,f,m,E]}class Nr extends U{constructor(e){super(),R(this,e,Ur,Rr,P,{options:1,blur:2,clear:3,destroy:4,focus:5})}get blur(){return this.$$.ctx[2]}get clear(){return this.$$.ctx[3]}get destroy(){return this.$$.ctx[4]}get focus(){return this.$$.ctx[5]}}function ht(t){let e;const r=t[15].default,n=G(r,t,t[14],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&16384)&&H(n,r,i,i[14],e?Y(r,i[14],o,null):K(i[14]),null)},i(i){e||(u(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function Sr(t){let e,r,n=t[1]&&t[0]&&ht(t);return{c(){n&&n.c(),e=te()},m(i,o){n&&n.m(i,o),p(i,e,o),r=!0},p(i,[o]){i[1]&&i[0]?n?(n.p(i,o),o&3&&u(n,1)):(n=ht(i),n.c(),u(n,1),n.m(e.parentNode,e)):n&&(x(),d(n,1,1,()=>{n=null}),F())},i(i){r||(u(n),r=!0)},o(i){d(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function Or(t,e,r){let n,{$$slots:i={},$$scope:o}=e,{stripe:s}=e,{mode:l=void 0}=e,{theme:c="stripe"}=e,{variables:a={}}=e,{rules:f={}}=e,{labels:m="above"}=e,{loader:E="auto"}=e,{fonts:y=[]}=e,{locale:_="auto"}=e,{currency:Q=void 0}=e,{amount:h=void 0}=e,{clientSecret:B=void 0}=e,{elements:J=null}=e;return t.$$set=$=>{"stripe"in $&&r(1,s=$.stripe),"mode"in $&&r(2,l=$.mode),"theme"in $&&r(3,c=$.theme),"variables"in $&&r(4,a=$.variables),"rules"in $&&r(5,f=$.rules),"labels"in $&&r(6,m=$.labels),"loader"in $&&r(7,E=$.loader),"fonts"in $&&r(8,y=$.fonts),"locale"in $&&r(9,_=$.locale),"currency"in $&&r(10,Q=$.currency),"amount"in $&&r(11,h=$.amount),"clientSecret"in $&&r(12,B=$.clientSecret),"elements"in $&&r(0,J=$.elements),"$$scope"in $&&r(14,o=$.$$scope)},t.$$.update=()=>{t.$$.dirty&120&&r(13,n={theme:c,variables:a,rules:f,labels:m}),t.$$.dirty&16263&&s&&!J&&(r(0,J=s.elements({mode:l,currency:Q,amount:h,appearance:n,clientSecret:B,fonts:y,loader:E,locale:_})),Tr(s),rn("stripe",{stripe:s,elements:J})),t.$$.dirty&8705&&J&&J.update({appearance:n,locale:_})},[J,s,l,c,a,f,m,E,y,_,Q,h,B,n,o,i]}class Lr extends U{constructor(e){super(),R(this,e,Or,Sr,P,{stripe:1,mode:2,theme:3,variables:4,rules:5,labels:6,loader:7,fonts:8,locale:9,currency:10,amount:11,clientSecret:12,elements:0})}}var Et="https://js.stripe.com/v3",xr=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,It="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Fr=function(){for(var e=document.querySelectorAll('script[src^="'.concat(Et,'"]')),r=0;r<e.length;r++){var n=e[r];if(xr.test(n.src))return n}return null},bt=function(e){var r=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(Et).concat(r);var i=document.head||document.body;if(!i)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return i.appendChild(n),n},Gr=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"2.3.0",startTime:r})},$e=null,Ue=null,Ne=null,Yr=function(e){return function(){e(new Error("Failed to load Stripe.js"))}},Hr=function(e,r){return function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))}},Kr=function(e){return $e!==null?$e:($e=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&e&&console.warn(It),window.Stripe){r(window.Stripe);return}try{var i=Fr();if(i&&e)console.warn(It);else if(!i)i=bt(e);else if(i&&Ne!==null&&Ue!==null){var o;i.removeEventListener("load",Ne),i.removeEventListener("error",Ue),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=bt(e)}Ne=Hr(r,n),Ue=Yr(n),i.addEventListener("load",Ne),i.addEventListener("error",Ue)}catch(s){n(s);return}}),$e.catch(function(r){return $e=null,Promise.reject(r)}))},qr=function(e,r,n){if(e===null)return null;var i=e.apply(void 0,r);return Gr(i,n),i},ve,wt=!1,kt=function(){return ve||(ve=Kr(null).catch(function(e){return ve=null,Promise.reject(e)}),ve)};Promise.resolve().then(function(){return kt()}).catch(function(t){wt||console.warn(t)});var jr=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];wt=!0;var i=Date.now();return kt().then(function(o){return qr(o,r,i)})};function Jr(t){S(t,"svelte-1xe711j",".rcb-header-layout.svelte-1xe711j{display:flex;justify-content:space-between;align-items:center;width:100%;font-size:24px;margin:0;font-weight:500}")}function Vr(t){let e,r;const n=t[0].default,i=G(n,t,t[1],null);return{c(){e=k("div"),i&&i.c(),A(e,"class","rcb-header-layout svelte-1xe711j")},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,s){i&&i.p&&(!r||s&2)&&H(i,n,o,o[1],r?Y(n,o[1],s,null):K(o[1]),null)},i(o){r||(u(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function Wr(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[Vr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&2&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function zr(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(1,i=o.$$scope)},[n,i]}class Ve extends U{constructor(e){super(),R(this,e,zr,Wr,P,{},Jr)}}const Xr="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18%208H17V6C17%203.24%2014.76%201%2012%201C9.24%201%207%203.24%207%206V8H6C4.9%208%204%208.9%204%2010V20C4%2021.1%204.9%2022%206%2022H18C19.1%2022%2020%2021.1%2020%2020V10C20%208.9%2019.1%208%2018%208ZM12%2017C10.9%2017%2010%2016.1%2010%2015C10%2013.9%2010.9%2013%2012%2013C13.1%2013%2014%2013.9%2014%2015C14%2016.1%2013.1%2017%2012%2017ZM15.1%208H8.9V6C8.9%204.29%2010.29%202.9%2012%202.9C13.71%202.9%2015.1%204.29%2015.1%206V8Z'%20fill='%2311D483'/%3e%3c/svg%3e";function Zr(t){let e,r;return{c(){e=k("img"),ee(e.src,r=Xr)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class ei extends U{constructor(e){super(),R(this,e,null,Zr,P,{})}}const ye={error:"#f2545b",warning:"#f4e971",focus:"#000080","grey-text-dark":"#000000","grey-text-light":"#767676","grey-ui-dark":"#dfdfdf",white:"#ffffff"};function ti(t){S(t,"svelte-rjmul6",`.processing.svelte-rjmul6{width:12px;aspect-ratio:1;border-radius:50%;animation:svelte-rjmul6-l5 1.5s infinite linear}@keyframes svelte-rjmul6-l5{0%{box-shadow:20px 0 #fff2,
|
|
2
2
|
-20px 0 #fff2;background:#fff2}25%{box-shadow:20px 0 #fff2,
|
|
3
3
|
-20px 0 #ffff;background:#fff2}50%{box-shadow:20px 0 #fff2,
|
|
4
4
|
-20px 0 #fff2;background:#ffff}75%{box-shadow:20px 0 #ffff,
|
|
5
5
|
-20px 0 #fff2;background:#fff2}100%{box-shadow:20px 0 #fff2,
|
|
6
|
-
-20px 0 #fff2;background:#fff2}}`)}function ni(t){let e;return{c(){e=k("div"),A(e,"class","processing svelte-rjmul6")},m(r,n){p(r,e,n)},p:v,i:v,o:v,d(r){r&&g(e)}}}class $t extends U{constructor(e){super(),R(this,e,null,ni,P,{},ti)}}function ri(t){S(t,"svelte-1wxt892",".rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}")}function ii(t){let e,r;return e=new je({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function si(t){let e,r,n,i,s,o;function l(a){t[9](a)}let c={stripe:t[3],clientSecret:t[4],loader:"always",theme:"stripe",variables:{borderRadius:"12px",fontSizeBase:"16px",fontSizeSm:"16px",spacingGridRow:"16px",colorText:ye["grey-text-dark"],focusBoxShadow:"none",colorDanger:ye.error},rules:{".Input":{boxShadow:"none",border:`2px solid ${ye["grey-ui-dark"]}`},".Input:focus":{border:`2px solid ${ye.focus}`,outline:"none"},".Label":{marginBottom:"8px",fontWeight:"500",lineHeight:"22px"},".Input--invalid":{boxShadow:"none"}},$$slots:{default:[gi]},$$scope:{ctx:t}};return t[2]!==void 0&&(c.elements=t[2]),r=new Lr({props:c}),Ce.push(()=>fn(r,"elements",l)),{c(){e=k("form"),w(r.$$.fragment)},m(a,f){p(a,e,f),I(r,e,null),i=!0,s||(o=_e(e,"submit",st(t[5])),s=!0)},p(a,f){const m={};f&8&&(m.stripe=a[3]),f&2051&&(m.$$scope={dirty:f,ctx:a}),!n&&f&4&&(n=!0,m.elements=a[2],cn(()=>n=!1)),r.$set(m)},i(a){i||(u(r.$$.fragment,a),i=!0)},o(a){d(r.$$.fragment,a),i=!1},d(a){a&&g(e),b(r),s=!1,o()}}}function oi(t){let e,r,n,i;return n=new ei({}),{c(){e=k("div"),e.textContent="Secure Checkout",r=T(),w(n.$$.fragment)},m(s,o){p(s,e,o),p(s,r,o),I(n,s,o),i=!0},p:v,i(s){i||(u(n.$$.fragment,s),i=!0)},o(s){d(n.$$.fragment,s),i=!1},d(s){s&&(g(e),g(r)),b(n,s)}}}function li(t){let e,r,n;return r=new Nr({}),{c(){e=k("div"),w(r.$$.fragment),A(e,"class","rcb-stripe-elements-container svelte-1wxt892")},m(i,s){p(i,e,s),I(r,e,null),n=!0},p:v,i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function ci(t){let e;return{c(){e=N("Pay")},m(r,n){p(r,e,n)},i:v,o:v,d(r){r&&g(e)}}}function ai(t){let e,r;return e=new $t({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ui(t){let e,r,n,i;const s=[ai,ci],o=[];function l(c,a){return c[0]?0:1}return e=l(t),r=o[e]=s[e](t),{c(){r.c(),n=te()},m(c,a){o[e].m(c,a),p(c,n,a),i=!0},p(c,a){let f=e;e=l(c),e!==f&&(F(),d(o[f],1,1,()=>{o[f]=null}),x(),r=o[e],r||(r=o[e]=s[e](c),r.c()),u(r,1),r.m(n.parentNode,n))},i(c){i||(u(r),i=!0)},o(c){d(r),i=!1},d(c){c&&g(n),o[e].d(c)}}}function fi(t){let e;return{c(){e=N("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function di(t){let e,r,n,i;return e=new we({props:{disabled:t[0],$$slots:{default:[ui]},$$scope:{ctx:t}}}),n=new we({props:{disabled:t[0],intent:"secondary",$$slots:{default:[fi]},$$scope:{ctx:t}}}),n.$on("click",function(){le(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment)},m(s,o){I(e,s,o),p(s,r,o),I(n,s,o),i=!0},p(s,o){t=s;const l={};o&1&&(l.disabled=t[0]),o&2049&&(l.$$scope={dirty:o,ctx:t}),e.$set(l);const c={};o&1&&(c.disabled=t[0]),o&2048&&(c.$$scope={dirty:o,ctx:t}),n.$set(c)},i(s){i||(u(e.$$.fragment,s),u(n.$$.fragment,s),i=!0)},o(s){d(e.$$.fragment,s),d(n.$$.fragment,s),i=!1},d(s){s&&g(r),b(e,s),b(n,s)}}}function mi(t){let e,r;return e=new ke({props:{$$slots:{default:[di]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const s={};i&2051&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function gi(t){let e,r,n,i,s,o;return e=new Ve({props:{$$slots:{default:[oi]},$$scope:{ctx:t}}}),n=new fe({props:{$$slots:{default:[li]},$$scope:{ctx:t}}}),s=new Je({props:{$$slots:{default:[mi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment),i=T(),w(s.$$.fragment)},m(l,c){I(e,l,c),p(l,r,c),I(n,l,c),p(l,i,c),I(s,l,c),o=!0},p(l,c){const a={};c&2048&&(a.$$scope={dirty:c,ctx:l}),e.$set(a);const f={};c&2048&&(f.$$scope={dirty:c,ctx:l}),n.$set(f);const m={};c&2051&&(m.$$scope={dirty:c,ctx:l}),s.$set(m)},i(l){o||(u(e.$$.fragment,l),u(n.$$.fragment,l),u(s.$$.fragment,l),o=!0)},o(l){d(e.$$.fragment,l),d(n.$$.fragment,l),d(s.$$.fragment,l),o=!1},d(l){l&&(g(r),g(i)),b(e,l),b(n,l),b(s,l)}}}function pi(t){let e,r,n,i;const s=[si,ii],o=[];function l(c,a){return c[3]&&c[4]?0:1}return r=l(t),n=o[r]=s[r](t),{c(){e=k("div"),n.c()},m(c,a){p(c,e,a),o[r].m(e,null),i=!0},p(c,[a]){let f=r;r=l(c),r===f?o[r].p(c,a):(F(),d(o[f],1,1,()=>{o[f]=null}),x(),n=o[r],n?n.p(c,a):(n=o[r]=s[r](c),n.c()),u(n,1),n.m(e,null))},i(c){i||(u(n),i=!0)},o(c){d(n),i=!1},d(c){c&&g(e),o[r].d()}}}function Ai(t,e,r){let{onClose:n}=e,{onContinue:i}=e,{onError:s}=e,{paymentInfoCollectionMetadata:o}=e,{processing:l=!1}=e;const c=o.data.client_secret;let a=null,f,m;Qe(async()=>{const _=o.data.publishable_api_key,Q=o.data.stripe_account_id;if(!_||!Q)throw new Error("Stripe publishable key or account ID not found");r(3,a=await jr(_,{stripeAccount:Q}))});const E=async()=>{if(l||!a||!m)return;r(0,l=!0);const _=await a.confirmSetup({elements:m,redirect:"if_required"});_.error?(r(0,l=!1),s(new j(O.StripeError,_.error.message))):i()};function y(_){f=_,r(2,f)}return t.$$set=_=>{"onClose"in _&&r(1,n=_.onClose),"onContinue"in _&&r(6,i=_.onContinue),"onError"in _&&r(7,s=_.onError),"paymentInfoCollectionMetadata"in _&&r(8,o=_.paymentInfoCollectionMetadata),"processing"in _&&r(0,l=_.processing)},t.$$.update=()=>{t.$$.dirty&4&&f&&f._elements.length>0&&(m=f)},[l,n,f,a,c,E,i,s,o,y]}class _i extends U{constructor(e){super(),R(this,e,Ai,pi,P,{onClose:1,onContinue:6,onError:7,paymentInfoCollectionMetadata:8,processing:0},ri)}}function hi(t){S(t,"svelte-favd20","form.svelte-favd20.svelte-favd20{display:flex;flex-direction:column;min-height:100%;flex-grow:1}.form-container.svelte-favd20.svelte-favd20{display:flex;flex-direction:column;width:100%;margin-top:32px;margin-bottom:16px}.form-label.svelte-favd20.svelte-favd20{margin-top:8px;margin-bottom:8px;display:block;font-weight:500;line-height:22px}.form-input.error.svelte-favd20 input.svelte-favd20{border-color:var(--rc-color-error)}.form-error.svelte-favd20.svelte-favd20{margin-top:4px;font-size:16px;line-height:20px;min-height:40px;color:var(--rc-color-error)}input.svelte-favd20.svelte-favd20{width:100%;box-sizing:border-box;padding:8px;border:2px solid var(--rc-color-grey-ui-dark);border-radius:12px;font-size:16px;height:48px;padding:6px 14px}input.svelte-favd20.svelte-favd20:focus{outline:none;border:2px solid var(--rc-color-focus)}")}function Ei(t){let e;return{c(){e=N("Billing email address")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function vt(t){let e,r;return{c(){e=k("div"),r=N(t[2]),A(e,"class","form-error svelte-favd20")},m(n,i){p(n,e,i),D(e,r)},p(n,i){i&4&&ie(r,n[2])},d(n){n&&g(e)}}}function Ii(t){let e,r,n,i,s,o,l,c,a,f=t[2]&&vt(t);return{c(){e=k("div"),r=k("div"),r.innerHTML='<label for="email">Email</label>',n=T(),i=k("div"),s=k("input"),l=T(),f&&f.c(),A(r,"class","form-label svelte-favd20"),A(s,"name","email"),A(s,"placeholder","john@appleseed.com"),A(s,"autocapitalize","off"),A(s,"class","svelte-favd20"),A(i,"class",o="form-input "+t[4]+" svelte-favd20"),A(e,"class","form-container svelte-favd20")},m(m,E){p(m,e,E),D(e,r),D(e,n),D(e,i),D(i,s),ot(s,t[3]),D(e,l),f&&f.m(e,null),c||(a=_e(s,"input",t[7]),c=!0)},p(m,E){E&8&&s.value!==m[3]&&ot(s,m[3]),E&16&&o!==(o="form-input "+m[4]+" svelte-favd20")&&A(i,"class",o),m[2]?f?f.p(m,E):(f=vt(m),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},d(m){m&&g(e),f&&f.d(),c=!1,a()}}}function bi(t){let e;return{c(){e=N("Continue")},m(r,n){p(r,e,n)},i:v,o:v,d(r){r&&g(e)}}}function wi(t){let e,r;return e=new $t({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ki(t){let e,r,n,i;const s=[wi,bi],o=[];function l(c,a){return c[1]?0:1}return e=l(t),r=o[e]=s[e](t),{c(){r.c(),n=te()},m(c,a){o[e].m(c,a),p(c,n,a),i=!0},p(c,a){let f=e;e=l(c),e!==f&&(F(),d(o[f],1,1,()=>{o[f]=null}),x(),r=o[e],r||(r=o[e]=s[e](c),r.c()),u(r,1),r.m(n.parentNode,n))},i(c){i||(u(r),i=!0)},o(c){d(r),i=!1},d(c){c&&g(n),o[e].d(c)}}}function $i(t){let e;return{c(){e=N("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function vi(t){let e,r,n,i;return e=new we({props:{disabled:t[1],$$slots:{default:[ki]},$$scope:{ctx:t}}}),n=new we({props:{intent:"secondary",disabled:t[1],$$slots:{default:[$i]},$$scope:{ctx:t}}}),n.$on("click",function(){le(t[0])&&t[0].apply(this,arguments)}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment)},m(s,o){I(e,s,o),p(s,r,o),I(n,s,o),i=!0},p(s,o){t=s;const l={};o&2&&(l.disabled=t[1]),o&258&&(l.$$scope={dirty:o,ctx:t}),e.$set(l);const c={};o&2&&(c.disabled=t[1]),o&256&&(c.$$scope={dirty:o,ctx:t}),n.$set(c)},i(s){i||(u(e.$$.fragment,s),u(n.$$.fragment,s),i=!0)},o(s){d(e.$$.fragment,s),d(n.$$.fragment,s),i=!1},d(s){s&&g(r),b(e,s),b(n,s)}}}function yi(t){let e,r;return e=new ke({props:{$$slots:{default:[vi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const s={};i&259&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Bi(t){let e,r,n,i,s,o,l,c,a;return r=new Ve({props:{$$slots:{default:[Ei]},$$scope:{ctx:t}}}),i=new fe({props:{$$slots:{default:[Ii]},$$scope:{ctx:t}}}),o=new Je({props:{$$slots:{default:[yi]},$$scope:{ctx:t}}}),{c(){e=k("form"),w(r.$$.fragment),n=T(),w(i.$$.fragment),s=T(),w(o.$$.fragment),A(e,"class","svelte-favd20")},m(f,m){p(f,e,m),I(r,e,null),D(e,n),I(i,e,null),D(e,s),I(o,e,null),l=!0,c||(a=_e(e,"submit",st(t[5])),c=!0)},p(f,[m]){const E={};m&256&&(E.$$scope={dirty:m,ctx:f}),r.$set(E);const y={};m&284&&(y.$$scope={dirty:m,ctx:f}),i.$set(y);const _={};m&259&&(_.$$scope={dirty:m,ctx:f}),o.$set(_)},i(f){l||(u(r.$$.fragment,f),u(i.$$.fragment,f),u(o.$$.fragment,f),l=!0)},o(f){d(r.$$.fragment,f),d(i.$$.fragment,f),d(o.$$.fragment,f),l=!1},d(f){f&&g(e),b(r),b(i),b(o),c=!1,a()}}}function Di(t,e,r){let n,i,s,{onContinue:o}=e,{onClose:l}=e,{processing:c}=e;const a=async()=>{n.trim()===""?r(2,i="You need to provide your email address to continue."):o({email:n})};function f(){n=this.value,r(3,n)}return t.$$set=m=>{"onContinue"in m&&r(6,o=m.onContinue),"onClose"in m&&r(0,l=m.onClose),"processing"in m&&r(1,c=m.processing)},t.$$.update=()=>{t.$$.dirty&4&&r(4,s=i?"error":"")},r(3,n=""),r(2,i=""),[l,c,i,n,s,a,o,f]}class Mi extends U{constructor(e){super(),R(this,e,Di,Bi,P,{onContinue:6,onClose:0,processing:1},hi)}}function Qi(t){S(t,"svelte-17tslso",".rcb-modal-backdrop.svelte-17tslso{position:fixed;top:0;left:0;right:0;min-width:100%;width:100vw;width:100dvw;min-height:100%;height:100vh;height:100dvh;background-color:rgba(40, 40, 40, 0.75);display:flex;flex-direction:column;justify-content:space-around;z-index:1000001}")}function Ci(t){let e,r;const n=t[1].default,i=G(n,t,t[0],null);return{c(){e=k("div"),i&&i.c(),A(e,"class","rcb-modal-backdrop svelte-17tslso")},m(s,o){p(s,e,o),i&&i.m(e,null),r=!0},p(s,[o]){i&&i.p&&(!r||o&1)&&H(i,n,s,s[0],r?Y(n,s[0],o,null):q(s[0]),null)},i(s){r||(u(i,s),r=!0)},o(s){d(i,s),r=!1},d(s){s&&g(e),i&&i.d(s)}}}function Pi(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=s=>{"$$scope"in s&&r(0,i=s.$$scope)},[i,n]}class Ti extends U{constructor(e){super(),R(this,e,Pi,Ci,P,{},Qi)}}function Ri(t){S(t,"svelte-t8k92q",".rcb-modal-main.svelte-t8k92q{box-sizing:border-box;border-radius:8px;background-color:var(--rc-color-white);color:var(--rc-color-grey-text-dark);max-width:640px;min-width:480px;min-height:460px;padding:40px;flex-direction:column;display:flex}.rcb-modal-dark.svelte-t8k92q{background-color:var(--rc-color-grey-text-dark);color:var(--rc-color-white);max-width:480px;min-width:320px;min-height:0px}@media screen and (max-width: 960px){.rcb-modal-main.svelte-t8k92q,.rcb-modal-dark.svelte-t8k92q{min-width:300px;max-width:640px;width:calc(100% - 32px);padding:32px}}")}function Ui(t){let e,r,n;const i=t[2].default,s=G(i,t,t[1],null);return{c(){e=k("main"),s&&s.c(),A(e,"class",r=Ae(`rcb-modal-main ${t[0]?"rcb-modal-dark":""}`)+" svelte-t8k92q")},m(o,l){p(o,e,l),s&&s.m(e,null),n=!0},p(o,[l]){s&&s.p&&(!n||l&2)&&H(s,i,o,o[1],n?Y(i,o[1],l,null):q(o[1]),null),(!n||l&1&&r!==(r=Ae(`rcb-modal-main ${o[0]?"rcb-modal-dark":""}`)+" svelte-t8k92q"))&&A(e,"class",r)},i(o){n||(u(s,o),n=!0)},o(o){d(s,o),n=!1},d(o){o&&g(e),s&&s.d(o)}}}function Ni(t,e,r){let{$$slots:n={},$$scope:i}=e,{dark:s=!1}=e;return t.$$set=o=>{"dark"in o&&r(0,s=o.dark),"$$scope"in o&&r(1,i=o.$$scope)},[s,i,n]}class Si extends U{constructor(e){super(),R(this,e,Ni,Ui,P,{dark:0},Ri)}}function Oi(t){let e;const r=t[1].default,n=G(r,t,t[2],null);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s&4)&&H(n,r,i,i[2],e?Y(r,i[2],s,null):q(i[2]),null)},i(i){e||(u(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function Li(t){let e,r;return e=new Ti({props:{$$slots:{default:[Fi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const s={};i&4&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Fi(t){let e;const r=t[1].default,n=G(r,t,t[2],null);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s&4)&&H(n,r,i,i[2],e?Y(r,i[2],s,null):q(i[2]),null)},i(i){e||(u(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function xi(t){let e,r,n,i;const s=[Li,Oi],o=[];function l(c,a){return c[0]?0:1}return e=l(t),r=o[e]=s[e](t),{c(){r.c(),n=te()},m(c,a){o[e].m(c,a),p(c,n,a),i=!0},p(c,[a]){let f=e;e=l(c),e===f?o[e].p(c,a):(F(),d(o[f],1,1,()=>{o[f]=null}),x(),r=o[e],r?r.p(c,a):(r=o[e]=s[e](c),r.c()),u(r,1),r.m(n.parentNode,n))},i(c){i||(u(r),i=!0)},o(c){d(r),i=!1},d(c){c&&g(n),o[e].d(c)}}}function Gi(t,e,r){let{$$slots:n={},$$scope:i}=e,{condition:s=!1}=e;return t.$$set=o=>{"condition"in o&&r(0,s=o.condition),"$$scope"in o&&r(2,i=o.$$scope)},[s,n,i]}class Yi extends U{constructor(e){super(),R(this,e,Gi,xi,P,{condition:0})}}const Hi=t=>({}),yt=t=>({});function qi(t){let e,r;const n=t[1].header,i=G(n,t,t[2],yt),s=t[1].default,o=G(s,t,t[2],null);return{c(){i&&i.c(),e=T(),o&&o.c()},m(l,c){i&&i.m(l,c),p(l,e,c),o&&o.m(l,c),r=!0},p(l,c){i&&i.p&&(!r||c&4)&&H(i,n,l,l[2],r?Y(n,l[2],c,Hi):q(l[2]),yt),o&&o.p&&(!r||c&4)&&H(o,s,l,l[2],r?Y(s,l[2],c,null):q(l[2]),null)},i(l){r||(u(i,l),u(o,l),r=!0)},o(l){d(i,l),d(o,l),r=!1},d(l){l&&g(e),i&&i.d(l),o&&o.d(l)}}}function Ki(t){let e,r;return e=new Si({props:{dark:t[0],$$slots:{default:[qi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const s={};i&1&&(s.dark=n[0]),i&4&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ji(t,e,r){let{$$slots:n={},$$scope:i}=e,{dark:s=!1}=e;return t.$$set=o=>{"dark"in o&&r(0,s=o.dark),"$$scope"in o&&r(2,i=o.$$scope)},[s,n,i]}class Bt extends U{constructor(e){super(),R(this,e,ji,Ki,P,{dark:0})}}var oe=(t=>(t[t.UnknownError=0]="UnknownError",t[t.UserCancelledError=1]="UserCancelledError",t[t.StoreProblemError=2]="StoreProblemError",t[t.PurchaseNotAllowedError=3]="PurchaseNotAllowedError",t[t.PurchaseInvalidError=4]="PurchaseInvalidError",t[t.ProductNotAvailableForPurchaseError=5]="ProductNotAvailableForPurchaseError",t[t.ProductAlreadyPurchasedError=6]="ProductAlreadyPurchasedError",t[t.ReceiptAlreadyInUseError=7]="ReceiptAlreadyInUseError",t[t.InvalidReceiptError=8]="InvalidReceiptError",t[t.MissingReceiptFileError=9]="MissingReceiptFileError",t[t.NetworkError=10]="NetworkError",t[t.InvalidCredentialsError=11]="InvalidCredentialsError",t[t.UnexpectedBackendResponseError=12]="UnexpectedBackendResponseError",t[t.InvalidAppUserIdError=14]="InvalidAppUserIdError",t[t.OperationAlreadyInProgressError=15]="OperationAlreadyInProgressError",t[t.UnknownBackendError=16]="UnknownBackendError",t[t.InvalidAppleSubscriptionKeyError=17]="InvalidAppleSubscriptionKeyError",t[t.IneligibleError=18]="IneligibleError",t[t.InsufficientPermissionsError=19]="InsufficientPermissionsError",t[t.PaymentPendingError=20]="PaymentPendingError",t[t.InvalidSubscriberAttributesError=21]="InvalidSubscriberAttributesError",t[t.LogOutWithAnonymousUserError=22]="LogOutWithAnonymousUserError",t[t.ConfigurationError=23]="ConfigurationError",t[t.UnsupportedError=24]="UnsupportedError",t[t.EmptySubscriberAttributesError=25]="EmptySubscriberAttributesError",t[t.CustomerInfoError=28]="CustomerInfoError",t[t.SignatureVerificationError=36]="SignatureVerificationError",t))(oe||{});class Se{static getPublicMessage(e){switch(e){case 0:return"Unknown error.";case 1:return"Purchase was cancelled.";case 2:return"There was a problem with the store.";case 3:return"The device or user is not allowed to make the purchase.";case 4:return"One or more of the arguments provided are invalid.";case 5:return"The product is not available for purchase.";case 6:return"This product is already active for the user.";case 7:return"There is already another active subscriber using the same receipt.";case 8:return"The receipt is not valid.";case 9:return"The receipt is missing.";case 10:return"Error performing request.";case 11:return"There was a credentials issue. Check the underlying error for more details.";case 12:return"Received unexpected response from the backend.";case 14:return"The app user id is not valid.";case 15:return"The operation is already in progress.";case 16:return"There was an unknown backend error.";case 17:return"Apple Subscription Key is invalid or not present. In order to provide subscription offers, you must first generate a subscription key. Please see https://docs.revenuecat.com/docs/ios-subscription-offers for more info.";case 18:return"The User is ineligible for that action.";case 19:return"App does not have sufficient permissions to make purchases.";case 20:return"The payment is pending.";case 21:return"One or more of the attributes sent could not be saved.";case 22:return"Called logOut but the current user is anonymous.";case 23:return"There is an issue with your configuration. Check the underlying error for more details.";case 24:return"There was a problem with the operation. Looks like we doesn't support that yet. Check the underlying error for more details.";case 25:return"A request for subscriber attributes returned none.";case 28:return"There was a problem related to the customer info.";case 36:return"Request failed signature verification. Please see https://rev.cat/trusted-entitlements for more info."}}static getErrorCodeForBackendErrorCode(e){switch(e){case 7101:return 2;case 7102:return 7;case 7103:return 8;case 7107:case 7224:case 7225:return 11;case 7105:case 7106:return 4;case 7220:return 14;case 7229:return 2;case 7230:case 7e3:return 23;case 7231:return 2;case 7232:return 18;case 7263:case 7264:return 21;case 7104:case 7234:case 7226:case 7110:return 12;case 7662:return 24}}static convertCodeToBackendErrorCode(e){return e in Dt?e:null}static convertPurchaseFlowErrorCodeToErrorCode(e){switch(e){case O.ErrorSettingUpPurchase:return 2;case O.ErrorChargingPayment:return 20;case O.NetworkError:return 10;case O.MissingEmailError:return 4;case O.StripeError:return 2;case O.UnknownError:return 0}}}var Dt=(t=>(t[t.BackendInvalidPlatform=7e3]="BackendInvalidPlatform",t[t.BackendStoreProblem=7101]="BackendStoreProblem",t[t.BackendCannotTransferPurchase=7102]="BackendCannotTransferPurchase",t[t.BackendInvalidReceiptToken=7103]="BackendInvalidReceiptToken",t[t.BackendInvalidAppStoreSharedSecret=7104]="BackendInvalidAppStoreSharedSecret",t[t.BackendInvalidPaymentModeOrIntroPriceNotProvided=7105]="BackendInvalidPaymentModeOrIntroPriceNotProvided",t[t.BackendProductIdForGoogleReceiptNotProvided=7106]="BackendProductIdForGoogleReceiptNotProvided",t[t.BackendInvalidPlayStoreCredentials=7107]="BackendInvalidPlayStoreCredentials",t[t.BackendInternalServerError=7110]="BackendInternalServerError",t[t.BackendEmptyAppUserId=7220]="BackendEmptyAppUserId",t[t.BackendInvalidAuthToken=7224]="BackendInvalidAuthToken",t[t.BackendInvalidAPIKey=7225]="BackendInvalidAPIKey",t[t.BackendBadRequest=7226]="BackendBadRequest",t[t.BackendPlayStoreQuotaExceeded=7229]="BackendPlayStoreQuotaExceeded",t[t.BackendPlayStoreInvalidPackageName=7230]="BackendPlayStoreInvalidPackageName",t[t.BackendPlayStoreGenericError=7231]="BackendPlayStoreGenericError",t[t.BackendUserIneligibleForPromoOffer=7232]="BackendUserIneligibleForPromoOffer",t[t.BackendInvalidAppleSubscriptionKey=7234]="BackendInvalidAppleSubscriptionKey",t[t.BackendInvalidSubscriberAttributes=7263]="BackendInvalidSubscriberAttributes",t[t.BackendInvalidSubscriberAttributesBody=7264]="BackendInvalidSubscriberAttributesBody",t[t.BackendProductIDsMalformed=7662]="BackendProductIDsMalformed",t))(Dt||{});class ne extends Error{constructor(r,n,i){super(n);C(this,"toString",()=>`PurchasesError(code: ${oe[this.errorCode]}, message: ${this.message})`);this.errorCode=r,this.underlyingErrorMessage=i}static getForBackendError(r,n){const i=Se.getErrorCodeForBackendErrorCode(r);return new ne(i,Se.getPublicMessage(i),n)}static getForPurchasesFlowError(r){return new ne(Se.convertPurchaseFlowErrorCodeToErrorCode(r.errorCode),r.message,r.underlyingErrorMessage)}}class Mt extends Error{constructor(){super("Purchases must be configured before calling getInstance")}}const Ji="0.1.0",de="https://api.revenuecat.com";var Oe;(function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.EARLY_HINTS=103]="EARLY_HINTS",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY=305]="USE_PROXY",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",t[t.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.IM_A_TEAPOT=418]="IM_A_TEAPOT",t[t.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",t[t.METHOD_FAILURE=420]="METHOD_FAILURE",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(Oe||(Oe={}));function We(t){return t?t.startsWith("rcb_sb_"):!1}async function me(t,e,r,n){const i=await fetch(t.url(),{method:t.method,headers:zi(e,n),body:Wi(r)});return await Vi(i,t),await i.json()}async function Vi(t,e){const r=t.status;if(r>=Oe.INTERNAL_SERVER_ERROR)ze(e,r,await t.text());else if(r>=Oe.BAD_REQUEST){const n=await t.json(),i=n?JSON.stringify(n):null,s=n==null?void 0:n.code,o=n==null?void 0:n.message;if(s!=null){const l=Se.convertCodeToBackendErrorCode(s);if(l==null)ze(e,r,i);else throw ne.getForBackendError(l,o)}else ze(e,r,i)}}function ze(t,e,r){throw new ne(oe.UnknownBackendError,`Unknown backend error. Request: ${t.name}. Status code: ${e}. Body: ${r}.`)}function Wi(t){return t==null?null:JSON.stringify(t)}function zi(t,e){let r={Authorization:`Bearer ${t}`,"Content-Type":"application/json",Accept:"application/json","X-Platform":"web","X-Version":Ji,"X-Is-Sandbox":`${We(t)}`};return e!=null&&(r={...r,...e}),r}const Qt="/v1/subscribers",Le="/rcbilling/v1";class Xi{constructor(e){C(this,"appUserId");C(this,"method","GET");C(this,"name","getOfferings");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${de}${Qt}/${e}/offerings`}}class Zi{constructor(){C(this,"method","POST");C(this,"name","subscribe")}url(){return`${de}${Le}/subscribe`}}class es{constructor(e,r){C(this,"method","GET");C(this,"name","getProducts");C(this,"appUserId");C(this,"productIds");this.appUserId=e,this.productIds=r}url(){const e=encodeURIComponent(this.appUserId),r=this.productIds.map(encodeURIComponent).join("&id=");return`${de}${Le}/subscribers/${e}/products?id=${r}`}}class ts{constructor(e){C(this,"method","GET");C(this,"name","getCustomerInfo");C(this,"appUserId");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${de}${Qt}/${e}`}}class ns{constructor(){C(this,"method","GET");C(this,"name","getBrandingInfo")}url(){return`${de}${Le}/branding`}}class rs{constructor(e){C(this,"method","GET");C(this,"name","getCheckoutStatus");C(this,"operationSessionId");this.operationSessionId=e}url(){return`${de}${Le}/checkout/${this.operationSessionId}`}}class is{constructor(e){C(this,"API_KEY");this.API_KEY=e}async getOfferings(e){return await me(new Xi(e),this.API_KEY)}async getCustomerInfo(e){return await me(new ts(e),this.API_KEY)}async getProducts(e,r){return await me(new es(e,r),this.API_KEY)}async getBrandingInfo(){return await me(new ns,this.API_KEY)}async postSubscribe(e,r,n,i){return await me(new Zi,this.API_KEY,{app_user_id:e,product_id:r,email:n,presented_offering_identifier:i})}async getCheckoutStatus(e){return await me(new rs(e),this.API_KEY)}}const ss="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.5'%20clip-path='url(%23clip0_344_3390)'%3e%3cpath%20d='M7%2018C5.9%2018%205.01%2018.9%205.01%2020C5.01%2021.1%205.9%2022%207%2022C8.1%2022%209%2021.1%209%2020C9%2018.9%208.1%2018%207%2018ZM1%202V4H3L6.6%2011.59L5.25%2014.04C5.09%2014.32%205%2014.65%205%2015C5%2016.1%205.9%2017%207%2017H19V15H7.42C7.28%2015%207.17%2014.89%207.17%2014.75L7.2%2014.63L8.1%2013H15.55C16.3%2013%2016.96%2012.59%2017.3%2011.97L20.88%205.48C20.96%205.34%2021%205.17%2021%205C21%204.45%2020.55%204%2020%204H5.21L4.27%202H1ZM17%2018C15.9%2018%2015.01%2018.9%2015.01%2020C15.01%2021.1%2015.9%2022%2017%2022C18.1%2022%2019%2021.1%2019%2020C19%2018.9%2018.1%2018%2017%2018Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_344_3390'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function os(t){let e,r;return{c(){e=k("img"),ee(e.src,r=ss)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class ls extends U{constructor(e){super(),R(this,e,null,os,P,{})}}function cs(t){S(t,"svelte-1rhrjxe","div.svelte-1rhrjxe{background-color:var(--rc-color-warning);color:var(--rc-color-grey-text-dark);font-size:10px;font-weight:bold;text-transform:uppercase;padding:4px 10px;line-height:10px;border-radius:9px;margin:0px;margin-left:16px}")}function as(t){let e;return{c(){e=k("div"),e.textContent="Sandbox",A(e,"class","svelte-1rhrjxe")},m(r,n){p(r,e,n)},p:v,i:v,o:v,d(r){r&&g(e)}}}class us extends U{constructor(e){super(),R(this,e,null,as,P,{},cs)}}function fs(t){S(t,"svelte-159ts4k",`.rcb-ui-container.svelte-159ts4k{color-scheme:none;font-size:16px;line-height:1.5em;font-weight:400;font-family:-apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu,
|
|
7
|
-
Cantarell, "Open Sans", "Helvetica Neue", sans-serif}.rcb-ui-layout.svelte-159ts4k{width:100vw;width:100dvw;margin-right:auto;display:flex;justify-content:center;align-items:flex-start;position:relative}.rcb-ui-aside.svelte-159ts4k{margin-right:16px}@media screen and (max-width: 960px){.rcb-ui-layout.svelte-159ts4k{flex-direction:column;align-items:center;justify-content:center;height:100%}.rcb-ui-aside.svelte-159ts4k{margin-right:0;margin-bottom:16px;min-width:100%;display:flex;flex-direction:column;align-items:center}}@media screen and (max-width: 960px) and (max-height: 960px){.rcb-ui-layout.svelte-159ts4k{overflow-y:scroll;justify-content:flex-start;padding:16px 0px}}`)}function Ct(t){let e,r,n;return r=new Bt({props:{dark:!0,$$slots:{header:[As],default:[ds]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),A(e,"class","rcb-ui-aside svelte-159ts4k")},m(i,s){p(i,e,s),I(r,e,null),n=!0},p(i,s){const o={};s&8388622&&(o.$$scope={dirty:s,ctx:i}),r.$set(o)},i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function Pt(t){let e,r;return e=new ft({props:{productDetails:t[2]}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const s={};i&4&&(s.productDetails=n[2]),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ds(t){let e,r,n=t[2]&&Pt(t);return{c(){n&&n.c(),e=te()},m(i,s){n&&n.m(i,s),p(i,e,s),r=!0},p(i,s){i[2]?n?(n.p(i,s),s&4&&u(n,1)):(n=Pt(i),n.c(),u(n,1),n.m(e.parentNode,e)):n&&(F(),d(n,1,1,()=>{n=null}),x())},i(i){r||(u(n),r=!0)},o(i){d(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function ms(t){let e,r;return e=new ls({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function gs(t){let e,r;return e=new us({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ps(t){let e,r,n,i,s,o,l;e=new gt({props:{brandingInfo:t[3]}});const c=[gs,ms],a=[];function f(m,E){return E&2&&(n=null),n==null&&(n=!!m[1].isSandbox()),n?0:1}return i=f(t,-1),s=a[i]=c[i](t),{c(){w(e.$$.fragment),r=T(),s.c(),o=te()},m(m,E){I(e,m,E),p(m,r,E),a[i].m(m,E),p(m,o,E),l=!0},p(m,E){const y={};E&8&&(y.brandingInfo=m[3]),e.$set(y);let _=i;i=f(m,E),i!==_&&(F(),d(a[_],1,1,()=>{a[_]=null}),x(),s=a[i],s||(s=a[i]=c[i](m),s.c()),u(s,1),s.m(o.parentNode,o))},i(m){l||(u(e.$$.fragment,m),u(s),l=!0)},o(m){d(e.$$.fragment,m),d(s),l=!1},d(m){m&&(g(r),g(o)),b(e,m),a[i].d(m)}}}function As(t){let e,r;return e=new Ve({props:{slot:"header",$$slots:{default:[ps]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const s={};i&8388618&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Tt(t){let e,r;return e=new ft({props:{productDetails:t[2]}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const s={};i&4&&(s.productDetails=n[2]),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Rt(t){let e,r;return e=new je({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ut(t){let e,r;return e=new Mi({props:{onContinue:t[10],onClose:t[9],processing:t[6]==="processing-auth-info"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const s={};i&64&&(s.processing=n[6]==="processing-auth-info"),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Nt(t){let e,r;return e=new _i({props:{paymentInfoCollectionMetadata:t[4],onContinue:t[10],onClose:t[9],onError:t[11],processing:t[6]==="polling-purchase-status"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const s={};i&16&&(s.paymentInfoCollectionMetadata=n[4]),i&64&&(s.processing=n[6]==="polling-purchase-status"),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function St(t){let e,r;return e=new je({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ot(t){var n;let e,r;return e=new br({props:{brandingInfo:t[3],lastError:t[5]??new j(O.UnknownError,"Unknown error without state set."),supportEmail:(n=t[3])==null?void 0:n.seller_company_support_email,onContinue:t[12]}}),{c(){w(e.$$.fragment)},m(i,s){I(e,i,s),r=!0},p(i,s){var l;const o={};s&8&&(o.brandingInfo=i[3]),s&32&&(o.lastError=i[5]??new j(O.UnknownError,"Unknown error without state set.")),s&8&&(o.supportEmail=(l=i[3])==null?void 0:l.seller_company_support_email),e.$set(o)},i(i){r||(u(e.$$.fragment,i),r=!0)},o(i){d(e.$$.fragment,i),r=!1},d(i){b(e,i)}}}function Lt(t){let e,r;return e=new Qr({props:{brandingInfo:t[3],onContinue:t[10]}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const s={};i&8&&(s.brandingInfo=n[3]),e.$set(s)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function _s(t){let e,r,n,i,s,o,l,c,a=t[6]==="present-offer"&&t[2]&&Tt(t),f=t[6]==="present-offer"&&!t[2]&&Rt(),m=(t[6]==="needs-auth-info"||t[6]==="processing-auth-info")&&Ut(t),E=t[4]&&(t[6]==="needs-payment-info"||t[6]==="polling-purchase-status")&&Nt(t),y=t[6]==="loading"&&St(),_=t[6]==="error"&&Ot(t),Q=t[6]==="success"&&Lt(t);return{c(){a&&a.c(),e=T(),f&&f.c(),r=T(),m&&m.c(),n=T(),E&&E.c(),i=T(),y&&y.c(),s=T(),_&&_.c(),o=T(),Q&&Q.c(),l=te()},m(h,B){a&&a.m(h,B),p(h,e,B),f&&f.m(h,B),p(h,r,B),m&&m.m(h,B),p(h,n,B),E&&E.m(h,B),p(h,i,B),y&&y.m(h,B),p(h,s,B),_&&_.m(h,B),p(h,o,B),Q&&Q.m(h,B),p(h,l,B),c=!0},p(h,B){h[6]==="present-offer"&&h[2]?a?(a.p(h,B),B&68&&u(a,1)):(a=Tt(h),a.c(),u(a,1),a.m(e.parentNode,e)):a&&(F(),d(a,1,1,()=>{a=null}),x()),h[6]==="present-offer"&&!h[2]?f?B&68&&u(f,1):(f=Rt(),f.c(),u(f,1),f.m(r.parentNode,r)):f&&(F(),d(f,1,1,()=>{f=null}),x()),h[6]==="needs-auth-info"||h[6]==="processing-auth-info"?m?(m.p(h,B),B&64&&u(m,1)):(m=Ut(h),m.c(),u(m,1),m.m(n.parentNode,n)):m&&(F(),d(m,1,1,()=>{m=null}),x()),h[4]&&(h[6]==="needs-payment-info"||h[6]==="polling-purchase-status")?E?(E.p(h,B),B&80&&u(E,1)):(E=Nt(h),E.c(),u(E,1),E.m(i.parentNode,i)):E&&(F(),d(E,1,1,()=>{E=null}),x()),h[6]==="loading"?y?B&64&&u(y,1):(y=St(),y.c(),u(y,1),y.m(s.parentNode,s)):y&&(F(),d(y,1,1,()=>{y=null}),x()),h[6]==="error"?_?(_.p(h,B),B&64&&u(_,1)):(_=Ot(h),_.c(),u(_,1),_.m(o.parentNode,o)):_&&(F(),d(_,1,1,()=>{_=null}),x()),h[6]==="success"?Q?(Q.p(h,B),B&64&&u(Q,1)):(Q=Lt(h),Q.c(),u(Q,1),Q.m(l.parentNode,l)):Q&&(F(),d(Q,1,1,()=>{Q=null}),x())},i(h){c||(u(a),u(f),u(m),u(E),u(y),u(_),u(Q),c=!0)},o(h){d(a),d(f),d(m),d(E),d(y),d(_),d(Q),c=!1},d(h){h&&(g(e),g(r),g(n),g(i),g(s),g(o),g(l)),a&&a.d(h),f&&f.d(h),m&&m.d(h),E&&E.d(h),y&&y.d(h),_&&_.d(h),Q&&Q.d(h)}}}function hs(t){let e,r=t[8].includes(t[6]),n,i,s,o=r&&Ct(t);return i=new Bt({props:{$$slots:{default:[_s]},$$scope:{ctx:t}}}),{c(){e=k("div"),o&&o.c(),n=T(),w(i.$$.fragment),A(e,"class","rcb-ui-layout svelte-159ts4k"),A(e,"style",t[7])},m(l,c){p(l,e,c),o&&o.m(e,null),D(e,n),I(i,e,null),s=!0},p(l,c){c&64&&(r=l[8].includes(l[6])),r?o?(o.p(l,c),c&64&&u(o,1)):(o=Ct(l),o.c(),u(o,1),o.m(e,n)):o&&(F(),d(o,1,1,()=>{o=null}),x());const a={};c&8388732&&(a.$$scope={dirty:c,ctx:l}),i.$set(a)},i(l){s||(u(o),u(i.$$.fragment,l),s=!0)},o(l){d(o),d(i.$$.fragment,l),s=!1},d(l){l&&g(e),o&&o.d(),b(i)}}}function Es(t){let e,r,n;return r=new Yi({props:{condition:t[0],$$slots:{default:[hs]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),A(e,"class","rcb-ui-container svelte-159ts4k")},m(i,s){p(i,e,s),I(r,e,null),n=!0},p(i,[s]){const o={};s&1&&(o.condition=i[0]),s&8388734&&(o.$$scope={dirty:s,ctx:i}),r.$set(o)},i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function Is(t,e,r){var Ft;let{asModal:n=!0}=e,{customerEmail:i}=e,{appUserId:s}=e,{rcPackage:o}=e,{onFinished:l}=e,{onError:c}=e,{onClose:a}=e,{purchases:f}=e,{backend:m}=e,{purchaseOperationHelper:E}=e;const y=Object.entries(ye).map(([M,Ze])=>`--rc-color-${M}: ${Ze}`).join("; ");let _=null,Q=null,h=null,B=null;const J=((Ft=o.rcBillingProduct)==null?void 0:Ft.identifier)??null;let $="present-offer";const Be=["present-offer","needs-auth-info","processing-auth-info","needs-payment-info","polling-purchase-status","loading"];Qe(async()=>{if(r(2,_=o.rcBillingProduct),r(3,Q=await m.getBrandingInfo()),$==="present-offer"){i?ge():r(6,$="needs-auth-info");return}});const xe=()=>{a()},ge=()=>{if(J===null){X(new j(O.ErrorSettingUpPurchase,"Product ID was not set before purchase."));return}else $==="present-offer"&&r(6,$="loading");if(!i){X(new j(O.MissingEmailError));return}E.startPurchase(s,J,i,o.rcBillingProduct.presentedOfferingIdentifier).then(M=>{if(M.next_action==="collect_payment_info"){r(6,$="needs-payment-info"),r(4,h=M);return}if(M.next_action==="completed"){r(6,$="success");return}}).catch(M=>{X(new j(O.ErrorSettingUpPurchase,M.message,M.underlyingErrorMessage))})},Z=M=>{if($==="needs-auth-info"){M&&(r(13,i=M.email),r(6,$="processing-auth-info")),ge();return}if($==="needs-payment-info"){r(6,$="polling-purchase-status"),E.pollCurrentPurchaseForCompletion().then(()=>{r(6,$="success")}).catch(Ze=>{X(Ze)});return}if($==="success"||$==="error"){l();return}r(6,$="success")},X=M=>{r(5,B=M),r(6,$="error")},Ps=()=>{c(B??new j(O.UnknownError,"Unknown error without state set."))};return t.$$set=M=>{"asModal"in M&&r(0,n=M.asModal),"customerEmail"in M&&r(13,i=M.customerEmail),"appUserId"in M&&r(14,s=M.appUserId),"rcPackage"in M&&r(15,o=M.rcPackage),"onFinished"in M&&r(16,l=M.onFinished),"onError"in M&&r(17,c=M.onError),"onClose"in M&&r(18,a=M.onClose),"purchases"in M&&r(1,f=M.purchases),"backend"in M&&r(19,m=M.backend),"purchaseOperationHelper"in M&&r(20,E=M.purchaseOperationHelper)},[n,f,_,Q,h,B,$,y,Be,xe,Z,X,Ps,i,s,o,l,c,a,m,E]}class bs extends U{constructor(e){super(),R(this,e,Is,Es,P,{asModal:0,customerEmail:13,appUserId:14,rcPackage:15,onFinished:16,onError:17,onClose:18,purchases:1,backend:19,purchaseOperationHelper:20},fs)}}function ws(t){return t.expires_date==null?!0:new Date(t.expires_date)>new Date}function ks(t,e,r){return{identifier:t,isActive:ws(e),willRenew:ys(e,r),store:(r==null?void 0:r.store)??"unknown",originalPurchaseDate:new Date(e.purchase_date),expirationDate:Fe(e.expires_date),productIdentifier:e.product_identifier,unsubscribeDetectedAt:Fe(r==null?void 0:r.unsubscribe_detected_at),billingIssueDetectedAt:Fe(r==null?void 0:r.billing_issues_detected_at),isSandbox:(r==null?void 0:r.is_sandbox)??!1,periodType:(r==null?void 0:r.period_type)??"normal"}}function $s(t,e){const r={},n={};for(const i in t){const s=e[i]??null,o=ks(i,t[i],s);r[i]=o,o.isActive&&(n[i]=o)}return{all:r,active:n}}function Fe(t){return t==null?null:new Date(t)}function vs(t){const e=Ds(t),r=t.subscriber;return{entitlements:$s(r.entitlements,r.subscriptions),allExpirationDatesByProduct:e,allPurchaseDatesByProduct:Bs(t),activeSubscriptions:Ms(e),managementURL:r.management_url,requestDate:new Date(t.request_date),firstSeenDate:new Date(r.first_seen),originalPurchaseDate:Fe(r.original_purchase_date),originalAppUserId:t.subscriber.original_app_user_id}}function ys(t,e){if(e==null)return!1;const r=e.store=="promotional",n=t.expires_date==null,i=e.unsubscribe_detected_at!=null,s=e.billing_issues_detected_at!=null;return!(r||n||i||s)}function Bs(t){const e={};for(const r in t.subscriber.subscriptions){const n=t.subscriber.subscriptions[r];e[r]=new Date(n.purchase_date)}return e}function Ds(t){const e={};for(const r in t.subscriber.subscriptions){const n=t.subscriber.subscriptions[r];n.expires_date==null?e[r]=null:e[r]=new Date(n.expires_date)}return e}function Ms(t){const e=new Set,r=new Date;for(const n in t){const i=t[n];(i==null||i>r)&&e.add(n)}return e}function Qs(t){if(!t.startsWith("rcb_"))throw new ne(oe.InvalidCredentialsError,"Invalid API key. Use your RevenueCat Billing API key.")}function Cs(t){if(new Set(["no_user","null","none","nil","(null)","NaN","\\x00","","unidentified","undefined","unknown"]).has(t)||t.includes("/"))throw new ne(oe.InvalidAppUserIdError,'Provided user id: "'+t+'" is not valid. See https://www.revenuecat.com/docs/customers/user-ids#tips-for-setting-app-user-ids for more information.')}const z=class z{constructor(e,r){C(this,"_API_KEY");C(this,"_appUserId");C(this,"backend");C(this,"purchaseOperationHelper");C(this,"toOfferings",(e,r)=>{const n=e.offerings.find(l=>l.identifier===e.current_offering_id)??null,i={};r.product_details.forEach(l=>{i[l.identifier]=l});const s=n==null?null:et(n,i),o={};return e.offerings.forEach(l=>{const c=et(l,i);c!=null&&(o[l.identifier]=c)}),Object.keys(o).length==0&&W.debugLog("Empty offerings. Please make sure you've configured offerings correctly in the RevenueCat dashboard and that the products are properly configured."),{all:o,current:s}});this._API_KEY=e,this._appUserId=r,We(e)&&W.debugLog("Initializing Purchases SDK with sandbox API Key"),this.backend=new is(this._API_KEY),this.purchaseOperationHelper=new Bn(this.backend)}static setLogLevel(e){W.setLogLevel(e)}static getSharedInstance(){if(z.isConfigured())return z.instance;throw new Mt}static isConfigured(){return z.instance!==void 0}static configure(e,r){return z.instance!==void 0?(W.warnLog("Purchases is already initialized. Ignoring and returning existing instance."),z.getSharedInstance()):(Qs(e),Cs(r),z.instance=new z(e,r),z.getSharedInstance())}async getOfferings(){const e=this._appUserId,r=await this.backend.getOfferings(e),n=r.offerings.flatMap(s=>s.packages).map(s=>s.platform_product_identifier),i=await this.backend.getProducts(e,n);return this.logMissingProductIds(n,i.product_details),this.toOfferings(r,i)}async isEntitledTo(e){const r=await this.getCustomerInfo();return e in r.entitlements.active}purchasePackage(e,r,n){let i=n??document.getElementById("rcb-ui-root");if(i===null){const c=document.createElement("div");c.className="rcb-ui-root",document.body.appendChild(c),i=c}if(i===null)throw new Error("Could not generate a mount point for the billing widget");const s=i,o=!n,l=this._appUserId;return W.debugLog(`Presenting purchase form for package ${e.identifier}`),new Promise((c,a)=>{new bs({target:s,props:{appUserId:l,rcPackage:e,customerEmail:r,onFinished:async()=>{W.debugLog("Purchase finished"),s.innerHTML="",c({customerInfo:await this._getCustomerInfoForUserId(l)})},onClose:()=>{s.innerHTML="",W.debugLog("Purchase cancelled by user"),a(new ne(oe.UserCancelledError))},onError:f=>{s.innerHTML="",a(ne.getForPurchasesFlowError(f))},purchases:this,backend:this.backend,purchaseOperationHelper:this.purchaseOperationHelper,asModal:o}})})}async getCustomerInfo(){return await this._getCustomerInfoForUserId(this._appUserId)}getAppUserId(){return this._appUserId}async changeUser(e){return this._appUserId=e,await this.getCustomerInfo()}logMissingProductIds(e,r){const n={};r.forEach(s=>n[s.identifier]=s);const i=[];e.forEach(s=>{n[s]===void 0&&i.push(s)}),i.length>0&&W.debugLog(`Could not find product data for product ids:
|
|
6
|
+
-20px 0 #fff2;background:#fff2}}`)}function ni(t){let e;return{c(){e=k("div"),A(e,"class","processing svelte-rjmul6")},m(r,n){p(r,e,n)},p:v,i:v,o:v,d(r){r&&g(e)}}}class $t extends U{constructor(e){super(),R(this,e,null,ni,P,{},ti)}}function ri(t){S(t,"svelte-1wxt892",".rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}")}function ii(t){let e,r;return e=new je({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p:v,i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function oi(t){let e,r,n,i,o,s;function l(a){t[9](a)}let c={stripe:t[3],clientSecret:t[4],loader:"always",theme:"stripe",variables:{borderRadius:"12px",fontSizeBase:"16px",fontSizeSm:"16px",spacingGridRow:"16px",colorText:ye["grey-text-dark"],focusBoxShadow:"none",colorDanger:ye.error},rules:{".Input":{boxShadow:"none",border:`2px solid ${ye["grey-ui-dark"]}`},".Input:focus":{border:`2px solid ${ye.focus}`,outline:"none"},".Label":{marginBottom:"8px",fontWeight:"500",lineHeight:"22px"},".Input--invalid":{boxShadow:"none"}},$$slots:{default:[gi]},$$scope:{ctx:t}};return t[2]!==void 0&&(c.elements=t[2]),r=new Lr({props:c}),Ce.push(()=>fn(r,"elements",l)),{c(){e=k("form"),w(r.$$.fragment)},m(a,f){p(a,e,f),I(r,e,null),i=!0,o||(s=_e(e,"submit",ot(t[5])),o=!0)},p(a,f){const m={};f&8&&(m.stripe=a[3]),f&2051&&(m.$$scope={dirty:f,ctx:a}),!n&&f&4&&(n=!0,m.elements=a[2],cn(()=>n=!1)),r.$set(m)},i(a){i||(u(r.$$.fragment,a),i=!0)},o(a){d(r.$$.fragment,a),i=!1},d(a){a&&g(e),b(r),o=!1,s()}}}function si(t){let e,r,n,i;return n=new ei({}),{c(){e=k("div"),e.textContent="Secure Checkout",r=T(),w(n.$$.fragment)},m(o,s){p(o,e,s),p(o,r,s),I(n,o,s),i=!0},p:v,i(o){i||(u(n.$$.fragment,o),i=!0)},o(o){d(n.$$.fragment,o),i=!1},d(o){o&&(g(e),g(r)),b(n,o)}}}function li(t){let e,r,n;return r=new Nr({}),{c(){e=k("div"),w(r.$$.fragment),A(e,"class","rcb-stripe-elements-container svelte-1wxt892")},m(i,o){p(i,e,o),I(r,e,null),n=!0},p:v,i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function ci(t){let e;return{c(){e=N("Pay")},m(r,n){p(r,e,n)},i:v,o:v,d(r){r&&g(e)}}}function ai(t){let e,r;return e=new $t({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ui(t){let e,r,n,i;const o=[ai,ci],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=te()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,a){let f=e;e=l(c),e!==f&&(x(),d(s[f],1,1,()=>{s[f]=null}),F(),r=s[e],r||(r=s[e]=o[e](c),r.c()),u(r,1),r.m(n.parentNode,n))},i(c){i||(u(r),i=!0)},o(c){d(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function fi(t){let e;return{c(){e=N("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function di(t){let e,r,n,i;return e=new we({props:{disabled:t[0],$$slots:{default:[ui]},$$scope:{ctx:t}}}),n=new we({props:{disabled:t[0],intent:"secondary",$$slots:{default:[fi]},$$scope:{ctx:t}}}),n.$on("click",function(){le(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment)},m(o,s){I(e,o,s),p(o,r,s),I(n,o,s),i=!0},p(o,s){t=o;const l={};s&1&&(l.disabled=t[0]),s&2049&&(l.$$scope={dirty:s,ctx:t}),e.$set(l);const c={};s&1&&(c.disabled=t[0]),s&2048&&(c.$$scope={dirty:s,ctx:t}),n.$set(c)},i(o){i||(u(e.$$.fragment,o),u(n.$$.fragment,o),i=!0)},o(o){d(e.$$.fragment,o),d(n.$$.fragment,o),i=!1},d(o){o&&g(r),b(e,o),b(n,o)}}}function mi(t){let e,r;return e=new ke({props:{$$slots:{default:[di]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&2051&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function gi(t){let e,r,n,i,o,s;return e=new Ve({props:{$$slots:{default:[si]},$$scope:{ctx:t}}}),n=new fe({props:{$$slots:{default:[li]},$$scope:{ctx:t}}}),o=new Je({props:{$$slots:{default:[mi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment),i=T(),w(o.$$.fragment)},m(l,c){I(e,l,c),p(l,r,c),I(n,l,c),p(l,i,c),I(o,l,c),s=!0},p(l,c){const a={};c&2048&&(a.$$scope={dirty:c,ctx:l}),e.$set(a);const f={};c&2048&&(f.$$scope={dirty:c,ctx:l}),n.$set(f);const m={};c&2051&&(m.$$scope={dirty:c,ctx:l}),o.$set(m)},i(l){s||(u(e.$$.fragment,l),u(n.$$.fragment,l),u(o.$$.fragment,l),s=!0)},o(l){d(e.$$.fragment,l),d(n.$$.fragment,l),d(o.$$.fragment,l),s=!1},d(l){l&&(g(r),g(i)),b(e,l),b(n,l),b(o,l)}}}function pi(t){let e,r,n,i;const o=[oi,ii],s=[];function l(c,a){return c[3]&&c[4]?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=k("div"),n.c()},m(c,a){p(c,e,a),s[r].m(e,null),i=!0},p(c,[a]){let f=r;r=l(c),r===f?s[r].p(c,a):(x(),d(s[f],1,1,()=>{s[f]=null}),F(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),u(n,1),n.m(e,null))},i(c){i||(u(n),i=!0)},o(c){d(n),i=!1},d(c){c&&g(e),s[r].d()}}}function Ai(t,e,r){let{onClose:n}=e,{onContinue:i}=e,{onError:o}=e,{paymentInfoCollectionMetadata:s}=e,{processing:l=!1}=e;const c=s.data.client_secret;let a=null,f,m;Qe(async()=>{const _=s.data.publishable_api_key,Q=s.data.stripe_account_id;if(!_||!Q)throw new Error("Stripe publishable key or account ID not found");r(3,a=await jr(_,{stripeAccount:Q}))});const E=async()=>{if(l||!a||!m)return;r(0,l=!0);const _=await a.confirmSetup({elements:m,redirect:"if_required"});_.error?(r(0,l=!1),o(new j(O.StripeError,_.error.message))):i()};function y(_){f=_,r(2,f)}return t.$$set=_=>{"onClose"in _&&r(1,n=_.onClose),"onContinue"in _&&r(6,i=_.onContinue),"onError"in _&&r(7,o=_.onError),"paymentInfoCollectionMetadata"in _&&r(8,s=_.paymentInfoCollectionMetadata),"processing"in _&&r(0,l=_.processing)},t.$$.update=()=>{t.$$.dirty&4&&f&&f._elements.length>0&&(m=f)},[l,n,f,a,c,E,i,o,s,y]}class _i extends U{constructor(e){super(),R(this,e,Ai,pi,P,{onClose:1,onContinue:6,onError:7,paymentInfoCollectionMetadata:8,processing:0},ri)}}function hi(t){S(t,"svelte-favd20","form.svelte-favd20.svelte-favd20{display:flex;flex-direction:column;min-height:100%;flex-grow:1}.form-container.svelte-favd20.svelte-favd20{display:flex;flex-direction:column;width:100%;margin-top:32px;margin-bottom:16px}.form-label.svelte-favd20.svelte-favd20{margin-top:8px;margin-bottom:8px;display:block;font-weight:500;line-height:22px}.form-input.error.svelte-favd20 input.svelte-favd20{border-color:var(--rc-color-error)}.form-error.svelte-favd20.svelte-favd20{margin-top:4px;font-size:16px;line-height:20px;min-height:40px;color:var(--rc-color-error)}input.svelte-favd20.svelte-favd20{width:100%;box-sizing:border-box;padding:8px;border:2px solid var(--rc-color-grey-ui-dark);border-radius:12px;font-size:16px;height:48px;padding:6px 14px}input.svelte-favd20.svelte-favd20:focus{outline:none;border:2px solid var(--rc-color-focus)}")}function Ei(t){let e;return{c(){e=N("Billing email address")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function vt(t){let e,r;return{c(){e=k("div"),r=N(t[2]),A(e,"class","form-error svelte-favd20")},m(n,i){p(n,e,i),D(e,r)},p(n,i){i&4&&ie(r,n[2])},d(n){n&&g(e)}}}function Ii(t){let e,r,n,i,o,s,l,c,a,f=t[2]&&vt(t);return{c(){e=k("div"),r=k("div"),r.innerHTML='<label for="email">Email</label>',n=T(),i=k("div"),o=k("input"),l=T(),f&&f.c(),A(r,"class","form-label svelte-favd20"),A(o,"name","email"),A(o,"placeholder","john@appleseed.com"),A(o,"autocapitalize","off"),A(o,"class","svelte-favd20"),A(i,"class",s="form-input "+t[4]+" svelte-favd20"),A(e,"class","form-container svelte-favd20")},m(m,E){p(m,e,E),D(e,r),D(e,n),D(e,i),D(i,o),st(o,t[3]),D(e,l),f&&f.m(e,null),c||(a=_e(o,"input",t[7]),c=!0)},p(m,E){E&8&&o.value!==m[3]&&st(o,m[3]),E&16&&s!==(s="form-input "+m[4]+" svelte-favd20")&&A(i,"class",s),m[2]?f?f.p(m,E):(f=vt(m),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},d(m){m&&g(e),f&&f.d(),c=!1,a()}}}function bi(t){let e;return{c(){e=N("Continue")},m(r,n){p(r,e,n)},i:v,o:v,d(r){r&&g(e)}}}function wi(t){let e,r;return e=new $t({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ki(t){let e,r,n,i;const o=[wi,bi],s=[];function l(c,a){return c[1]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=te()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,a){let f=e;e=l(c),e!==f&&(x(),d(s[f],1,1,()=>{s[f]=null}),F(),r=s[e],r||(r=s[e]=o[e](c),r.c()),u(r,1),r.m(n.parentNode,n))},i(c){i||(u(r),i=!0)},o(c){d(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function $i(t){let e;return{c(){e=N("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function vi(t){let e,r,n,i;return e=new we({props:{disabled:t[1],$$slots:{default:[ki]},$$scope:{ctx:t}}}),n=new we({props:{intent:"secondary",disabled:t[1],$$slots:{default:[$i]},$$scope:{ctx:t}}}),n.$on("click",function(){le(t[0])&&t[0].apply(this,arguments)}),{c(){w(e.$$.fragment),r=T(),w(n.$$.fragment)},m(o,s){I(e,o,s),p(o,r,s),I(n,o,s),i=!0},p(o,s){t=o;const l={};s&2&&(l.disabled=t[1]),s&258&&(l.$$scope={dirty:s,ctx:t}),e.$set(l);const c={};s&2&&(c.disabled=t[1]),s&256&&(c.$$scope={dirty:s,ctx:t}),n.$set(c)},i(o){i||(u(e.$$.fragment,o),u(n.$$.fragment,o),i=!0)},o(o){d(e.$$.fragment,o),d(n.$$.fragment,o),i=!1},d(o){o&&g(r),b(e,o),b(n,o)}}}function yi(t){let e,r;return e=new ke({props:{$$slots:{default:[vi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&259&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Bi(t){let e,r,n,i,o,s,l,c,a;return r=new Ve({props:{$$slots:{default:[Ei]},$$scope:{ctx:t}}}),i=new fe({props:{$$slots:{default:[Ii]},$$scope:{ctx:t}}}),s=new Je({props:{$$slots:{default:[yi]},$$scope:{ctx:t}}}),{c(){e=k("form"),w(r.$$.fragment),n=T(),w(i.$$.fragment),o=T(),w(s.$$.fragment),A(e,"class","svelte-favd20")},m(f,m){p(f,e,m),I(r,e,null),D(e,n),I(i,e,null),D(e,o),I(s,e,null),l=!0,c||(a=_e(e,"submit",ot(t[5])),c=!0)},p(f,[m]){const E={};m&256&&(E.$$scope={dirty:m,ctx:f}),r.$set(E);const y={};m&284&&(y.$$scope={dirty:m,ctx:f}),i.$set(y);const _={};m&259&&(_.$$scope={dirty:m,ctx:f}),s.$set(_)},i(f){l||(u(r.$$.fragment,f),u(i.$$.fragment,f),u(s.$$.fragment,f),l=!0)},o(f){d(r.$$.fragment,f),d(i.$$.fragment,f),d(s.$$.fragment,f),l=!1},d(f){f&&g(e),b(r),b(i),b(s),c=!1,a()}}}function Di(t,e,r){let n,i,o,{onContinue:s}=e,{onClose:l}=e,{processing:c}=e;const a=async()=>{n.trim()===""?r(2,i="You need to provide your email address to continue."):s({email:n})};function f(){n=this.value,r(3,n)}return t.$$set=m=>{"onContinue"in m&&r(6,s=m.onContinue),"onClose"in m&&r(0,l=m.onClose),"processing"in m&&r(1,c=m.processing)},t.$$.update=()=>{t.$$.dirty&4&&r(4,o=i?"error":"")},r(3,n=""),r(2,i=""),[l,c,i,n,o,a,s,f]}class Mi extends U{constructor(e){super(),R(this,e,Di,Bi,P,{onContinue:6,onClose:0,processing:1},hi)}}function Qi(t){S(t,"svelte-17tslso",".rcb-modal-backdrop.svelte-17tslso{position:fixed;top:0;left:0;right:0;min-width:100%;width:100vw;width:100dvw;min-height:100%;height:100vh;height:100dvh;background-color:rgba(40, 40, 40, 0.75);display:flex;flex-direction:column;justify-content:space-around;z-index:1000001}")}function Ci(t){let e,r;const n=t[1].default,i=G(n,t,t[0],null);return{c(){e=k("div"),i&&i.c(),A(e,"class","rcb-modal-backdrop svelte-17tslso")},m(o,s){p(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&H(i,n,o,o[0],r?Y(n,o[0],s,null):K(o[0]),null)},i(o){r||(u(i,o),r=!0)},o(o){d(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function Pi(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class Ti extends U{constructor(e){super(),R(this,e,Pi,Ci,P,{},Qi)}}function Ri(t){S(t,"svelte-ioxu5d",".rcb-modal-container.svelte-ioxu5d{width:100%}.rcb-modal-main.svelte-ioxu5d{box-sizing:border-box;border-radius:8px;background-color:var(--rc-color-white);color:var(--rc-color-grey-text-dark);min-height:460px;padding:40px;flex-direction:column;display:flex}.rcb-modal-dark.svelte-ioxu5d{background-color:var(--rc-color-grey-text-dark);color:var(--rc-color-white);min-height:0px}@media screen and (max-width: 960px){.rcb-modal-container.svelte-ioxu5d{width:calc(100% - 32px);min-width:300px;max-width:640px;margin:auto}.rcb-modal-main.svelte-ioxu5d,.rcb-modal-dark.svelte-ioxu5d{min-width:300px;max-width:640px;padding:32px}}")}function Ui(t){let e,r,n,i;const o=t[2].default,s=G(o,t,t[1],null);return{c(){e=k("div"),r=k("main"),s&&s.c(),A(r,"class",n=Ae(`rcb-modal-main ${t[0]?"rcb-modal-dark":""}`)+" svelte-ioxu5d"),A(e,"class","rcb-modal-container svelte-ioxu5d")},m(l,c){p(l,e,c),D(e,r),s&&s.m(r,null),i=!0},p(l,[c]){s&&s.p&&(!i||c&2)&&H(s,o,l,l[1],i?Y(o,l[1],c,null):K(l[1]),null),(!i||c&1&&n!==(n=Ae(`rcb-modal-main ${l[0]?"rcb-modal-dark":""}`)+" svelte-ioxu5d"))&&A(r,"class",n)},i(l){i||(u(s,l),i=!0)},o(l){d(s,l),i=!1},d(l){l&&g(e),s&&s.d(l)}}}function Ni(t,e,r){let{$$slots:n={},$$scope:i}=e,{dark:o=!1}=e;return t.$$set=s=>{"dark"in s&&r(0,o=s.dark),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class Si extends U{constructor(e){super(),R(this,e,Ni,Ui,P,{dark:0},Ri)}}function Oi(t){let e;const r=t[1].default,n=G(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&H(n,r,i,i[2],e?Y(r,i[2],o,null):K(i[2]),null)},i(i){e||(u(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function Li(t){let e,r;return e=new Ti({props:{$$slots:{default:[xi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function xi(t){let e;const r=t[1].default,n=G(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&H(n,r,i,i[2],e?Y(r,i[2],o,null):K(i[2]),null)},i(i){e||(u(n,i),e=!0)},o(i){d(n,i),e=!1},d(i){n&&n.d(i)}}}function Fi(t){let e,r,n,i;const o=[Li,Oi],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=te()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,[a]){let f=e;e=l(c),e===f?s[e].p(c,a):(x(),d(s[f],1,1,()=>{s[f]=null}),F(),r=s[e],r?r.p(c,a):(r=s[e]=o[e](c),r.c()),u(r,1),r.m(n.parentNode,n))},i(c){i||(u(r),i=!0)},o(c){d(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function Gi(t,e,r){let{$$slots:n={},$$scope:i}=e,{condition:o=!1}=e;return t.$$set=s=>{"condition"in s&&r(0,o=s.condition),"$$scope"in s&&r(2,i=s.$$scope)},[o,n,i]}class Yi extends U{constructor(e){super(),R(this,e,Gi,Fi,P,{condition:0})}}const Hi=t=>({}),yt=t=>({});function Ki(t){let e,r;const n=t[1].header,i=G(n,t,t[2],yt),o=t[1].default,s=G(o,t,t[2],null);return{c(){i&&i.c(),e=T(),s&&s.c()},m(l,c){i&&i.m(l,c),p(l,e,c),s&&s.m(l,c),r=!0},p(l,c){i&&i.p&&(!r||c&4)&&H(i,n,l,l[2],r?Y(n,l[2],c,Hi):K(l[2]),yt),s&&s.p&&(!r||c&4)&&H(s,o,l,l[2],r?Y(o,l[2],c,null):K(l[2]),null)},i(l){r||(u(i,l),u(s,l),r=!0)},o(l){d(i,l),d(s,l),r=!1},d(l){l&&g(e),i&&i.d(l),s&&s.d(l)}}}function qi(t){let e,r;return e=new Si({props:{dark:t[0],$$slots:{default:[Ki]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.dark=n[0]),i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ji(t,e,r){let{$$slots:n={},$$scope:i}=e,{dark:o=!1}=e;return t.$$set=s=>{"dark"in s&&r(0,o=s.dark),"$$scope"in s&&r(2,i=s.$$scope)},[o,n,i]}class Bt extends U{constructor(e){super(),R(this,e,ji,qi,P,{dark:0})}}var se=(t=>(t[t.UnknownError=0]="UnknownError",t[t.UserCancelledError=1]="UserCancelledError",t[t.StoreProblemError=2]="StoreProblemError",t[t.PurchaseNotAllowedError=3]="PurchaseNotAllowedError",t[t.PurchaseInvalidError=4]="PurchaseInvalidError",t[t.ProductNotAvailableForPurchaseError=5]="ProductNotAvailableForPurchaseError",t[t.ProductAlreadyPurchasedError=6]="ProductAlreadyPurchasedError",t[t.ReceiptAlreadyInUseError=7]="ReceiptAlreadyInUseError",t[t.InvalidReceiptError=8]="InvalidReceiptError",t[t.MissingReceiptFileError=9]="MissingReceiptFileError",t[t.NetworkError=10]="NetworkError",t[t.InvalidCredentialsError=11]="InvalidCredentialsError",t[t.UnexpectedBackendResponseError=12]="UnexpectedBackendResponseError",t[t.InvalidAppUserIdError=14]="InvalidAppUserIdError",t[t.OperationAlreadyInProgressError=15]="OperationAlreadyInProgressError",t[t.UnknownBackendError=16]="UnknownBackendError",t[t.InvalidAppleSubscriptionKeyError=17]="InvalidAppleSubscriptionKeyError",t[t.IneligibleError=18]="IneligibleError",t[t.InsufficientPermissionsError=19]="InsufficientPermissionsError",t[t.PaymentPendingError=20]="PaymentPendingError",t[t.InvalidSubscriberAttributesError=21]="InvalidSubscriberAttributesError",t[t.LogOutWithAnonymousUserError=22]="LogOutWithAnonymousUserError",t[t.ConfigurationError=23]="ConfigurationError",t[t.UnsupportedError=24]="UnsupportedError",t[t.EmptySubscriberAttributesError=25]="EmptySubscriberAttributesError",t[t.CustomerInfoError=28]="CustomerInfoError",t[t.SignatureVerificationError=36]="SignatureVerificationError",t))(se||{});class Se{static getPublicMessage(e){switch(e){case 0:return"Unknown error.";case 1:return"Purchase was cancelled.";case 2:return"There was a problem with the store.";case 3:return"The device or user is not allowed to make the purchase.";case 4:return"One or more of the arguments provided are invalid.";case 5:return"The product is not available for purchase.";case 6:return"This product is already active for the user.";case 7:return"There is already another active subscriber using the same receipt.";case 8:return"The receipt is not valid.";case 9:return"The receipt is missing.";case 10:return"Error performing request.";case 11:return"There was a credentials issue. Check the underlying error for more details.";case 12:return"Received unexpected response from the backend.";case 14:return"The app user id is not valid.";case 15:return"The operation is already in progress.";case 16:return"There was an unknown backend error.";case 17:return"Apple Subscription Key is invalid or not present. In order to provide subscription offers, you must first generate a subscription key. Please see https://docs.revenuecat.com/docs/ios-subscription-offers for more info.";case 18:return"The User is ineligible for that action.";case 19:return"App does not have sufficient permissions to make purchases.";case 20:return"The payment is pending.";case 21:return"One or more of the attributes sent could not be saved.";case 22:return"Called logOut but the current user is anonymous.";case 23:return"There is an issue with your configuration. Check the underlying error for more details.";case 24:return"There was a problem with the operation. Looks like we doesn't support that yet. Check the underlying error for more details.";case 25:return"A request for subscriber attributes returned none.";case 28:return"There was a problem related to the customer info.";case 36:return"Request failed signature verification. Please see https://rev.cat/trusted-entitlements for more info."}}static getErrorCodeForBackendErrorCode(e){switch(e){case 7101:return 2;case 7102:return 7;case 7103:return 8;case 7107:case 7224:case 7225:return 11;case 7105:case 7106:return 4;case 7220:return 14;case 7229:return 2;case 7230:case 7e3:return 23;case 7231:return 2;case 7232:return 18;case 7263:case 7264:return 21;case 7104:case 7234:case 7226:case 7110:return 12;case 7662:return 24}}static convertCodeToBackendErrorCode(e){return e in Dt?e:null}static convertPurchaseFlowErrorCodeToErrorCode(e){switch(e){case O.ErrorSettingUpPurchase:return 2;case O.ErrorChargingPayment:return 20;case O.NetworkError:return 10;case O.MissingEmailError:return 4;case O.StripeError:return 2;case O.UnknownError:return 0}}}var Dt=(t=>(t[t.BackendInvalidPlatform=7e3]="BackendInvalidPlatform",t[t.BackendStoreProblem=7101]="BackendStoreProblem",t[t.BackendCannotTransferPurchase=7102]="BackendCannotTransferPurchase",t[t.BackendInvalidReceiptToken=7103]="BackendInvalidReceiptToken",t[t.BackendInvalidAppStoreSharedSecret=7104]="BackendInvalidAppStoreSharedSecret",t[t.BackendInvalidPaymentModeOrIntroPriceNotProvided=7105]="BackendInvalidPaymentModeOrIntroPriceNotProvided",t[t.BackendProductIdForGoogleReceiptNotProvided=7106]="BackendProductIdForGoogleReceiptNotProvided",t[t.BackendInvalidPlayStoreCredentials=7107]="BackendInvalidPlayStoreCredentials",t[t.BackendInternalServerError=7110]="BackendInternalServerError",t[t.BackendEmptyAppUserId=7220]="BackendEmptyAppUserId",t[t.BackendInvalidAuthToken=7224]="BackendInvalidAuthToken",t[t.BackendInvalidAPIKey=7225]="BackendInvalidAPIKey",t[t.BackendBadRequest=7226]="BackendBadRequest",t[t.BackendPlayStoreQuotaExceeded=7229]="BackendPlayStoreQuotaExceeded",t[t.BackendPlayStoreInvalidPackageName=7230]="BackendPlayStoreInvalidPackageName",t[t.BackendPlayStoreGenericError=7231]="BackendPlayStoreGenericError",t[t.BackendUserIneligibleForPromoOffer=7232]="BackendUserIneligibleForPromoOffer",t[t.BackendInvalidAppleSubscriptionKey=7234]="BackendInvalidAppleSubscriptionKey",t[t.BackendInvalidSubscriberAttributes=7263]="BackendInvalidSubscriberAttributes",t[t.BackendInvalidSubscriberAttributesBody=7264]="BackendInvalidSubscriberAttributesBody",t[t.BackendProductIDsMalformed=7662]="BackendProductIDsMalformed",t))(Dt||{});class ne extends Error{constructor(r,n,i){super(n);C(this,"toString",()=>`PurchasesError(code: ${se[this.errorCode]}, message: ${this.message})`);this.errorCode=r,this.underlyingErrorMessage=i}static getForBackendError(r,n){const i=Se.getErrorCodeForBackendErrorCode(r);return new ne(i,Se.getPublicMessage(i),n)}static getForPurchasesFlowError(r){return new ne(Se.convertPurchaseFlowErrorCodeToErrorCode(r.errorCode),r.message,r.underlyingErrorMessage)}}class Mt extends Error{constructor(){super("Purchases must be configured before calling getInstance")}}const Ji="0.1.1",de="https://api.revenuecat.com";var Oe;(function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.EARLY_HINTS=103]="EARLY_HINTS",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY=305]="USE_PROXY",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",t[t.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.IM_A_TEAPOT=418]="IM_A_TEAPOT",t[t.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",t[t.METHOD_FAILURE=420]="METHOD_FAILURE",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(Oe||(Oe={}));function We(t){return t?t.startsWith("rcb_sb_"):!1}async function me(t,e,r,n){const i=await fetch(t.url(),{method:t.method,headers:zi(e,n),body:Wi(r)});return await Vi(i,t),await i.json()}async function Vi(t,e){const r=t.status;if(r>=Oe.INTERNAL_SERVER_ERROR)ze(e,r,await t.text());else if(r>=Oe.BAD_REQUEST){const n=await t.json(),i=n?JSON.stringify(n):null,o=n==null?void 0:n.code,s=n==null?void 0:n.message;if(o!=null){const l=Se.convertCodeToBackendErrorCode(o);if(l==null)ze(e,r,i);else throw ne.getForBackendError(l,s)}else ze(e,r,i)}}function ze(t,e,r){throw new ne(se.UnknownBackendError,`Unknown backend error. Request: ${t.name}. Status code: ${e}. Body: ${r}.`)}function Wi(t){return t==null?null:JSON.stringify(t)}function zi(t,e){let r={Authorization:`Bearer ${t}`,"Content-Type":"application/json",Accept:"application/json","X-Platform":"web","X-Version":Ji,"X-Is-Sandbox":`${We(t)}`};return e!=null&&(r={...r,...e}),r}const Qt="/v1/subscribers",Le="/rcbilling/v1";class Xi{constructor(e){C(this,"appUserId");C(this,"method","GET");C(this,"name","getOfferings");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${de}${Qt}/${e}/offerings`}}class Zi{constructor(){C(this,"method","POST");C(this,"name","subscribe")}url(){return`${de}${Le}/subscribe`}}class eo{constructor(e,r){C(this,"method","GET");C(this,"name","getProducts");C(this,"appUserId");C(this,"productIds");this.appUserId=e,this.productIds=r}url(){const e=encodeURIComponent(this.appUserId),r=this.productIds.map(encodeURIComponent).join("&id=");return`${de}${Le}/subscribers/${e}/products?id=${r}`}}class to{constructor(e){C(this,"method","GET");C(this,"name","getCustomerInfo");C(this,"appUserId");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${de}${Qt}/${e}`}}class no{constructor(){C(this,"method","GET");C(this,"name","getBrandingInfo")}url(){return`${de}${Le}/branding`}}class ro{constructor(e){C(this,"method","GET");C(this,"name","getCheckoutStatus");C(this,"operationSessionId");this.operationSessionId=e}url(){return`${de}${Le}/checkout/${this.operationSessionId}`}}class io{constructor(e){C(this,"API_KEY");this.API_KEY=e}async getOfferings(e){return await me(new Xi(e),this.API_KEY)}async getCustomerInfo(e){return await me(new to(e),this.API_KEY)}async getProducts(e,r){return await me(new eo(e,r),this.API_KEY)}async getBrandingInfo(){return await me(new no,this.API_KEY)}async postSubscribe(e,r,n,i){return await me(new Zi,this.API_KEY,{app_user_id:e,product_id:r,email:n,presented_offering_identifier:i})}async getCheckoutStatus(e){return await me(new ro(e),this.API_KEY)}}const oo="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.5'%20clip-path='url(%23clip0_344_3390)'%3e%3cpath%20d='M7%2018C5.9%2018%205.01%2018.9%205.01%2020C5.01%2021.1%205.9%2022%207%2022C8.1%2022%209%2021.1%209%2020C9%2018.9%208.1%2018%207%2018ZM1%202V4H3L6.6%2011.59L5.25%2014.04C5.09%2014.32%205%2014.65%205%2015C5%2016.1%205.9%2017%207%2017H19V15H7.42C7.28%2015%207.17%2014.89%207.17%2014.75L7.2%2014.63L8.1%2013H15.55C16.3%2013%2016.96%2012.59%2017.3%2011.97L20.88%205.48C20.96%205.34%2021%205.17%2021%205C21%204.45%2020.55%204%2020%204H5.21L4.27%202H1ZM17%2018C15.9%2018%2015.01%2018.9%2015.01%2020C15.01%2021.1%2015.9%2022%2017%2022C18.1%2022%2019%2021.1%2019%2020C19%2018.9%2018.1%2018%2017%2018Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_344_3390'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function so(t){let e,r;return{c(){e=k("img"),ee(e.src,r=oo)||A(e,"src",r),A(e,"alt","icon"),A(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:v,i:v,o:v,d(n){n&&g(e)}}}class lo extends U{constructor(e){super(),R(this,e,null,so,P,{})}}function co(t){S(t,"svelte-1rhrjxe","div.svelte-1rhrjxe{background-color:var(--rc-color-warning);color:var(--rc-color-grey-text-dark);font-size:10px;font-weight:bold;text-transform:uppercase;padding:4px 10px;line-height:10px;border-radius:9px;margin:0px;margin-left:16px}")}function ao(t){let e;return{c(){e=k("div"),e.textContent="Sandbox",A(e,"class","svelte-1rhrjxe")},m(r,n){p(r,e,n)},p:v,i:v,o:v,d(r){r&&g(e)}}}class uo extends U{constructor(e){super(),R(this,e,null,ao,P,{},co)}}function fo(t){S(t,"svelte-13pdaik",`.rcb-ui-container.svelte-13pdaik{color-scheme:none;font-size:16px;line-height:1.5em;font-weight:400;font-family:-apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu,
|
|
7
|
+
Cantarell, "Open Sans", "Helvetica Neue", sans-serif}.rcb-ui-layout.svelte-13pdaik{width:100vw;width:100dvw;margin-right:auto;display:flex;justify-content:center;align-items:flex-start;position:relative;padding:0px 80px;box-sizing:border-box}.rcb-ui-aside.svelte-13pdaik{margin-right:16px;flex:320px 1 0;max-width:480px}.rcb-ui-main.svelte-13pdaik{flex:480px 1 0;max-width:640px}@media screen and (max-width: 960px){.rcb-ui-layout.svelte-13pdaik{flex-direction:column;align-items:center;justify-content:center;height:100%;min-width:100%}.rcb-ui-aside.svelte-13pdaik{margin-right:0;margin-bottom:16px;min-width:100%;display:flex;flex-direction:column;align-items:center;flex:none;max-width:none}.rcb-ui-main.svelte-13pdaik{flex:none;max-width:none;min-width:100%}}@media screen and (max-width: 960px) and (max-height: 960px){.rcb-ui-layout.svelte-13pdaik{overflow-y:scroll;justify-content:flex-start;padding:16px 0px}}`)}function Ct(t){let e,r,n;return r=new Bt({props:{dark:!0,$$slots:{header:[_o],default:[mo]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),A(e,"class","rcb-ui-aside svelte-13pdaik")},m(i,o){p(i,e,o),I(r,e,null),n=!0},p(i,o){const s={};o&8388622&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function Pt(t){let e,r;return e=new ft({props:{productDetails:t[2]}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.productDetails=n[2]),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function mo(t){let e,r,n=t[2]&&Pt(t);return{c(){n&&n.c(),e=te()},m(i,o){n&&n.m(i,o),p(i,e,o),r=!0},p(i,o){i[2]?n?(n.p(i,o),o&4&&u(n,1)):(n=Pt(i),n.c(),u(n,1),n.m(e.parentNode,e)):n&&(x(),d(n,1,1,()=>{n=null}),F())},i(i){r||(u(n),r=!0)},o(i){d(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function go(t){let e,r;return e=new lo({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function po(t){let e,r;return e=new uo({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ao(t){let e,r,n,i,o,s,l;e=new gt({props:{brandingInfo:t[3]}});const c=[po,go],a=[];function f(m,E){return E&2&&(n=null),n==null&&(n=!!m[1].isSandbox()),n?0:1}return i=f(t,-1),o=a[i]=c[i](t),{c(){w(e.$$.fragment),r=T(),o.c(),s=te()},m(m,E){I(e,m,E),p(m,r,E),a[i].m(m,E),p(m,s,E),l=!0},p(m,E){const y={};E&8&&(y.brandingInfo=m[3]),e.$set(y);let _=i;i=f(m,E),i!==_&&(x(),d(a[_],1,1,()=>{a[_]=null}),F(),o=a[i],o||(o=a[i]=c[i](m),o.c()),u(o,1),o.m(s.parentNode,s))},i(m){l||(u(e.$$.fragment,m),u(o),l=!0)},o(m){d(e.$$.fragment,m),d(o),l=!1},d(m){m&&(g(r),g(s)),b(e,m),a[i].d(m)}}}function _o(t){let e,r;return e=new Ve({props:{slot:"header",$$slots:{default:[Ao]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&8388618&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Tt(t){let e,r;return e=new ft({props:{productDetails:t[2]}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.productDetails=n[2]),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Rt(t){let e,r;return e=new je({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ut(t){let e,r;return e=new Mi({props:{onContinue:t[10],onClose:t[9],processing:t[6]==="processing-auth-info"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&64&&(o.processing=n[6]==="processing-auth-info"),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Nt(t){let e,r;return e=new _i({props:{paymentInfoCollectionMetadata:t[4],onContinue:t[10],onClose:t[9],onError:t[11],processing:t[6]==="polling-purchase-status"}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.paymentInfoCollectionMetadata=n[4]),i&64&&(o.processing=n[6]==="polling-purchase-status"),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function St(t){let e,r;return e=new je({}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function Ot(t){var n;let e,r;return e=new br({props:{brandingInfo:t[3],lastError:t[5]??new j(O.UnknownError,"Unknown error without state set."),supportEmail:(n=t[3])==null?void 0:n.seller_company_support_email,onContinue:t[12]}}),{c(){w(e.$$.fragment)},m(i,o){I(e,i,o),r=!0},p(i,o){var l;const s={};o&8&&(s.brandingInfo=i[3]),o&32&&(s.lastError=i[5]??new j(O.UnknownError,"Unknown error without state set.")),o&8&&(s.supportEmail=(l=i[3])==null?void 0:l.seller_company_support_email),e.$set(s)},i(i){r||(u(e.$$.fragment,i),r=!0)},o(i){d(e.$$.fragment,i),r=!1},d(i){b(e,i)}}}function Lt(t){let e,r;return e=new Qr({props:{brandingInfo:t[3],onContinue:t[10]}}),{c(){w(e.$$.fragment)},m(n,i){I(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.brandingInfo=n[3]),e.$set(o)},i(n){r||(u(e.$$.fragment,n),r=!0)},o(n){d(e.$$.fragment,n),r=!1},d(n){b(e,n)}}}function ho(t){let e,r,n,i,o,s,l,c,a=t[6]==="present-offer"&&t[2]&&Tt(t),f=t[6]==="present-offer"&&!t[2]&&Rt(),m=(t[6]==="needs-auth-info"||t[6]==="processing-auth-info")&&Ut(t),E=t[4]&&(t[6]==="needs-payment-info"||t[6]==="polling-purchase-status")&&Nt(t),y=t[6]==="loading"&&St(),_=t[6]==="error"&&Ot(t),Q=t[6]==="success"&&Lt(t);return{c(){a&&a.c(),e=T(),f&&f.c(),r=T(),m&&m.c(),n=T(),E&&E.c(),i=T(),y&&y.c(),o=T(),_&&_.c(),s=T(),Q&&Q.c(),l=te()},m(h,B){a&&a.m(h,B),p(h,e,B),f&&f.m(h,B),p(h,r,B),m&&m.m(h,B),p(h,n,B),E&&E.m(h,B),p(h,i,B),y&&y.m(h,B),p(h,o,B),_&&_.m(h,B),p(h,s,B),Q&&Q.m(h,B),p(h,l,B),c=!0},p(h,B){h[6]==="present-offer"&&h[2]?a?(a.p(h,B),B&68&&u(a,1)):(a=Tt(h),a.c(),u(a,1),a.m(e.parentNode,e)):a&&(x(),d(a,1,1,()=>{a=null}),F()),h[6]==="present-offer"&&!h[2]?f?B&68&&u(f,1):(f=Rt(),f.c(),u(f,1),f.m(r.parentNode,r)):f&&(x(),d(f,1,1,()=>{f=null}),F()),h[6]==="needs-auth-info"||h[6]==="processing-auth-info"?m?(m.p(h,B),B&64&&u(m,1)):(m=Ut(h),m.c(),u(m,1),m.m(n.parentNode,n)):m&&(x(),d(m,1,1,()=>{m=null}),F()),h[4]&&(h[6]==="needs-payment-info"||h[6]==="polling-purchase-status")?E?(E.p(h,B),B&80&&u(E,1)):(E=Nt(h),E.c(),u(E,1),E.m(i.parentNode,i)):E&&(x(),d(E,1,1,()=>{E=null}),F()),h[6]==="loading"?y?B&64&&u(y,1):(y=St(),y.c(),u(y,1),y.m(o.parentNode,o)):y&&(x(),d(y,1,1,()=>{y=null}),F()),h[6]==="error"?_?(_.p(h,B),B&64&&u(_,1)):(_=Ot(h),_.c(),u(_,1),_.m(s.parentNode,s)):_&&(x(),d(_,1,1,()=>{_=null}),F()),h[6]==="success"?Q?(Q.p(h,B),B&64&&u(Q,1)):(Q=Lt(h),Q.c(),u(Q,1),Q.m(l.parentNode,l)):Q&&(x(),d(Q,1,1,()=>{Q=null}),F())},i(h){c||(u(a),u(f),u(m),u(E),u(y),u(_),u(Q),c=!0)},o(h){d(a),d(f),d(m),d(E),d(y),d(_),d(Q),c=!1},d(h){h&&(g(e),g(r),g(n),g(i),g(o),g(s),g(l)),a&&a.d(h),f&&f.d(h),m&&m.d(h),E&&E.d(h),y&&y.d(h),_&&_.d(h),Q&&Q.d(h)}}}function Eo(t){let e,r=t[8].includes(t[6]),n,i,o,s,l=r&&Ct(t);return o=new Bt({props:{$$slots:{default:[ho]},$$scope:{ctx:t}}}),{c(){e=k("div"),l&&l.c(),n=T(),i=k("div"),w(o.$$.fragment),A(i,"class","rcb-ui-main svelte-13pdaik"),A(e,"class","rcb-ui-layout svelte-13pdaik"),A(e,"style",t[7])},m(c,a){p(c,e,a),l&&l.m(e,null),D(e,n),D(e,i),I(o,i,null),s=!0},p(c,a){a&64&&(r=c[8].includes(c[6])),r?l?(l.p(c,a),a&64&&u(l,1)):(l=Ct(c),l.c(),u(l,1),l.m(e,n)):l&&(x(),d(l,1,1,()=>{l=null}),F());const f={};a&8388732&&(f.$$scope={dirty:a,ctx:c}),o.$set(f)},i(c){s||(u(l),u(o.$$.fragment,c),s=!0)},o(c){d(l),d(o.$$.fragment,c),s=!1},d(c){c&&g(e),l&&l.d(),b(o)}}}function Io(t){let e,r,n;return r=new Yi({props:{condition:t[0],$$slots:{default:[Eo]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),A(e,"class","rcb-ui-container svelte-13pdaik")},m(i,o){p(i,e,o),I(r,e,null),n=!0},p(i,[o]){const s={};o&1&&(s.condition=i[0]),o&8388734&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(u(r.$$.fragment,i),n=!0)},o(i){d(r.$$.fragment,i),n=!1},d(i){i&&g(e),b(r)}}}function bo(t,e,r){var xt;let{asModal:n=!0}=e,{customerEmail:i}=e,{appUserId:o}=e,{rcPackage:s}=e,{onFinished:l}=e,{onError:c}=e,{onClose:a}=e,{purchases:f}=e,{backend:m}=e,{purchaseOperationHelper:E}=e;const y=Object.entries(ye).map(([M,Ze])=>`--rc-color-${M}: ${Ze}`).join("; ");let _=null,Q=null,h=null,B=null;const J=((xt=s.rcBillingProduct)==null?void 0:xt.identifier)??null;let $="present-offer";const Be=["present-offer","needs-auth-info","processing-auth-info","needs-payment-info","polling-purchase-status","loading"];Qe(async()=>{if(r(2,_=s.rcBillingProduct),r(3,Q=await m.getBrandingInfo()),$==="present-offer"){i?ge():r(6,$="needs-auth-info");return}});const Fe=()=>{a()},ge=()=>{if(J===null){X(new j(O.ErrorSettingUpPurchase,"Product ID was not set before purchase."));return}else $==="present-offer"&&r(6,$="loading");if(!i){X(new j(O.MissingEmailError));return}E.startPurchase(o,J,i,s.rcBillingProduct.presentedOfferingIdentifier).then(M=>{if(M.next_action==="collect_payment_info"){r(6,$="needs-payment-info"),r(4,h=M);return}if(M.next_action==="completed"){r(6,$="success");return}}).catch(M=>{X(new j(O.ErrorSettingUpPurchase,M.message,M.underlyingErrorMessage))})},Z=M=>{if($==="needs-auth-info"){M&&(r(13,i=M.email),r(6,$="processing-auth-info")),ge();return}if($==="needs-payment-info"){r(6,$="polling-purchase-status"),E.pollCurrentPurchaseForCompletion().then(()=>{r(6,$="success")}).catch(Ze=>{X(Ze)});return}if($==="success"||$==="error"){l();return}r(6,$="success")},X=M=>{r(5,B=M),r(6,$="error")},To=()=>{c(B??new j(O.UnknownError,"Unknown error without state set."))};return t.$$set=M=>{"asModal"in M&&r(0,n=M.asModal),"customerEmail"in M&&r(13,i=M.customerEmail),"appUserId"in M&&r(14,o=M.appUserId),"rcPackage"in M&&r(15,s=M.rcPackage),"onFinished"in M&&r(16,l=M.onFinished),"onError"in M&&r(17,c=M.onError),"onClose"in M&&r(18,a=M.onClose),"purchases"in M&&r(1,f=M.purchases),"backend"in M&&r(19,m=M.backend),"purchaseOperationHelper"in M&&r(20,E=M.purchaseOperationHelper)},[n,f,_,Q,h,B,$,y,Be,Fe,Z,X,To,i,o,s,l,c,a,m,E]}class wo extends U{constructor(e){super(),R(this,e,bo,Io,P,{asModal:0,customerEmail:13,appUserId:14,rcPackage:15,onFinished:16,onError:17,onClose:18,purchases:1,backend:19,purchaseOperationHelper:20},fo)}}function ko(t){return t.expires_date==null?!0:new Date(t.expires_date)>new Date}function $o(t,e,r){return{identifier:t,isActive:ko(e),willRenew:Bo(e,r),store:(r==null?void 0:r.store)??"unknown",originalPurchaseDate:new Date(e.purchase_date),expirationDate:xe(e.expires_date),productIdentifier:e.product_identifier,unsubscribeDetectedAt:xe(r==null?void 0:r.unsubscribe_detected_at),billingIssueDetectedAt:xe(r==null?void 0:r.billing_issues_detected_at),isSandbox:(r==null?void 0:r.is_sandbox)??!1,periodType:(r==null?void 0:r.period_type)??"normal"}}function vo(t,e){const r={},n={};for(const i in t){const o=e[i]??null,s=$o(i,t[i],o);r[i]=s,s.isActive&&(n[i]=s)}return{all:r,active:n}}function xe(t){return t==null?null:new Date(t)}function yo(t){const e=Mo(t),r=t.subscriber;return{entitlements:vo(r.entitlements,r.subscriptions),allExpirationDatesByProduct:e,allPurchaseDatesByProduct:Do(t),activeSubscriptions:Qo(e),managementURL:r.management_url,requestDate:new Date(t.request_date),firstSeenDate:new Date(r.first_seen),originalPurchaseDate:xe(r.original_purchase_date),originalAppUserId:t.subscriber.original_app_user_id}}function Bo(t,e){if(e==null)return!1;const r=e.store=="promotional",n=t.expires_date==null,i=e.unsubscribe_detected_at!=null,o=e.billing_issues_detected_at!=null;return!(r||n||i||o)}function Do(t){const e={};for(const r in t.subscriber.subscriptions){const n=t.subscriber.subscriptions[r];e[r]=new Date(n.purchase_date)}return e}function Mo(t){const e={};for(const r in t.subscriber.subscriptions){const n=t.subscriber.subscriptions[r];n.expires_date==null?e[r]=null:e[r]=new Date(n.expires_date)}return e}function Qo(t){const e=new Set,r=new Date;for(const n in t){const i=t[n];(i==null||i>r)&&e.add(n)}return e}function Co(t){if(!t.startsWith("rcb_"))throw new ne(se.InvalidCredentialsError,"Invalid API key. Use your RevenueCat Billing API key.")}function Po(t){if(new Set(["no_user","null","none","nil","(null)","NaN","\\x00","","unidentified","undefined","unknown"]).has(t)||t.includes("/"))throw new ne(se.InvalidAppUserIdError,'Provided user id: "'+t+'" is not valid. See https://www.revenuecat.com/docs/customers/user-ids#tips-for-setting-app-user-ids for more information.')}const z=class z{constructor(e,r){C(this,"_API_KEY");C(this,"_appUserId");C(this,"backend");C(this,"purchaseOperationHelper");C(this,"toOfferings",(e,r)=>{const n=e.offerings.find(l=>l.identifier===e.current_offering_id)??null,i={};r.product_details.forEach(l=>{i[l.identifier]=l});const o=n==null?null:et(n,i),s={};return e.offerings.forEach(l=>{const c=et(l,i);c!=null&&(s[l.identifier]=c)}),Object.keys(s).length==0&&W.debugLog("Empty offerings. Please make sure you've configured offerings correctly in the RevenueCat dashboard and that the products are properly configured."),{all:s,current:o}});this._API_KEY=e,this._appUserId=r,We(e)&&W.debugLog("Initializing Purchases SDK with sandbox API Key"),this.backend=new io(this._API_KEY),this.purchaseOperationHelper=new Bn(this.backend)}static setLogLevel(e){W.setLogLevel(e)}static getSharedInstance(){if(z.isConfigured())return z.instance;throw new Mt}static isConfigured(){return z.instance!==void 0}static configure(e,r){return z.instance!==void 0?(W.warnLog("Purchases is already initialized. Ignoring and returning existing instance."),z.getSharedInstance()):(Co(e),Po(r),z.instance=new z(e,r),z.getSharedInstance())}async getOfferings(){const e=this._appUserId,r=await this.backend.getOfferings(e),n=r.offerings.flatMap(o=>o.packages).map(o=>o.platform_product_identifier),i=await this.backend.getProducts(e,n);return this.logMissingProductIds(n,i.product_details),this.toOfferings(r,i)}async isEntitledTo(e){const r=await this.getCustomerInfo();return e in r.entitlements.active}purchasePackage(e,r,n){let i=n??document.getElementById("rcb-ui-root");if(i===null){const c=document.createElement("div");c.className="rcb-ui-root",document.body.appendChild(c),i=c}if(i===null)throw new Error("Could not generate a mount point for the billing widget");const o=i,s=!n,l=this._appUserId;return W.debugLog(`Presenting purchase form for package ${e.identifier}`),new Promise((c,a)=>{new wo({target:o,props:{appUserId:l,rcPackage:e,customerEmail:r,onFinished:async()=>{W.debugLog("Purchase finished"),o.innerHTML="",c({customerInfo:await this._getCustomerInfoForUserId(l)})},onClose:()=>{o.innerHTML="",W.debugLog("Purchase cancelled by user"),a(new ne(se.UserCancelledError))},onError:f=>{o.innerHTML="",a(ne.getForPurchasesFlowError(f))},purchases:this,backend:this.backend,purchaseOperationHelper:this.purchaseOperationHelper,asModal:s}})})}async getCustomerInfo(){return await this._getCustomerInfoForUserId(this._appUserId)}getAppUserId(){return this._appUserId}async changeUser(e){return this._appUserId=e,await this.getCustomerInfo()}logMissingProductIds(e,r){const n={};r.forEach(o=>n[o.identifier]=o);const i=[];e.forEach(o=>{n[o]===void 0&&i.push(o)}),i.length>0&&W.debugLog(`Could not find product data for product ids:
|
|
8
8
|
${i.join()}.
|
|
9
|
-
Please check that your product configuration is correct.`)}isSandbox(){return We(this._API_KEY)}close(){z.instance===this?z.instance=void 0:W.warnLog("Trying to close a Purchases instance that is not the current instance. Ignoring.")}async _getCustomerInfoForUserId(e){const r=await this.backend.getCustomerInfo(e);return
|
|
9
|
+
Please check that your product configuration is correct.`)}isSandbox(){return We(this._API_KEY)}close(){z.instance===this?z.instance=void 0:W.warnLog("Trying to close a Purchases instance that is not the current instance. Ignoring.")}async _getCustomerInfoForUserId(e){const r=await this.backend.getCustomerInfo(e);return yo(r)}};C(z,"instance");let Xe=z;L.ErrorCode=se,L.LogLevel=q,L.PackageType=re,L.Purchases=Xe,L.PurchasesError=ne,L.UninitializedPurchasesError=Mt,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.rcb-modal-section.svelte-1bzqb13{padding:8px 0;display:flex}section.rcb-modal-section.svelte-1bzqb13{flex-grow:1}.rcb-modal-section.svelte-1bzqb13:last-of-type{padding:0}.rcb-pricing-info.svelte-i5dq8q{display:flex;flex-direction:column;margin-top:102px;font-weight:500}.rcb-product-price.svelte-i5dq8q{font-size:24px;margin:12px 0}.rcb-product-details.svelte-i5dq8q{opacity:.6;list-style-type:disc;list-style-position:inside;margin:0;padding:0}@media screen and (max-width: 960px){.rcb-pricing-info.svelte-i5dq8q{margin-top:48px}}.rcb-modal-loader.svelte-1mxx341{width:100%;flex-grow:1;min-height:100%;display:flex;justify-content:center;align-items:center}button.svelte-1rmxk7q{border:none;border-radius:56px;font-size:16px;cursor:pointer;height:56px;color:var(--rc-color-grey-text-dark);background-color:var(--rc-color-grey-ui-dark);display:flex;align-items:center;justify-content:center}button.intent-primary.svelte-1rmxk7q{background-color:var(--rc-color-grey-text-dark);color:var(--rc-color-white);font-size:16px}button.svelte-1rmxk7q:disabled{color:var(--rc-color-grey-text-light)}button.intent-primary.svelte-1rmxk7q:disabled{color:var(--rc-color-grey-text-light)}footer.svelte-1f9z0o8{display:flex;flex-direction:column}.column.svelte-6o8e90{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "8px");flex-grow:1}.close-button.svelte-14xreta{border:none;cursor:pointer;background-color:transparent;padding:0}.rcb-app-icon.svelte-44qpq9{width:40px;height:40px;border-radius:12px;box-shadow:0 1px 10px #0000001a;margin-right:16px}.rcb-app-icon-picture-container.svelte-44qpq9{height:40px}.rcb-app-icon.loading.svelte-44qpq9{background-color:gray}.app-title.svelte-10uf5fq{font-weight:500;margin:8px 0;font-size:16px}.rcb-header-layout__business-info.svelte-10uf5fq{display:flex;align-items:center}.rcb-post-purchase-header-layout.svelte-17puakv{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:-4px}.rcb-modal-message.svelte-10pcqja{width:100%;min-height:160px;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center}.title.svelte-10pcqja{font-size:24px;line-height:1.25em}.subtitle.svelte-10pcqja{font-size:16px;line-height:1.25em;overflow-wrap:anywhere}img.svelte-1609h93{width:124px;height:124px;margin:0 auto}.rcb-header-layout.svelte-1xe711j{display:flex;justify-content:space-between;align-items:center;width:100%;font-size:24px;margin:0;font-weight:500}.processing.svelte-rjmul6{width:12px;aspect-ratio:1;border-radius:50%;animation:svelte-rjmul6-l5 1.5s infinite linear}@keyframes svelte-rjmul6-l5{0%{box-shadow:20px 0 #fff2,-20px 0 #fff2;background:#fff2}25%{box-shadow:20px 0 #fff2,-20px 0 #fff;background:#fff2}50%{box-shadow:20px 0 #fff2,-20px 0 #fff2;background:#fff}75%{box-shadow:20px 0 #fff,-20px 0 #fff2;background:#fff2}to{box-shadow:20px 0 #fff2,-20px 0 #fff2;background:#fff2}}.rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}form.svelte-favd20.svelte-favd20{display:flex;flex-direction:column;min-height:100%;flex-grow:1}.form-container.svelte-favd20.svelte-favd20{display:flex;flex-direction:column;width:100%;margin-top:32px;margin-bottom:16px}.form-label.svelte-favd20.svelte-favd20{margin-top:8px;margin-bottom:8px;display:block;font-weight:500;line-height:22px}.form-input.error.svelte-favd20 input.svelte-favd20{border-color:var(--rc-color-error)}.form-error.svelte-favd20.svelte-favd20{margin-top:4px;font-size:16px;line-height:20px;min-height:40px;color:var(--rc-color-error)}input.svelte-favd20.svelte-favd20{width:100%;box-sizing:border-box;border:2px solid var(--rc-color-grey-ui-dark);border-radius:12px;font-size:16px;height:48px;padding:6px 14px}input.svelte-favd20.svelte-favd20:focus{outline:none;border:2px solid var(--rc-color-focus)}.rcb-modal-backdrop.svelte-17tslso{position:fixed;top:0;left:0;right:0;min-width:100%;width:100vw;width:100dvw;min-height:100%;height:100vh;height:100dvh;background-color:#282828bf;display:flex;flex-direction:column;justify-content:space-around;z-index:1000001}.rcb-modal-main.svelte-
|
|
1
|
+
.rcb-modal-section.svelte-1bzqb13{padding:8px 0;display:flex}section.rcb-modal-section.svelte-1bzqb13{flex-grow:1}.rcb-modal-section.svelte-1bzqb13:last-of-type{padding:0}.rcb-pricing-info.svelte-i5dq8q{display:flex;flex-direction:column;margin-top:102px;font-weight:500}.rcb-product-price.svelte-i5dq8q{font-size:24px;margin:12px 0}.rcb-product-details.svelte-i5dq8q{opacity:.6;list-style-type:disc;list-style-position:inside;margin:0;padding:0}@media screen and (max-width: 960px){.rcb-pricing-info.svelte-i5dq8q{margin-top:48px}}.rcb-modal-loader.svelte-1mxx341{width:100%;flex-grow:1;min-height:100%;display:flex;justify-content:center;align-items:center}button.svelte-1rmxk7q{border:none;border-radius:56px;font-size:16px;cursor:pointer;height:56px;color:var(--rc-color-grey-text-dark);background-color:var(--rc-color-grey-ui-dark);display:flex;align-items:center;justify-content:center}button.intent-primary.svelte-1rmxk7q{background-color:var(--rc-color-grey-text-dark);color:var(--rc-color-white);font-size:16px}button.svelte-1rmxk7q:disabled{color:var(--rc-color-grey-text-light)}button.intent-primary.svelte-1rmxk7q:disabled{color:var(--rc-color-grey-text-light)}footer.svelte-1f9z0o8{display:flex;flex-direction:column}.column.svelte-6o8e90{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "8px");flex-grow:1}.close-button.svelte-14xreta{border:none;cursor:pointer;background-color:transparent;padding:0}.rcb-app-icon.svelte-44qpq9{width:40px;height:40px;border-radius:12px;box-shadow:0 1px 10px #0000001a;margin-right:16px}.rcb-app-icon-picture-container.svelte-44qpq9{height:40px}.rcb-app-icon.loading.svelte-44qpq9{background-color:gray}.app-title.svelte-10uf5fq{font-weight:500;margin:8px 0;font-size:16px}.rcb-header-layout__business-info.svelte-10uf5fq{display:flex;align-items:center}.rcb-post-purchase-header-layout.svelte-17puakv{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:-4px}.rcb-modal-message.svelte-10pcqja{width:100%;min-height:160px;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center}.title.svelte-10pcqja{font-size:24px;line-height:1.25em}.subtitle.svelte-10pcqja{font-size:16px;line-height:1.25em;overflow-wrap:anywhere}img.svelte-1609h93{width:124px;height:124px;margin:0 auto}.rcb-header-layout.svelte-1xe711j{display:flex;justify-content:space-between;align-items:center;width:100%;font-size:24px;margin:0;font-weight:500}.processing.svelte-rjmul6{width:12px;aspect-ratio:1;border-radius:50%;animation:svelte-rjmul6-l5 1.5s infinite linear}@keyframes svelte-rjmul6-l5{0%{box-shadow:20px 0 #fff2,-20px 0 #fff2;background:#fff2}25%{box-shadow:20px 0 #fff2,-20px 0 #fff;background:#fff2}50%{box-shadow:20px 0 #fff2,-20px 0 #fff2;background:#fff}75%{box-shadow:20px 0 #fff,-20px 0 #fff2;background:#fff2}to{box-shadow:20px 0 #fff2,-20px 0 #fff2;background:#fff2}}.rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}form.svelte-favd20.svelte-favd20{display:flex;flex-direction:column;min-height:100%;flex-grow:1}.form-container.svelte-favd20.svelte-favd20{display:flex;flex-direction:column;width:100%;margin-top:32px;margin-bottom:16px}.form-label.svelte-favd20.svelte-favd20{margin-top:8px;margin-bottom:8px;display:block;font-weight:500;line-height:22px}.form-input.error.svelte-favd20 input.svelte-favd20{border-color:var(--rc-color-error)}.form-error.svelte-favd20.svelte-favd20{margin-top:4px;font-size:16px;line-height:20px;min-height:40px;color:var(--rc-color-error)}input.svelte-favd20.svelte-favd20{width:100%;box-sizing:border-box;border:2px solid var(--rc-color-grey-ui-dark);border-radius:12px;font-size:16px;height:48px;padding:6px 14px}input.svelte-favd20.svelte-favd20:focus{outline:none;border:2px solid var(--rc-color-focus)}.rcb-modal-backdrop.svelte-17tslso{position:fixed;top:0;left:0;right:0;min-width:100%;width:100vw;width:100dvw;min-height:100%;height:100vh;height:100dvh;background-color:#282828bf;display:flex;flex-direction:column;justify-content:space-around;z-index:1000001}.rcb-modal-container.svelte-ioxu5d{width:100%}.rcb-modal-main.svelte-ioxu5d{box-sizing:border-box;border-radius:8px;background-color:var(--rc-color-white);color:var(--rc-color-grey-text-dark);min-height:460px;padding:40px;flex-direction:column;display:flex}.rcb-modal-dark.svelte-ioxu5d{background-color:var(--rc-color-grey-text-dark);color:var(--rc-color-white);min-height:0px}@media screen and (max-width: 960px){.rcb-modal-container.svelte-ioxu5d{width:calc(100% - 32px);min-width:300px;max-width:640px;margin:auto}.rcb-modal-main.svelte-ioxu5d,.rcb-modal-dark.svelte-ioxu5d{min-width:300px;max-width:640px;padding:32px}}div.svelte-1rhrjxe{background-color:var(--rc-color-warning);color:var(--rc-color-grey-text-dark);font-size:10px;font-weight:700;text-transform:uppercase;padding:4px 10px;line-height:10px;border-radius:9px;margin:0 0 0 16px}.rcb-ui-container.svelte-13pdaik{color-scheme:none;font-size:16px;line-height:1.5em;font-weight:400;font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}.rcb-ui-layout.svelte-13pdaik{width:100vw;width:100dvw;margin-right:auto;display:flex;justify-content:center;align-items:flex-start;position:relative;padding:0 80px;box-sizing:border-box}.rcb-ui-aside.svelte-13pdaik{margin-right:16px;flex:320px 1 0;max-width:480px}.rcb-ui-main.svelte-13pdaik{flex:480px 1 0;max-width:640px}@media screen and (max-width: 960px){.rcb-ui-layout.svelte-13pdaik{flex-direction:column;align-items:center;justify-content:center;height:100%;min-width:100%}.rcb-ui-aside.svelte-13pdaik{margin-right:0;margin-bottom:16px;min-width:100%;display:flex;flex-direction:column;align-items:center;flex:none;max-width:none}.rcb-ui-main.svelte-13pdaik{flex:none;max-width:none;min-width:100%}}@media screen and (max-width: 960px) and (max-height: 960px){.rcb-ui-layout.svelte-13pdaik{overflow-y:scroll;justify-content:flex-start;padding:16px 0}}
|