@revenuecat/purchases-js 0.3.2 → 0.3.3

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.
@@ -4142,7 +4142,7 @@ class Ft extends U {
4142
4142
  super(), N(this, e, uo, ao, T, { dark: 0 });
4143
4143
  }
4144
4144
  }
4145
- const fo = "0.3.2", fe = "https://api.revenuecat.com";
4145
+ const fo = "0.3.3", fe = "https://api.revenuecat.com";
4146
4146
  var Re;
4147
4147
  (function(t) {
4148
4148
  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";
@@ -4393,8 +4393,8 @@ function At(t) {
4393
4393
  },
4394
4394
  p(i, o) {
4395
4395
  const s = {};
4396
- o & /*$$scope, purchases, brandingInfo, productDetails, purchaseOption*/
4397
- 67108894 && (s.$$scope = { dirty: o, ctx: i }), r.$set(s);
4396
+ o & /*$$scope, purchases, brandingInfo, productDetails*/
4397
+ 67108878 && (s.$$scope = { dirty: o, ctx: i }), r.$set(s);
4398
4398
  },
4399
4399
  i(i) {
4400
4400
  n || (f(r.$$.fragment, i), n = !0);
@@ -4413,11 +4413,11 @@ function ht(t) {
4413
4413
  props: {
4414
4414
  productDetails: (
4415
4415
  /*productDetails*/
4416
- t[3]
4416
+ t[2]
4417
4417
  ),
4418
4418
  purchaseOption: (
4419
- /*purchaseOption*/
4420
- t[1]
4419
+ /*purchaseOptionToUse*/
4420
+ t[8]
4421
4421
  )
4422
4422
  }
4423
4423
  }), {
@@ -4430,10 +4430,8 @@ function ht(t) {
4430
4430
  p(n, i) {
4431
4431
  const o = {};
4432
4432
  i & /*productDetails*/
4433
- 8 && (o.productDetails = /*productDetails*/
4434
- n[3]), i & /*purchaseOption*/
4435
- 2 && (o.purchaseOption = /*purchaseOption*/
4436
- n[1]), e.$set(o);
4433
+ 4 && (o.productDetails = /*productDetails*/
4434
+ n[2]), e.$set(o);
4437
4435
  },
4438
4436
  i(n) {
4439
4437
  r || (f(e.$$.fragment, n), r = !0);
@@ -4449,8 +4447,8 @@ function ht(t) {
4449
4447
  function Co(t) {
4450
4448
  let e, r, n = (
4451
4449
  /*productDetails*/
4452
- t[3] && /*purchaseOption*/
4453
- t[1] && ht(t)
4450
+ t[2] && /*purchaseOptionToUse*/
4451
+ t[8] && ht(t)
4454
4452
  );
4455
4453
  return {
4456
4454
  c() {
@@ -4461,9 +4459,9 @@ function Co(t) {
4461
4459
  },
4462
4460
  p(i, o) {
4463
4461
  /*productDetails*/
4464
- i[3] && /*purchaseOption*/
4465
- i[1] ? n ? (n.p(i, o), o & /*productDetails, purchaseOption*/
4466
- 10 && f(n, 1)) : (n = ht(i), n.c(), f(n, 1), n.m(e.parentNode, e)) : n && (H(), m(n, 1, 1, () => {
4462
+ i[2] && /*purchaseOptionToUse*/
4463
+ i[8] ? n ? (n.p(i, o), o & /*productDetails*/
4464
+ 4 && f(n, 1)) : (n = ht(i), n.c(), f(n, 1), n.m(e.parentNode, e)) : n && (H(), m(n, 1, 1, () => {
4467
4465
  n = null;
4468
4466
  }), K());
4469
4467
  },
@@ -4523,14 +4521,14 @@ function To(t) {
4523
4521
  e = new Ut({
4524
4522
  props: { brandingInfo: (
4525
4523
  /*brandingInfo*/
4526
- t[4]
4524
+ t[3]
4527
4525
  ) }
4528
4526
  });
4529
4527
  const c = [Po, Qo], a = [];
4530
4528
  function u(d, h) {
4531
4529
  return h & /*purchases*/
4532
- 4 && (n = null), n == null && (n = !!/*purchases*/
4533
- d[2].isSandbox()), n ? 0 : 1;
4530
+ 2 && (n = null), n == null && (n = !!/*purchases*/
4531
+ d[1].isSandbox()), n ? 0 : 1;
4534
4532
  }
4535
4533
  return i = u(t, -1), o = a[i] = c[i](t), {
4536
4534
  c() {
@@ -4542,8 +4540,8 @@ function To(t) {
4542
4540
  p(d, h) {
4543
4541
  const $ = {};
4544
4542
  h & /*brandingInfo*/
4545
- 16 && ($.brandingInfo = /*brandingInfo*/
4546
- d[4]), e.$set($);
4543
+ 8 && ($.brandingInfo = /*brandingInfo*/
4544
+ d[3]), e.$set($);
4547
4545
  let E = i;
4548
4546
  i = u(d, h), i !== E && (H(), m(a[E], 1, 1, () => {
4549
4547
  a[E] = null;
@@ -4578,7 +4576,7 @@ function No(t) {
4578
4576
  p(n, i) {
4579
4577
  const o = {};
4580
4578
  i & /*$$scope, purchases, brandingInfo*/
4581
- 67108884 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o);
4579
+ 67108874 && (o.$$scope = { dirty: i, ctx: n }), e.$set(o);
4582
4580
  },
4583
4581
  i(n) {
4584
4582
  r || (f(e.$$.fragment, n), r = !0);
@@ -4597,11 +4595,11 @@ function Et(t) {
4597
4595
  props: {
4598
4596
  productDetails: (
4599
4597
  /*productDetails*/
4600
- t[3]
4598
+ t[2]
4601
4599
  ),
4602
4600
  purchaseOption: (
4603
- /*purchaseOption*/
4604
- t[1]
4601
+ /*purchaseOptionToUse*/
4602
+ t[8]
4605
4603
  )
4606
4604
  }
4607
4605
  }), {
@@ -4614,10 +4612,8 @@ function Et(t) {
4614
4612
  p(n, i) {
4615
4613
  const o = {};
4616
4614
  i & /*productDetails*/
4617
- 8 && (o.productDetails = /*productDetails*/
4618
- n[3]), i & /*purchaseOption*/
4619
- 2 && (o.purchaseOption = /*purchaseOption*/
4620
- n[1]), e.$set(o);
4615
+ 4 && (o.productDetails = /*productDetails*/
4616
+ n[2]), e.$set(o);
4621
4617
  },
4622
4618
  i(n) {
4623
4619
  r || (f(e.$$.fragment, n), r = !0);
@@ -4664,7 +4660,7 @@ function It(t) {
4664
4660
  ),
4665
4661
  processing: (
4666
4662
  /*state*/
4667
- t[7] === "processing-auth-info"
4663
+ t[6] === "processing-auth-info"
4668
4664
  )
4669
4665
  }
4670
4666
  }), {
@@ -4677,8 +4673,8 @@ function It(t) {
4677
4673
  p(n, i) {
4678
4674
  const o = {};
4679
4675
  i & /*state*/
4680
- 128 && (o.processing = /*state*/
4681
- n[7] === "processing-auth-info"), e.$set(o);
4676
+ 64 && (o.processing = /*state*/
4677
+ n[6] === "processing-auth-info"), e.$set(o);
4682
4678
  },
4683
4679
  i(n) {
4684
4680
  r || (f(e.$$.fragment, n), r = !0);
@@ -4697,7 +4693,7 @@ function wt(t) {
4697
4693
  props: {
4698
4694
  paymentInfoCollectionMetadata: (
4699
4695
  /*paymentInfoCollectionMetadata*/
4700
- t[5]
4696
+ t[4]
4701
4697
  ),
4702
4698
  onContinue: (
4703
4699
  /*handleContinue*/
@@ -4713,7 +4709,7 @@ function wt(t) {
4713
4709
  ),
4714
4710
  processing: (
4715
4711
  /*state*/
4716
- t[7] === "polling-purchase-status"
4712
+ t[6] === "polling-purchase-status"
4717
4713
  )
4718
4714
  }
4719
4715
  }), {
@@ -4726,10 +4722,10 @@ function wt(t) {
4726
4722
  p(n, i) {
4727
4723
  const o = {};
4728
4724
  i & /*paymentInfoCollectionMetadata*/
4729
- 32 && (o.paymentInfoCollectionMetadata = /*paymentInfoCollectionMetadata*/
4730
- n[5]), i & /*state*/
4731
- 128 && (o.processing = /*state*/
4732
- n[7] === "polling-purchase-status"), e.$set(o);
4725
+ 16 && (o.paymentInfoCollectionMetadata = /*paymentInfoCollectionMetadata*/
4726
+ n[4]), i & /*state*/
4727
+ 64 && (o.processing = /*state*/
4728
+ n[6] === "polling-purchase-status"), e.$set(o);
4733
4729
  },
4734
4730
  i(n) {
4735
4731
  r || (f(e.$$.fragment, n), r = !0);
@@ -4769,15 +4765,15 @@ function $t(t) {
4769
4765
  props: {
4770
4766
  brandingInfo: (
4771
4767
  /*brandingInfo*/
4772
- t[4]
4768
+ t[3]
4773
4769
  ),
4774
4770
  lastError: (
4775
4771
  /*lastError*/
4776
- t[6] ?? new Y(O.UnknownError, "Unknown error without state set.")
4772
+ t[5] ?? new Y(O.UnknownError, "Unknown error without state set.")
4777
4773
  ),
4778
4774
  supportEmail: (
4779
4775
  /*brandingInfo*/
4780
- (n = t[4]) == null ? void 0 : n.seller_company_support_email
4776
+ (n = t[3]) == null ? void 0 : n.seller_company_support_email
4781
4777
  ),
4782
4778
  onContinue: (
4783
4779
  /*closeWithError*/
@@ -4795,12 +4791,12 @@ function $t(t) {
4795
4791
  var l;
4796
4792
  const s = {};
4797
4793
  o & /*brandingInfo*/
4798
- 16 && (s.brandingInfo = /*brandingInfo*/
4799
- i[4]), o & /*lastError*/
4800
- 64 && (s.lastError = /*lastError*/
4801
- i[6] ?? new Y(O.UnknownError, "Unknown error without state set.")), o & /*brandingInfo*/
4802
- 16 && (s.supportEmail = /*brandingInfo*/
4803
- (l = i[4]) == null ? void 0 : l.seller_company_support_email), e.$set(s);
4794
+ 8 && (s.brandingInfo = /*brandingInfo*/
4795
+ i[3]), o & /*lastError*/
4796
+ 32 && (s.lastError = /*lastError*/
4797
+ i[5] ?? new Y(O.UnknownError, "Unknown error without state set.")), o & /*brandingInfo*/
4798
+ 8 && (s.supportEmail = /*brandingInfo*/
4799
+ (l = i[3]) == null ? void 0 : l.seller_company_support_email), e.$set(s);
4804
4800
  },
4805
4801
  i(i) {
4806
4802
  r || (f(e.$$.fragment, i), r = !0);
@@ -4819,7 +4815,7 @@ function vt(t) {
4819
4815
  props: {
4820
4816
  brandingInfo: (
4821
4817
  /*brandingInfo*/
4822
- t[4]
4818
+ t[3]
4823
4819
  ),
4824
4820
  onContinue: (
4825
4821
  /*handleContinue*/
@@ -4836,8 +4832,8 @@ function vt(t) {
4836
4832
  p(n, i) {
4837
4833
  const o = {};
4838
4834
  i & /*brandingInfo*/
4839
- 16 && (o.brandingInfo = /*brandingInfo*/
4840
- n[4]), e.$set(o);
4835
+ 8 && (o.brandingInfo = /*brandingInfo*/
4836
+ n[3]), e.$set(o);
4841
4837
  },
4842
4838
  i(n) {
4843
4839
  r || (f(e.$$.fragment, n), r = !0);
@@ -4853,31 +4849,31 @@ function vt(t) {
4853
4849
  function Uo(t) {
4854
4850
  let e, r, n, i, o, s, l, c, a = (
4855
4851
  /*state*/
4856
- t[7] === "present-offer" && /*productDetails*/
4857
- t[3] && /*purchaseOption*/
4858
- t[1] && Et(t)
4852
+ t[6] === "present-offer" && /*productDetails*/
4853
+ t[2] && /*purchaseOptionToUse*/
4854
+ t[8] && Et(t)
4859
4855
  ), u = (
4860
4856
  /*state*/
4861
- t[7] === "present-offer" && !/*productDetails*/
4862
- t[3] && bt()
4857
+ t[6] === "present-offer" && !/*productDetails*/
4858
+ t[2] && bt()
4863
4859
  ), d = (
4864
4860
  /*state*/
4865
- (t[7] === "needs-auth-info" || /*state*/
4866
- t[7] === "processing-auth-info") && It(t)
4861
+ (t[6] === "needs-auth-info" || /*state*/
4862
+ t[6] === "processing-auth-info") && It(t)
4867
4863
  ), h = (
4868
4864
  /*paymentInfoCollectionMetadata*/
4869
- t[5] && /*state*/
4870
- (t[7] === "needs-payment-info" || /*state*/
4871
- t[7] === "polling-purchase-status") && wt(t)
4865
+ t[4] && /*state*/
4866
+ (t[6] === "needs-payment-info" || /*state*/
4867
+ t[6] === "polling-purchase-status") && wt(t)
4872
4868
  ), $ = (
4873
4869
  /*state*/
4874
- t[7] === "loading" && kt()
4870
+ t[6] === "loading" && kt()
4875
4871
  ), E = (
4876
4872
  /*state*/
4877
- t[7] === "error" && $t(t)
4873
+ t[6] === "error" && $t(t)
4878
4874
  ), B = (
4879
4875
  /*state*/
4880
- t[7] === "success" && vt(t)
4876
+ t[6] === "success" && vt(t)
4881
4877
  );
4882
4878
  return {
4883
4879
  c() {
@@ -4888,38 +4884,38 @@ function Uo(t) {
4888
4884
  },
4889
4885
  p(A, y) {
4890
4886
  /*state*/
4891
- A[7] === "present-offer" && /*productDetails*/
4892
- A[3] && /*purchaseOption*/
4893
- A[1] ? a ? (a.p(A, y), y & /*state, productDetails, purchaseOption*/
4894
- 138 && f(a, 1)) : (a = Et(A), a.c(), f(a, 1), a.m(e.parentNode, e)) : a && (H(), m(a, 1, 1, () => {
4887
+ A[6] === "present-offer" && /*productDetails*/
4888
+ A[2] && /*purchaseOptionToUse*/
4889
+ A[8] ? a ? (a.p(A, y), y & /*state, productDetails*/
4890
+ 68 && f(a, 1)) : (a = Et(A), a.c(), f(a, 1), a.m(e.parentNode, e)) : a && (H(), m(a, 1, 1, () => {
4895
4891
  a = null;
4896
4892
  }), K()), /*state*/
4897
- A[7] === "present-offer" && !/*productDetails*/
4898
- A[3] ? u ? y & /*state, productDetails*/
4899
- 136 && f(u, 1) : (u = bt(), u.c(), f(u, 1), u.m(r.parentNode, r)) : u && (H(), m(u, 1, 1, () => {
4893
+ A[6] === "present-offer" && !/*productDetails*/
4894
+ A[2] ? u ? y & /*state, productDetails*/
4895
+ 68 && f(u, 1) : (u = bt(), u.c(), f(u, 1), u.m(r.parentNode, r)) : u && (H(), m(u, 1, 1, () => {
4900
4896
  u = null;
4901
4897
  }), K()), /*state*/
4902
- A[7] === "needs-auth-info" || /*state*/
4903
- A[7] === "processing-auth-info" ? d ? (d.p(A, y), y & /*state*/
4904
- 128 && f(d, 1)) : (d = It(A), d.c(), f(d, 1), d.m(n.parentNode, n)) : d && (H(), m(d, 1, 1, () => {
4898
+ A[6] === "needs-auth-info" || /*state*/
4899
+ A[6] === "processing-auth-info" ? d ? (d.p(A, y), y & /*state*/
4900
+ 64 && f(d, 1)) : (d = It(A), d.c(), f(d, 1), d.m(n.parentNode, n)) : d && (H(), m(d, 1, 1, () => {
4905
4901
  d = null;
4906
4902
  }), K()), /*paymentInfoCollectionMetadata*/
4907
- A[5] && /*state*/
4908
- (A[7] === "needs-payment-info" || /*state*/
4909
- A[7] === "polling-purchase-status") ? h ? (h.p(A, y), y & /*paymentInfoCollectionMetadata, state*/
4910
- 160 && f(h, 1)) : (h = wt(A), h.c(), f(h, 1), h.m(i.parentNode, i)) : h && (H(), m(h, 1, 1, () => {
4903
+ A[4] && /*state*/
4904
+ (A[6] === "needs-payment-info" || /*state*/
4905
+ A[6] === "polling-purchase-status") ? h ? (h.p(A, y), y & /*paymentInfoCollectionMetadata, state*/
4906
+ 80 && f(h, 1)) : (h = wt(A), h.c(), f(h, 1), h.m(i.parentNode, i)) : h && (H(), m(h, 1, 1, () => {
4911
4907
  h = null;
4912
4908
  }), K()), /*state*/
4913
- A[7] === "loading" ? $ ? y & /*state*/
4914
- 128 && f($, 1) : ($ = kt(), $.c(), f($, 1), $.m(o.parentNode, o)) : $ && (H(), m($, 1, 1, () => {
4909
+ A[6] === "loading" ? $ ? y & /*state*/
4910
+ 64 && f($, 1) : ($ = kt(), $.c(), f($, 1), $.m(o.parentNode, o)) : $ && (H(), m($, 1, 1, () => {
4915
4911
  $ = null;
4916
4912
  }), K()), /*state*/
4917
- A[7] === "error" ? E ? (E.p(A, y), y & /*state*/
4918
- 128 && f(E, 1)) : (E = $t(A), E.c(), f(E, 1), E.m(s.parentNode, s)) : E && (H(), m(E, 1, 1, () => {
4913
+ A[6] === "error" ? E ? (E.p(A, y), y & /*state*/
4914
+ 64 && f(E, 1)) : (E = $t(A), E.c(), f(E, 1), E.m(s.parentNode, s)) : E && (H(), m(E, 1, 1, () => {
4919
4915
  E = null;
4920
4916
  }), K()), /*state*/
4921
- A[7] === "success" ? B ? (B.p(A, y), y & /*state*/
4922
- 128 && f(B, 1)) : (B = vt(A), B.c(), f(B, 1), B.m(l.parentNode, l)) : B && (H(), m(B, 1, 1, () => {
4917
+ A[6] === "success" ? B ? (B.p(A, y), y & /*state*/
4918
+ 64 && f(B, 1)) : (B = vt(A), B.c(), f(B, 1), B.m(l.parentNode, l)) : B && (H(), m(B, 1, 1, () => {
4923
4919
  B = null;
4924
4920
  }), K());
4925
4921
  },
@@ -4939,7 +4935,7 @@ function Ro(t) {
4939
4935
  /*statesWhereOfferDetailsAreShown*/
4940
4936
  t[9].includes(
4941
4937
  /*state*/
4942
- t[7]
4938
+ t[6]
4943
4939
  )
4944
4940
  ), n, i, o, s, l = r && At(t);
4945
4941
  return o = new Ft({
@@ -4953,7 +4949,7 @@ function Ro(t) {
4953
4949
  e,
4954
4950
  "style",
4955
4951
  /*colorVariables*/
4956
- t[8]
4952
+ t[7]
4957
4953
  );
4958
4954
  },
4959
4955
  m(c, a) {
@@ -4961,17 +4957,17 @@ function Ro(t) {
4961
4957
  },
4962
4958
  p(c, a) {
4963
4959
  a & /*state*/
4964
- 128 && (r = /*statesWhereOfferDetailsAreShown*/
4960
+ 64 && (r = /*statesWhereOfferDetailsAreShown*/
4965
4961
  c[9].includes(
4966
4962
  /*state*/
4967
- c[7]
4963
+ c[6]
4968
4964
  )), r ? l ? (l.p(c, a), a & /*state*/
4969
- 128 && f(l, 1)) : (l = At(c), l.c(), f(l, 1), l.m(e, n)) : l && (H(), m(l, 1, 1, () => {
4965
+ 64 && f(l, 1)) : (l = At(c), l.c(), f(l, 1), l.m(e, n)) : l && (H(), m(l, 1, 1, () => {
4970
4966
  l = null;
4971
4967
  }), K());
4972
4968
  const u = {};
4973
- a & /*$$scope, brandingInfo, state, lastError, paymentInfoCollectionMetadata, productDetails, purchaseOption*/
4974
- 67109114 && (u.$$scope = { dirty: a, ctx: c }), o.$set(u);
4969
+ a & /*$$scope, brandingInfo, state, lastError, paymentInfoCollectionMetadata, productDetails*/
4970
+ 67108988 && (u.$$scope = { dirty: a, ctx: c }), o.$set(u);
4975
4971
  },
4976
4972
  i(c) {
4977
4973
  s || (f(l), f(o.$$.fragment, c), s = !0);
@@ -5006,8 +5002,8 @@ function So(t) {
5006
5002
  const s = {};
5007
5003
  o & /*asModal*/
5008
5004
  1 && (s.condition = /*asModal*/
5009
- i[0]), o & /*$$scope, brandingInfo, state, lastError, paymentInfoCollectionMetadata, productDetails, purchaseOption, purchases*/
5010
- 67109118 && (s.$$scope = { dirty: o, ctx: i }), r.$set(s);
5005
+ i[0]), o & /*$$scope, brandingInfo, state, lastError, paymentInfoCollectionMetadata, productDetails, purchases*/
5006
+ 67108990 && (s.$$scope = { dirty: o, ctx: i }), r.$set(s);
5011
5007
  },
5012
5008
  i(i) {
5013
5009
  n || (f(r.$$.fragment, i), n = !0);
@@ -5036,8 +5032,8 @@ function Oo(t, e, r) {
5036
5032
  "loading"
5037
5033
  ];
5038
5034
  Oe(async () => {
5039
- if (r(3, B = s.rcBillingProduct), r(4, A = await h.getBrandingInfo()), S === "present-offer") {
5040
- i ? Ze() : r(7, S = "needs-auth-info");
5035
+ if (r(2, B = s.rcBillingProduct), r(3, A = await h.getBrandingInfo()), S === "present-offer") {
5036
+ i ? Ze() : r(6, S = "needs-auth-info");
5041
5037
  return;
5042
5038
  }
5043
5039
  });
@@ -5048,18 +5044,18 @@ function Oo(t, e, r) {
5048
5044
  de(new Y(O.ErrorSettingUpPurchase, "Product ID was not set before purchase."));
5049
5045
  return;
5050
5046
  } else
5051
- S === "present-offer" && r(7, S = "loading");
5047
+ S === "present-offer" && r(6, S = "loading");
5052
5048
  if (!i) {
5053
5049
  de(new Y(O.MissingEmailError));
5054
5050
  return;
5055
5051
  }
5056
5052
  $.startPurchase(o, M, F, i, s.rcBillingProduct.presentedOfferingIdentifier).then((D) => {
5057
5053
  if (D.next_action === "collect_payment_info") {
5058
- r(7, S = "needs-payment-info"), r(5, y = D);
5054
+ r(6, S = "needs-payment-info"), r(4, y = D);
5059
5055
  return;
5060
5056
  }
5061
5057
  if (D.next_action === "completed") {
5062
- r(7, S = "success");
5058
+ r(6, S = "success");
5063
5059
  return;
5064
5060
  }
5065
5061
  }).catch((D) => {
@@ -5067,12 +5063,12 @@ function Oo(t, e, r) {
5067
5063
  });
5068
5064
  }, Yt = (D) => {
5069
5065
  if (S === "needs-auth-info") {
5070
- D && (r(14, i = D.email), r(7, S = "processing-auth-info")), Ze();
5066
+ D && (r(14, i = D.email), r(6, S = "processing-auth-info")), Ze();
5071
5067
  return;
5072
5068
  }
5073
5069
  if (S === "needs-payment-info") {
5074
- r(7, S = "polling-purchase-status"), $.pollCurrentPurchaseForCompletion().then(() => {
5075
- r(7, S = "success");
5070
+ r(6, S = "polling-purchase-status"), $.pollCurrentPurchaseForCompletion().then(() => {
5071
+ r(6, S = "success");
5076
5072
  }).catch((xe) => {
5077
5073
  de(xe);
5078
5074
  });
@@ -5082,17 +5078,16 @@ function Oo(t, e, r) {
5082
5078
  c();
5083
5079
  return;
5084
5080
  }
5085
- r(7, S = "success");
5081
+ r(6, S = "success");
5086
5082
  }, de = (D) => {
5087
- r(6, R = D), r(7, S = "error");
5083
+ r(5, R = D), r(6, S = "error");
5088
5084
  }, Ht = () => {
5089
5085
  a(R ?? new Y(O.UnknownError, "Unknown error without state set."));
5090
5086
  };
5091
5087
  return t.$$set = (D) => {
5092
- "asModal" in D && r(0, n = D.asModal), "customerEmail" in D && r(14, i = D.customerEmail), "appUserId" in D && r(15, o = D.appUserId), "rcPackage" in D && r(16, s = D.rcPackage), "purchaseOption" in D && r(1, l = D.purchaseOption), "onFinished" in D && r(17, c = D.onFinished), "onError" in D && r(18, a = D.onError), "onClose" in D && r(19, u = D.onClose), "purchases" in D && r(2, d = D.purchases), "backend" in D && r(20, h = D.backend), "purchaseOperationHelper" in D && r(21, $ = D.purchaseOperationHelper);
5088
+ "asModal" in D && r(0, n = D.asModal), "customerEmail" in D && r(14, i = D.customerEmail), "appUserId" in D && r(15, o = D.appUserId), "rcPackage" in D && r(16, s = D.rcPackage), "purchaseOption" in D && r(17, l = D.purchaseOption), "onFinished" in D && r(18, c = D.onFinished), "onError" in D && r(19, a = D.onError), "onClose" in D && r(20, u = D.onClose), "purchases" in D && r(1, d = D.purchases), "backend" in D && r(21, h = D.backend), "purchaseOperationHelper" in D && r(22, $ = D.purchaseOperationHelper);
5093
5089
  }, [
5094
5090
  n,
5095
- l,
5096
5091
  d,
5097
5092
  B,
5098
5093
  A,
@@ -5100,6 +5095,7 @@ function Oo(t, e, r) {
5100
5095
  R,
5101
5096
  S,
5102
5097
  E,
5098
+ F,
5103
5099
  ye,
5104
5100
  Be,
5105
5101
  Yt,
@@ -5108,6 +5104,7 @@ function Oo(t, e, r) {
5108
5104
  i,
5109
5105
  o,
5110
5106
  s,
5107
+ l,
5111
5108
  c,
5112
5109
  a,
5113
5110
  u,
@@ -5128,13 +5125,13 @@ class Lo extends U {
5128
5125
  customerEmail: 14,
5129
5126
  appUserId: 15,
5130
5127
  rcPackage: 16,
5131
- purchaseOption: 1,
5132
- onFinished: 17,
5133
- onError: 18,
5134
- onClose: 19,
5135
- purchases: 2,
5136
- backend: 20,
5137
- purchaseOperationHelper: 21
5128
+ purchaseOption: 17,
5129
+ onFinished: 18,
5130
+ onError: 19,
5131
+ onClose: 20,
5132
+ purchases: 1,
5133
+ backend: 21,
5134
+ purchaseOperationHelper: 22
5138
5135
  },
5139
5136
  Mo
5140
5137
  );
@@ -1,9 +1,9 @@
1
- (function(H,X){typeof exports=="object"&&typeof module<"u"?X(exports):typeof define=="function"&&define.amd?define(["exports"],X):(H=typeof globalThis<"u"?globalThis:H||self,X(H.Purchases={}))})(this,function(H){"use strict";var Xo=Object.defineProperty;var Zo=(H,X,x)=>X in H?Xo(H,X,{enumerable:!0,configurable:!0,writable:!0,value:x}):H[X]=x;var Q=(H,X,x)=>(Zo(H,typeof X!="symbol"?X+"":X,x),x);function X(t){return t!=null}var x=(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))(x||{});class G{static setLogLevel(e){this.logLevel=e}static log(e,r=this.logLevel){const n=`[Purchases] ${e}`;if(!(this.logLevel<r||r===x.Silent))switch(r){case x.Error:console.error(n);break;case x.Warn:console.warn(n);break;case x.Info:console.info(n);break;case x.Debug:console.debug(n);break;case x.Verbose:console.debug(n);break}}static errorLog(e){this.log(e,x.Error)}static warnLog(e){this.log(e,x.Warn)}static infoLog(e){this.log(e,x.Info)}static debugLog(e){this.log(e,x.Debug)}static verboseLog(e){this.log(e,x.Verbose)}}Q(G,"logLevel",x.Silent);var ie=(t=>(t.Year="year",t.Month="month",t.Week="week",t.Day="day",t))(ie||{});function Ge(t){const e=t.match(/^PT?([0-9]+)([MDYW])$/);if(!e||e.length<3)return G.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 G.errorLog(`Invalid ISO 8601 unit duration format: ${t}`),null}}const Ye=(t,e)=>{const r=t/100;return new Intl.NumberFormat("en-US",{style:"currency",currency:e}).format(r)},jt=t=>{const e=t.number;if(e===1)switch(t.unit){case ie.Year:return"yearly";case ie.Month:return"monthly";case ie.Week:return"weekly";case ie.Day:return"daily"}else return`every ${e} ${t.unit}s`},Jt=t=>{const e=t.number;if(e===1)switch(t.unit){case ie.Year:return"1 year";case ie.Month:return"1 month";case ie.Week:return"1 week";case ie.Day:return"1 day"}else return`${e} ${t.unit}s`},nt=t=>{const e=Ge(t);return e?jt(e):"unknown"},Vt=t=>{const e=Ge(t);return e?Jt(e):"unknown"};var rt=(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))(rt||{});const Wt=t=>({amount:t.amount,currency:t.currency,formattedPrice:Ye(t.amount,t.currency)}),it=t=>{const e=t.period_duration;return{periodDuration:e,period:e?Ge(e):null,cycleCount:t.cycle_count,price:t.price?Wt(t.price):null}},zt=t=>t.base==null?(G.debugLog("Missing base phase for subscription option. Ignoring."),null):{id:t.id,base:it(t.base),trial:t.trial?it(t.trial):null},Xt=(t,e)=>{const r={};if(Object.entries(t.subscription_options).forEach(([s,l])=>{const c=zt(l);c!=null&&(r[s]=c)}),Object.keys(r).length===0)return G.debugLog(`Product ${t.identifier} has no subscription options. Ignoring.`),null;const n=t.default_subscription_option_id,i=n&&n in r?r[n]:null;if(i==null)return G.debugLog(`Product ${t.identifier} has no default subscription option. Ignoring.`),null;const o=i.base.price;return o==null?(G.debugLog(`Product ${t.identifier} default option has no base price. Ignoring.`),null):{identifier:t.identifier,displayName:t.title,title:t.title,description:t.description,currentPrice:o,normalPeriodDuration:i.base.periodDuration,presentedOfferingIdentifier:e,defaultSubscriptionOption:i,subscriptionOptions:r}},Zt=(t,e,r)=>{const n=r[e.platform_product_identifier];if(n===void 0)return null;const i=Xt(n,t);return i===null?null:{identifier:e.identifier,rcBillingProduct:i,packageType:en(e.identifier)}},ot=(t,e)=>{const r=t.packages.map(i=>Zt(t.identifier,i,e)).filter(X),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 en(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 $(){}function tn(t,e){for(const r in e)t[r]=e[r];return t}function st(t){return t()}function lt(){return Object.create(null)}function ge(t){t.forEach(st)}function se(t){return typeof t=="function"}function T(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Be;function ne(t,e){return t===e?!0:(Be||(Be=document.createElement("a")),Be.href=e,t===Be.href)}function ct(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function nn(t,e){const r=ct(t.srcset),n=ct(e||"");return n.length===r.length&&n.every(([i,o],s)=>o===r[s][1]&&(ne(r[s][0],i)||ne(i,r[s][0])))}function rn(t){return Object.keys(t).length===0}function J(t,e,r,n){if(t){const i=at(t,e,r,n);return t[0](i)}}function at(t,e,r,n){return t[1]&&n?tn(r.ctx.slice(),t[1](n(e))):r.ctx}function V(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 W(t,e,r,n,i,o){if(i){const s=at(e,r,n,o);t.p(s,i)}}function z(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 pe(t){return t??""}function M(t,e){t.appendChild(e)}function F(t,e,r){const n=on(t);if(!n.getElementById(e)){const i=k("style");i.id=e,i.textContent=r,sn(n,i)}}function on(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function sn(t,e){return M(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 O(t){return document.createTextNode(t)}function C(){return O(" ")}function re(){return O("")}function _e(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function ut(t){return function(e){return e.preventDefault(),t.call(this,e)}}function _(t,e,r){r==null?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}const ln=["width","height"];function cn(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&&ln.indexOf(n)===-1?t[n]=e[n]:_(t,n,e[n])}function an(t,e){Object.keys(e).forEach(r=>{un(t,r,e[r])})}function un(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:_(t,e,r)}function fn(t){return/-/.test(t)?an:cn}function dn(t){return Array.from(t.childNodes)}function le(t,e){e=""+e,t.data!==e&&(t.data=e)}function ft(t,e){t.value=e??""}function mn(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}let Ae;function he(t){Ae=t}function De(){if(!Ae)throw new Error("Function called outside component initialization");return Ae}function Me(t){De().$$.on_mount.push(t)}function gn(){const t=De();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=mn(e,r,{cancelable:n});return i.slice().forEach(s=>{s.call(t,o)}),!o.defaultPrevented}return!0}}function pn(t,e){return De().$$.context.set(t,e),e}function _n(t){return De().$$.context.get(t)}function dt(t,e){const r=t.$$.callbacks[e.type];r&&r.slice().forEach(n=>n.call(this,e))}const ce=[],Pe=[];let ae=[];const He=[],An=Promise.resolve();let Ke=!1;function hn(){Ke||(Ke=!0,An.then(mt))}function qe(t){ae.push(t)}function En(t){He.push(t)}const je=new Set;let ue=0;function mt(){if(ue!==0)return;const t=Ae;do{try{for(;ue<ce.length;){const e=ce[ue];ue++,he(e),bn(e.$$)}}catch(e){throw ce.length=0,ue=0,e}for(he(null),ce.length=0,ue=0;Pe.length;)Pe.pop()();for(let e=0;e<ae.length;e+=1){const r=ae[e];je.has(r)||(je.add(r),r())}ae.length=0}while(ce.length);for(;He.length;)He.pop()();Ke=!1,je.clear(),he(t)}function bn(t){if(t.fragment!==null){t.update(),ge(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(qe)}}function In(t){const e=[],r=[];ae.forEach(n=>t.indexOf(n)===-1?e.push(n):r.push(n)),r.forEach(n=>n()),ae=e}const Ce=new Set;let oe;function K(){oe={r:0,c:[],p:oe}}function q(){oe.r||ge(oe.c),oe=oe.p}function f(t,e){t&&t.i&&(Ce.delete(t),t.i(e))}function m(t,e,r,n){if(t&&t.o){if(Ce.has(t))return;Ce.add(t),oe.c.push(()=>{Ce.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}function wn(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 b(t,e,r){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,r),qe(()=>{const o=t.$$.on_mount.map(st).filter(se);t.$$.on_destroy?t.$$.on_destroy.push(...o):ge(o),t.$$.on_mount=[]}),i.forEach(qe)}function I(t,e){const r=t.$$;r.fragment!==null&&(In(r.after_update),ge(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function kn(t,e){t.$$.dirty[0]===-1&&(ce.push(t),hn(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function N(t,e,r,n,i,o,s=null,l=[-1]){const c=Ae;he(t);const a=t.$$={fragment:null,ctx:[],props:o,update:$,not_equal:i,bound:lt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:lt(),dirty:l,skip_bound:!1,root:e.target||c.$$.root};s&&s(a.root);let u=!1;if(a.ctx=r?r(t,e.props||{},(d,h,...v)=>{const E=v.length?v[0]:h;return a.ctx&&i(a.ctx[d],a.ctx[d]=E)&&(!a.skip_bound&&a.bound[d]&&a.bound[d](E),u&&kn(t,d)),h}):[],a.update(),u=!0,ge(a.before_update),a.fragment=n?n(a.ctx):!1,e.target){if(e.hydrate){const d=dn(e.target);a.fragment&&a.fragment.l(d),d.forEach(g)}else a.fragment&&a.fragment.c();e.intro&&f(t.$$.fragment),b(t,e.target,e.anchor),mt()}he(c)}class U{constructor(){Q(this,"$$");Q(this,"$$set")}$destroy(){I(this,1),this.$destroy=$}$on(e,r){if(!se(r))return $;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&&!rn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const $n="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add($n);function vn(t){F(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 Je(t){let e,r;const n=t[2].default,i=J(n,t,t[1],null);return{c(){e=k(t[0]),i&&i.c(),fn(t[0])(e,{class:pe("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)&&W(i,n,o,o[1],r?V(n,o[1],s,null):z(o[1]),null)},i(o){r||(f(i,o),r=!0)},o(o){m(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function yn(t){let e=t[0],r,n,i=t[0]&&Je(t);return{c(){i&&i.c(),r=re()},m(o,s){i&&i.m(o,s),p(o,r,s),n=!0},p(o,[s]){o[0]?e?T(e,o[0])?(i.d(1),i=Je(o),e=o[0],i.c(),i.m(r.parentNode,r)):i.p(o,s):(i=Je(o),e=o[0],i.c(),i.m(r.parentNode,r)):e&&(i.d(1),i=null,e=o[0])},i(o){n||(f(i,o),n=!0)},o(o){m(i,o),n=!1},d(o){o&&g(r),i&&i.d(o)}}}function Bn(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(),N(this,e,Bn,yn,T,{as:0},vn)}}function Dn(t){F(t,"svelte-gf0gr5",".rcb-pricing-info.svelte-gf0gr5{display:flex;flex-direction:column;margin-top:102px;font-weight:500}.rcb-product-price.svelte-gf0gr5{font-size:24px;margin:12px 0px}.rcb-product-price-after-trial.svelte-gf0gr5{margin-bottom:12px}.rcb-product-details.svelte-gf0gr5{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-gf0gr5{margin-top:48px}}")}function Mn(t){let e=Vt(t[1].periodDuration)+"",r,n;return{c(){r=O(e),n=O(" free trial")},m(i,o){p(i,r,o),p(i,n,o)},p:$,d(i){i&&(g(r),g(n))}}}function Pn(t){let e=(t[2].currency||"")+"",r,n,i=Ye(t[2].amount,t[2].currency)+"",o;return{c(){r=O(e),n=C(),o=O(i)},m(s,l){p(s,r,l),p(s,n,l),p(s,o,l)},p:$,d(s){s&&(g(r),g(n),g(o))}}}function Cn(t){let e;return{c(){e=k("span"),e.textContent=`${t[1]&&t[2]&&`${t[2].currency} ${Ye(t[2].amount,t[2].currency)} after end of trial`}`,_(e,"class","rcb-product-price-after-trial svelte-gf0gr5")},m(r,n){p(r,e,n)},p:$,d(r){r&&g(e)}}}function gt(t){let e,r,n=nt(t[0].normalPeriodDuration)+"",i;return{c(){e=k("li"),r=O("Renews "),i=O(n)},m(o,s){p(o,e,s),M(e,r),M(e,i)},p(o,s){s&1&&n!==(n=nt(o[0].normalPeriodDuration)+"")&&le(i,n)},d(o){o&&g(e)}}}function Qn(t){var P,Le;let e,r,n=t[0].displayName+"",i,o,s,l,c,a,u,d,h,v,E,B=((P=t[1])==null?void 0:P.periodDuration)&&Mn(t),A=!((Le=t[1])!=null&&Le.periodDuration)&&t[2]&&Pn(t),y=t[1]&&t[2]&&Cn(t),R=t[0].normalPeriodDuration&&gt(t);return{c(){e=k("div"),r=k("span"),i=O(n),o=C(),s=k("span"),B&&B.c(),l=C(),A&&A.c(),c=C(),y&&y.c(),a=C(),u=k("ul"),R&&R.c(),d=C(),h=k("li"),h.textContent="Continues until canceled",v=C(),E=k("li"),E.textContent="Cancel anytime",_(s,"class","rcb-product-price svelte-gf0gr5"),_(u,"class","rcb-product-details svelte-gf0gr5"),_(e,"class","rcb-pricing-info svelte-gf0gr5")},m(Y,S){p(Y,e,S),M(e,r),M(r,i),M(e,o),M(e,s),B&&B.m(s,null),M(s,l),A&&A.m(s,null),M(e,c),y&&y.m(e,null),M(e,a),M(e,u),R&&R.m(u,null),M(u,d),M(u,h),M(u,v),M(u,E)},p(Y,S){var Fe,xe;S&1&&n!==(n=Y[0].displayName+"")&&le(i,n),(Fe=Y[1])!=null&&Fe.periodDuration&&B.p(Y,S),!((xe=Y[1])!=null&&xe.periodDuration)&&Y[2]&&A.p(Y,S),Y[1]&&Y[2]&&y.p(Y,S),Y[0].normalPeriodDuration?R?R.p(Y,S):(R=gt(Y),R.c(),R.m(u,d)):R&&(R.d(1),R=null)},d(Y){Y&&g(e),B&&B.d(),A&&A.d(),y&&y.d(),R&&R.d()}}}function Tn(t){let e,r;return e=new fe({props:{$$slots:{default:[Qn]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&33&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Nn(t,e,r){var c;let{productDetails:n}=e,{purchaseOption:i}=e;const o=i,s=o==null?void 0:o.trial,l=(c=o==null?void 0:o.base)==null?void 0:c.price;return t.$$set=a=>{"productDetails"in a&&r(0,n=a.productDetails),"purchaseOption"in a&&r(3,i=a.purchaseOption)},[n,s,l,i]}class pt extends U{constructor(e){super(),N(this,e,Nn,Tn,T,{productDetails:0,purchaseOption:3},Dn)}}const Un="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+rJryqvxGhxxGNLjkVcwMCCN6ZeLkNevDCcRYYKJJfZptyCQwdiijl0CDxdlLPryw2lymY9WzTs17ijV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MGQwqXPggwsKBTLQshPDgYYAaD1owdPjQB4QIThRGgGAxwIYIIBQ2LMlkJBCDFEsGOPEgA5aCK0tKmQChRkGEMgPIiDDhoRYjTR56CPGwiooXN6oENQikhYsWP65MJXglx4sVMoZsJdikRosWOMYSRPJih9q3cOPKnWuRSxa7eO9O3cJFCxe+frdMDQgAIfkEBQUAAQAsBQADACAAEAAACKYAAwgcSLAgwQcODCpcyNDAAYYQAzhpaIDhFYY+NOBY6HAhkyETFRLZ0CGKQgMVDV4RAoQKQxMdUpx8aJAJECYQnWzYcMQgSoNVgAy5CHGGhhI+aRIkMgRnxCohNvQoiLDgEyFDskQUuINDiK1Hfpgc+ETKQi0nVGxNkkSrwCw/hiBxu7XuFidAhARpgqWu3yxIhgApEtLvVipIgARBYthvlKaNFQYEADs=";function Rn(t){let e,r;return{c(){e=k("img"),ne(e.src,r=Un)||_(e,"src",r),_(e,"alt","spinner")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class Sn extends U{constructor(e){super(),N(this,e,null,Rn,T,{})}}function On(t){F(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 Ln(t){let e,r,n;return r=new Sn({}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-modal-loader svelte-1mxx341")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p:$,i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}class Ve extends U{constructor(e){super(),N(this,e,null,Ln,T,{},On)}}var te=(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))(te||{});class Ee{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:case 7814:return 4;case 7772:return 6;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 _t?e:null}static convertPurchaseFlowErrorCodeToErrorCode(e){switch(e){case L.ErrorSettingUpPurchase:return 2;case L.ErrorChargingPayment:return 20;case L.NetworkError:return 10;case L.MissingEmailError:return 4;case L.StripeError:return 2;case L.UnknownError:return 0;case L.AlreadySubscribedError:return 6}}}var _t=(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[t.BackendAlreadySubscribedError=7772]="BackendAlreadySubscribedError",t[t.BackendOfferNotFound=7814]="BackendOfferNotFound",t))(_t||{});class Z extends Error{constructor(r,n,i){super(n);Q(this,"toString",()=>`PurchasesError(code: ${te[this.errorCode]}, message: ${this.message})`);this.errorCode=r,this.underlyingErrorMessage=i}static getForBackendError(r,n){const i=Ee.getErrorCodeForBackendErrorCode(r);return new Z(i,Ee.getPublicMessage(i),n)}static getForPurchasesFlowError(r){return new Z(Ee.convertPurchaseFlowErrorCodeToErrorCode(r.errorCode),r.message,r.underlyingErrorMessage)}}class At extends Error{constructor(){super("Purchases must be configured before calling getInstance")}}var be=(t=>(t.Started="started",t.InProgress="in_progress",t.Succeeded="succeeded",t.Failed="failed",t))(be||{}),Qe=(t=>(t[t.SetupIntentCreationFailed=1]="SetupIntentCreationFailed",t[t.PaymentMethodCreationFailed=2]="PaymentMethodCreationFailed",t[t.PaymentChargeFailed=3]="PaymentChargeFailed",t))(Qe||{}),L=(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[t.AlreadySubscribedError=6]="AlreadySubscribedError",t))(L||{});class j extends Error{constructor(e,r,n){super(r),this.errorCode=e,this.underlyingErrorMessage=n}static fromPurchasesError(e,r){let n;return e.errorCode===te.ProductAlreadyPurchasedError?n=6:n=r,new j(n,e.message,e.underlyingErrorMessage)}}class Fn{constructor(e,r=10){Q(this,"operationSessionId",null);Q(this,"backend");Q(this,"maxNumberAttempts");Q(this,"waitMSBetweenAttempts",1e3);this.backend=e,this.maxNumberAttempts=r}async startPurchase(e,r,n,i,o){try{const s=await this.backend.postSubscribe(e,r,i,o,n==null?void 0:n.id);return this.operationSessionId=s.operation_session_id,s}catch(s){if(s instanceof Z)throw j.fromPurchasesError(s,0);{const l="Unknown error starting purchase: "+String(s);throw G.errorLog(l),new j(2,l)}}}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=>{const l=j.fromPurchasesError(s,3);n(l)})};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 Qe.SetupIntentCreationFailed:r(new j(0,"Setup intent creation failed"));return;case Qe.PaymentMethodCreationFailed:r(new j(0,"Payment method creation failed"));return;case Qe.PaymentChargeFailed:r(new j(1,"Payment charge failed"));return}}}const xn="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 Gn(t){F(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Yn(t){let e,r;return{c(){e=k("img"),ne(e.src,r=xn)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class Hn extends U{constructor(e){super(),N(this,e,null,Yn,T,{},Gn)}}function Kn(t){F(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 qn(t){let e,r,n,i,o;const s=t[3].default,l=J(s,t,t[2],null);return{c(){e=k("button"),l&&l.c(),_(e,"class",r=pe(`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)&&W(l,s,c,c[2],n?V(s,c[2],a,null):z(c[2]),null),(!n||a&1&&r!==(r=pe(`intent-${c[0]}`)+" svelte-1rmxk7q"))&&_(e,"class",r),(!n||a&2)&&(e.disabled=c[1])},i(c){n||(f(l,c),n=!0)},o(c){m(l,c),n=!1},d(c){c&&g(e),l&&l.d(c),i=!1,o()}}}function jn(t,e,r){let{$$slots:n={},$$scope:i}=e,{intent:o="primary"}=e,{disabled:s=!1}=e;function l(c){dt.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 Ie extends U{constructor(e){super(),N(this,e,jn,qn,T,{intent:0,disabled:1},Kn)}}function Jn(t){F(t,"svelte-1f9z0o8","footer.svelte-1f9z0o8{display:flex;flex-direction:column}")}function Vn(t){let e,r;const n=t[1].default,i=J(n,t,t[0],null);return{c(){e=k("footer"),i&&i.c(),_(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)&&W(i,n,o,o[0],r?V(n,o[0],s,null):z(o[0]),null)},i(o){r||(f(i,o),r=!0)},o(o){m(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function Wn(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class We extends U{constructor(e){super(),N(this,e,Wn,Vn,T,{},Jn)}}function zn(t){F(t,"svelte-6o8e90",'.column.svelte-6o8e90{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "8px");flex-grow:1}')}function Xn(t){let e,r,n;const i=t[2].default,o=J(i,t,t[1],null);return{c(){e=k("div"),o&&o.c(),_(e,"class","column svelte-6o8e90"),_(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)&&W(o,i,s,s[1],n?V(i,s[1],l,null):z(s[1]),null),(!n||l&1&&r!==(r=`--gap:${s[0]};`))&&_(e,"style",r)},i(s){n||(f(o,s),n=!0)},o(s){m(o,s),n=!1},d(s){s&&g(e),o&&o.d(s)}}}function Zn(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 we extends U{constructor(e){super(),N(this,e,Zn,Xn,T,{gutter:0},zn)}}const er="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 tr(t){F(t,"svelte-14xreta",".close-button.svelte-14xreta{border:none;cursor:pointer;background-color:transparent;padding:0px}")}function nr(t){let e,r,n,i,o;return{c(){e=k("button"),r=k("img"),ne(r.src,n=er)||_(r,"src",n),_(r,"alt","close"),_(e,"class","close-button svelte-14xreta"),e.disabled=t[0]},m(s,l){p(s,e,l),M(e,r),i||(o=_e(e,"click",t[1]),i=!0)},p(s,[l]){l&1&&(e.disabled=s[0])},i:$,o:$,d(s){s&&g(e),i=!1,o()}}}function rr(t,e,r){let{disabled:n=!1}=e;function i(o){dt.call(this,t,o)}return t.$$set=o=>{"disabled"in o&&r(0,n=o.disabled)},[n,i]}class ir extends U{constructor(e){super(),N(this,e,rr,nr,T,{disabled:0},tr)}}function or(t){F(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 sr(t){let e;return{c(){e=k("div"),_(e,"class","rcb-app-icon loading svelte-44qpq9")},m(r,n){p(r,e,n)},p:$,d(r){r&&g(e)}}}function lr(t){let e,r,n,i,o,s;return{c(){e=k("picture"),r=k("source"),i=C(),o=k("img"),_(r,"type","image/webp"),nn(r,n=t[1])||_(r,"srcset",n),_(o,"class","rcb-app-icon svelte-44qpq9"),ne(o.src,s=t[0])||_(o,"src",s),_(o,"alt","App icon"),_(e,"class","rcb-app-icon-picture-container svelte-44qpq9")},m(l,c){p(l,e,c),M(e,r),M(e,i),M(e,o)},p(l,c){c&2&&n!==(n=l[1])&&_(r,"srcset",n),c&1&&!ne(o.src,s=l[0])&&_(o,"src",s)},d(l){l&&g(e)}}}function cr(t){let e;function r(o,s){return o[0]!==null?lr:sr}let n=r(t),i=n(t);return{c(){i.c(),e=re()},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:$,o:$,d(o){o&&g(e),i.d(o)}}}function ar(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 ht extends U{constructor(e){super(),N(this,e,ar,cr,T,{src:0,srcWebp:1},or)}}const Te=t=>`https://da08ctfrofx1b.cloudfront.net/${t}`;function ur(t){F(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 fr(t){let e,r;return e=new ht({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:$,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function dr(t){let e,r,n=t[0].seller_company_name+"",i,o,s=t[0].app_icon_webp!==null&&t[0].app_icon!==null&&Et(t);return{c(){s&&s.c(),e=C(),r=k("span"),i=O(n),_(r,"class","app-title svelte-10uf5fq")},m(l,c){s&&s.m(l,c),p(l,e,c),p(l,r,c),M(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&&f(s,1)):(s=Et(l),s.c(),f(s,1),s.m(e.parentNode,e)):s&&(K(),m(s,1,1,()=>{s=null}),q()),(!o||c&1)&&n!==(n=l[0].seller_company_name+"")&&le(i,n)},i(l){o||(f(s),o=!0)},o(l){m(s),o=!1},d(l){l&&(g(e),g(r)),s&&s.d(l)}}}function Et(t){let e,r;return e=new ht({props:{src:Te(t[0].app_icon),srcWebp:Te(t[0].app_icon_webp)}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.src=Te(n[0].app_icon)),i&1&&(o.srcWebp=Te(n[0].app_icon_webp)),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function mr(t){let e,r,n,i;const o=[dr,fr],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(),_(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 u=r;r=l(c),r===u?s[r].p(c,a):(K(),m(s[u],1,1,()=>{s[u]=null}),q(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),f(n,1),n.m(e,null))},i(c){i||(f(n),i=!0)},o(c){m(n),i=!1},d(c){c&&g(e),s[r].d()}}}function gr(t,e,r){let{brandingInfo:n=null}=e;return t.$$set=i=>{"brandingInfo"in i&&r(0,n=i.brandingInfo)},[n]}class bt extends U{constructor(e){super(),N(this,e,gr,mr,T,{brandingInfo:0},ur)}}function pr(t){F(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 _r(t){let e,r,n,i,o;return r=new bt({props:{brandingInfo:t[0]}}),i=new ir({}),i.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){e=k("div"),w(r.$$.fragment),n=C(),w(i.$$.fragment),_(e,"class","rcb-post-purchase-header-layout svelte-17puakv")},m(s,l){p(s,e,l),b(r,e,null),M(e,n),b(i,e,null),o=!0},p(s,l){t=s;const c={};l&1&&(c.brandingInfo=t[0]),r.$set(c)},i(s){o||(f(r.$$.fragment,s),f(i.$$.fragment,s),o=!0)},o(s){m(r.$$.fragment,s),m(i.$$.fragment,s),o=!1},d(s){s&&g(e),I(r),I(i)}}}function Ar(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[_r]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&7&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function hr(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 Er extends U{constructor(e){super(),N(this,e,hr,Ar,T,{brandingInfo:0,onClose:1},pr)}}function br(t){F(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 Ir=t=>({}),It=t=>({});function wr(t){let e,r,n,i,o;const s=t[4].default,l=J(s,t,t[5],null);return{c(){e=k("span"),r=O(t[2]),n=C(),i=k("span"),l&&l.c(),_(e,"class","title svelte-10pcqja"),_(i,"class","subtitle svelte-10pcqja")},m(c,a){p(c,e,a),M(e,r),p(c,n,a),p(c,i,a),l&&l.m(i,null),o=!0},p(c,a){(!o||a&4)&&le(r,c[2]),l&&l.p&&(!o||a&32)&&W(l,s,c,c[5],o?V(s,c[5],a,null):z(c[5]),null)},i(c){o||(f(l,c),o=!0)},o(c){m(l,c),o=!1},d(c){c&&(g(e),g(n),g(i)),l&&l.d(c)}}}function kr(t){let e,r,n;const i=t[4].icon,o=J(i,t,t[5],It);return r=new we({props:{gutter:"16px",$$slots:{default:[wr]},$$scope:{ctx:t}}}),{c(){o&&o.c(),e=C(),w(r.$$.fragment)},m(s,l){o&&o.m(s,l),p(s,e,l),b(r,s,l),n=!0},p(s,l){o&&o.p&&(!n||l&32)&&W(o,i,s,s[5],n?V(i,s[5],l,Ir):z(s[5]),It);const c={};l&36&&(c.$$scope={dirty:l,ctx:s}),r.$set(c)},i(s){n||(f(o,s),f(r.$$.fragment,s),n=!0)},o(s){m(o,s),m(r.$$.fragment,s),n=!1},d(s){s&&g(e),o&&o.d(s),I(r,s)}}}function $r(t){let e,r,n;return r=new we({props:{gutter:"16px",$$slots:{default:[kr]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-modal-message svelte-10pcqja"),_(e,"data-type",t[3])},m(i,o){p(i,e,o),b(r,e,null),n=!0},p(i,o){const s={};o&36&&(s.$$scope={dirty:o,ctx:i}),r.$set(s),(!n||o&8)&&_(e,"data-type",i[3])},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}function vr(t){let e;return{c(){e=O("Go back to app")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function yr(t){let e,r;return e=new Ie({props:{$$slots:{default:[vr]},$$scope:{ctx:t}}}),e.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment)},m(n,i){b(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||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Br(t){let e,r,n,i,o,s;return e=new Er({props:{brandingInfo:t[0],onClose:t[1]}}),n=new fe({props:{$$slots:{default:[$r]},$$scope:{ctx:t}}}),o=new We({props:{$$slots:{default:[yr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=C(),w(n.$$.fragment),i=C(),w(o.$$.fragment)},m(l,c){b(e,l,c),p(l,r,c),b(n,l,c),p(l,i,c),b(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 u={};c&44&&(u.$$scope={dirty:c,ctx:l}),n.$set(u);const d={};c&34&&(d.$$scope={dirty:c,ctx:l}),o.$set(d)},i(l){s||(f(e.$$.fragment,l),f(n.$$.fragment,l),f(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(n.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(g(r),g(i)),I(e,l),I(n,l),I(o,l)}}}function Dr(t){let e,r;return e=new we({props:{gutter:"32px",$$slots:{default:[Br]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&47&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Mr(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 wt extends U{constructor(e){super(),N(this,e,Mr,Dr,T,{brandingInfo:0,onContinue:1,title:2,type:3},br)}}function kt(t){let e,r,n,i,o;return{c(){e=O("If this error persists, please contact "),r=k("a"),n=O(t[1]),o=O("."),_(r,"href",i="mailto:"+t[1])},m(s,l){p(s,e,l),p(s,r,l),M(r,n),p(s,o,l)},p(s,l){l&2&&le(n,s[1]),l&2&&i!==(i="mailto:"+s[1])&&_(r,"href",i)},d(s){s&&(g(e),g(r),g(o))}}}function Pr(t){let e=t[3]()+"",r,n,i,o=t[1]&&kt(t);return{c(){r=O(e),n=C(),o&&o.c(),i=re()},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=kt(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 Cr(t){let e,r;return e=new Hn({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:$,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Qr(t){let e,r;return e=new wt({props:{title:t[4](),brandingInfo:t[0],onContinue:t[2],type:"error",$$slots:{icon:[Cr],default:[Pr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&4&&(o.onContinue=n[2]),i&66&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Tr(t,e,r){let{brandingInfo:n=null}=e,{lastError:i}=e,{supportEmail:o=null}=e,{onContinue:s}=e;Me(()=>{G.errorLog(`Displayed error: ${L[i.errorCode]}. Message: ${i.message??"None"}. Underlying error: ${i.underlyingErrorMessage??"None"}`)});function l(){switch(i.errorCode){case L.UnknownError:return"An unknown error occurred.";case L.ErrorSettingUpPurchase:return"Purchase not started due to an error.";case L.ErrorChargingPayment:return"Payment failed.";case L.NetworkError:return"Network error. Please check your internet connection.";case L.StripeError:return i.message;case L.MissingEmailError:return"Email is required to complete the purchase.";case L.AlreadySubscribedError:return"You are already subscribed to this product."}return i.message}function c(){switch(i.errorCode){case L.AlreadySubscribedError:return"Already subscribed";default:return"Something went wrong"}}return t.$$set=a=>{"brandingInfo"in a&&r(0,n=a.brandingInfo),"lastError"in a&&r(5,i=a.lastError),"supportEmail"in a&&r(1,o=a.supportEmail),"onContinue"in a&&r(2,s=a.onContinue)},[n,o,s,l,c,i]}class Nr extends U{constructor(e){super(),N(this,e,Tr,Qr,T,{brandingInfo:0,lastError:5,supportEmail:1,onContinue:2})}}const Ur="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 Rr(t){F(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Sr(t){let e,r;return{c(){e=k("img"),ne(e.src,r=Ur)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class Or extends U{constructor(e){super(),N(this,e,null,Sr,T,{},Rr)}}function Lr(t){let e;return{c(){e=O("Your plan is now active.")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function Fr(t){let e,r;return e=new Or({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:$,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function xr(t){let e,r;return e=new wt({props:{type:"success",title:"Purchase successful",brandingInfo:t[0],onContinue:t[1],$$slots:{icon:[Fr],default:[Lr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(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||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Gr(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 Yr extends U{constructor(e){super(),N(this,e,Gr,xr,T,{brandingInfo:0,onContinue:1})}}function Hr(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 Kr=typeof window>"u";function qr(t){if(!Kr)return t.registerAppInfo({name:"svelte-stripe-js",url:"https://svelte-stripe-js.vercel.app"})}function jr(t){let e;return{c(){e=k("div")},m(r,n){p(r,e,n),t[6](e)},p:$,i:$,o:$,d(r){r&&g(e),t[6](null)}}}function Jr(t,e,r){let n,i;const o=gn(),{elements:s}=_n("stripe");let{options:l=void 0}=e;Me(()=>(n=Hr(i,"payment",s,o,l),()=>n.destroy()));function c(){n.blur()}function a(){n.clear()}function u(){n.destroy()}function d(){n.focus()}function h(v){Pe[v?"unshift":"push"](()=>{i=v,r(0,i)})}return t.$$set=v=>{"options"in v&&r(1,l=v.options)},[i,l,c,a,u,d,h]}class Vr extends U{constructor(e){super(),N(this,e,Jr,jr,T,{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 $t(t){let e;const r=t[15].default,n=J(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)&&W(n,r,i,i[14],e?V(r,i[14],o,null):z(i[14]),null)},i(i){e||(f(n,i),e=!0)},o(i){m(n,i),e=!1},d(i){n&&n.d(i)}}}function Wr(t){let e,r,n=t[1]&&t[0]&&$t(t);return{c(){n&&n.c(),e=re()},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&&f(n,1)):(n=$t(i),n.c(),f(n,1),n.m(e.parentNode,e)):n&&(K(),m(n,1,1,()=>{n=null}),q())},i(i){r||(f(n),r=!0)},o(i){m(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function zr(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:u={}}=e,{labels:d="above"}=e,{loader:h="auto"}=e,{fonts:v=[]}=e,{locale:E="auto"}=e,{currency:B=void 0}=e,{amount:A=void 0}=e,{clientSecret:y=void 0}=e,{elements:R=null}=e;return t.$$set=P=>{"stripe"in P&&r(1,s=P.stripe),"mode"in P&&r(2,l=P.mode),"theme"in P&&r(3,c=P.theme),"variables"in P&&r(4,a=P.variables),"rules"in P&&r(5,u=P.rules),"labels"in P&&r(6,d=P.labels),"loader"in P&&r(7,h=P.loader),"fonts"in P&&r(8,v=P.fonts),"locale"in P&&r(9,E=P.locale),"currency"in P&&r(10,B=P.currency),"amount"in P&&r(11,A=P.amount),"clientSecret"in P&&r(12,y=P.clientSecret),"elements"in P&&r(0,R=P.elements),"$$scope"in P&&r(14,o=P.$$scope)},t.$$.update=()=>{t.$$.dirty&120&&r(13,n={theme:c,variables:a,rules:u,labels:d}),t.$$.dirty&16263&&s&&!R&&(r(0,R=s.elements({mode:l,currency:B,amount:A,appearance:n,clientSecret:y,fonts:v,loader:h,locale:E})),qr(s),pn("stripe",{stripe:s,elements:R})),t.$$.dirty&8705&&R&&R.update({appearance:n,locale:E})},[R,s,l,c,a,u,d,h,v,E,B,A,y,n,o,i]}class Xr extends U{constructor(e){super(),N(this,e,zr,Wr,T,{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 vt="https://js.stripe.com/v3",Zr=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,yt="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",ei=function(){for(var e=document.querySelectorAll('script[src^="'.concat(vt,'"]')),r=0;r<e.length;r++){var n=e[r];if(Zr.test(n.src))return n}return null},Bt=function(e){var r=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(vt).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},ti=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"2.4.0",startTime:r})},ke=null,Ne=null,Ue=null,ni=function(e){return function(){e(new Error("Failed to load Stripe.js"))}},ri=function(e,r){return function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))}},ii=function(e){return ke!==null?ke:(ke=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&e&&console.warn(yt),window.Stripe){r(window.Stripe);return}try{var i=ei();if(i&&e)console.warn(yt);else if(!i)i=Bt(e);else if(i&&Ue!==null&&Ne!==null){var o;i.removeEventListener("load",Ue),i.removeEventListener("error",Ne),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=Bt(e)}Ue=ri(r,n),Ne=ni(n),i.addEventListener("load",Ue),i.addEventListener("error",Ne)}catch(s){n(s);return}}),ke.catch(function(r){return ke=null,Promise.reject(r)}))},oi=function(e,r,n){if(e===null)return null;var i=e.apply(void 0,r);return ti(i,n),i},$e,Dt=!1,Mt=function(){return $e||($e=ii(null).catch(function(e){return $e=null,Promise.reject(e)}),$e)};Promise.resolve().then(function(){return Mt()}).catch(function(t){Dt||console.warn(t)});var si=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];Dt=!0;var i=Date.now();return Mt().then(function(o){return oi(o,r,i)})};function li(t){F(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 ci(t){let e,r;const n=t[0].default,i=J(n,t,t[1],null);return{c(){e=k("div"),i&&i.c(),_(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)&&W(i,n,o,o[1],r?V(n,o[1],s,null):z(o[1]),null)},i(o){r||(f(i,o),r=!0)},o(o){m(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function ai(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[ci]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&2&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function ui(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(1,i=o.$$scope)},[n,i]}class ze extends U{constructor(e){super(),N(this,e,ui,ai,T,{},li)}}const fi="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 di(t){let e,r;return{c(){e=k("img"),ne(e.src,r=fi)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class mi extends U{constructor(e){super(),N(this,e,null,di,T,{})}}const ve={error:"#f2545b",warning:"#f4e971",focus:"#000080","grey-text-dark":"#000000","grey-text-light":"#767676","grey-ui-dark":"#dfdfdf",white:"#ffffff"};function gi(t){F(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(H,X){typeof exports=="object"&&typeof module<"u"?X(exports):typeof define=="function"&&define.amd?define(["exports"],X):(H=typeof globalThis<"u"?globalThis:H||self,X(H.Purchases={}))})(this,function(H){"use strict";var Xo=Object.defineProperty;var Zo=(H,X,x)=>X in H?Xo(H,X,{enumerable:!0,configurable:!0,writable:!0,value:x}):H[X]=x;var Q=(H,X,x)=>(Zo(H,typeof X!="symbol"?X+"":X,x),x);function X(t){return t!=null}var x=(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))(x||{});class Y{static setLogLevel(e){this.logLevel=e}static log(e,r=this.logLevel){const n=`[Purchases] ${e}`;if(!(this.logLevel<r||r===x.Silent))switch(r){case x.Error:console.error(n);break;case x.Warn:console.warn(n);break;case x.Info:console.info(n);break;case x.Debug:console.debug(n);break;case x.Verbose:console.debug(n);break}}static errorLog(e){this.log(e,x.Error)}static warnLog(e){this.log(e,x.Warn)}static infoLog(e){this.log(e,x.Info)}static debugLog(e){this.log(e,x.Debug)}static verboseLog(e){this.log(e,x.Verbose)}}Q(Y,"logLevel",x.Silent);var ie=(t=>(t.Year="year",t.Month="month",t.Week="week",t.Day="day",t))(ie||{});function Ge(t){const e=t.match(/^PT?([0-9]+)([MDYW])$/);if(!e||e.length<3)return Y.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 Y.errorLog(`Invalid ISO 8601 unit duration format: ${t}`),null}}const Ye=(t,e)=>{const r=t/100;return new Intl.NumberFormat("en-US",{style:"currency",currency:e}).format(r)},jt=t=>{const e=t.number;if(e===1)switch(t.unit){case ie.Year:return"yearly";case ie.Month:return"monthly";case ie.Week:return"weekly";case ie.Day:return"daily"}else return`every ${e} ${t.unit}s`},Jt=t=>{const e=t.number;if(e===1)switch(t.unit){case ie.Year:return"1 year";case ie.Month:return"1 month";case ie.Week:return"1 week";case ie.Day:return"1 day"}else return`${e} ${t.unit}s`},nt=t=>{const e=Ge(t);return e?jt(e):"unknown"},Vt=t=>{const e=Ge(t);return e?Jt(e):"unknown"};var rt=(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))(rt||{});const Wt=t=>({amount:t.amount,currency:t.currency,formattedPrice:Ye(t.amount,t.currency)}),it=t=>{const e=t.period_duration;return{periodDuration:e,period:e?Ge(e):null,cycleCount:t.cycle_count,price:t.price?Wt(t.price):null}},zt=t=>t.base==null?(Y.debugLog("Missing base phase for subscription option. Ignoring."),null):{id:t.id,base:it(t.base),trial:t.trial?it(t.trial):null},Xt=(t,e)=>{const r={};if(Object.entries(t.subscription_options).forEach(([s,l])=>{const c=zt(l);c!=null&&(r[s]=c)}),Object.keys(r).length===0)return Y.debugLog(`Product ${t.identifier} has no subscription options. Ignoring.`),null;const n=t.default_subscription_option_id,i=n&&n in r?r[n]:null;if(i==null)return Y.debugLog(`Product ${t.identifier} has no default subscription option. Ignoring.`),null;const o=i.base.price;return o==null?(Y.debugLog(`Product ${t.identifier} default option has no base price. Ignoring.`),null):{identifier:t.identifier,displayName:t.title,title:t.title,description:t.description,currentPrice:o,normalPeriodDuration:i.base.periodDuration,presentedOfferingIdentifier:e,defaultSubscriptionOption:i,subscriptionOptions:r}},Zt=(t,e,r)=>{const n=r[e.platform_product_identifier];if(n===void 0)return null;const i=Xt(n,t);return i===null?null:{identifier:e.identifier,rcBillingProduct:i,packageType:en(e.identifier)}},ot=(t,e)=>{const r=t.packages.map(i=>Zt(t.identifier,i,e)).filter(X),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 en(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 $(){}function tn(t,e){for(const r in e)t[r]=e[r];return t}function st(t){return t()}function lt(){return Object.create(null)}function ge(t){t.forEach(st)}function se(t){return typeof t=="function"}function T(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Be;function ne(t,e){return t===e?!0:(Be||(Be=document.createElement("a")),Be.href=e,t===Be.href)}function ct(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function nn(t,e){const r=ct(t.srcset),n=ct(e||"");return n.length===r.length&&n.every(([i,o],s)=>o===r[s][1]&&(ne(r[s][0],i)||ne(i,r[s][0])))}function rn(t){return Object.keys(t).length===0}function J(t,e,r,n){if(t){const i=at(t,e,r,n);return t[0](i)}}function at(t,e,r,n){return t[1]&&n?tn(r.ctx.slice(),t[1](n(e))):r.ctx}function V(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 W(t,e,r,n,i,o){if(i){const s=at(e,r,n,o);t.p(s,i)}}function z(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 pe(t){return t??""}function M(t,e){t.appendChild(e)}function F(t,e,r){const n=on(t);if(!n.getElementById(e)){const i=k("style");i.id=e,i.textContent=r,sn(n,i)}}function on(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function sn(t,e){return M(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 O(t){return document.createTextNode(t)}function C(){return O(" ")}function re(){return O("")}function _e(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function ut(t){return function(e){return e.preventDefault(),t.call(this,e)}}function _(t,e,r){r==null?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}const ln=["width","height"];function cn(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&&ln.indexOf(n)===-1?t[n]=e[n]:_(t,n,e[n])}function an(t,e){Object.keys(e).forEach(r=>{un(t,r,e[r])})}function un(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:_(t,e,r)}function fn(t){return/-/.test(t)?an:cn}function dn(t){return Array.from(t.childNodes)}function le(t,e){e=""+e,t.data!==e&&(t.data=e)}function ft(t,e){t.value=e??""}function mn(t,e,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:r,cancelable:n})}let Ae;function he(t){Ae=t}function De(){if(!Ae)throw new Error("Function called outside component initialization");return Ae}function Me(t){De().$$.on_mount.push(t)}function gn(){const t=De();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=mn(e,r,{cancelable:n});return i.slice().forEach(s=>{s.call(t,o)}),!o.defaultPrevented}return!0}}function pn(t,e){return De().$$.context.set(t,e),e}function _n(t){return De().$$.context.get(t)}function dt(t,e){const r=t.$$.callbacks[e.type];r&&r.slice().forEach(n=>n.call(this,e))}const ce=[],Pe=[];let ae=[];const He=[],An=Promise.resolve();let Ke=!1;function hn(){Ke||(Ke=!0,An.then(mt))}function qe(t){ae.push(t)}function En(t){He.push(t)}const je=new Set;let ue=0;function mt(){if(ue!==0)return;const t=Ae;do{try{for(;ue<ce.length;){const e=ce[ue];ue++,he(e),bn(e.$$)}}catch(e){throw ce.length=0,ue=0,e}for(he(null),ce.length=0,ue=0;Pe.length;)Pe.pop()();for(let e=0;e<ae.length;e+=1){const r=ae[e];je.has(r)||(je.add(r),r())}ae.length=0}while(ce.length);for(;He.length;)He.pop()();Ke=!1,je.clear(),he(t)}function bn(t){if(t.fragment!==null){t.update(),ge(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(qe)}}function In(t){const e=[],r=[];ae.forEach(n=>t.indexOf(n)===-1?e.push(n):r.push(n)),r.forEach(n=>n()),ae=e}const Ce=new Set;let oe;function K(){oe={r:0,c:[],p:oe}}function q(){oe.r||ge(oe.c),oe=oe.p}function f(t,e){t&&t.i&&(Ce.delete(t),t.i(e))}function m(t,e,r,n){if(t&&t.o){if(Ce.has(t))return;Ce.add(t),oe.c.push(()=>{Ce.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}function wn(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 b(t,e,r){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,r),qe(()=>{const o=t.$$.on_mount.map(st).filter(se);t.$$.on_destroy?t.$$.on_destroy.push(...o):ge(o),t.$$.on_mount=[]}),i.forEach(qe)}function I(t,e){const r=t.$$;r.fragment!==null&&(In(r.after_update),ge(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function kn(t,e){t.$$.dirty[0]===-1&&(ce.push(t),hn(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function N(t,e,r,n,i,o,s=null,l=[-1]){const c=Ae;he(t);const a=t.$$={fragment:null,ctx:[],props:o,update:$,not_equal:i,bound:lt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:lt(),dirty:l,skip_bound:!1,root:e.target||c.$$.root};s&&s(a.root);let u=!1;if(a.ctx=r?r(t,e.props||{},(d,h,...y)=>{const E=y.length?y[0]:h;return a.ctx&&i(a.ctx[d],a.ctx[d]=E)&&(!a.skip_bound&&a.bound[d]&&a.bound[d](E),u&&kn(t,d)),h}):[],a.update(),u=!0,ge(a.before_update),a.fragment=n?n(a.ctx):!1,e.target){if(e.hydrate){const d=dn(e.target);a.fragment&&a.fragment.l(d),d.forEach(g)}else a.fragment&&a.fragment.c();e.intro&&f(t.$$.fragment),b(t,e.target,e.anchor),mt()}he(c)}class U{constructor(){Q(this,"$$");Q(this,"$$set")}$destroy(){I(this,1),this.$destroy=$}$on(e,r){if(!se(r))return $;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&&!rn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const $n="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add($n);function yn(t){F(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 Je(t){let e,r;const n=t[2].default,i=J(n,t,t[1],null);return{c(){e=k(t[0]),i&&i.c(),fn(t[0])(e,{class:pe("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)&&W(i,n,o,o[1],r?V(n,o[1],s,null):z(o[1]),null)},i(o){r||(f(i,o),r=!0)},o(o){m(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function vn(t){let e=t[0],r,n,i=t[0]&&Je(t);return{c(){i&&i.c(),r=re()},m(o,s){i&&i.m(o,s),p(o,r,s),n=!0},p(o,[s]){o[0]?e?T(e,o[0])?(i.d(1),i=Je(o),e=o[0],i.c(),i.m(r.parentNode,r)):i.p(o,s):(i=Je(o),e=o[0],i.c(),i.m(r.parentNode,r)):e&&(i.d(1),i=null,e=o[0])},i(o){n||(f(i,o),n=!0)},o(o){m(i,o),n=!1},d(o){o&&g(r),i&&i.d(o)}}}function Bn(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(),N(this,e,Bn,vn,T,{as:0},yn)}}function Dn(t){F(t,"svelte-gf0gr5",".rcb-pricing-info.svelte-gf0gr5{display:flex;flex-direction:column;margin-top:102px;font-weight:500}.rcb-product-price.svelte-gf0gr5{font-size:24px;margin:12px 0px}.rcb-product-price-after-trial.svelte-gf0gr5{margin-bottom:12px}.rcb-product-details.svelte-gf0gr5{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-gf0gr5{margin-top:48px}}")}function Mn(t){let e=Vt(t[1].periodDuration)+"",r,n;return{c(){r=O(e),n=O(" free trial")},m(i,o){p(i,r,o),p(i,n,o)},p:$,d(i){i&&(g(r),g(n))}}}function Pn(t){let e=(t[2].currency||"")+"",r,n,i=Ye(t[2].amount,t[2].currency)+"",o;return{c(){r=O(e),n=C(),o=O(i)},m(s,l){p(s,r,l),p(s,n,l),p(s,o,l)},p:$,d(s){s&&(g(r),g(n),g(o))}}}function Cn(t){let e;return{c(){e=k("span"),e.textContent=`${t[1]&&t[2]&&`${t[2].currency} ${Ye(t[2].amount,t[2].currency)} after end of trial`}`,_(e,"class","rcb-product-price-after-trial svelte-gf0gr5")},m(r,n){p(r,e,n)},p:$,d(r){r&&g(e)}}}function gt(t){let e,r,n=nt(t[0].normalPeriodDuration)+"",i;return{c(){e=k("li"),r=O("Renews "),i=O(n)},m(o,s){p(o,e,s),M(e,r),M(e,i)},p(o,s){s&1&&n!==(n=nt(o[0].normalPeriodDuration)+"")&&le(i,n)},d(o){o&&g(e)}}}function Qn(t){var P,Le;let e,r,n=t[0].displayName+"",i,o,s,l,c,a,u,d,h,y,E,B=((P=t[1])==null?void 0:P.periodDuration)&&Mn(t),A=!((Le=t[1])!=null&&Le.periodDuration)&&t[2]&&Pn(t),v=t[1]&&t[2]&&Cn(t),R=t[0].normalPeriodDuration&&gt(t);return{c(){e=k("div"),r=k("span"),i=O(n),o=C(),s=k("span"),B&&B.c(),l=C(),A&&A.c(),c=C(),v&&v.c(),a=C(),u=k("ul"),R&&R.c(),d=C(),h=k("li"),h.textContent="Continues until canceled",y=C(),E=k("li"),E.textContent="Cancel anytime",_(s,"class","rcb-product-price svelte-gf0gr5"),_(u,"class","rcb-product-details svelte-gf0gr5"),_(e,"class","rcb-pricing-info svelte-gf0gr5")},m(G,S){p(G,e,S),M(e,r),M(r,i),M(e,o),M(e,s),B&&B.m(s,null),M(s,l),A&&A.m(s,null),M(e,c),v&&v.m(e,null),M(e,a),M(e,u),R&&R.m(u,null),M(u,d),M(u,h),M(u,y),M(u,E)},p(G,S){var Fe,xe;S&1&&n!==(n=G[0].displayName+"")&&le(i,n),(Fe=G[1])!=null&&Fe.periodDuration&&B.p(G,S),!((xe=G[1])!=null&&xe.periodDuration)&&G[2]&&A.p(G,S),G[1]&&G[2]&&v.p(G,S),G[0].normalPeriodDuration?R?R.p(G,S):(R=gt(G),R.c(),R.m(u,d)):R&&(R.d(1),R=null)},d(G){G&&g(e),B&&B.d(),A&&A.d(),v&&v.d(),R&&R.d()}}}function Tn(t){let e,r;return e=new fe({props:{$$slots:{default:[Qn]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&33&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Nn(t,e,r){var c;let{productDetails:n}=e,{purchaseOption:i}=e;const o=i,s=o==null?void 0:o.trial,l=(c=o==null?void 0:o.base)==null?void 0:c.price;return t.$$set=a=>{"productDetails"in a&&r(0,n=a.productDetails),"purchaseOption"in a&&r(3,i=a.purchaseOption)},[n,s,l,i]}class pt extends U{constructor(e){super(),N(this,e,Nn,Tn,T,{productDetails:0,purchaseOption:3},Dn)}}const Un="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/wCzcBFIcKDBgggPKkzIcCEXLlq4bIEokeLEiBcrYrTIcaNHjRobinQ4sqRCkBlTdtR44MBKlR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CACgMJFWroUBGHgQNMFE6sGGDCAQsaHVY8csAAD4MjSX4w8MDgRpIBoCQwsKIgQpwBUBxIULEHkYcUUC580tDEE6AGbXSYKKMKVIJSUnDQIGIHl6sQS0w8AZagjxAsyqpdy7at24pJfgwBMkQukCRQjQQBIgTIXiFGoAYEACH5BAUFAAEALAMAAwAXABcAAAiVAAMIHEiwoMEMGQwqXPggwsKBTLQshPDgYYAaD1owdPjQB4QIThRGgGAxwIYIIBQ2LMlkJBCDFEsGOPEgA5aCK0tKmQChRkGEMgPIiDDhoRYjTR56CPGwiooXN6oENQikhYsWP65MJXglx4sVMoZsJdikRosWOMYSRPJih9q3cOPKnWuRSxa7eO9O3cJFCxe+frdMDQgAIfkEBQUAAQAsBQADACAAEAAACKYAAwgcSLAgwQcODCpcyNDAAYYQAzhpaIDhFYY+NOBY6HAhkyETFRLZ0CGKQgMVDV4RAoQKQxMdUpx8aJAJECYQnWzYcMQgSoNVgAy5CHGGhhI+aRIkMgRnxCohNvQoiLDgEyFDskQUuINDiK1Hfpgc+ETKQi0nVGxNkkSrwCw/hiBxu7XuFidAhARpgqWu3yxIhgApEtLvVipIgARBYthvlKaNFQYEADs=";function Rn(t){let e,r;return{c(){e=k("img"),ne(e.src,r=Un)||_(e,"src",r),_(e,"alt","spinner")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class Sn extends U{constructor(e){super(),N(this,e,null,Rn,T,{})}}function On(t){F(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 Ln(t){let e,r,n;return r=new Sn({}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-modal-loader svelte-1mxx341")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p:$,i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}class Ve extends U{constructor(e){super(),N(this,e,null,Ln,T,{},On)}}var te=(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))(te||{});class Ee{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:case 7814:return 4;case 7772:return 6;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 _t?e:null}static convertPurchaseFlowErrorCodeToErrorCode(e){switch(e){case L.ErrorSettingUpPurchase:return 2;case L.ErrorChargingPayment:return 20;case L.NetworkError:return 10;case L.MissingEmailError:return 4;case L.StripeError:return 2;case L.UnknownError:return 0;case L.AlreadySubscribedError:return 6}}}var _t=(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[t.BackendAlreadySubscribedError=7772]="BackendAlreadySubscribedError",t[t.BackendOfferNotFound=7814]="BackendOfferNotFound",t))(_t||{});class Z extends Error{constructor(r,n,i){super(n);Q(this,"toString",()=>`PurchasesError(code: ${te[this.errorCode]}, message: ${this.message})`);this.errorCode=r,this.underlyingErrorMessage=i}static getForBackendError(r,n){const i=Ee.getErrorCodeForBackendErrorCode(r);return new Z(i,Ee.getPublicMessage(i),n)}static getForPurchasesFlowError(r){return new Z(Ee.convertPurchaseFlowErrorCodeToErrorCode(r.errorCode),r.message,r.underlyingErrorMessage)}}class At extends Error{constructor(){super("Purchases must be configured before calling getInstance")}}var be=(t=>(t.Started="started",t.InProgress="in_progress",t.Succeeded="succeeded",t.Failed="failed",t))(be||{}),Qe=(t=>(t[t.SetupIntentCreationFailed=1]="SetupIntentCreationFailed",t[t.PaymentMethodCreationFailed=2]="PaymentMethodCreationFailed",t[t.PaymentChargeFailed=3]="PaymentChargeFailed",t))(Qe||{}),L=(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[t.AlreadySubscribedError=6]="AlreadySubscribedError",t))(L||{});class j extends Error{constructor(e,r,n){super(r),this.errorCode=e,this.underlyingErrorMessage=n}static fromPurchasesError(e,r){let n;return e.errorCode===te.ProductAlreadyPurchasedError?n=6:n=r,new j(n,e.message,e.underlyingErrorMessage)}}class Fn{constructor(e,r=10){Q(this,"operationSessionId",null);Q(this,"backend");Q(this,"maxNumberAttempts");Q(this,"waitMSBetweenAttempts",1e3);this.backend=e,this.maxNumberAttempts=r}async startPurchase(e,r,n,i,o){try{const s=await this.backend.postSubscribe(e,r,i,o,n==null?void 0:n.id);return this.operationSessionId=s.operation_session_id,s}catch(s){if(s instanceof Z)throw j.fromPurchasesError(s,0);{const l="Unknown error starting purchase: "+String(s);throw Y.errorLog(l),new j(2,l)}}}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=>{const l=j.fromPurchasesError(s,3);n(l)})};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 Qe.SetupIntentCreationFailed:r(new j(0,"Setup intent creation failed"));return;case Qe.PaymentMethodCreationFailed:r(new j(0,"Payment method creation failed"));return;case Qe.PaymentChargeFailed:r(new j(1,"Payment charge failed"));return}}}const xn="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 Gn(t){F(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Yn(t){let e,r;return{c(){e=k("img"),ne(e.src,r=xn)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class Hn extends U{constructor(e){super(),N(this,e,null,Yn,T,{},Gn)}}function Kn(t){F(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 qn(t){let e,r,n,i,o;const s=t[3].default,l=J(s,t,t[2],null);return{c(){e=k("button"),l&&l.c(),_(e,"class",r=pe(`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)&&W(l,s,c,c[2],n?V(s,c[2],a,null):z(c[2]),null),(!n||a&1&&r!==(r=pe(`intent-${c[0]}`)+" svelte-1rmxk7q"))&&_(e,"class",r),(!n||a&2)&&(e.disabled=c[1])},i(c){n||(f(l,c),n=!0)},o(c){m(l,c),n=!1},d(c){c&&g(e),l&&l.d(c),i=!1,o()}}}function jn(t,e,r){let{$$slots:n={},$$scope:i}=e,{intent:o="primary"}=e,{disabled:s=!1}=e;function l(c){dt.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 Ie extends U{constructor(e){super(),N(this,e,jn,qn,T,{intent:0,disabled:1},Kn)}}function Jn(t){F(t,"svelte-1f9z0o8","footer.svelte-1f9z0o8{display:flex;flex-direction:column}")}function Vn(t){let e,r;const n=t[1].default,i=J(n,t,t[0],null);return{c(){e=k("footer"),i&&i.c(),_(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)&&W(i,n,o,o[0],r?V(n,o[0],s,null):z(o[0]),null)},i(o){r||(f(i,o),r=!0)},o(o){m(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function Wn(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class We extends U{constructor(e){super(),N(this,e,Wn,Vn,T,{},Jn)}}function zn(t){F(t,"svelte-6o8e90",'.column.svelte-6o8e90{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "8px");flex-grow:1}')}function Xn(t){let e,r,n;const i=t[2].default,o=J(i,t,t[1],null);return{c(){e=k("div"),o&&o.c(),_(e,"class","column svelte-6o8e90"),_(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)&&W(o,i,s,s[1],n?V(i,s[1],l,null):z(s[1]),null),(!n||l&1&&r!==(r=`--gap:${s[0]};`))&&_(e,"style",r)},i(s){n||(f(o,s),n=!0)},o(s){m(o,s),n=!1},d(s){s&&g(e),o&&o.d(s)}}}function Zn(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 we extends U{constructor(e){super(),N(this,e,Zn,Xn,T,{gutter:0},zn)}}const er="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 tr(t){F(t,"svelte-14xreta",".close-button.svelte-14xreta{border:none;cursor:pointer;background-color:transparent;padding:0px}")}function nr(t){let e,r,n,i,o;return{c(){e=k("button"),r=k("img"),ne(r.src,n=er)||_(r,"src",n),_(r,"alt","close"),_(e,"class","close-button svelte-14xreta"),e.disabled=t[0]},m(s,l){p(s,e,l),M(e,r),i||(o=_e(e,"click",t[1]),i=!0)},p(s,[l]){l&1&&(e.disabled=s[0])},i:$,o:$,d(s){s&&g(e),i=!1,o()}}}function rr(t,e,r){let{disabled:n=!1}=e;function i(o){dt.call(this,t,o)}return t.$$set=o=>{"disabled"in o&&r(0,n=o.disabled)},[n,i]}class ir extends U{constructor(e){super(),N(this,e,rr,nr,T,{disabled:0},tr)}}function or(t){F(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 sr(t){let e;return{c(){e=k("div"),_(e,"class","rcb-app-icon loading svelte-44qpq9")},m(r,n){p(r,e,n)},p:$,d(r){r&&g(e)}}}function lr(t){let e,r,n,i,o,s;return{c(){e=k("picture"),r=k("source"),i=C(),o=k("img"),_(r,"type","image/webp"),nn(r,n=t[1])||_(r,"srcset",n),_(o,"class","rcb-app-icon svelte-44qpq9"),ne(o.src,s=t[0])||_(o,"src",s),_(o,"alt","App icon"),_(e,"class","rcb-app-icon-picture-container svelte-44qpq9")},m(l,c){p(l,e,c),M(e,r),M(e,i),M(e,o)},p(l,c){c&2&&n!==(n=l[1])&&_(r,"srcset",n),c&1&&!ne(o.src,s=l[0])&&_(o,"src",s)},d(l){l&&g(e)}}}function cr(t){let e;function r(o,s){return o[0]!==null?lr:sr}let n=r(t),i=n(t);return{c(){i.c(),e=re()},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:$,o:$,d(o){o&&g(e),i.d(o)}}}function ar(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 ht extends U{constructor(e){super(),N(this,e,ar,cr,T,{src:0,srcWebp:1},or)}}const Te=t=>`https://da08ctfrofx1b.cloudfront.net/${t}`;function ur(t){F(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 fr(t){let e,r;return e=new ht({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:$,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function dr(t){let e,r,n=t[0].seller_company_name+"",i,o,s=t[0].app_icon_webp!==null&&t[0].app_icon!==null&&Et(t);return{c(){s&&s.c(),e=C(),r=k("span"),i=O(n),_(r,"class","app-title svelte-10uf5fq")},m(l,c){s&&s.m(l,c),p(l,e,c),p(l,r,c),M(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&&f(s,1)):(s=Et(l),s.c(),f(s,1),s.m(e.parentNode,e)):s&&(K(),m(s,1,1,()=>{s=null}),q()),(!o||c&1)&&n!==(n=l[0].seller_company_name+"")&&le(i,n)},i(l){o||(f(s),o=!0)},o(l){m(s),o=!1},d(l){l&&(g(e),g(r)),s&&s.d(l)}}}function Et(t){let e,r;return e=new ht({props:{src:Te(t[0].app_icon),srcWebp:Te(t[0].app_icon_webp)}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.src=Te(n[0].app_icon)),i&1&&(o.srcWebp=Te(n[0].app_icon_webp)),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function mr(t){let e,r,n,i;const o=[dr,fr],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(),_(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 u=r;r=l(c),r===u?s[r].p(c,a):(K(),m(s[u],1,1,()=>{s[u]=null}),q(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),f(n,1),n.m(e,null))},i(c){i||(f(n),i=!0)},o(c){m(n),i=!1},d(c){c&&g(e),s[r].d()}}}function gr(t,e,r){let{brandingInfo:n=null}=e;return t.$$set=i=>{"brandingInfo"in i&&r(0,n=i.brandingInfo)},[n]}class bt extends U{constructor(e){super(),N(this,e,gr,mr,T,{brandingInfo:0},ur)}}function pr(t){F(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 _r(t){let e,r,n,i,o;return r=new bt({props:{brandingInfo:t[0]}}),i=new ir({}),i.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){e=k("div"),w(r.$$.fragment),n=C(),w(i.$$.fragment),_(e,"class","rcb-post-purchase-header-layout svelte-17puakv")},m(s,l){p(s,e,l),b(r,e,null),M(e,n),b(i,e,null),o=!0},p(s,l){t=s;const c={};l&1&&(c.brandingInfo=t[0]),r.$set(c)},i(s){o||(f(r.$$.fragment,s),f(i.$$.fragment,s),o=!0)},o(s){m(r.$$.fragment,s),m(i.$$.fragment,s),o=!1},d(s){s&&g(e),I(r),I(i)}}}function Ar(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[_r]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&7&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function hr(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 Er extends U{constructor(e){super(),N(this,e,hr,Ar,T,{brandingInfo:0,onClose:1},pr)}}function br(t){F(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 Ir=t=>({}),It=t=>({});function wr(t){let e,r,n,i,o;const s=t[4].default,l=J(s,t,t[5],null);return{c(){e=k("span"),r=O(t[2]),n=C(),i=k("span"),l&&l.c(),_(e,"class","title svelte-10pcqja"),_(i,"class","subtitle svelte-10pcqja")},m(c,a){p(c,e,a),M(e,r),p(c,n,a),p(c,i,a),l&&l.m(i,null),o=!0},p(c,a){(!o||a&4)&&le(r,c[2]),l&&l.p&&(!o||a&32)&&W(l,s,c,c[5],o?V(s,c[5],a,null):z(c[5]),null)},i(c){o||(f(l,c),o=!0)},o(c){m(l,c),o=!1},d(c){c&&(g(e),g(n),g(i)),l&&l.d(c)}}}function kr(t){let e,r,n;const i=t[4].icon,o=J(i,t,t[5],It);return r=new we({props:{gutter:"16px",$$slots:{default:[wr]},$$scope:{ctx:t}}}),{c(){o&&o.c(),e=C(),w(r.$$.fragment)},m(s,l){o&&o.m(s,l),p(s,e,l),b(r,s,l),n=!0},p(s,l){o&&o.p&&(!n||l&32)&&W(o,i,s,s[5],n?V(i,s[5],l,Ir):z(s[5]),It);const c={};l&36&&(c.$$scope={dirty:l,ctx:s}),r.$set(c)},i(s){n||(f(o,s),f(r.$$.fragment,s),n=!0)},o(s){m(o,s),m(r.$$.fragment,s),n=!1},d(s){s&&g(e),o&&o.d(s),I(r,s)}}}function $r(t){let e,r,n;return r=new we({props:{gutter:"16px",$$slots:{default:[kr]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-modal-message svelte-10pcqja"),_(e,"data-type",t[3])},m(i,o){p(i,e,o),b(r,e,null),n=!0},p(i,o){const s={};o&36&&(s.$$scope={dirty:o,ctx:i}),r.$set(s),(!n||o&8)&&_(e,"data-type",i[3])},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}function yr(t){let e;return{c(){e=O("Go back to app")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function vr(t){let e,r;return e=new Ie({props:{$$slots:{default:[yr]},$$scope:{ctx:t}}}),e.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment)},m(n,i){b(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||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Br(t){let e,r,n,i,o,s;return e=new Er({props:{brandingInfo:t[0],onClose:t[1]}}),n=new fe({props:{$$slots:{default:[$r]},$$scope:{ctx:t}}}),o=new We({props:{$$slots:{default:[vr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=C(),w(n.$$.fragment),i=C(),w(o.$$.fragment)},m(l,c){b(e,l,c),p(l,r,c),b(n,l,c),p(l,i,c),b(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 u={};c&44&&(u.$$scope={dirty:c,ctx:l}),n.$set(u);const d={};c&34&&(d.$$scope={dirty:c,ctx:l}),o.$set(d)},i(l){s||(f(e.$$.fragment,l),f(n.$$.fragment,l),f(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(n.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(g(r),g(i)),I(e,l),I(n,l),I(o,l)}}}function Dr(t){let e,r;return e=new we({props:{gutter:"32px",$$slots:{default:[Br]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&47&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Mr(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 wt extends U{constructor(e){super(),N(this,e,Mr,Dr,T,{brandingInfo:0,onContinue:1,title:2,type:3},br)}}function kt(t){let e,r,n,i,o;return{c(){e=O("If this error persists, please contact "),r=k("a"),n=O(t[1]),o=O("."),_(r,"href",i="mailto:"+t[1])},m(s,l){p(s,e,l),p(s,r,l),M(r,n),p(s,o,l)},p(s,l){l&2&&le(n,s[1]),l&2&&i!==(i="mailto:"+s[1])&&_(r,"href",i)},d(s){s&&(g(e),g(r),g(o))}}}function Pr(t){let e=t[3]()+"",r,n,i,o=t[1]&&kt(t);return{c(){r=O(e),n=C(),o&&o.c(),i=re()},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=kt(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 Cr(t){let e,r;return e=new Hn({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:$,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Qr(t){let e,r;return e=new wt({props:{title:t[4](),brandingInfo:t[0],onContinue:t[2],type:"error",$$slots:{icon:[Cr],default:[Pr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&1&&(o.brandingInfo=n[0]),i&4&&(o.onContinue=n[2]),i&66&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Tr(t,e,r){let{brandingInfo:n=null}=e,{lastError:i}=e,{supportEmail:o=null}=e,{onContinue:s}=e;Me(()=>{Y.errorLog(`Displayed error: ${L[i.errorCode]}. Message: ${i.message??"None"}. Underlying error: ${i.underlyingErrorMessage??"None"}`)});function l(){switch(i.errorCode){case L.UnknownError:return"An unknown error occurred.";case L.ErrorSettingUpPurchase:return"Purchase not started due to an error.";case L.ErrorChargingPayment:return"Payment failed.";case L.NetworkError:return"Network error. Please check your internet connection.";case L.StripeError:return i.message;case L.MissingEmailError:return"Email is required to complete the purchase.";case L.AlreadySubscribedError:return"You are already subscribed to this product."}return i.message}function c(){switch(i.errorCode){case L.AlreadySubscribedError:return"Already subscribed";default:return"Something went wrong"}}return t.$$set=a=>{"brandingInfo"in a&&r(0,n=a.brandingInfo),"lastError"in a&&r(5,i=a.lastError),"supportEmail"in a&&r(1,o=a.supportEmail),"onContinue"in a&&r(2,s=a.onContinue)},[n,o,s,l,c,i]}class Nr extends U{constructor(e){super(),N(this,e,Tr,Qr,T,{brandingInfo:0,lastError:5,supportEmail:1,onContinue:2})}}const Ur="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 Rr(t){F(t,"svelte-1609h93","img.svelte-1609h93{width:124px;height:124px;margin:0 auto}")}function Sr(t){let e,r;return{c(){e=k("img"),ne(e.src,r=Ur)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon svelte-1609h93")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class Or extends U{constructor(e){super(),N(this,e,null,Sr,T,{},Rr)}}function Lr(t){let e;return{c(){e=O("Your plan is now active.")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function Fr(t){let e,r;return e=new Or({props:{slot:"icon"}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:$,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function xr(t){let e,r;return e=new wt({props:{type:"success",title:"Purchase successful",brandingInfo:t[0],onContinue:t[1],$$slots:{icon:[Fr],default:[Lr]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(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||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Gr(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 Yr extends U{constructor(e){super(),N(this,e,Gr,xr,T,{brandingInfo:0,onContinue:1})}}function Hr(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 Kr=typeof window>"u";function qr(t){if(!Kr)return t.registerAppInfo({name:"svelte-stripe-js",url:"https://svelte-stripe-js.vercel.app"})}function jr(t){let e;return{c(){e=k("div")},m(r,n){p(r,e,n),t[6](e)},p:$,i:$,o:$,d(r){r&&g(e),t[6](null)}}}function Jr(t,e,r){let n,i;const o=gn(),{elements:s}=_n("stripe");let{options:l=void 0}=e;Me(()=>(n=Hr(i,"payment",s,o,l),()=>n.destroy()));function c(){n.blur()}function a(){n.clear()}function u(){n.destroy()}function d(){n.focus()}function h(y){Pe[y?"unshift":"push"](()=>{i=y,r(0,i)})}return t.$$set=y=>{"options"in y&&r(1,l=y.options)},[i,l,c,a,u,d,h]}class Vr extends U{constructor(e){super(),N(this,e,Jr,jr,T,{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 $t(t){let e;const r=t[15].default,n=J(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)&&W(n,r,i,i[14],e?V(r,i[14],o,null):z(i[14]),null)},i(i){e||(f(n,i),e=!0)},o(i){m(n,i),e=!1},d(i){n&&n.d(i)}}}function Wr(t){let e,r,n=t[1]&&t[0]&&$t(t);return{c(){n&&n.c(),e=re()},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&&f(n,1)):(n=$t(i),n.c(),f(n,1),n.m(e.parentNode,e)):n&&(K(),m(n,1,1,()=>{n=null}),q())},i(i){r||(f(n),r=!0)},o(i){m(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function zr(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:u={}}=e,{labels:d="above"}=e,{loader:h="auto"}=e,{fonts:y=[]}=e,{locale:E="auto"}=e,{currency:B=void 0}=e,{amount:A=void 0}=e,{clientSecret:v=void 0}=e,{elements:R=null}=e;return t.$$set=P=>{"stripe"in P&&r(1,s=P.stripe),"mode"in P&&r(2,l=P.mode),"theme"in P&&r(3,c=P.theme),"variables"in P&&r(4,a=P.variables),"rules"in P&&r(5,u=P.rules),"labels"in P&&r(6,d=P.labels),"loader"in P&&r(7,h=P.loader),"fonts"in P&&r(8,y=P.fonts),"locale"in P&&r(9,E=P.locale),"currency"in P&&r(10,B=P.currency),"amount"in P&&r(11,A=P.amount),"clientSecret"in P&&r(12,v=P.clientSecret),"elements"in P&&r(0,R=P.elements),"$$scope"in P&&r(14,o=P.$$scope)},t.$$.update=()=>{t.$$.dirty&120&&r(13,n={theme:c,variables:a,rules:u,labels:d}),t.$$.dirty&16263&&s&&!R&&(r(0,R=s.elements({mode:l,currency:B,amount:A,appearance:n,clientSecret:v,fonts:y,loader:h,locale:E})),qr(s),pn("stripe",{stripe:s,elements:R})),t.$$.dirty&8705&&R&&R.update({appearance:n,locale:E})},[R,s,l,c,a,u,d,h,y,E,B,A,v,n,o,i]}class Xr extends U{constructor(e){super(),N(this,e,zr,Wr,T,{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 yt="https://js.stripe.com/v3",Zr=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,vt="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",ei=function(){for(var e=document.querySelectorAll('script[src^="'.concat(yt,'"]')),r=0;r<e.length;r++){var n=e[r];if(Zr.test(n.src))return n}return null},Bt=function(e){var r=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(yt).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},ti=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"2.4.0",startTime:r})},ke=null,Ne=null,Ue=null,ni=function(e){return function(){e(new Error("Failed to load Stripe.js"))}},ri=function(e,r){return function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))}},ii=function(e){return ke!==null?ke:(ke=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&e&&console.warn(vt),window.Stripe){r(window.Stripe);return}try{var i=ei();if(i&&e)console.warn(vt);else if(!i)i=Bt(e);else if(i&&Ue!==null&&Ne!==null){var o;i.removeEventListener("load",Ue),i.removeEventListener("error",Ne),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=Bt(e)}Ue=ri(r,n),Ne=ni(n),i.addEventListener("load",Ue),i.addEventListener("error",Ne)}catch(s){n(s);return}}),ke.catch(function(r){return ke=null,Promise.reject(r)}))},oi=function(e,r,n){if(e===null)return null;var i=e.apply(void 0,r);return ti(i,n),i},$e,Dt=!1,Mt=function(){return $e||($e=ii(null).catch(function(e){return $e=null,Promise.reject(e)}),$e)};Promise.resolve().then(function(){return Mt()}).catch(function(t){Dt||console.warn(t)});var si=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];Dt=!0;var i=Date.now();return Mt().then(function(o){return oi(o,r,i)})};function li(t){F(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 ci(t){let e,r;const n=t[0].default,i=J(n,t,t[1],null);return{c(){e=k("div"),i&&i.c(),_(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)&&W(i,n,o,o[1],r?V(n,o[1],s,null):z(o[1]),null)},i(o){r||(f(i,o),r=!0)},o(o){m(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function ai(t){let e,r;return e=new fe({props:{as:"header",$$slots:{default:[ci]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,[i]){const o={};i&2&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function ui(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(1,i=o.$$scope)},[n,i]}class ze extends U{constructor(e){super(),N(this,e,ui,ai,T,{},li)}}const fi="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 di(t){let e,r;return{c(){e=k("img"),ne(e.src,r=fi)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class mi extends U{constructor(e){super(),N(this,e,null,di,T,{})}}const ye={error:"#f2545b",warning:"#f4e971",focus:"#000080","grey-text-dark":"#000000","grey-text-light":"#767676","grey-ui-dark":"#dfdfdf",white:"#ffffff"};function gi(t){F(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 pi(t){let e;return{c(){e=k("div"),_(e,"class","processing svelte-rjmul6")},m(r,n){p(r,e,n)},p:$,i:$,o:$,d(r){r&&g(e)}}}class Pt extends U{constructor(e){super(),N(this,e,null,pi,T,{},gi)}}function _i(t){F(t,"svelte-1wxt892",".rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}")}function Ai(t){let e,r;return e=new Ve({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:$,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function hi(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:ve["grey-text-dark"],focusBoxShadow:"none",colorDanger:ve.error},rules:{".Input":{boxShadow:"none",border:`2px solid ${ve["grey-ui-dark"]}`},".Input:focus":{border:`2px solid ${ve.focus}`,outline:"none"},".Label":{marginBottom:"8px",fontWeight:"500",lineHeight:"22px"},".Input--invalid":{boxShadow:"none"}},$$slots:{default:[Bi]},$$scope:{ctx:t}};return t[2]!==void 0&&(c.elements=t[2]),r=new Xr({props:c}),Pe.push(()=>wn(r,"elements",l)),{c(){e=k("form"),w(r.$$.fragment)},m(a,u){p(a,e,u),b(r,e,null),i=!0,o||(s=_e(e,"submit",ut(t[5])),o=!0)},p(a,u){const d={};u&8&&(d.stripe=a[3]),u&2051&&(d.$$scope={dirty:u,ctx:a}),!n&&u&4&&(n=!0,d.elements=a[2],En(()=>n=!1)),r.$set(d)},i(a){i||(f(r.$$.fragment,a),i=!0)},o(a){m(r.$$.fragment,a),i=!1},d(a){a&&g(e),I(r),o=!1,s()}}}function Ei(t){let e,r,n,i;return n=new mi({}),{c(){e=k("div"),e.textContent="Secure Checkout",r=C(),w(n.$$.fragment)},m(o,s){p(o,e,s),p(o,r,s),b(n,o,s),i=!0},p:$,i(o){i||(f(n.$$.fragment,o),i=!0)},o(o){m(n.$$.fragment,o),i=!1},d(o){o&&(g(e),g(r)),I(n,o)}}}function bi(t){let e,r,n;return r=new Vr({}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-stripe-elements-container svelte-1wxt892")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p:$,i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}function Ii(t){let e;return{c(){e=O("Pay")},m(r,n){p(r,e,n)},i:$,o:$,d(r){r&&g(e)}}}function wi(t){let e,r;return e=new Pt({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function ki(t){let e,r,n,i;const o=[wi,Ii],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=re()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,a){let u=e;e=l(c),e!==u&&(K(),m(s[u],1,1,()=>{s[u]=null}),q(),r=s[e],r||(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){m(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function $i(t){let e;return{c(){e=O("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function vi(t){let e,r,n,i;return e=new Ie({props:{disabled:t[0],$$slots:{default:[ki]},$$scope:{ctx:t}}}),n=new Ie({props:{disabled:t[0],intent:"secondary",$$slots:{default:[$i]},$$scope:{ctx:t}}}),n.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment),r=C(),w(n.$$.fragment)},m(o,s){b(e,o,s),p(o,r,s),b(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||(f(e.$$.fragment,o),f(n.$$.fragment,o),i=!0)},o(o){m(e.$$.fragment,o),m(n.$$.fragment,o),i=!1},d(o){o&&g(r),I(e,o),I(n,o)}}}function yi(t){let e,r;return e=new we({props:{$$slots:{default:[vi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&2051&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Bi(t){let e,r,n,i,o,s;return e=new ze({props:{$$slots:{default:[Ei]},$$scope:{ctx:t}}}),n=new fe({props:{$$slots:{default:[bi]},$$scope:{ctx:t}}}),o=new We({props:{$$slots:{default:[yi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=C(),w(n.$$.fragment),i=C(),w(o.$$.fragment)},m(l,c){b(e,l,c),p(l,r,c),b(n,l,c),p(l,i,c),b(o,l,c),s=!0},p(l,c){const a={};c&2048&&(a.$$scope={dirty:c,ctx:l}),e.$set(a);const u={};c&2048&&(u.$$scope={dirty:c,ctx:l}),n.$set(u);const d={};c&2051&&(d.$$scope={dirty:c,ctx:l}),o.$set(d)},i(l){s||(f(e.$$.fragment,l),f(n.$$.fragment,l),f(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(n.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(g(r),g(i)),I(e,l),I(n,l),I(o,l)}}}function Di(t){let e,r,n,i;const o=[hi,Ai],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 u=r;r=l(c),r===u?s[r].p(c,a):(K(),m(s[u],1,1,()=>{s[u]=null}),q(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),f(n,1),n.m(e,null))},i(c){i||(f(n),i=!0)},o(c){m(n),i=!1},d(c){c&&g(e),s[r].d()}}}function Mi(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,u,d;Me(async()=>{const E=s.data.publishable_api_key,B=s.data.stripe_account_id;if(!E||!B)throw new Error("Stripe publishable key or account ID not found");r(3,a=await si(E,{stripeAccount:B}))});const h=async()=>{if(l||!a||!d)return;r(0,l=!0);const E=await a.confirmSetup({elements:d,redirect:"if_required"});E.error?(r(0,l=!1),o(new j(L.StripeError,E.error.message))):i()};function v(E){u=E,r(2,u)}return t.$$set=E=>{"onClose"in E&&r(1,n=E.onClose),"onContinue"in E&&r(6,i=E.onContinue),"onError"in E&&r(7,o=E.onError),"paymentInfoCollectionMetadata"in E&&r(8,s=E.paymentInfoCollectionMetadata),"processing"in E&&r(0,l=E.processing)},t.$$.update=()=>{t.$$.dirty&4&&u&&u._elements.length>0&&(d=u)},[l,n,u,a,c,h,i,o,s,v]}class Pi extends U{constructor(e){super(),N(this,e,Mi,Di,T,{onClose:1,onContinue:6,onError:7,paymentInfoCollectionMetadata:8,processing:0},_i)}}function Ci(t){return t.trim()===""?"You need to provide your email address to continue.":t.match(/^[^@]+@[^@]+\.[^@]+$/)?null:"Email is not valid. Please provide a valid email address."}function Qi(t){F(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 Ti(t){let e;return{c(){e=O("Billing email address")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function Ct(t){let e,r;return{c(){e=k("div"),r=O(t[2]),_(e,"class","form-error svelte-favd20")},m(n,i){p(n,e,i),M(e,r)},p(n,i){i&4&&le(r,n[2])},d(n){n&&g(e)}}}function Ni(t){let e,r,n,i,o,s,l,c,a,u=t[2]&&Ct(t);return{c(){e=k("div"),r=k("div"),r.innerHTML='<label for="email">Email</label>',n=C(),i=k("div"),o=k("input"),l=C(),u&&u.c(),_(r,"class","form-label svelte-favd20"),_(o,"name","email"),_(o,"placeholder","john@appleseed.com"),_(o,"autocapitalize","off"),_(o,"class","svelte-favd20"),_(i,"class",s="form-input "+t[4]+" svelte-favd20"),_(e,"class","form-container svelte-favd20")},m(d,h){p(d,e,h),M(e,r),M(e,n),M(e,i),M(i,o),ft(o,t[3]),M(e,l),u&&u.m(e,null),c||(a=_e(o,"input",t[7]),c=!0)},p(d,h){h&8&&o.value!==d[3]&&ft(o,d[3]),h&16&&s!==(s="form-input "+d[4]+" svelte-favd20")&&_(i,"class",s),d[2]?u?u.p(d,h):(u=Ct(d),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},d(d){d&&g(e),u&&u.d(),c=!1,a()}}}function Ui(t){let e;return{c(){e=O("Continue")},m(r,n){p(r,e,n)},i:$,o:$,d(r){r&&g(e)}}}function Ri(t){let e,r;return e=new Pt({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Si(t){let e,r,n,i;const o=[Ri,Ui],s=[];function l(c,a){return c[1]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=re()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,a){let u=e;e=l(c),e!==u&&(K(),m(s[u],1,1,()=>{s[u]=null}),q(),r=s[e],r||(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){m(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function Oi(t){let e;return{c(){e=O("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function Li(t){let e,r,n,i;return e=new Ie({props:{disabled:t[1],$$slots:{default:[Si]},$$scope:{ctx:t}}}),n=new Ie({props:{intent:"secondary",disabled:t[1],$$slots:{default:[Oi]},$$scope:{ctx:t}}}),n.$on("click",function(){se(t[0])&&t[0].apply(this,arguments)}),{c(){w(e.$$.fragment),r=C(),w(n.$$.fragment)},m(o,s){b(e,o,s),p(o,r,s),b(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||(f(e.$$.fragment,o),f(n.$$.fragment,o),i=!0)},o(o){m(e.$$.fragment,o),m(n.$$.fragment,o),i=!1},d(o){o&&g(r),I(e,o),I(n,o)}}}function Fi(t){let e,r;return e=new we({props:{$$slots:{default:[Li]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&259&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function xi(t){let e,r,n,i,o,s,l,c,a;return r=new ze({props:{$$slots:{default:[Ti]},$$scope:{ctx:t}}}),i=new fe({props:{$$slots:{default:[Ni]},$$scope:{ctx:t}}}),s=new We({props:{$$slots:{default:[Fi]},$$scope:{ctx:t}}}),{c(){e=k("form"),w(r.$$.fragment),n=C(),w(i.$$.fragment),o=C(),w(s.$$.fragment),_(e,"class","svelte-favd20")},m(u,d){p(u,e,d),b(r,e,null),M(e,n),b(i,e,null),M(e,o),b(s,e,null),l=!0,c||(a=_e(e,"submit",ut(t[5])),c=!0)},p(u,[d]){const h={};d&256&&(h.$$scope={dirty:d,ctx:u}),r.$set(h);const v={};d&284&&(v.$$scope={dirty:d,ctx:u}),i.$set(v);const E={};d&259&&(E.$$scope={dirty:d,ctx:u}),s.$set(E)},i(u){l||(f(r.$$.fragment,u),f(i.$$.fragment,u),f(s.$$.fragment,u),l=!0)},o(u){m(r.$$.fragment,u),m(i.$$.fragment,u),m(s.$$.fragment,u),l=!1},d(u){u&&g(e),I(r),I(i),I(s),c=!1,a()}}}function Gi(t,e,r){let n,i,o,{onContinue:s}=e,{onClose:l}=e,{processing:c}=e;const a=async()=>{const d=Ci(n);d?r(2,i=d):s({email:n})};function u(){n=this.value,r(3,n)}return t.$$set=d=>{"onContinue"in d&&r(6,s=d.onContinue),"onClose"in d&&r(0,l=d.onClose),"processing"in d&&r(1,c=d.processing)},t.$$.update=()=>{t.$$.dirty&4&&r(4,o=i?"error":"")},r(3,n=""),r(2,i=""),[l,c,i,n,o,a,s,u]}class Yi extends U{constructor(e){super(),N(this,e,Gi,xi,T,{onContinue:6,onClose:0,processing:1},Qi)}}function Hi(t){F(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 Ki(t){let e,r;const n=t[1].default,i=J(n,t,t[0],null);return{c(){e=k("div"),i&&i.c(),_(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)&&W(i,n,o,o[0],r?V(n,o[0],s,null):z(o[0]),null)},i(o){r||(f(i,o),r=!0)},o(o){m(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function qi(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class ji extends U{constructor(e){super(),N(this,e,qi,Ki,T,{},Hi)}}function Ji(t){F(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 Vi(t){let e,r,n,i;const o=t[2].default,s=J(o,t,t[1],null);return{c(){e=k("div"),r=k("main"),s&&s.c(),_(r,"class",n=pe(`rcb-modal-main ${t[0]?"rcb-modal-dark":""}`)+" svelte-ioxu5d"),_(e,"class","rcb-modal-container svelte-ioxu5d")},m(l,c){p(l,e,c),M(e,r),s&&s.m(r,null),i=!0},p(l,[c]){s&&s.p&&(!i||c&2)&&W(s,o,l,l[1],i?V(o,l[1],c,null):z(l[1]),null),(!i||c&1&&n!==(n=pe(`rcb-modal-main ${l[0]?"rcb-modal-dark":""}`)+" svelte-ioxu5d"))&&_(r,"class",n)},i(l){i||(f(s,l),i=!0)},o(l){m(s,l),i=!1},d(l){l&&g(e),s&&s.d(l)}}}function Wi(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 zi extends U{constructor(e){super(),N(this,e,Wi,Vi,T,{dark:0},Ji)}}function Xi(t){let e;const r=t[1].default,n=J(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)&&W(n,r,i,i[2],e?V(r,i[2],o,null):z(i[2]),null)},i(i){e||(f(n,i),e=!0)},o(i){m(n,i),e=!1},d(i){n&&n.d(i)}}}function Zi(t){let e,r;return e=new ji({props:{$$slots:{default:[eo]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function eo(t){let e;const r=t[1].default,n=J(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)&&W(n,r,i,i[2],e?V(r,i[2],o,null):z(i[2]),null)},i(i){e||(f(n,i),e=!0)},o(i){m(n,i),e=!1},d(i){n&&n.d(i)}}}function to(t){let e,r,n,i;const o=[Zi,Xi],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=re()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,[a]){let u=e;e=l(c),e===u?s[e].p(c,a):(K(),m(s[u],1,1,()=>{s[u]=null}),q(),r=s[e],r?r.p(c,a):(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){m(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function no(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 ro extends U{constructor(e){super(),N(this,e,no,to,T,{condition:0})}}const io=t=>({}),Qt=t=>({});function oo(t){let e,r;const n=t[1].header,i=J(n,t,t[2],Qt),o=t[1].default,s=J(o,t,t[2],null);return{c(){i&&i.c(),e=C(),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)&&W(i,n,l,l[2],r?V(n,l[2],c,io):z(l[2]),Qt),s&&s.p&&(!r||c&4)&&W(s,o,l,l[2],r?V(o,l[2],c,null):z(l[2]),null)},i(l){r||(f(i,l),f(s,l),r=!0)},o(l){m(i,l),m(s,l),r=!1},d(l){l&&g(e),i&&i.d(l),s&&s.d(l)}}}function so(t){let e,r;return e=new zi({props:{dark:t[0],$$slots:{default:[oo]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(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||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function lo(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 Tt extends U{constructor(e){super(),N(this,e,lo,so,T,{dark:0})}}const co="0.3.2",de="https://api.revenuecat.com";var Re;(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"})(Re||(Re={}));function Xe(t){return t?t.startsWith("rcb_sb_"):!1}async function me(t,e,r,n){try{const i=await fetch(t.url(),{method:t.method,headers:fo(e,n),body:uo(r)});return await ao(i,t),await i.json()}catch(i){throw i instanceof TypeError?new Z(te.NetworkError,Ee.getPublicMessage(te.NetworkError),i.message):i}}async function ao(t,e){const r=t.status;if(r>=Re.INTERNAL_SERVER_ERROR)Ze(e,r,await t.text());else if(r>=Re.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=Ee.convertCodeToBackendErrorCode(o);if(l==null)Ze(e,r,i);else throw Z.getForBackendError(l,s)}else Ze(e,r,i)}}function Ze(t,e,r){throw new Z(te.UnknownBackendError,`Unknown backend error. Request: ${t.name}. Status code: ${e}. Body: ${r}.`)}function uo(t){return t==null?null:JSON.stringify(t)}function fo(t,e){let r={Authorization:`Bearer ${t}`,"Content-Type":"application/json",Accept:"application/json","X-Platform":"web","X-Version":co,"X-Is-Sandbox":`${Xe(t)}`};return e!=null&&(r={...r,...e}),r}const Nt="/v1/subscribers",Se="/rcbilling/v1";class mo{constructor(e){Q(this,"appUserId");Q(this,"method","GET");Q(this,"name","getOfferings");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${de}${Nt}/${e}/offerings`}}class go{constructor(){Q(this,"method","POST");Q(this,"name","subscribe")}url(){return`${de}${Se}/subscribe`}}class po{constructor(e,r){Q(this,"method","GET");Q(this,"name","getProducts");Q(this,"appUserId");Q(this,"productIds");this.appUserId=e,this.productIds=r}url(){const e=encodeURIComponent(this.appUserId),r=this.productIds.map(encodeURIComponent).join("&id=");return`${de}${Se}/subscribers/${e}/products?id=${r}`}}class _o{constructor(e){Q(this,"method","GET");Q(this,"name","getCustomerInfo");Q(this,"appUserId");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${de}${Nt}/${e}`}}class Ao{constructor(){Q(this,"method","GET");Q(this,"name","getBrandingInfo")}url(){return`${de}${Se}/branding`}}class ho{constructor(e){Q(this,"method","GET");Q(this,"name","getCheckoutStatus");Q(this,"operationSessionId");this.operationSessionId=e}url(){return`${de}${Se}/checkout/${this.operationSessionId}`}}class Eo{constructor(e){Q(this,"API_KEY");this.API_KEY=e}async getOfferings(e){return await me(new mo(e),this.API_KEY)}async getCustomerInfo(e){return await me(new _o(e),this.API_KEY)}async getProducts(e,r){return await me(new po(e,r),this.API_KEY)}async getBrandingInfo(){return await me(new Ao,this.API_KEY)}async postSubscribe(e,r,n,i,o){const s={app_user_id:e,product_id:r,email:n,presented_offering_identifier:i};return o&&o!=="base_option"&&(s.offer_id=o),await me(new go,this.API_KEY,s)}async getCheckoutStatus(e){return await me(new ho(e),this.API_KEY)}}const bo="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 Io(t){let e,r;return{c(){e=k("img"),ne(e.src,r=bo)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class wo extends U{constructor(e){super(),N(this,e,null,Io,T,{})}}function ko(t){F(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 $o(t){let e;return{c(){e=k("div"),e.textContent="Sandbox",_(e,"class","svelte-1rhrjxe")},m(r,n){p(r,e,n)},p:$,i:$,o:$,d(r){r&&g(e)}}}class vo extends U{constructor(e){super(),N(this,e,null,$o,T,{},ko)}}function yo(t){F(t,"svelte-1qect5g",`.rcb-ui-container.svelte-1qect5g{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-1qect5g{width:100vw;width:100 dvw;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-1qect5g{margin-right:16px;flex:320px 1 0;max-width:480px}.rcb-ui-main.svelte-1qect5g{flex:480px 1 0;max-width:640px}@media screen and (max-width: 960px){.rcb-ui-layout.svelte-1qect5g{flex-direction:column;align-items:center;justify-content:center;height:100%;min-width:100%}.rcb-ui-aside.svelte-1qect5g{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-1qect5g{flex:none;max-width:none;min-width:100%}}@media screen and (max-width: 960px) and (max-height: 960px){.rcb-ui-layout.svelte-1qect5g{overflow-y:scroll;justify-content:flex-start;padding:16px 0px}}`)}function Ut(t){let e,r,n;return r=new Tt({props:{dark:!0,$$slots:{header:[Co],default:[Bo]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-ui-aside svelte-1qect5g")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p(i,o){const s={};o&67108894&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}function Rt(t){let e,r;return e=new pt({props:{productDetails:t[3],purchaseOption:t[1]}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.productDetails=n[3]),i&2&&(o.purchaseOption=n[1]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Bo(t){let e,r,n=t[3]&&t[1]&&Rt(t);return{c(){n&&n.c(),e=re()},m(i,o){n&&n.m(i,o),p(i,e,o),r=!0},p(i,o){i[3]&&i[1]?n?(n.p(i,o),o&10&&f(n,1)):(n=Rt(i),n.c(),f(n,1),n.m(e.parentNode,e)):n&&(K(),m(n,1,1,()=>{n=null}),q())},i(i){r||(f(n),r=!0)},o(i){m(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function Do(t){let e,r;return e=new wo({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Mo(t){let e,r;return e=new vo({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Po(t){let e,r,n,i,o,s,l;e=new bt({props:{brandingInfo:t[4]}});const c=[Mo,Do],a=[];function u(d,h){return h&4&&(n=null),n==null&&(n=!!d[2].isSandbox()),n?0:1}return i=u(t,-1),o=a[i]=c[i](t),{c(){w(e.$$.fragment),r=C(),o.c(),s=re()},m(d,h){b(e,d,h),p(d,r,h),a[i].m(d,h),p(d,s,h),l=!0},p(d,h){const v={};h&16&&(v.brandingInfo=d[4]),e.$set(v);let E=i;i=u(d,h),i!==E&&(K(),m(a[E],1,1,()=>{a[E]=null}),q(),o=a[i],o||(o=a[i]=c[i](d),o.c()),f(o,1),o.m(s.parentNode,s))},i(d){l||(f(e.$$.fragment,d),f(o),l=!0)},o(d){m(e.$$.fragment,d),m(o),l=!1},d(d){d&&(g(r),g(s)),I(e,d),a[i].d(d)}}}function Co(t){let e,r;return e=new ze({props:{slot:"header",$$slots:{default:[Po]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&67108884&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function St(t){let e,r;return e=new pt({props:{productDetails:t[3],purchaseOption:t[1]}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.productDetails=n[3]),i&2&&(o.purchaseOption=n[1]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Ot(t){let e,r;return e=new Ve({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Lt(t){let e,r;return e=new Yi({props:{onContinue:t[11],onClose:t[10],processing:t[7]==="processing-auth-info"}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&128&&(o.processing=n[7]==="processing-auth-info"),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Ft(t){let e,r;return e=new Pi({props:{paymentInfoCollectionMetadata:t[5],onContinue:t[11],onClose:t[10],onError:t[12],processing:t[7]==="polling-purchase-status"}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&32&&(o.paymentInfoCollectionMetadata=n[5]),i&128&&(o.processing=n[7]==="polling-purchase-status"),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function xt(t){let e,r;return e=new Ve({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Gt(t){var n;let e,r;return e=new Nr({props:{brandingInfo:t[4],lastError:t[6]??new j(L.UnknownError,"Unknown error without state set."),supportEmail:(n=t[4])==null?void 0:n.seller_company_support_email,onContinue:t[13]}}),{c(){w(e.$$.fragment)},m(i,o){b(e,i,o),r=!0},p(i,o){var l;const s={};o&16&&(s.brandingInfo=i[4]),o&64&&(s.lastError=i[6]??new j(L.UnknownError,"Unknown error without state set.")),o&16&&(s.supportEmail=(l=i[4])==null?void 0:l.seller_company_support_email),e.$set(s)},i(i){r||(f(e.$$.fragment,i),r=!0)},o(i){m(e.$$.fragment,i),r=!1},d(i){I(e,i)}}}function Yt(t){let e,r;return e=new Yr({props:{brandingInfo:t[4],onContinue:t[11]}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.brandingInfo=n[4]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Qo(t){let e,r,n,i,o,s,l,c,a=t[7]==="present-offer"&&t[3]&&t[1]&&St(t),u=t[7]==="present-offer"&&!t[3]&&Ot(),d=(t[7]==="needs-auth-info"||t[7]==="processing-auth-info")&&Lt(t),h=t[5]&&(t[7]==="needs-payment-info"||t[7]==="polling-purchase-status")&&Ft(t),v=t[7]==="loading"&&xt(),E=t[7]==="error"&&Gt(t),B=t[7]==="success"&&Yt(t);return{c(){a&&a.c(),e=C(),u&&u.c(),r=C(),d&&d.c(),n=C(),h&&h.c(),i=C(),v&&v.c(),o=C(),E&&E.c(),s=C(),B&&B.c(),l=re()},m(A,y){a&&a.m(A,y),p(A,e,y),u&&u.m(A,y),p(A,r,y),d&&d.m(A,y),p(A,n,y),h&&h.m(A,y),p(A,i,y),v&&v.m(A,y),p(A,o,y),E&&E.m(A,y),p(A,s,y),B&&B.m(A,y),p(A,l,y),c=!0},p(A,y){A[7]==="present-offer"&&A[3]&&A[1]?a?(a.p(A,y),y&138&&f(a,1)):(a=St(A),a.c(),f(a,1),a.m(e.parentNode,e)):a&&(K(),m(a,1,1,()=>{a=null}),q()),A[7]==="present-offer"&&!A[3]?u?y&136&&f(u,1):(u=Ot(),u.c(),f(u,1),u.m(r.parentNode,r)):u&&(K(),m(u,1,1,()=>{u=null}),q()),A[7]==="needs-auth-info"||A[7]==="processing-auth-info"?d?(d.p(A,y),y&128&&f(d,1)):(d=Lt(A),d.c(),f(d,1),d.m(n.parentNode,n)):d&&(K(),m(d,1,1,()=>{d=null}),q()),A[5]&&(A[7]==="needs-payment-info"||A[7]==="polling-purchase-status")?h?(h.p(A,y),y&160&&f(h,1)):(h=Ft(A),h.c(),f(h,1),h.m(i.parentNode,i)):h&&(K(),m(h,1,1,()=>{h=null}),q()),A[7]==="loading"?v?y&128&&f(v,1):(v=xt(),v.c(),f(v,1),v.m(o.parentNode,o)):v&&(K(),m(v,1,1,()=>{v=null}),q()),A[7]==="error"?E?(E.p(A,y),y&128&&f(E,1)):(E=Gt(A),E.c(),f(E,1),E.m(s.parentNode,s)):E&&(K(),m(E,1,1,()=>{E=null}),q()),A[7]==="success"?B?(B.p(A,y),y&128&&f(B,1)):(B=Yt(A),B.c(),f(B,1),B.m(l.parentNode,l)):B&&(K(),m(B,1,1,()=>{B=null}),q())},i(A){c||(f(a),f(u),f(d),f(h),f(v),f(E),f(B),c=!0)},o(A){m(a),m(u),m(d),m(h),m(v),m(E),m(B),c=!1},d(A){A&&(g(e),g(r),g(n),g(i),g(o),g(s),g(l)),a&&a.d(A),u&&u.d(A),d&&d.d(A),h&&h.d(A),v&&v.d(A),E&&E.d(A),B&&B.d(A)}}}function To(t){let e,r=t[9].includes(t[7]),n,i,o,s,l=r&&Ut(t);return o=new Tt({props:{$$slots:{default:[Qo]},$$scope:{ctx:t}}}),{c(){e=k("div"),l&&l.c(),n=C(),i=k("div"),w(o.$$.fragment),_(i,"class","rcb-ui-main svelte-1qect5g"),_(e,"class","rcb-ui-layout svelte-1qect5g"),_(e,"style",t[8])},m(c,a){p(c,e,a),l&&l.m(e,null),M(e,n),M(e,i),b(o,i,null),s=!0},p(c,a){a&128&&(r=c[9].includes(c[7])),r?l?(l.p(c,a),a&128&&f(l,1)):(l=Ut(c),l.c(),f(l,1),l.m(e,n)):l&&(K(),m(l,1,1,()=>{l=null}),q());const u={};a&67109114&&(u.$$scope={dirty:a,ctx:c}),o.$set(u)},i(c){s||(f(l),f(o.$$.fragment,c),s=!0)},o(c){m(l),m(o.$$.fragment,c),s=!1},d(c){c&&g(e),l&&l.d(),I(o)}}}function No(t){let e,r,n;return r=new ro({props:{condition:t[0],$$slots:{default:[To]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-ui-container svelte-1qect5g")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p(i,[o]){const s={};o&1&&(s.condition=i[0]),o&67109118&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}function Uo(t,e,r){var Kt,qt;let{asModal:n=!0}=e,{customerEmail:i}=e,{appUserId:o}=e,{rcPackage:s}=e,{purchaseOption:l}=e,{onFinished:c}=e,{onError:a}=e,{onClose:u}=e,{purchases:d}=e,{backend:h}=e,{purchaseOperationHelper:v}=e;const E=Object.entries(ve).map(([D,tt])=>`--rc-color-${D}: ${tt}`).join("; ");let B=null,A=null,y=null,R=null;const P=((Kt=s==null?void 0:s.rcBillingProduct)==null?void 0:Kt.identifier)??null,Le=(qt=s==null?void 0:s.rcBillingProduct)==null?void 0:qt.defaultSubscriptionOption,Y=l||Le;let S="present-offer";const Fe=["present-offer","needs-auth-info","processing-auth-info","needs-payment-info","polling-purchase-status","loading"];Me(async()=>{if(r(3,B=s.rcBillingProduct),r(4,A=await h.getBrandingInfo()),S==="present-offer"){i?Ht():r(7,S="needs-auth-info");return}});const xe=()=>{u()},Ht=()=>{if(P===null){ye(new j(L.ErrorSettingUpPurchase,"Product ID was not set before purchase."));return}else S==="present-offer"&&r(7,S="loading");if(!i){ye(new j(L.MissingEmailError));return}v.startPurchase(o,P,Y,i,s.rcBillingProduct.presentedOfferingIdentifier).then(D=>{if(D.next_action==="collect_payment_info"){r(7,S="needs-payment-info"),r(5,y=D);return}if(D.next_action==="completed"){r(7,S="success");return}}).catch(D=>{ye(D)})},Wo=D=>{if(S==="needs-auth-info"){D&&(r(14,i=D.email),r(7,S="processing-auth-info")),Ht();return}if(S==="needs-payment-info"){r(7,S="polling-purchase-status"),v.pollCurrentPurchaseForCompletion().then(()=>{r(7,S="success")}).catch(tt=>{ye(tt)});return}if(S==="success"||S==="error"){c();return}r(7,S="success")},ye=D=>{r(6,R=D),r(7,S="error")},zo=()=>{a(R??new j(L.UnknownError,"Unknown error without state set."))};return t.$$set=D=>{"asModal"in D&&r(0,n=D.asModal),"customerEmail"in D&&r(14,i=D.customerEmail),"appUserId"in D&&r(15,o=D.appUserId),"rcPackage"in D&&r(16,s=D.rcPackage),"purchaseOption"in D&&r(1,l=D.purchaseOption),"onFinished"in D&&r(17,c=D.onFinished),"onError"in D&&r(18,a=D.onError),"onClose"in D&&r(19,u=D.onClose),"purchases"in D&&r(2,d=D.purchases),"backend"in D&&r(20,h=D.backend),"purchaseOperationHelper"in D&&r(21,v=D.purchaseOperationHelper)},[n,l,d,B,A,y,R,S,E,Fe,xe,Wo,ye,zo,i,o,s,c,a,u,h,v]}class Ro extends U{constructor(e){super(),N(this,e,Uo,No,T,{asModal:0,customerEmail:14,appUserId:15,rcPackage:16,purchaseOption:1,onFinished:17,onError:18,onClose:19,purchases:2,backend:20,purchaseOperationHelper:21},yo)}}function So(t){return t.expires_date==null?!0:new Date(t.expires_date)>new Date}function Oo(t,e,r,n){const i=e.product_identifier;if(i in r)return Lo(t,e,r[i]);if(i in n)return Fo(t,e,n[i]);throw new Z(te.CustomerInfoError,"Could not find entitlement product in subscriptions or non-subscriptions.")}function Lo(t,e,r){return{identifier:t,isActive:So(e),willRenew:Yo(e,r),store:(r==null?void 0:r.store)??"unknown",latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(e.purchase_date),expirationDate:Oe(e.expires_date),productIdentifier:e.product_identifier,unsubscribeDetectedAt:Oe(r==null?void 0:r.unsubscribe_detected_at),billingIssueDetectedAt:Oe(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 Fo(t,e,r){return{identifier:t,isActive:!0,willRenew:!1,store:r.store,latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(r.original_purchase_date),expirationDate:null,productIdentifier:e.product_identifier,unsubscribeDetectedAt:null,billingIssueDetectedAt:null,isSandbox:r.is_sandbox,periodType:"normal"}}function xo(t,e,r){const n={},i={};for(const o in t){const s=Oo(o,t[o],e,r);n[o]=s,s.isActive&&(i[o]=s)}return{all:n,active:i}}function Oe(t){return t==null?null:new Date(t)}function Go(t){const e=Ko(t),r=t.subscriber,n=jo(r.non_subscriptions);return{entitlements:xo(r.entitlements,r.subscriptions,n),allExpirationDatesByProduct:e,allPurchaseDatesByProduct:Ho(t,n),activeSubscriptions:qo(e),managementURL:r.management_url,requestDate:new Date(t.request_date),firstSeenDate:new Date(r.first_seen),originalPurchaseDate:Oe(r.original_purchase_date),originalAppUserId:t.subscriber.original_app_user_id}}function Yo(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 Ho(t,e){const r={};for(const n in t.subscriber.subscriptions){const i=t.subscriber.subscriptions[n];r[n]=new Date(i.purchase_date)}for(const n in e){const i=e[n].purchase_date;i==null?r[n]=null:r[n]=new Date(i)}return r}function Ko(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 jo(t){const e={};for(const r in t){if(t[r].length===0)continue;const n=t[r].length;e[r]=t[r][n-1]}return e}function Jo(t){if(!/^rcb_[a-zA-Z0-9_.-]+$/.test(t))throw new Z(te.InvalidCredentialsError,"Invalid API key. Use your RevenueCat Billing API key.")}function Vo(t){if(new Set(["no_user","null","none","nil","(null)","NaN","\\x00","","unidentified","undefined","unknown"]).has(t)||t.includes("/"))throw new Z(te.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 ee=class ee{constructor(e,r){Q(this,"_API_KEY");Q(this,"_appUserId");Q(this,"backend");Q(this,"purchaseOperationHelper");Q(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:ot(n,i),s={};return e.offerings.forEach(l=>{const c=ot(l,i);c!=null&&(s[l.identifier]=c)}),Object.keys(s).length==0&&G.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,Xe(e)&&G.debugLog("Initializing Purchases SDK with sandbox API Key"),this.backend=new Eo(this._API_KEY),this.purchaseOperationHelper=new Fn(this.backend)}static setLogLevel(e){G.setLogLevel(e)}static getSharedInstance(){if(ee.isConfigured())return ee.instance;throw new At}static isConfigured(){return ee.instance!==void 0}static configure(e,r){return ee.instance!==void 0&&G.warnLog("Purchases is already initialized. You normally should only configure Purchases once. Creating and returning new instance."),Jo(e),Vo(r),ee.instance=new ee(e,r),ee.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){return this.purchase({rcPackage:e,customerEmail:r,htmlTarget:n})}purchase(e){const{rcPackage:r,purchaseOption:n,htmlTarget:i,customerEmail:o}=e;let s=i??document.getElementById("rcb-ui-root");if(s===null){const u=document.createElement("div");u.className="rcb-ui-root",document.body.appendChild(u),s=u}if(s===null)throw new Error("Could not generate a mount point for the billing widget");const l=s,c=!i,a=this._appUserId;return G.debugLog(`Presenting purchase form for package ${r.identifier}`),new Promise((u,d)=>{new Ro({target:l,props:{appUserId:a,rcPackage:r,purchaseOption:n,customerEmail:o,onFinished:async()=>{G.debugLog("Purchase finished"),l.innerHTML="",u({customerInfo:await this._getCustomerInfoForUserId(a)})},onClose:()=>{l.innerHTML="",G.debugLog("Purchase cancelled by user"),d(new Z(te.UserCancelledError))},onError:h=>{l.innerHTML="",d(Z.getForPurchasesFlowError(h))},purchases:this,backend:this.backend,purchaseOperationHelper:this.purchaseOperationHelper,asModal:c}})})}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&&G.debugLog(`Could not find product data for product ids:
6
+ -20px 0 #fff2;background:#fff2}}`)}function pi(t){let e;return{c(){e=k("div"),_(e,"class","processing svelte-rjmul6")},m(r,n){p(r,e,n)},p:$,i:$,o:$,d(r){r&&g(e)}}}class Pt extends U{constructor(e){super(),N(this,e,null,pi,T,{},gi)}}function _i(t){F(t,"svelte-1wxt892",".rcb-stripe-elements-container.svelte-1wxt892{width:100%;margin-top:32px;margin-bottom:24px}")}function Ai(t){let e,r;return e=new Ve({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p:$,i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function hi(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:[Bi]},$$scope:{ctx:t}};return t[2]!==void 0&&(c.elements=t[2]),r=new Xr({props:c}),Pe.push(()=>wn(r,"elements",l)),{c(){e=k("form"),w(r.$$.fragment)},m(a,u){p(a,e,u),b(r,e,null),i=!0,o||(s=_e(e,"submit",ut(t[5])),o=!0)},p(a,u){const d={};u&8&&(d.stripe=a[3]),u&2051&&(d.$$scope={dirty:u,ctx:a}),!n&&u&4&&(n=!0,d.elements=a[2],En(()=>n=!1)),r.$set(d)},i(a){i||(f(r.$$.fragment,a),i=!0)},o(a){m(r.$$.fragment,a),i=!1},d(a){a&&g(e),I(r),o=!1,s()}}}function Ei(t){let e,r,n,i;return n=new mi({}),{c(){e=k("div"),e.textContent="Secure Checkout",r=C(),w(n.$$.fragment)},m(o,s){p(o,e,s),p(o,r,s),b(n,o,s),i=!0},p:$,i(o){i||(f(n.$$.fragment,o),i=!0)},o(o){m(n.$$.fragment,o),i=!1},d(o){o&&(g(e),g(r)),I(n,o)}}}function bi(t){let e,r,n;return r=new Vr({}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-stripe-elements-container svelte-1wxt892")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p:$,i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}function Ii(t){let e;return{c(){e=O("Pay")},m(r,n){p(r,e,n)},i:$,o:$,d(r){r&&g(e)}}}function wi(t){let e,r;return e=new Pt({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function ki(t){let e,r,n,i;const o=[wi,Ii],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=re()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,a){let u=e;e=l(c),e!==u&&(K(),m(s[u],1,1,()=>{s[u]=null}),q(),r=s[e],r||(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){m(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function $i(t){let e;return{c(){e=O("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function yi(t){let e,r,n,i;return e=new Ie({props:{disabled:t[0],$$slots:{default:[ki]},$$scope:{ctx:t}}}),n=new Ie({props:{disabled:t[0],intent:"secondary",$$slots:{default:[$i]},$$scope:{ctx:t}}}),n.$on("click",function(){se(t[1])&&t[1].apply(this,arguments)}),{c(){w(e.$$.fragment),r=C(),w(n.$$.fragment)},m(o,s){b(e,o,s),p(o,r,s),b(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||(f(e.$$.fragment,o),f(n.$$.fragment,o),i=!0)},o(o){m(e.$$.fragment,o),m(n.$$.fragment,o),i=!1},d(o){o&&g(r),I(e,o),I(n,o)}}}function vi(t){let e,r;return e=new we({props:{$$slots:{default:[yi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&2051&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Bi(t){let e,r,n,i,o,s;return e=new ze({props:{$$slots:{default:[Ei]},$$scope:{ctx:t}}}),n=new fe({props:{$$slots:{default:[bi]},$$scope:{ctx:t}}}),o=new We({props:{$$slots:{default:[vi]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment),r=C(),w(n.$$.fragment),i=C(),w(o.$$.fragment)},m(l,c){b(e,l,c),p(l,r,c),b(n,l,c),p(l,i,c),b(o,l,c),s=!0},p(l,c){const a={};c&2048&&(a.$$scope={dirty:c,ctx:l}),e.$set(a);const u={};c&2048&&(u.$$scope={dirty:c,ctx:l}),n.$set(u);const d={};c&2051&&(d.$$scope={dirty:c,ctx:l}),o.$set(d)},i(l){s||(f(e.$$.fragment,l),f(n.$$.fragment,l),f(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(n.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(g(r),g(i)),I(e,l),I(n,l),I(o,l)}}}function Di(t){let e,r,n,i;const o=[hi,Ai],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 u=r;r=l(c),r===u?s[r].p(c,a):(K(),m(s[u],1,1,()=>{s[u]=null}),q(),n=s[r],n?n.p(c,a):(n=s[r]=o[r](c),n.c()),f(n,1),n.m(e,null))},i(c){i||(f(n),i=!0)},o(c){m(n),i=!1},d(c){c&&g(e),s[r].d()}}}function Mi(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,u,d;Me(async()=>{const E=s.data.publishable_api_key,B=s.data.stripe_account_id;if(!E||!B)throw new Error("Stripe publishable key or account ID not found");r(3,a=await si(E,{stripeAccount:B}))});const h=async()=>{if(l||!a||!d)return;r(0,l=!0);const E=await a.confirmSetup({elements:d,redirect:"if_required"});E.error?(r(0,l=!1),o(new j(L.StripeError,E.error.message))):i()};function y(E){u=E,r(2,u)}return t.$$set=E=>{"onClose"in E&&r(1,n=E.onClose),"onContinue"in E&&r(6,i=E.onContinue),"onError"in E&&r(7,o=E.onError),"paymentInfoCollectionMetadata"in E&&r(8,s=E.paymentInfoCollectionMetadata),"processing"in E&&r(0,l=E.processing)},t.$$.update=()=>{t.$$.dirty&4&&u&&u._elements.length>0&&(d=u)},[l,n,u,a,c,h,i,o,s,y]}class Pi extends U{constructor(e){super(),N(this,e,Mi,Di,T,{onClose:1,onContinue:6,onError:7,paymentInfoCollectionMetadata:8,processing:0},_i)}}function Ci(t){return t.trim()===""?"You need to provide your email address to continue.":t.match(/^[^@]+@[^@]+\.[^@]+$/)?null:"Email is not valid. Please provide a valid email address."}function Qi(t){F(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 Ti(t){let e;return{c(){e=O("Billing email address")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function Ct(t){let e,r;return{c(){e=k("div"),r=O(t[2]),_(e,"class","form-error svelte-favd20")},m(n,i){p(n,e,i),M(e,r)},p(n,i){i&4&&le(r,n[2])},d(n){n&&g(e)}}}function Ni(t){let e,r,n,i,o,s,l,c,a,u=t[2]&&Ct(t);return{c(){e=k("div"),r=k("div"),r.innerHTML='<label for="email">Email</label>',n=C(),i=k("div"),o=k("input"),l=C(),u&&u.c(),_(r,"class","form-label svelte-favd20"),_(o,"name","email"),_(o,"placeholder","john@appleseed.com"),_(o,"autocapitalize","off"),_(o,"class","svelte-favd20"),_(i,"class",s="form-input "+t[4]+" svelte-favd20"),_(e,"class","form-container svelte-favd20")},m(d,h){p(d,e,h),M(e,r),M(e,n),M(e,i),M(i,o),ft(o,t[3]),M(e,l),u&&u.m(e,null),c||(a=_e(o,"input",t[7]),c=!0)},p(d,h){h&8&&o.value!==d[3]&&ft(o,d[3]),h&16&&s!==(s="form-input "+d[4]+" svelte-favd20")&&_(i,"class",s),d[2]?u?u.p(d,h):(u=Ct(d),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},d(d){d&&g(e),u&&u.d(),c=!1,a()}}}function Ui(t){let e;return{c(){e=O("Continue")},m(r,n){p(r,e,n)},i:$,o:$,d(r){r&&g(e)}}}function Ri(t){let e,r;return e=new Pt({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Si(t){let e,r,n,i;const o=[Ri,Ui],s=[];function l(c,a){return c[1]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=re()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,a){let u=e;e=l(c),e!==u&&(K(),m(s[u],1,1,()=>{s[u]=null}),q(),r=s[e],r||(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){m(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function Oi(t){let e;return{c(){e=O("Close")},m(r,n){p(r,e,n)},d(r){r&&g(e)}}}function Li(t){let e,r,n,i;return e=new Ie({props:{disabled:t[1],$$slots:{default:[Si]},$$scope:{ctx:t}}}),n=new Ie({props:{intent:"secondary",disabled:t[1],$$slots:{default:[Oi]},$$scope:{ctx:t}}}),n.$on("click",function(){se(t[0])&&t[0].apply(this,arguments)}),{c(){w(e.$$.fragment),r=C(),w(n.$$.fragment)},m(o,s){b(e,o,s),p(o,r,s),b(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||(f(e.$$.fragment,o),f(n.$$.fragment,o),i=!0)},o(o){m(e.$$.fragment,o),m(n.$$.fragment,o),i=!1},d(o){o&&g(r),I(e,o),I(n,o)}}}function Fi(t){let e,r;return e=new we({props:{$$slots:{default:[Li]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&259&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function xi(t){let e,r,n,i,o,s,l,c,a;return r=new ze({props:{$$slots:{default:[Ti]},$$scope:{ctx:t}}}),i=new fe({props:{$$slots:{default:[Ni]},$$scope:{ctx:t}}}),s=new We({props:{$$slots:{default:[Fi]},$$scope:{ctx:t}}}),{c(){e=k("form"),w(r.$$.fragment),n=C(),w(i.$$.fragment),o=C(),w(s.$$.fragment),_(e,"class","svelte-favd20")},m(u,d){p(u,e,d),b(r,e,null),M(e,n),b(i,e,null),M(e,o),b(s,e,null),l=!0,c||(a=_e(e,"submit",ut(t[5])),c=!0)},p(u,[d]){const h={};d&256&&(h.$$scope={dirty:d,ctx:u}),r.$set(h);const y={};d&284&&(y.$$scope={dirty:d,ctx:u}),i.$set(y);const E={};d&259&&(E.$$scope={dirty:d,ctx:u}),s.$set(E)},i(u){l||(f(r.$$.fragment,u),f(i.$$.fragment,u),f(s.$$.fragment,u),l=!0)},o(u){m(r.$$.fragment,u),m(i.$$.fragment,u),m(s.$$.fragment,u),l=!1},d(u){u&&g(e),I(r),I(i),I(s),c=!1,a()}}}function Gi(t,e,r){let n,i,o,{onContinue:s}=e,{onClose:l}=e,{processing:c}=e;const a=async()=>{const d=Ci(n);d?r(2,i=d):s({email:n})};function u(){n=this.value,r(3,n)}return t.$$set=d=>{"onContinue"in d&&r(6,s=d.onContinue),"onClose"in d&&r(0,l=d.onClose),"processing"in d&&r(1,c=d.processing)},t.$$.update=()=>{t.$$.dirty&4&&r(4,o=i?"error":"")},r(3,n=""),r(2,i=""),[l,c,i,n,o,a,s,u]}class Yi extends U{constructor(e){super(),N(this,e,Gi,xi,T,{onContinue:6,onClose:0,processing:1},Qi)}}function Hi(t){F(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 Ki(t){let e,r;const n=t[1].default,i=J(n,t,t[0],null);return{c(){e=k("div"),i&&i.c(),_(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)&&W(i,n,o,o[0],r?V(n,o[0],s,null):z(o[0]),null)},i(o){r||(f(i,o),r=!0)},o(o){m(i,o),r=!1},d(o){o&&g(e),i&&i.d(o)}}}function qi(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class ji extends U{constructor(e){super(),N(this,e,qi,Ki,T,{},Hi)}}function Ji(t){F(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 Vi(t){let e,r,n,i;const o=t[2].default,s=J(o,t,t[1],null);return{c(){e=k("div"),r=k("main"),s&&s.c(),_(r,"class",n=pe(`rcb-modal-main ${t[0]?"rcb-modal-dark":""}`)+" svelte-ioxu5d"),_(e,"class","rcb-modal-container svelte-ioxu5d")},m(l,c){p(l,e,c),M(e,r),s&&s.m(r,null),i=!0},p(l,[c]){s&&s.p&&(!i||c&2)&&W(s,o,l,l[1],i?V(o,l[1],c,null):z(l[1]),null),(!i||c&1&&n!==(n=pe(`rcb-modal-main ${l[0]?"rcb-modal-dark":""}`)+" svelte-ioxu5d"))&&_(r,"class",n)},i(l){i||(f(s,l),i=!0)},o(l){m(s,l),i=!1},d(l){l&&g(e),s&&s.d(l)}}}function Wi(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 zi extends U{constructor(e){super(),N(this,e,Wi,Vi,T,{dark:0},Ji)}}function Xi(t){let e;const r=t[1].default,n=J(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)&&W(n,r,i,i[2],e?V(r,i[2],o,null):z(i[2]),null)},i(i){e||(f(n,i),e=!0)},o(i){m(n,i),e=!1},d(i){n&&n.d(i)}}}function Zi(t){let e,r;return e=new ji({props:{$$slots:{default:[eo]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function eo(t){let e;const r=t[1].default,n=J(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)&&W(n,r,i,i[2],e?V(r,i[2],o,null):z(i[2]),null)},i(i){e||(f(n,i),e=!0)},o(i){m(n,i),e=!1},d(i){n&&n.d(i)}}}function to(t){let e,r,n,i;const o=[Zi,Xi],s=[];function l(c,a){return c[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=re()},m(c,a){s[e].m(c,a),p(c,n,a),i=!0},p(c,[a]){let u=e;e=l(c),e===u?s[e].p(c,a):(K(),m(s[u],1,1,()=>{s[u]=null}),q(),r=s[e],r?r.p(c,a):(r=s[e]=o[e](c),r.c()),f(r,1),r.m(n.parentNode,n))},i(c){i||(f(r),i=!0)},o(c){m(r),i=!1},d(c){c&&g(n),s[e].d(c)}}}function no(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 ro extends U{constructor(e){super(),N(this,e,no,to,T,{condition:0})}}const io=t=>({}),Qt=t=>({});function oo(t){let e,r;const n=t[1].header,i=J(n,t,t[2],Qt),o=t[1].default,s=J(o,t,t[2],null);return{c(){i&&i.c(),e=C(),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)&&W(i,n,l,l[2],r?V(n,l[2],c,io):z(l[2]),Qt),s&&s.p&&(!r||c&4)&&W(s,o,l,l[2],r?V(o,l[2],c,null):z(l[2]),null)},i(l){r||(f(i,l),f(s,l),r=!0)},o(l){m(i,l),m(s,l),r=!1},d(l){l&&g(e),i&&i.d(l),s&&s.d(l)}}}function so(t){let e,r;return e=new zi({props:{dark:t[0],$$slots:{default:[oo]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(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||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function lo(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 Tt extends U{constructor(e){super(),N(this,e,lo,so,T,{dark:0})}}const co="0.3.3",de="https://api.revenuecat.com";var Re;(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"})(Re||(Re={}));function Xe(t){return t?t.startsWith("rcb_sb_"):!1}async function me(t,e,r,n){try{const i=await fetch(t.url(),{method:t.method,headers:fo(e,n),body:uo(r)});return await ao(i,t),await i.json()}catch(i){throw i instanceof TypeError?new Z(te.NetworkError,Ee.getPublicMessage(te.NetworkError),i.message):i}}async function ao(t,e){const r=t.status;if(r>=Re.INTERNAL_SERVER_ERROR)Ze(e,r,await t.text());else if(r>=Re.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=Ee.convertCodeToBackendErrorCode(o);if(l==null)Ze(e,r,i);else throw Z.getForBackendError(l,s)}else Ze(e,r,i)}}function Ze(t,e,r){throw new Z(te.UnknownBackendError,`Unknown backend error. Request: ${t.name}. Status code: ${e}. Body: ${r}.`)}function uo(t){return t==null?null:JSON.stringify(t)}function fo(t,e){let r={Authorization:`Bearer ${t}`,"Content-Type":"application/json",Accept:"application/json","X-Platform":"web","X-Version":co,"X-Is-Sandbox":`${Xe(t)}`};return e!=null&&(r={...r,...e}),r}const Nt="/v1/subscribers",Se="/rcbilling/v1";class mo{constructor(e){Q(this,"appUserId");Q(this,"method","GET");Q(this,"name","getOfferings");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${de}${Nt}/${e}/offerings`}}class go{constructor(){Q(this,"method","POST");Q(this,"name","subscribe")}url(){return`${de}${Se}/subscribe`}}class po{constructor(e,r){Q(this,"method","GET");Q(this,"name","getProducts");Q(this,"appUserId");Q(this,"productIds");this.appUserId=e,this.productIds=r}url(){const e=encodeURIComponent(this.appUserId),r=this.productIds.map(encodeURIComponent).join("&id=");return`${de}${Se}/subscribers/${e}/products?id=${r}`}}class _o{constructor(e){Q(this,"method","GET");Q(this,"name","getCustomerInfo");Q(this,"appUserId");this.appUserId=e}url(){const e=encodeURIComponent(this.appUserId);return`${de}${Nt}/${e}`}}class Ao{constructor(){Q(this,"method","GET");Q(this,"name","getBrandingInfo")}url(){return`${de}${Se}/branding`}}class ho{constructor(e){Q(this,"method","GET");Q(this,"name","getCheckoutStatus");Q(this,"operationSessionId");this.operationSessionId=e}url(){return`${de}${Se}/checkout/${this.operationSessionId}`}}class Eo{constructor(e){Q(this,"API_KEY");this.API_KEY=e}async getOfferings(e){return await me(new mo(e),this.API_KEY)}async getCustomerInfo(e){return await me(new _o(e),this.API_KEY)}async getProducts(e,r){return await me(new po(e,r),this.API_KEY)}async getBrandingInfo(){return await me(new Ao,this.API_KEY)}async postSubscribe(e,r,n,i,o){const s={app_user_id:e,product_id:r,email:n,presented_offering_identifier:i};return o&&o!=="base_option"&&(s.offer_id=o),await me(new go,this.API_KEY,s)}async getCheckoutStatus(e){return await me(new ho(e),this.API_KEY)}}const bo="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 Io(t){let e,r;return{c(){e=k("img"),ne(e.src,r=bo)||_(e,"src",r),_(e,"alt","icon"),_(e,"class","rcb-ui-asset-icon")},m(n,i){p(n,e,i)},p:$,i:$,o:$,d(n){n&&g(e)}}}class wo extends U{constructor(e){super(),N(this,e,null,Io,T,{})}}function ko(t){F(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 $o(t){let e;return{c(){e=k("div"),e.textContent="Sandbox",_(e,"class","svelte-1rhrjxe")},m(r,n){p(r,e,n)},p:$,i:$,o:$,d(r){r&&g(e)}}}class yo extends U{constructor(e){super(),N(this,e,null,$o,T,{},ko)}}function vo(t){F(t,"svelte-1qect5g",`.rcb-ui-container.svelte-1qect5g{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-1qect5g{width:100vw;width:100 dvw;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-1qect5g{margin-right:16px;flex:320px 1 0;max-width:480px}.rcb-ui-main.svelte-1qect5g{flex:480px 1 0;max-width:640px}@media screen and (max-width: 960px){.rcb-ui-layout.svelte-1qect5g{flex-direction:column;align-items:center;justify-content:center;height:100%;min-width:100%}.rcb-ui-aside.svelte-1qect5g{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-1qect5g{flex:none;max-width:none;min-width:100%}}@media screen and (max-width: 960px) and (max-height: 960px){.rcb-ui-layout.svelte-1qect5g{overflow-y:scroll;justify-content:flex-start;padding:16px 0px}}`)}function Ut(t){let e,r,n;return r=new Tt({props:{dark:!0,$$slots:{header:[Co],default:[Bo]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-ui-aside svelte-1qect5g")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p(i,o){const s={};o&67108878&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}function Rt(t){let e,r;return e=new pt({props:{productDetails:t[2],purchaseOption:t[8]}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.productDetails=n[2]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Bo(t){let e,r,n=t[2]&&t[8]&&Rt(t);return{c(){n&&n.c(),e=re()},m(i,o){n&&n.m(i,o),p(i,e,o),r=!0},p(i,o){i[2]&&i[8]?n?(n.p(i,o),o&4&&f(n,1)):(n=Rt(i),n.c(),f(n,1),n.m(e.parentNode,e)):n&&(K(),m(n,1,1,()=>{n=null}),q())},i(i){r||(f(n),r=!0)},o(i){m(n),r=!1},d(i){i&&g(e),n&&n.d(i)}}}function Do(t){let e,r;return e=new wo({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Mo(t){let e,r;return e=new yo({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Po(t){let e,r,n,i,o,s,l;e=new bt({props:{brandingInfo:t[3]}});const c=[Mo,Do],a=[];function u(d,h){return h&2&&(n=null),n==null&&(n=!!d[1].isSandbox()),n?0:1}return i=u(t,-1),o=a[i]=c[i](t),{c(){w(e.$$.fragment),r=C(),o.c(),s=re()},m(d,h){b(e,d,h),p(d,r,h),a[i].m(d,h),p(d,s,h),l=!0},p(d,h){const y={};h&8&&(y.brandingInfo=d[3]),e.$set(y);let E=i;i=u(d,h),i!==E&&(K(),m(a[E],1,1,()=>{a[E]=null}),q(),o=a[i],o||(o=a[i]=c[i](d),o.c()),f(o,1),o.m(s.parentNode,s))},i(d){l||(f(e.$$.fragment,d),f(o),l=!0)},o(d){m(e.$$.fragment,d),m(o),l=!1},d(d){d&&(g(r),g(s)),I(e,d),a[i].d(d)}}}function Co(t){let e,r;return e=new ze({props:{slot:"header",$$slots:{default:[Po]},$$scope:{ctx:t}}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&67108874&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function St(t){let e,r;return e=new pt({props:{productDetails:t[2],purchaseOption:t[8]}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.productDetails=n[2]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Ot(t){let e,r;return e=new Ve({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Lt(t){let e,r;return e=new Yi({props:{onContinue:t[11],onClose:t[10],processing:t[6]==="processing-auth-info"}}),{c(){w(e.$$.fragment)},m(n,i){b(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||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Ft(t){let e,r;return e=new Pi({props:{paymentInfoCollectionMetadata:t[4],onContinue:t[11],onClose:t[10],onError:t[12],processing:t[6]==="polling-purchase-status"}}),{c(){w(e.$$.fragment)},m(n,i){b(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||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function xt(t){let e,r;return e=new Ve({}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Gt(t){var n;let e,r;return e=new Nr({props:{brandingInfo:t[3],lastError:t[5]??new j(L.UnknownError,"Unknown error without state set."),supportEmail:(n=t[3])==null?void 0:n.seller_company_support_email,onContinue:t[13]}}),{c(){w(e.$$.fragment)},m(i,o){b(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(L.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||(f(e.$$.fragment,i),r=!0)},o(i){m(e.$$.fragment,i),r=!1},d(i){I(e,i)}}}function Yt(t){let e,r;return e=new Yr({props:{brandingInfo:t[3],onContinue:t[11]}}),{c(){w(e.$$.fragment)},m(n,i){b(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.brandingInfo=n[3]),e.$set(o)},i(n){r||(f(e.$$.fragment,n),r=!0)},o(n){m(e.$$.fragment,n),r=!1},d(n){I(e,n)}}}function Qo(t){let e,r,n,i,o,s,l,c,a=t[6]==="present-offer"&&t[2]&&t[8]&&St(t),u=t[6]==="present-offer"&&!t[2]&&Ot(),d=(t[6]==="needs-auth-info"||t[6]==="processing-auth-info")&&Lt(t),h=t[4]&&(t[6]==="needs-payment-info"||t[6]==="polling-purchase-status")&&Ft(t),y=t[6]==="loading"&&xt(),E=t[6]==="error"&&Gt(t),B=t[6]==="success"&&Yt(t);return{c(){a&&a.c(),e=C(),u&&u.c(),r=C(),d&&d.c(),n=C(),h&&h.c(),i=C(),y&&y.c(),o=C(),E&&E.c(),s=C(),B&&B.c(),l=re()},m(A,v){a&&a.m(A,v),p(A,e,v),u&&u.m(A,v),p(A,r,v),d&&d.m(A,v),p(A,n,v),h&&h.m(A,v),p(A,i,v),y&&y.m(A,v),p(A,o,v),E&&E.m(A,v),p(A,s,v),B&&B.m(A,v),p(A,l,v),c=!0},p(A,v){A[6]==="present-offer"&&A[2]&&A[8]?a?(a.p(A,v),v&68&&f(a,1)):(a=St(A),a.c(),f(a,1),a.m(e.parentNode,e)):a&&(K(),m(a,1,1,()=>{a=null}),q()),A[6]==="present-offer"&&!A[2]?u?v&68&&f(u,1):(u=Ot(),u.c(),f(u,1),u.m(r.parentNode,r)):u&&(K(),m(u,1,1,()=>{u=null}),q()),A[6]==="needs-auth-info"||A[6]==="processing-auth-info"?d?(d.p(A,v),v&64&&f(d,1)):(d=Lt(A),d.c(),f(d,1),d.m(n.parentNode,n)):d&&(K(),m(d,1,1,()=>{d=null}),q()),A[4]&&(A[6]==="needs-payment-info"||A[6]==="polling-purchase-status")?h?(h.p(A,v),v&80&&f(h,1)):(h=Ft(A),h.c(),f(h,1),h.m(i.parentNode,i)):h&&(K(),m(h,1,1,()=>{h=null}),q()),A[6]==="loading"?y?v&64&&f(y,1):(y=xt(),y.c(),f(y,1),y.m(o.parentNode,o)):y&&(K(),m(y,1,1,()=>{y=null}),q()),A[6]==="error"?E?(E.p(A,v),v&64&&f(E,1)):(E=Gt(A),E.c(),f(E,1),E.m(s.parentNode,s)):E&&(K(),m(E,1,1,()=>{E=null}),q()),A[6]==="success"?B?(B.p(A,v),v&64&&f(B,1)):(B=Yt(A),B.c(),f(B,1),B.m(l.parentNode,l)):B&&(K(),m(B,1,1,()=>{B=null}),q())},i(A){c||(f(a),f(u),f(d),f(h),f(y),f(E),f(B),c=!0)},o(A){m(a),m(u),m(d),m(h),m(y),m(E),m(B),c=!1},d(A){A&&(g(e),g(r),g(n),g(i),g(o),g(s),g(l)),a&&a.d(A),u&&u.d(A),d&&d.d(A),h&&h.d(A),y&&y.d(A),E&&E.d(A),B&&B.d(A)}}}function To(t){let e,r=t[9].includes(t[6]),n,i,o,s,l=r&&Ut(t);return o=new Tt({props:{$$slots:{default:[Qo]},$$scope:{ctx:t}}}),{c(){e=k("div"),l&&l.c(),n=C(),i=k("div"),w(o.$$.fragment),_(i,"class","rcb-ui-main svelte-1qect5g"),_(e,"class","rcb-ui-layout svelte-1qect5g"),_(e,"style",t[7])},m(c,a){p(c,e,a),l&&l.m(e,null),M(e,n),M(e,i),b(o,i,null),s=!0},p(c,a){a&64&&(r=c[9].includes(c[6])),r?l?(l.p(c,a),a&64&&f(l,1)):(l=Ut(c),l.c(),f(l,1),l.m(e,n)):l&&(K(),m(l,1,1,()=>{l=null}),q());const u={};a&67108988&&(u.$$scope={dirty:a,ctx:c}),o.$set(u)},i(c){s||(f(l),f(o.$$.fragment,c),s=!0)},o(c){m(l),m(o.$$.fragment,c),s=!1},d(c){c&&g(e),l&&l.d(),I(o)}}}function No(t){let e,r,n;return r=new ro({props:{condition:t[0],$$slots:{default:[To]},$$scope:{ctx:t}}}),{c(){e=k("div"),w(r.$$.fragment),_(e,"class","rcb-ui-container svelte-1qect5g")},m(i,o){p(i,e,o),b(r,e,null),n=!0},p(i,[o]){const s={};o&1&&(s.condition=i[0]),o&67108990&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(f(r.$$.fragment,i),n=!0)},o(i){m(r.$$.fragment,i),n=!1},d(i){i&&g(e),I(r)}}}function Uo(t,e,r){var Kt,qt;let{asModal:n=!0}=e,{customerEmail:i}=e,{appUserId:o}=e,{rcPackage:s}=e,{purchaseOption:l}=e,{onFinished:c}=e,{onError:a}=e,{onClose:u}=e,{purchases:d}=e,{backend:h}=e,{purchaseOperationHelper:y}=e;const E=Object.entries(ye).map(([D,tt])=>`--rc-color-${D}: ${tt}`).join("; ");let B=null,A=null,v=null,R=null;const P=((Kt=s==null?void 0:s.rcBillingProduct)==null?void 0:Kt.identifier)??null,Le=(qt=s==null?void 0:s.rcBillingProduct)==null?void 0:qt.defaultSubscriptionOption,G=l||Le;let S="present-offer";const Fe=["present-offer","needs-auth-info","processing-auth-info","needs-payment-info","polling-purchase-status","loading"];Me(async()=>{if(r(2,B=s.rcBillingProduct),r(3,A=await h.getBrandingInfo()),S==="present-offer"){i?Ht():r(6,S="needs-auth-info");return}});const xe=()=>{u()},Ht=()=>{if(P===null){ve(new j(L.ErrorSettingUpPurchase,"Product ID was not set before purchase."));return}else S==="present-offer"&&r(6,S="loading");if(!i){ve(new j(L.MissingEmailError));return}y.startPurchase(o,P,G,i,s.rcBillingProduct.presentedOfferingIdentifier).then(D=>{if(D.next_action==="collect_payment_info"){r(6,S="needs-payment-info"),r(4,v=D);return}if(D.next_action==="completed"){r(6,S="success");return}}).catch(D=>{ve(D)})},Wo=D=>{if(S==="needs-auth-info"){D&&(r(14,i=D.email),r(6,S="processing-auth-info")),Ht();return}if(S==="needs-payment-info"){r(6,S="polling-purchase-status"),y.pollCurrentPurchaseForCompletion().then(()=>{r(6,S="success")}).catch(tt=>{ve(tt)});return}if(S==="success"||S==="error"){c();return}r(6,S="success")},ve=D=>{r(5,R=D),r(6,S="error")},zo=()=>{a(R??new j(L.UnknownError,"Unknown error without state set."))};return t.$$set=D=>{"asModal"in D&&r(0,n=D.asModal),"customerEmail"in D&&r(14,i=D.customerEmail),"appUserId"in D&&r(15,o=D.appUserId),"rcPackage"in D&&r(16,s=D.rcPackage),"purchaseOption"in D&&r(17,l=D.purchaseOption),"onFinished"in D&&r(18,c=D.onFinished),"onError"in D&&r(19,a=D.onError),"onClose"in D&&r(20,u=D.onClose),"purchases"in D&&r(1,d=D.purchases),"backend"in D&&r(21,h=D.backend),"purchaseOperationHelper"in D&&r(22,y=D.purchaseOperationHelper)},[n,d,B,A,v,R,S,E,G,Fe,xe,Wo,ve,zo,i,o,s,l,c,a,u,h,y]}class Ro extends U{constructor(e){super(),N(this,e,Uo,No,T,{asModal:0,customerEmail:14,appUserId:15,rcPackage:16,purchaseOption:17,onFinished:18,onError:19,onClose:20,purchases:1,backend:21,purchaseOperationHelper:22},vo)}}function So(t){return t.expires_date==null?!0:new Date(t.expires_date)>new Date}function Oo(t,e,r,n){const i=e.product_identifier;if(i in r)return Lo(t,e,r[i]);if(i in n)return Fo(t,e,n[i]);throw new Z(te.CustomerInfoError,"Could not find entitlement product in subscriptions or non-subscriptions.")}function Lo(t,e,r){return{identifier:t,isActive:So(e),willRenew:Yo(e,r),store:(r==null?void 0:r.store)??"unknown",latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(e.purchase_date),expirationDate:Oe(e.expires_date),productIdentifier:e.product_identifier,unsubscribeDetectedAt:Oe(r==null?void 0:r.unsubscribe_detected_at),billingIssueDetectedAt:Oe(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 Fo(t,e,r){return{identifier:t,isActive:!0,willRenew:!1,store:r.store,latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(r.original_purchase_date),expirationDate:null,productIdentifier:e.product_identifier,unsubscribeDetectedAt:null,billingIssueDetectedAt:null,isSandbox:r.is_sandbox,periodType:"normal"}}function xo(t,e,r){const n={},i={};for(const o in t){const s=Oo(o,t[o],e,r);n[o]=s,s.isActive&&(i[o]=s)}return{all:n,active:i}}function Oe(t){return t==null?null:new Date(t)}function Go(t){const e=Ko(t),r=t.subscriber,n=jo(r.non_subscriptions);return{entitlements:xo(r.entitlements,r.subscriptions,n),allExpirationDatesByProduct:e,allPurchaseDatesByProduct:Ho(t,n),activeSubscriptions:qo(e),managementURL:r.management_url,requestDate:new Date(t.request_date),firstSeenDate:new Date(r.first_seen),originalPurchaseDate:Oe(r.original_purchase_date),originalAppUserId:t.subscriber.original_app_user_id}}function Yo(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 Ho(t,e){const r={};for(const n in t.subscriber.subscriptions){const i=t.subscriber.subscriptions[n];r[n]=new Date(i.purchase_date)}for(const n in e){const i=e[n].purchase_date;i==null?r[n]=null:r[n]=new Date(i)}return r}function Ko(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 jo(t){const e={};for(const r in t){if(t[r].length===0)continue;const n=t[r].length;e[r]=t[r][n-1]}return e}function Jo(t){if(!/^rcb_[a-zA-Z0-9_.-]+$/.test(t))throw new Z(te.InvalidCredentialsError,"Invalid API key. Use your RevenueCat Billing API key.")}function Vo(t){if(new Set(["no_user","null","none","nil","(null)","NaN","\\x00","","unidentified","undefined","unknown"]).has(t)||t.includes("/"))throw new Z(te.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 ee=class ee{constructor(e,r){Q(this,"_API_KEY");Q(this,"_appUserId");Q(this,"backend");Q(this,"purchaseOperationHelper");Q(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:ot(n,i),s={};return e.offerings.forEach(l=>{const c=ot(l,i);c!=null&&(s[l.identifier]=c)}),Object.keys(s).length==0&&Y.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,Xe(e)&&Y.debugLog("Initializing Purchases SDK with sandbox API Key"),this.backend=new Eo(this._API_KEY),this.purchaseOperationHelper=new Fn(this.backend)}static setLogLevel(e){Y.setLogLevel(e)}static getSharedInstance(){if(ee.isConfigured())return ee.instance;throw new At}static isConfigured(){return ee.instance!==void 0}static configure(e,r){return ee.instance!==void 0&&Y.warnLog("Purchases is already initialized. You normally should only configure Purchases once. Creating and returning new instance."),Jo(e),Vo(r),ee.instance=new ee(e,r),ee.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){return this.purchase({rcPackage:e,customerEmail:r,htmlTarget:n})}purchase(e){const{rcPackage:r,purchaseOption:n,htmlTarget:i,customerEmail:o}=e;let s=i??document.getElementById("rcb-ui-root");if(s===null){const u=document.createElement("div");u.className="rcb-ui-root",document.body.appendChild(u),s=u}if(s===null)throw new Error("Could not generate a mount point for the billing widget");const l=s,c=!i,a=this._appUserId;return Y.debugLog(`Presenting purchase form for package ${r.identifier}`),new Promise((u,d)=>{new Ro({target:l,props:{appUserId:a,rcPackage:r,purchaseOption:n,customerEmail:o,onFinished:async()=>{Y.debugLog("Purchase finished"),l.innerHTML="",u({customerInfo:await this._getCustomerInfoForUserId(a)})},onClose:()=>{l.innerHTML="",Y.debugLog("Purchase cancelled by user"),d(new Z(te.UserCancelledError))},onError:h=>{l.innerHTML="",d(Z.getForPurchasesFlowError(h))},purchases:this,backend:this.backend,purchaseOperationHelper:this.purchaseOperationHelper,asModal:c}})})}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&&Y.debugLog(`Could not find product data for product ids:
8
8
  ${i.join()}.
9
- Please check that your product configuration is correct.`)}isSandbox(){return Xe(this._API_KEY)}close(){ee.instance===this?ee.instance=void 0:G.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 Go(r)}};Q(ee,"instance");let et=ee;H.ErrorCode=te,H.LogLevel=x,H.PackageType=rt,H.Purchases=et,H.PurchasesError=Z,H.UninitializedPurchasesError=At,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
9
+ Please check that your product configuration is correct.`)}isSandbox(){return Xe(this._API_KEY)}close(){ee.instance===this?ee.instance=void 0:Y.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 Go(r)}};Q(ee,"instance");let et=ee;H.ErrorCode=te,H.LogLevel=x,H.PackageType=rt,H.Purchases=et,H.PurchasesError=Z,H.UninitializedPurchasesError=At,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@revenuecat/purchases-js",
3
3
  "description": "Web subscriptions made easy. Powered by RevenueCat",
4
4
  "private": false,
5
- "version": "0.3.2",
5
+ "version": "0.3.3",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"