@salla.sa/twilight-components 1.0.144 → 1.0.146

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.
@@ -7,11 +7,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-b4140db0.js');
9
9
 
10
- const sallaInstallmentCss = "#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm);margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}";
10
+ const sallaInstallmentCss = "#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm);margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}";
11
11
 
12
12
  const SallaInstallment = class {
13
13
  constructor(hostRef) {
14
14
  index.registerInstance(this, hostRef);
15
+ this.tabbyBorderRemoved = false;
16
+ this.tabbyRemoveBorderTries = 0;
15
17
  /**
16
18
  * Language code
17
19
  */
@@ -65,26 +67,23 @@ const SallaInstallment = class {
65
67
  document.querySelectorAll('.tabby-promo-snippet__logo').forEach(function (element) {
66
68
  element.setAttribute('aria-label', 'Tabby Logo');
67
69
  });
68
- //this is workaround to remove the default border and add margin
69
- setTimeout(() => {
70
- let promo = document.querySelector('#tabbyPromo>div>div');
71
- promo = promo ? promo.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]') : null;
72
- promo && (promo.style = 'border: none; margin: 15px 0!important; box-sizing: content-box;');
73
- }, 1000);
74
70
  };
71
+ //this is workaround to remove the default border and add margin
72
+ this.removeTabbyBorder();
75
73
  }
76
74
  // Spotii
77
75
  if (this.spotiiIsActive) {
78
76
  let amount = salla.money((Number(this.price) / 4).toFixed(2));
77
+ let isRTL = salla.config.get('theme.is_rtl', true);
79
78
  window.spotiiConfig = {
80
79
  targetXPath: ['.spotii-wrapper'],
81
80
  renderToPath: ['.spotii-promo'],
82
81
  numberOfPayment: 4,
83
82
  currency: this.currency,
84
- templateLine: "${textOne} ${number} ${textTwo} " + amount + " ${textThree} ${logo} ${info}",
83
+ templateLine: "${textOne} ${number} ${textTwo} " + amount + "${logo} ${info}",
85
84
  //todo:: translate these
86
- textOne: "جزء الدفع على",
87
- textTwo: "أو إدفعها على أقساط متساوية بدون تكاليف اضافية بقيمة",
85
+ textOne: isRTL ? "جزء الدفع على" : "Split it into",
86
+ textTwo: isRTL ? "أقساط متساوية بدون تكاليف اضافية بقيمة" : "payments of",
88
87
  textThree: "مع",
89
88
  price: this.price,
90
89
  // forcedShow: false,
@@ -98,6 +97,27 @@ const SallaInstallment = class {
98
97
  // }
99
98
  }
100
99
  }
100
+ /**
101
+ * this is workaround to remove the default border and add margin
102
+ * we will try to remove tabby border 5 times for 7.5 seconds
103
+ */
104
+ removeTabbyBorder() {
105
+ if (this.tabbyBorderRemoved || this.tabbyRemoveBorderTries > 5) {
106
+ return;
107
+ }
108
+ this.tabbyRemoveBorderTries++;
109
+ setTimeout(() => {
110
+ let promo = document.querySelector('#tabbyPromo>div>div');
111
+ promo = promo ? promo.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]') : null;
112
+ if (promo) {
113
+ promo.style = 'border: none; margin: 15px 0!important; box-sizing: content-box;';
114
+ this.tabbyBorderRemoved = true;
115
+ }
116
+ else {
117
+ this.removeTabbyBorder();
118
+ }
119
+ }, this.tabbyRemoveBorderTries * 500);
120
+ }
101
121
  };
102
122
  SallaInstallment.style = sallaInstallmentCss;
103
123
 
@@ -79,6 +79,26 @@
79
79
  .spotii-wrapper:hover {
80
80
  box-shadow: 0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D;
81
81
  }
82
+ .tamara-product-widget .spotii-logo,
83
+ .spotii-wrapper .spotii-logo {
84
+ float: left;
85
+ margin: 0 0 0 -75px;
86
+ }
87
+
88
+ .ltr .tamara-product-widget,
89
+ .ltr .spotii-wrapper {
90
+ text-align: left;
91
+ padding: 18px 100px 18px !important;
92
+ }
93
+ .ltr .tamara-product-widget .spotii-logo,
94
+ .ltr .spotii-wrapper .spotii-logo {
95
+ float: right;
96
+ margin: 0 -75px 0 0;
97
+ }
98
+ .ltr .tamara-product-widget .spotii-product-widget,
99
+ .ltr .spotii-wrapper .spotii-product-widget {
100
+ text-align: left !important;
101
+ }
82
102
 
83
103
  .spotii-wrapper .spotii-promo {
84
104
  font-size: var(--font-md);
@@ -4,6 +4,8 @@
4
4
  import { Component, Host, h, Prop, State } from '@stencil/core';
5
5
  export class SallaInstallment {
6
6
  constructor() {
7
+ this.tabbyBorderRemoved = false;
8
+ this.tabbyRemoveBorderTries = 0;
7
9
  /**
8
10
  * Language code
9
11
  */
@@ -62,26 +64,23 @@ export class SallaInstallment {
62
64
  document.querySelectorAll('.tabby-promo-snippet__logo').forEach(function (element) {
63
65
  element.setAttribute('aria-label', 'Tabby Logo');
64
66
  });
65
- //this is workaround to remove the default border and add margin
66
- setTimeout(() => {
67
- let promo = document.querySelector('#tabbyPromo>div>div');
68
- promo = promo ? promo.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]') : null;
69
- promo && (promo.style = 'border: none; margin: 15px 0!important; box-sizing: content-box;');
70
- }, 1000);
71
67
  };
68
+ //this is workaround to remove the default border and add margin
69
+ this.removeTabbyBorder();
72
70
  }
73
71
  // Spotii
74
72
  if (this.spotiiIsActive) {
75
73
  let amount = salla.money((Number(this.price) / 4).toFixed(2));
74
+ let isRTL = salla.config.get('theme.is_rtl', true);
76
75
  window.spotiiConfig = {
77
76
  targetXPath: ['.spotii-wrapper'],
78
77
  renderToPath: ['.spotii-promo'],
79
78
  numberOfPayment: 4,
80
79
  currency: this.currency,
81
- templateLine: "${textOne} ${number} ${textTwo} " + amount + " ${textThree} ${logo} ${info}",
80
+ templateLine: "${textOne} ${number} ${textTwo} " + amount + "${logo} ${info}",
82
81
  //todo:: translate these
83
- textOne: "جزء الدفع على",
84
- textTwo: "أو إدفعها على أقساط متساوية بدون تكاليف اضافية بقيمة",
82
+ textOne: isRTL ? "جزء الدفع على" : "Split it into",
83
+ textTwo: isRTL ? "أقساط متساوية بدون تكاليف اضافية بقيمة" : "payments of",
85
84
  textThree: "مع",
86
85
  price: this.price,
87
86
  // forcedShow: false,
@@ -95,6 +94,27 @@ export class SallaInstallment {
95
94
  // }
96
95
  }
97
96
  }
97
+ /**
98
+ * this is workaround to remove the default border and add margin
99
+ * we will try to remove tabby border 5 times for 7.5 seconds
100
+ */
101
+ removeTabbyBorder() {
102
+ if (this.tabbyBorderRemoved || this.tabbyRemoveBorderTries > 5) {
103
+ return;
104
+ }
105
+ this.tabbyRemoveBorderTries++;
106
+ setTimeout(() => {
107
+ let promo = document.querySelector('#tabbyPromo>div>div');
108
+ promo = promo ? promo.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]') : null;
109
+ if (promo) {
110
+ promo.style = 'border: none; margin: 15px 0!important; box-sizing: content-box;';
111
+ this.tabbyBorderRemoved = true;
112
+ }
113
+ else {
114
+ this.removeTabbyBorder();
115
+ }
116
+ }, this.tabbyRemoveBorderTries * 500);
117
+ }
98
118
  static get is() { return "salla-installment"; }
99
119
  static get originalStyleUrls() { return {
100
120
  "$": ["salla-installment.scss"]
@@ -3,12 +3,14 @@
3
3
  */
4
4
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
5
5
 
6
- const sallaInstallmentCss = "#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm);margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}";
6
+ const sallaInstallmentCss = "#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm);margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}";
7
7
 
8
8
  const SallaInstallment$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
9
9
  constructor() {
10
10
  super();
11
11
  this.__registerHost();
12
+ this.tabbyBorderRemoved = false;
13
+ this.tabbyRemoveBorderTries = 0;
12
14
  /**
13
15
  * Language code
14
16
  */
@@ -62,26 +64,23 @@ const SallaInstallment$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
62
64
  document.querySelectorAll('.tabby-promo-snippet__logo').forEach(function (element) {
63
65
  element.setAttribute('aria-label', 'Tabby Logo');
64
66
  });
65
- //this is workaround to remove the default border and add margin
66
- setTimeout(() => {
67
- let promo = document.querySelector('#tabbyPromo>div>div');
68
- promo = promo ? promo.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]') : null;
69
- promo && (promo.style = 'border: none; margin: 15px 0!important; box-sizing: content-box;');
70
- }, 1000);
71
67
  };
68
+ //this is workaround to remove the default border and add margin
69
+ this.removeTabbyBorder();
72
70
  }
73
71
  // Spotii
74
72
  if (this.spotiiIsActive) {
75
73
  let amount = salla.money((Number(this.price) / 4).toFixed(2));
74
+ let isRTL = salla.config.get('theme.is_rtl', true);
76
75
  window.spotiiConfig = {
77
76
  targetXPath: ['.spotii-wrapper'],
78
77
  renderToPath: ['.spotii-promo'],
79
78
  numberOfPayment: 4,
80
79
  currency: this.currency,
81
- templateLine: "${textOne} ${number} ${textTwo} " + amount + " ${textThree} ${logo} ${info}",
80
+ templateLine: "${textOne} ${number} ${textTwo} " + amount + "${logo} ${info}",
82
81
  //todo:: translate these
83
- textOne: "جزء الدفع على",
84
- textTwo: "أو إدفعها على أقساط متساوية بدون تكاليف اضافية بقيمة",
82
+ textOne: isRTL ? "جزء الدفع على" : "Split it into",
83
+ textTwo: isRTL ? "أقساط متساوية بدون تكاليف اضافية بقيمة" : "payments of",
85
84
  textThree: "مع",
86
85
  price: this.price,
87
86
  // forcedShow: false,
@@ -95,6 +94,27 @@ const SallaInstallment$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
95
94
  // }
96
95
  }
97
96
  }
97
+ /**
98
+ * this is workaround to remove the default border and add margin
99
+ * we will try to remove tabby border 5 times for 7.5 seconds
100
+ */
101
+ removeTabbyBorder() {
102
+ if (this.tabbyBorderRemoved || this.tabbyRemoveBorderTries > 5) {
103
+ return;
104
+ }
105
+ this.tabbyRemoveBorderTries++;
106
+ setTimeout(() => {
107
+ let promo = document.querySelector('#tabbyPromo>div>div');
108
+ promo = promo ? promo.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]') : null;
109
+ if (promo) {
110
+ promo.style = 'border: none; margin: 15px 0!important; box-sizing: content-box;';
111
+ this.tabbyBorderRemoved = true;
112
+ }
113
+ else {
114
+ this.removeTabbyBorder();
115
+ }
116
+ }, this.tabbyRemoveBorderTries * 500);
117
+ }
98
118
  static get style() { return sallaInstallmentCss; }
99
119
  }, [0, "salla-installment", {
100
120
  "price": [1],
@@ -3,11 +3,13 @@
3
3
  */
4
4
  import { r as registerInstance, h, H as Host } from './index-20b84fd0.js';
5
5
 
6
- const sallaInstallmentCss = "#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm);margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}";
6
+ const sallaInstallmentCss = "#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm);margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}";
7
7
 
8
8
  const SallaInstallment = class {
9
9
  constructor(hostRef) {
10
10
  registerInstance(this, hostRef);
11
+ this.tabbyBorderRemoved = false;
12
+ this.tabbyRemoveBorderTries = 0;
11
13
  /**
12
14
  * Language code
13
15
  */
@@ -61,26 +63,23 @@ const SallaInstallment = class {
61
63
  document.querySelectorAll('.tabby-promo-snippet__logo').forEach(function (element) {
62
64
  element.setAttribute('aria-label', 'Tabby Logo');
63
65
  });
64
- //this is workaround to remove the default border and add margin
65
- setTimeout(() => {
66
- let promo = document.querySelector('#tabbyPromo>div>div');
67
- promo = promo ? promo.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]') : null;
68
- promo && (promo.style = 'border: none; margin: 15px 0!important; box-sizing: content-box;');
69
- }, 1000);
70
66
  };
67
+ //this is workaround to remove the default border and add margin
68
+ this.removeTabbyBorder();
71
69
  }
72
70
  // Spotii
73
71
  if (this.spotiiIsActive) {
74
72
  let amount = salla.money((Number(this.price) / 4).toFixed(2));
73
+ let isRTL = salla.config.get('theme.is_rtl', true);
75
74
  window.spotiiConfig = {
76
75
  targetXPath: ['.spotii-wrapper'],
77
76
  renderToPath: ['.spotii-promo'],
78
77
  numberOfPayment: 4,
79
78
  currency: this.currency,
80
- templateLine: "${textOne} ${number} ${textTwo} " + amount + " ${textThree} ${logo} ${info}",
79
+ templateLine: "${textOne} ${number} ${textTwo} " + amount + "${logo} ${info}",
81
80
  //todo:: translate these
82
- textOne: "جزء الدفع على",
83
- textTwo: "أو إدفعها على أقساط متساوية بدون تكاليف اضافية بقيمة",
81
+ textOne: isRTL ? "جزء الدفع على" : "Split it into",
82
+ textTwo: isRTL ? "أقساط متساوية بدون تكاليف اضافية بقيمة" : "payments of",
84
83
  textThree: "مع",
85
84
  price: this.price,
86
85
  // forcedShow: false,
@@ -94,6 +93,27 @@ const SallaInstallment = class {
94
93
  // }
95
94
  }
96
95
  }
96
+ /**
97
+ * this is workaround to remove the default border and add margin
98
+ * we will try to remove tabby border 5 times for 7.5 seconds
99
+ */
100
+ removeTabbyBorder() {
101
+ if (this.tabbyBorderRemoved || this.tabbyRemoveBorderTries > 5) {
102
+ return;
103
+ }
104
+ this.tabbyRemoveBorderTries++;
105
+ setTimeout(() => {
106
+ let promo = document.querySelector('#tabbyPromo>div>div');
107
+ promo = promo ? promo.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]') : null;
108
+ if (promo) {
109
+ promo.style = 'border: none; margin: 15px 0!important; box-sizing: content-box;';
110
+ this.tabbyBorderRemoved = true;
111
+ }
112
+ else {
113
+ this.removeTabbyBorder();
114
+ }
115
+ }, this.tabbyRemoveBorderTries * 500);
116
+ }
97
117
  };
98
118
  SallaInstallment.style = sallaInstallmentCss;
99
119
 
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import{r as t,h as o,H as r}from"./p-c2bef5f2.js";const a=class{constructor(o){t(this,o),this.tabbyBorderRemoved=!1,this.tabbyRemoveBorderTries=0,this.language=salla.config.get("user.language_code"),this.currency=salla.config.get("user.currency_code"),salla.onReady((()=>{const t=salla.config.get("store.settings.installments");this.tamaraIsActive=-1!=t.indexOf("tamara_installment"),this.tabbyIsActive=-1!=t.indexOf("tabby_installment"),this.spotiiIsActive=-1!=t.indexOf("spotii_pay")}))}render(){return o(r,null,this.tamaraIsActive?o("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"}):"",this.tabbyIsActive?o("div",{id:"tabbyPromoWrapper"},o("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?o("div",{class:"spotii-wrapper"},o("div",{class:"spotii-promo"})):"")}componentDidLoad(){if(this.tamaraIsActive&&((t=document.createElement("script")).setAttribute("src","https://cdn.tamara.co/widget/product-widget.min.js"),document.head.appendChild(t),t.onload=()=>{window.TamaraProductWidget.init({lang:this.language}),setTimeout((()=>{window.TamaraProductWidget.render()}),300)}),this.tabbyIsActive&&((t=document.createElement("script")).setAttribute("src","https://checkout.tabby.ai/tabby-promo.js"),document.head.appendChild(t),t.onload=()=>{new(0,window.TabbyPromo)({selector:"#tabbyPromo",currency:this.currency,price:this.price,lang:this.language}),document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))},this.removeTabbyBorder()),this.spotiiIsActive){let o=salla.money((Number(this.price)/4).toFixed(2)),r=salla.config.get("theme.is_rtl",!0);var t;window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:4,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+o+"${logo} ${info}",textOne:r?"جزء الدفع على":"Split it into",textTwo:r?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price},(t=document.createElement("script")).setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js")),document.head.appendChild(t)}}removeTabbyBorder(){this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5||(this.tabbyRemoveBorderTries++,setTimeout((()=>{let t=document.querySelector("#tabbyPromo>div>div");t=t?t.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null,t?(t.style="border: none; margin: 15px 0!important; box-sizing: content-box;",this.tabbyBorderRemoved=!0):this.removeTabbyBorder()}),500*this.tabbyRemoveBorderTries))}};a.style="#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm);margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}";export{a as salla_installment}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{p as e,b as a}from"./p-c2bef5f2.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((e=>a([["p-6ba4ed00",[[4,"salla-login-modal",{isEmailAllowed:[1028,"is-email-allowed"],isMobileAllowed:[1028,"is-mobile-allowed"],isEmailRequired:[1028,"is-email-required"],title:[32],loginTypeTitle:[32],loginText:[32],smsLabel:[32],mobileLabel:[32],emailLabel:[32],enterText:[32],bySMSText:[32],byEmailText:[32],emailErrorMsg:[32],firstNameLabel:[32],lastNameLabel:[32],firstNameErrorMsg:[32],lastNameErrorMsg:[32],open:[64]},[[8,"verified","onVerified"]]],[0,"salla-rating-modal",{orderId:[2,"order-id"],order:[32],open:[64],close:[64]}],[4,"salla-branches",{position:[1],displayAs:[1,"display-as"],browseProductsFrom:[1,"browse-products-from"],branches:[16],current:[1026],open:[32],selected:[32],isOpenedBefore:[32],show:[64],hide:[64]}],[0,"salla-localization-modal",{language:[1537],currency:[1537],languages:[32],currencies:[32],languagesTitle:[32],currenciesTitle:[32],isLoading:[32],open:[64],close:[64],submit:[64]}],[0,"salla-offer-modal",{offer:[32],offer_name:[32],offer_message:[32],offer_expires_in:[32],remember_my_choice:[32],add_to_cart:[32],out_of_stock:[32],open:[64],showOffer:[64]}],[0,"salla-search",{inline:[4],oval:[4],height:[2],results:[32],placeholder:[32],noResultsText:[32],typing:[32],debounce:[32],search_term:[32]}],[4,"salla-infinite-scroll",{nextPage:[1,"next-page"],autoload:[1028],container:[1],item:[1],loadMore:[32],noMore:[32],failedToLoad:[32]}],[0,"salla-product-availability",{channels:[1],productId:[2,"product-id"],isSubscribed:[1028,"is-subscribed"],subTitle:[32],mobileLabel:[32],emailLabel:[32],emailPlaceholder:[32],subscribedMessage:[32],title_:[32],emailErrorMsg:[32],isVisitorSubscribed:[32]}],[4,"salla-verify",{display:[1],type:[1025],autoReload:[4,"auto-reload"],title:[32],resendAfter:[32],isProfileVerify:[32],getCode:[64],open:[64]}],[0,"salla-rating-stars",{name:[1],size:[1],value:[2]}],[0,"salla-tel-input",{phone:[1025],name:[1],countryCode:[1025,"country-code"],mobileRequired:[32],countryCodeLabel:[32],mobileLabel:[32],tooShort:[32],tooLong:[32],invalidCountryCode:[32],invalidNumber:[32],errorMap:[32],getValues:[64],isValid:[64]}],[4,"salla-button",{shape:[513],color:[513],fill:[513],size:[513],width:[513],loading:[516],disabled:[516],loaderPosition:[1,"loader-position"],href:[1],load:[64],stop:[64],setText:[64],disable:[64],enable:[64]}],[4,"salla-modal",{isClosable:[1028,"is-closable"],width:[513],position:[513],visible:[516],isLoading:[1540,"is-loading"],subTitleFirst:[4,"sub-title-first"],noPadding:[4,"no-padding"],subTitle:[1,"sub-title"],icon:[1],iconStyle:[1,"icon-style"],imageIcon:[1,"image-icon"],modalTitle:[32],open:[64],close:[64],setTitle:[64],loading:[64],stopLoading:[64]}]]],["p-6f4f4260",[[4,"salla-add-product-button",{channels:[513],quantity:[514],donatingAmount:[514,"donating-amount"],productId:[520,"product-id"],productStatus:[513,"product-status"],productType:[513,"product-type"]}]]],["p-27d01075",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["p-cbb8c0f6",[[0,"salla-installment",{price:[1],language:[1],currency:[1],tamaraIsActive:[32],tabbyIsActive:[32],spotiiIsActive:[32]}]]],["p-a1ec2c1d",[[4,"salla-quantity-input",{quantity:[32],decrease:[64],increase:[64],setValue:[64]}]]]],e)));
4
+ import{p as e,b as a}from"./p-c2bef5f2.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((e=>a([["p-6ba4ed00",[[4,"salla-login-modal",{isEmailAllowed:[1028,"is-email-allowed"],isMobileAllowed:[1028,"is-mobile-allowed"],isEmailRequired:[1028,"is-email-required"],title:[32],loginTypeTitle:[32],loginText:[32],smsLabel:[32],mobileLabel:[32],emailLabel:[32],enterText:[32],bySMSText:[32],byEmailText:[32],emailErrorMsg:[32],firstNameLabel:[32],lastNameLabel:[32],firstNameErrorMsg:[32],lastNameErrorMsg:[32],open:[64]},[[8,"verified","onVerified"]]],[0,"salla-rating-modal",{orderId:[2,"order-id"],order:[32],open:[64],close:[64]}],[4,"salla-branches",{position:[1],displayAs:[1,"display-as"],browseProductsFrom:[1,"browse-products-from"],branches:[16],current:[1026],open:[32],selected:[32],isOpenedBefore:[32],show:[64],hide:[64]}],[0,"salla-localization-modal",{language:[1537],currency:[1537],languages:[32],currencies:[32],languagesTitle:[32],currenciesTitle:[32],isLoading:[32],open:[64],close:[64],submit:[64]}],[0,"salla-offer-modal",{offer:[32],offer_name:[32],offer_message:[32],offer_expires_in:[32],remember_my_choice:[32],add_to_cart:[32],out_of_stock:[32],open:[64],showOffer:[64]}],[0,"salla-search",{inline:[4],oval:[4],height:[2],results:[32],placeholder:[32],noResultsText:[32],typing:[32],debounce:[32],search_term:[32]}],[4,"salla-infinite-scroll",{nextPage:[1,"next-page"],autoload:[1028],container:[1],item:[1],loadMore:[32],noMore:[32],failedToLoad:[32]}],[0,"salla-product-availability",{channels:[1],productId:[2,"product-id"],isSubscribed:[1028,"is-subscribed"],subTitle:[32],mobileLabel:[32],emailLabel:[32],emailPlaceholder:[32],subscribedMessage:[32],title_:[32],emailErrorMsg:[32],isVisitorSubscribed:[32]}],[4,"salla-verify",{display:[1],type:[1025],autoReload:[4,"auto-reload"],title:[32],resendAfter:[32],isProfileVerify:[32],getCode:[64],open:[64]}],[0,"salla-rating-stars",{name:[1],size:[1],value:[2]}],[0,"salla-tel-input",{phone:[1025],name:[1],countryCode:[1025,"country-code"],mobileRequired:[32],countryCodeLabel:[32],mobileLabel:[32],tooShort:[32],tooLong:[32],invalidCountryCode:[32],invalidNumber:[32],errorMap:[32],getValues:[64],isValid:[64]}],[4,"salla-button",{shape:[513],color:[513],fill:[513],size:[513],width:[513],loading:[516],disabled:[516],loaderPosition:[1,"loader-position"],href:[1],load:[64],stop:[64],setText:[64],disable:[64],enable:[64]}],[4,"salla-modal",{isClosable:[1028,"is-closable"],width:[513],position:[513],visible:[516],isLoading:[1540,"is-loading"],subTitleFirst:[4,"sub-title-first"],noPadding:[4,"no-padding"],subTitle:[1,"sub-title"],icon:[1],iconStyle:[1,"icon-style"],imageIcon:[1,"image-icon"],modalTitle:[32],open:[64],close:[64],setTitle:[64],loading:[64],stopLoading:[64]}]]],["p-6f4f4260",[[4,"salla-add-product-button",{channels:[513],quantity:[514],donatingAmount:[514,"donating-amount"],productId:[520,"product-id"],productStatus:[513,"product-status"],productType:[513,"product-type"]}]]],["p-27d01075",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["p-5996a734",[[0,"salla-installment",{price:[1],language:[1],currency:[1],tamaraIsActive:[32],tabbyIsActive:[32],spotiiIsActive:[32]}]]],["p-a1ec2c1d",[[4,"salla-quantity-input",{quantity:[32],decrease:[64],increase:[64],setValue:[64]}]]]],e)));
@@ -1,4 +1,6 @@
1
1
  export declare class SallaInstallment {
2
+ private tabbyBorderRemoved;
3
+ private tabbyRemoveBorderTries;
2
4
  constructor();
3
5
  /**
4
6
  * Current product price
@@ -17,4 +19,9 @@ export declare class SallaInstallment {
17
19
  spotiiIsActive: boolean;
18
20
  render(): any;
19
21
  componentDidLoad(): void;
22
+ /**
23
+ * this is workaround to remove the default border and add margin
24
+ * we will try to remove tabby border 5 times for 7.5 seconds
25
+ */
26
+ removeTabbyBorder(): void;
20
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight-components",
3
- "version": "1.0.144",
3
+ "version": "1.0.146",
4
4
  "license": "MIT",
5
5
  "author": "Salla Team <support@salla.dev> (https://salla.dev)",
6
6
  "bugs": {
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,h as o,H as a}from"./p-c2bef5f2.js";const r=class{constructor(o){t(this,o),this.language=salla.config.get("user.language_code"),this.currency=salla.config.get("user.currency_code"),salla.onReady((()=>{const t=salla.config.get("store.settings.installments");this.tamaraIsActive=-1!=t.indexOf("tamara_installment"),this.tabbyIsActive=-1!=t.indexOf("tabby_installment"),this.spotiiIsActive=-1!=t.indexOf("spotii_pay")}))}render(){return o(a,null,this.tamaraIsActive?o("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"}):"",this.tabbyIsActive?o("div",{id:"tabbyPromoWrapper"},o("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?o("div",{class:"spotii-wrapper"},o("div",{class:"spotii-promo"})):"")}componentDidLoad(){if(this.tamaraIsActive&&((t=document.createElement("script")).setAttribute("src","https://cdn.tamara.co/widget/product-widget.min.js"),document.head.appendChild(t),t.onload=()=>{window.TamaraProductWidget.init({lang:this.language}),setTimeout((()=>{window.TamaraProductWidget.render()}),300)}),this.tabbyIsActive&&((t=document.createElement("script")).setAttribute("src","https://checkout.tabby.ai/tabby-promo.js"),document.head.appendChild(t),t.onload=()=>{new(0,window.TabbyPromo)({selector:"#tabbyPromo",currency:this.currency,price:this.price,lang:this.language}),document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")})),setTimeout((()=>{let t=document.querySelector("#tabbyPromo>div>div");t=t?t.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null,t&&(t.style="border: none; margin: 15px 0!important; box-sizing: content-box;")}),1e3)}),this.spotiiIsActive){let o=salla.money((Number(this.price)/4).toFixed(2));var t;window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:4,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+o+" ${textThree} ${logo} ${info}",textOne:"جزء الدفع على",textTwo:"أو إدفعها على أقساط متساوية بدون تكاليف اضافية بقيمة",textThree:"مع",price:this.price},(t=document.createElement("script")).setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js")),document.head.appendChild(t)}}};r.style="#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm);margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}";export{r as salla_installment}