@salla.sa/twilight-components 1.0.71 → 1.0.73

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.
Files changed (46) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/{salla-tel-input.cjs.entry.js → salla-add-product-button_6.cjs.entry.js} +519 -0
  3. package/dist/cjs/salla-login-modal.cjs.entry.js +2 -2
  4. package/dist/cjs/salla-verify-modal.cjs.entry.js +4 -5
  5. package/dist/cjs/twilight-components.cjs.js +1 -1
  6. package/dist/collection/collection-manifest.json +1 -0
  7. package/dist/collection/components/salla-add-product-button/salla-add-product-button.css +3 -0
  8. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +230 -0
  9. package/dist/collection/components/salla-button/salla-button.css +1 -1
  10. package/dist/collection/components/salla-login-modal/salla-login-modal.js +2 -2
  11. package/dist/collection/components/salla-modal/salla-modal.js +1 -2
  12. package/dist/collection/components/salla-product-availability/salla-product-availability.css +1 -1
  13. package/dist/collection/components/salla-product-availability/salla-product-availability.js +5 -3
  14. package/dist/collection/components/salla-verify-modal/salla-verify-modal.js +9 -10
  15. package/dist/components/salla-add-product-button.d.ts +11 -0
  16. package/dist/components/salla-add-product-button.js +121 -0
  17. package/dist/components/salla-button2.js +1 -1
  18. package/dist/components/salla-login-modal.js +2 -2
  19. package/dist/components/salla-modal2.js +1 -2
  20. package/dist/components/salla-product-availability.js +1 -155
  21. package/dist/{esm/salla-product-availability.entry.js → components/salla-product-availability2.js} +59 -12
  22. package/dist/components/salla-verify-modal2.js +5 -6
  23. package/dist/esm/loader.js +1 -1
  24. package/dist/esm/{salla-tel-input.entry.js → salla-add-product-button_6.entry.js} +515 -1
  25. package/dist/esm/salla-login-modal.entry.js +2 -2
  26. package/dist/esm/salla-verify-modal.entry.js +4 -5
  27. package/dist/esm/twilight-components.js +1 -1
  28. package/dist/twilight-components/p-20a8492d.entry.js +4 -0
  29. package/dist/twilight-components/p-a970ba23.entry.js +4 -0
  30. package/dist/twilight-components/p-f8e1ea72.entry.js +4 -0
  31. package/dist/twilight-components/twilight-components.esm.js +1 -1
  32. package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +25 -0
  33. package/dist/types/components/salla-verify-modal/salla-verify-modal.d.ts +1 -1
  34. package/dist/types/components.d.ts +43 -8
  35. package/package.json +1 -1
  36. package/dist/cjs/salla-button.cjs.entry.js +0 -122
  37. package/dist/cjs/salla-modal_2.cjs.entry.js +0 -240
  38. package/dist/cjs/salla-product-availability.cjs.entry.js +0 -119
  39. package/dist/esm/salla-button.entry.js +0 -118
  40. package/dist/esm/salla-modal_2.entry.js +0 -235
  41. package/dist/twilight-components/p-3aabd1b6.entry.js +0 -4
  42. package/dist/twilight-components/p-44910fc8.entry.js +0 -4
  43. package/dist/twilight-components/p-48c877fc.entry.js +0 -4
  44. package/dist/twilight-components/p-7580c125.entry.js +0 -4
  45. package/dist/twilight-components/p-c3b196f3.entry.js +0 -4
  46. package/dist/twilight-components/p-ca4cf691.entry.js +0 -4
@@ -17,7 +17,7 @@ const patchEsm = () => {
17
17
  const defineCustomElements = (win, options) => {
18
18
  if (typeof window === 'undefined') return Promise.resolve();
19
19
  return patchEsm().then(() => {
20
- return index.bootstrapLazy([["salla-modal_2.cjs",[[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[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],"show":[64],"hide":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-login-modal.cjs",[[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],"show":[64]},[[0,"verified","onVerified"]]]]],["salla-product-availability.cjs",[[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]}]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-branches.cjs",[[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]}]]],["salla-localization-modal.cjs",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"show":[64],"hide":[64],"submit":[64]}]]],["salla-offer-modal.cjs",[[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],"show":[64],"showOffer":[64]}]]],["salla-conditional-fields.cjs",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"nextPageAutoload":[1028,"next-page-autoload"],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-installment.cjs",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-quantity-input.cjs",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]],["salla-button.cjs",[[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["salla-verify-modal.cjs",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"url":[513],"by":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}]]],["salla-rating-stars.cjs",[[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}]]],["salla-tel-input.cjs",[[0,"salla-tel-input",{"mobile":[1025],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}]]]], options);
20
+ return index.bootstrapLazy([["salla-add-product-button_6.cjs",[[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"],"disabled":[516]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[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]}],[0,"salla-tel-input",{"mobile":[1025],"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"],"wide":[4],"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],"show":[64],"hide":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-login-modal.cjs",[[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],"show":[64]},[[0,"verified","onVerified"]]]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-branches.cjs",[[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]}]]],["salla-localization-modal.cjs",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"show":[64],"hide":[64],"submit":[64]}]]],["salla-offer-modal.cjs",[[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],"show":[64],"showOffer":[64]}]]],["salla-conditional-fields.cjs",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"nextPageAutoload":[1028,"next-page-autoload"],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-installment.cjs",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-quantity-input.cjs",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]],["salla-verify-modal.cjs",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"url":[513],"type":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}]]],["salla-rating-stars.cjs",[[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}]]]], options);
21
21
  });
22
22
  };
23
23
 
@@ -8,6 +8,520 @@ Object.defineProperty(exports, '__esModule', { value: true });
8
8
  const index = require('./index-c0f5bb97.js');
9
9
  const Helper = require('./Helper-8ae6a805.js');
10
10
 
11
+ const sallaAddProductButtonCss = ":host{display:block}";
12
+
13
+ const SallaAddProductButton = class {
14
+ constructor(hostRef) {
15
+ index.registerInstance(this, hostRef);
16
+ this.success = index.createEvent(this, "success", 7);
17
+ this.failed = index.createEvent(this, "failed", 7);
18
+ this.hostAttributes = {};
19
+ this.hasNotText = false;
20
+ this.channels = null;
21
+ this.quantity = 1;
22
+ this.donatingAmount = 0;
23
+ this.productStatus = 'sale';
24
+ this.productType = 'product';
25
+ /**
26
+ * Is the button currently disabled
27
+ */
28
+ this.disabled = false;
29
+ }
30
+ getLabel() {
31
+ if (this.productStatus === 'sale') {
32
+ return salla.lang.get('pages.cart.add_to_cart');
33
+ }
34
+ if (this.productType === 'product') {
35
+ return salla.lang.get('pages.products.out_of_stock');
36
+ }
37
+ // donating
38
+ return salla.lang.get('pages.products.donation_exceed');
39
+ }
40
+ componentWillLoad() {
41
+ this.hasNotText = !this.host.innerHTML || this.host.innerHTML === "" || this.host.innerHTML.trim().replace(/\s/g, '').localeCompare("<!---->") === 0;
42
+ }
43
+ componentDidRender() {
44
+ if (this.buttonLabel && this.hasNotText) {
45
+ salla.event.once('languages::translations.loaded', () => {
46
+ this.buttonLabel.innerHTML = this.getLabel() || 'اضافة للسلة';
47
+ });
48
+ }
49
+ }
50
+ addProductToCart(event) {
51
+ event.preventDefault();
52
+ return salla.cart.addItem({
53
+ id: this.productId,
54
+ donating_amount: this.donatingAmount,
55
+ quantity: this.quantity
56
+ }).then((response) => this.success.emit(response))
57
+ .catch((error) => this.failed.emit(error));
58
+ }
59
+ getBtnAttributes() {
60
+ for (let i = 0; i < this.host.attributes.length; i++) {
61
+ if (!['id', 'class'].includes(this.host.attributes[i].name)) {
62
+ this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
63
+ }
64
+ }
65
+ return this.hostAttributes;
66
+ }
67
+ render() {
68
+ return (index.h(index.Host, null, this.productStatus === 'out-and-notify' && this.channels ?
69
+ index.h("salla-product-availability", Object.assign({}, this.getBtnAttributes()), index.h("slot", null)) :
70
+ index.h("salla-button", Object.assign({ onClick: (event) => this.addProductToCart(event), type: "button", fill: this.productStatus === 'sale' ? 'solid' : 'outline', color: this.productStatus === 'sale' ? 'primary' : 'light', "loader-position": "center" }, this.getBtnAttributes(), { disabled: this.productStatus === 'out' }), index.h("slot", null), index.h("span", { ref: (el) => this.buttonLabel = el }))));
71
+ }
72
+ get host() { return index.getElement(this); }
73
+ };
74
+ SallaAddProductButton.style = sallaAddProductButtonCss;
75
+
76
+ const sallaButtonCss = "salla-button{pointer-events:none}salla-button[type=submit],salla-button[type=button],salla-button[type=reset]{-webkit-appearance:none}salla-button[width=wide]{width:100%}.s-button-wrap[loading]{pointer-events:none}.s-button-wrap[loading] .s-button-element{pointer-events:none !important}.s-button-wrap[loading] .s-button-loader-center .s-button-text{opacity:0}.s-button-wrap .s-button-element[loading]{pointer-events:none !important}.s-button-wrap .s-button-element:not(:disabled){pointer-events:auto}.s-button-wrap .s-button-solid .s-button-loader:before{border-color:#fff #fff rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.2)}.s-button-wrap .s-button-outline{border:1px solid currentColor}.s-button-wrap .s-button-outline:hover{border-color:transparent}.s-button-wrap .s-button-outline .s-button-loader:before{border-top-color:currentColor;border-left-color:currentColor}.s-button-wrap .s-button-icon.s-button-large{width:56px;height:56px}.s-button-wrap .s-button-icon.s-button-small{width:24px;height:24px}.s-button-wrap .s-button-icon.s-button-small .s-button-loader:before{width:0.85rem;height:0.85rem}.s-button-wrap .s-button-loader-after .s-button-load{flex-direction:row}.s-button-wrap .s-button-loader-start.s-button-element{padding-left:32px;padding-right:32px}.s-button-wrap .s-button-loader-start .s-button-loader{position:absolute;right:8px}.s-button-wrap .s-button-loader-start .s-button-loader [dir=ltr]{left:8px;right:auto}.s-button-wrap .s-button-loader-end.s-button-element{padding-left:32px;padding-right:32px}.s-button-wrap .s-button-loader-end .s-button-loader{position:absolute;left:8px}.s-button-wrap .s-button-loader-end .s-button-loader [dir=ltr]{right:8px;left:auto}.s-button-wrap .s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);margin:0 !important}";
77
+
78
+ const SallaButton = class {
79
+ constructor(hostRef) {
80
+ index.registerInstance(this, hostRef);
81
+ this.hostAttributes = {};
82
+ /**
83
+ * Button Type
84
+ */
85
+ this.shape = 'btn';
86
+ /**
87
+ * Button Color
88
+ */
89
+ this.color = 'primary';
90
+ /**
91
+ * Button Fill
92
+ */
93
+ this.fill = 'solid';
94
+ /**
95
+ * Button Size
96
+ */
97
+ this.size = 'medium';
98
+ /**
99
+ * Button Width
100
+ */
101
+ this.width = 'normal';
102
+ /**
103
+ * Is the button currently loading
104
+ */
105
+ this.loading = false;
106
+ /**
107
+ * Is the button currently disabled
108
+ */
109
+ this.disabled = false;
110
+ /**
111
+ * If there is need to change loader position, pass the position
112
+ */
113
+ this.loaderPosition = 'after';
114
+ /**
115
+ * Is the button wide
116
+ */
117
+ this.wide = false;
118
+ if (this.wide) {
119
+ this.host.classList.add('s-button-wide');
120
+ }
121
+ }
122
+ /**
123
+ * Run loading animation
124
+ */
125
+ async load() {
126
+ if (this.loaderPosition == 'center')
127
+ this.text.classList.add('s-button-hide');
128
+ this.host.setAttribute('loading', '');
129
+ return this.host;
130
+ }
131
+ /**
132
+ * Stop loading animation
133
+ */
134
+ async stop() {
135
+ this.host.removeAttribute('loading');
136
+ if (this.loaderPosition == 'center')
137
+ this.text.classList.remove('s-button-hide');
138
+ return this.host;
139
+ }
140
+ /**
141
+ * Changing the body of the button
142
+ * @param html
143
+ */
144
+ async setText(html) {
145
+ this.text.innerHTML = html;
146
+ return this.host;
147
+ }
148
+ /**
149
+ * Add `disabled` attribute
150
+ */
151
+ async disable() {
152
+ this.host.setAttribute('disabled', '');
153
+ return this.host;
154
+ }
155
+ /**
156
+ * Remove `disabled` attribute
157
+ */
158
+ async enable() {
159
+ this.host.removeAttribute('disabled');
160
+ return this.host;
161
+ }
162
+ getBtnAttributes() {
163
+ for (let i = 0; i < this.host.attributes.length; i++) {
164
+ if (!['color', 'fill', 'size', 'width', 'id', 'loading'].includes(this.host.attributes[i].name)) {
165
+ this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
166
+ }
167
+ }
168
+ this.hostAttributes.type = this.hostAttributes.type || 'button';
169
+ this.hostAttributes.class +=
170
+ ' s-button-element s-button-' + this.shape
171
+ + ' s-button-' + (this.fill == "none" ? 'fill-none' : this.fill)
172
+ + (this.size != "medium" ? ' s-button-' + this.size : '')
173
+ + (this.width != "normal" ? ' s-button-' + this.width : '')
174
+ + (this.shape == "link" ? ' s-button-' + this.color + '-link' : '')
175
+ + (this.shape != "link" && this.fill != 'outline' ? ' s-button-' + this.color : '')
176
+ + (this.fill == 'outline' ? ' s-button-' + this.color + '-outline' : '')
177
+ + (this.disabled ? ' s-button-disabled ' : '')
178
+ + (this.shape == 'icon' ? ' s-button-loader-center' : ' s-button-loader-' + this.loaderPosition);
179
+ return this.hostAttributes;
180
+ }
181
+ render() {
182
+ return (index.h(index.Host, { class: "s-button-wrap" }, index.h("button", Object.assign({}, this.getBtnAttributes(), { disabled: this.disabled }), index.h("span", { class: "s-button-text", ref: el => this.text = el }, index.h("slot", null)), this.loading ? index.h("span", { class: "s-button-loader" }) : '')));
183
+ }
184
+ get host() { return index.getElement(this); }
185
+ };
186
+ SallaButton.style = sallaButtonCss;
187
+
188
+ const sallaModalCss = "";
189
+
190
+ const SallaModal = class {
191
+ constructor(hostRef) {
192
+ index.registerInstance(this, hostRef);
193
+ this.modalOpened = index.createEvent(this, "modalOpened", 7);
194
+ this.modalClosed = index.createEvent(this, "modalClosed", 7);
195
+ this.isClosable = true; //todo::rename unclude
196
+ /**
197
+ * The size of the modal
198
+ */
199
+ this.width = 'md';
200
+ /**
201
+ * The position of the modal
202
+ */
203
+ this.position = 'middle';
204
+ /**
205
+ * Show the modal on rendering
206
+ */
207
+ this.visible = false;
208
+ /**
209
+ * Show loading in the middle
210
+ */
211
+ this.isLoading = false;
212
+ this.subTitleFirst = false; //todo:: choose better name
213
+ this.noPadding = false; //todo:: choose better name
214
+ this.subTitle = '';
215
+ /**
216
+ * Icon css class, default for types `error` is `sicon-alert-engine`, `success` is `sicon-check-circle2`
217
+ */
218
+ this.icon = '';
219
+ this.iconStyle = '';
220
+ /**
221
+ * url of an image
222
+ */
223
+ this.imageIcon = '';
224
+ Helper.Helper.setHost(this.host);
225
+ salla.event.on('modal::open', btn => btn.dataset.target == this.host.id && this.show());
226
+ salla.event.on('modal::close', btn => btn.dataset.target == this.host.id && this.hide());
227
+ this.modalTitle = this.host.getAttribute('modal-title');
228
+ }
229
+ handleVisible(newValue) {
230
+ if (!newValue) {
231
+ this.toggleModal(false);
232
+ this.modalClosed.emit();
233
+ return;
234
+ }
235
+ this.host.classList.remove('s-hidden');
236
+ setTimeout(() => this.toggleModal(true)); //small amont of time to running toggle After adding hidden
237
+ this.modalOpened.emit();
238
+ }
239
+ /**
240
+ * Show the modal
241
+ */
242
+ async show() {
243
+ this.host.setAttribute('visible', '');
244
+ return this.host;
245
+ }
246
+ /**
247
+ * hide the modal
248
+ */
249
+ async hide() {
250
+ this.host.removeAttribute('visible');
251
+ return this.host;
252
+ }
253
+ /**
254
+ * Change the Modal Title
255
+ * @param {string} modalTitle
256
+ */
257
+ async setTitle(modalTitle) {
258
+ this.modalTitle = modalTitle;
259
+ return this.host;
260
+ }
261
+ /**
262
+ * Start loading
263
+ */
264
+ async loading() {
265
+ this.isLoading = true;
266
+ return this.host;
267
+ }
268
+ /**
269
+ * Stop the loading
270
+ */
271
+ async stopLoading() {
272
+ this.isLoading = false;
273
+ return this.host;
274
+ }
275
+ toggleModal(isOpen) {
276
+ const body = this.host.querySelector('.s-modal-body');
277
+ Helper.Helper.toggleElementClassIf(body, 's-modal-entering', 's-modal-leaving', () => isOpen)
278
+ .toggleElementClassIf(this.overlay, 's-modal-entering', 's-modal-overlay-leaving', () => isOpen)
279
+ .toggleElementClassIf(document.body, 'modal-is-open', 'modal-is-closed', () => isOpen);
280
+ if (!isOpen) {
281
+ setTimeout(() => this.host.classList.add('s-hidden'), 350);
282
+ }
283
+ }
284
+ closeModal() {
285
+ if (!this.isClosable) {
286
+ return;
287
+ }
288
+ this.host.removeAttribute('visible');
289
+ }
290
+ iconBlockClasses() {
291
+ return {
292
+ 's-modal-icon': true,
293
+ 's-modal-bg-error': this.iconStyle == 'error',
294
+ 's-modal-bg-success': this.iconStyle == 'success',
295
+ 's-modal-bg-normal': this.iconStyle != 'error' && this.iconStyle != 'success',
296
+ 's-modal-bg-primary': this.iconStyle == 'primary'
297
+ };
298
+ }
299
+ iconClasses() {
300
+ return {
301
+ [this.icon]: true,
302
+ 'sicon-alert-engine': !this.icon && this.iconStyle == 'error' && !this.imageIcon,
303
+ 'sicon-check-circle2': !this.icon && this.iconStyle == 'success' && !this.imageIcon,
304
+ };
305
+ }
306
+ //todo:: pref for each modal
307
+ render() {
308
+ this.host.id = this.host.id || 'salla-modal';
309
+ return (index.h(index.Host, { class: 'salla-modal s-modal-container s-hidden', "aria-modal": "true", role: "dialog" }, index.h("div", { class: "s-modal-overlay", ref: el => this.overlay = el, onClick: () => this.closeModal() }), index.h("div", { class: "s-modal-wrapper" }, index.h("span", { class: 's-modal-spacer s-modal-align-' + this.position }, "\u200B"), index.h("div", { class: 's-modal-body ' + 's-modal-align-' + this.position + ' s-modal-' + this.width + (this.noPadding ? ' s-modal-nopadding' : ' s-modal-padding') }, this.isLoading ?
310
+ index.h("div", { class: "s-modal-loader-wrap" }, index.h("span", { class: "s-modal-loader" }))
311
+ :
312
+ [
313
+ index.h("div", { class: { 's-modal-header': true, 's-modal-is-center': this.icon != '' || this.imageIcon != '' } }, this.isClosable ?
314
+ index.h("button", { class: "s-modal-close", onClick: () => this.closeModal(), type: "button" }, index.h("span", { class: "sicon-cancel" }))
315
+ : '', this.modalTitle || this.subTitle ?
316
+ index.h("div", { class: "s-modal-header-inner" }, this.iconStyle || this.icon
317
+ ? index.h("div", { class: this.iconBlockClasses() }, index.h("i", { class: this.iconClasses() }))
318
+ : this.imageIcon ? index.h("img", { class: "s-modal-header-img", src: this.imageIcon }) : '', index.h("div", { class: "s-modal-header-content" }, index.h("div", { class: { 's-modal-title': true, 's-modal-title-below': this.subTitleFirst }, innerHTML: this.modalTitle }), index.h("p", { class: { 's-modal-sub-title': true }, innerHTML: this.subTitle })))
319
+ : ''),
320
+ index.h("slot", null),
321
+ index.h("slot", { name: "footer" })
322
+ ]))));
323
+ }
324
+ get host() { return index.getElement(this); }
325
+ static get watchers() { return {
326
+ "visible": ["handleVisible"]
327
+ }; }
328
+ };
329
+ SallaModal.style = sallaModalCss;
330
+
331
+ const sallaProductAvailabilityCss = "";
332
+
333
+ const SallaProductAvailability = class {
334
+ constructor(hostRef) {
335
+ index.registerInstance(this, hostRef);
336
+ this.isUser = Helper.Helper.isUser();
337
+ this.mobileLabel = '555555555';
338
+ this.emailPlaceholder = 'your@email.com';
339
+ /**
340
+ * product id that can visitor subscribe to its availability notification
341
+ */
342
+ this.productId = salla.config.get('page.id');
343
+ /**
344
+ * is current user already subscribed
345
+ */
346
+ this.isSubscribed = false;
347
+ // @Method()
348
+ this.submit = async () => {
349
+ if (this.isUser) {
350
+ return salla.api.product.availabilitySubscribe(this.productId)
351
+ .then(() => this.isSubscribed = true);
352
+ }
353
+ let { mobile, countryCode } = await this.mobileInput.getValues(), data = { id: this.productId, country_code: countryCode };
354
+ mobile !== '' && (data['mobile'] = mobile);
355
+ this.email.value !== '' && (data['email'] = this.email.value);
356
+ await this.validateform();
357
+ return this.btn.load()
358
+ .then(() => this.btn.disable())
359
+ .then(() => salla.api.product.availabilitySubscribe(data))
360
+ .then(() => {
361
+ this.isSubscribed = true;
362
+ salla.storage.set(`product-${this.productId}-subscribed`, true);
363
+ }) //no need to wait until finishing alert animation
364
+ .then(() => this.btn.stop())
365
+ .then(() => this.modal.hide())
366
+ .catch(() => this.btn.stop() && this.btn.enable());
367
+ };
368
+ // helpers
369
+ this.typing = (e, submitMethod) => {
370
+ const error = e.target.nextElementSibling;
371
+ e.target.classList.remove('s-has-error');
372
+ (error === null || error === void 0 ? void 0 : error.classList.contains('s-product-availability-error-msg')) && (error.innerText = '');
373
+ e.key == 'Enter' && submitMethod();
374
+ };
375
+ salla.event.on('languages::translations.loaded', () => {
376
+ var _a, _b, _c, _d;
377
+ // console.log('translations:', salla.lang);
378
+ this.subscribedMessage = salla.lang.get('pages.products.notify_availability_success');
379
+ this.title_ = this.host.title || salla.lang.get('pages.products.notify_availability_title');
380
+ this.subTitle = salla.lang.get('pages.products.notify_availability_subtitle');
381
+ this.mobileLabel = salla.lang.get('common.elements.mobile') || '555555555';
382
+ this.emailLabel = salla.lang.get('common.elements.email');
383
+ this.emailPlaceholder = salla.lang.get('common.elements.email_placeholder') || 'your@email.com';
384
+ this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');
385
+ (_a = this.modal) === null || _a === void 0 ? void 0 : _a.setTitle(this.title_);
386
+ (_b = this.btn) === null || _b === void 0 ? void 0 : _b.setText(salla.lang.get('common.elements.submit'));
387
+ (_c = this.cancelBtn) === null || _c === void 0 ? void 0 : _c.setText(salla.lang.get('common.elements.cancel'));
388
+ (_d = this.inlineBtn) === null || _d === void 0 ? void 0 : _d.setText(salla.lang.get('pages.products.notify_availability'));
389
+ });
390
+ if (this.isUser)
391
+ return;
392
+ this.channelsWatcher(this.channels);
393
+ this.title_ = this.host.title || salla.lang.get('pages.products.notify_availability_title');
394
+ this.host.removeAttribute('title');
395
+ this.isVisitorSubscribed = salla.storage.get(`product-${this.productId}-subscribed`);
396
+ }
397
+ channelsWatcher(newValue) {
398
+ this.channels_ = newValue.split(',');
399
+ }
400
+ async validateform() {
401
+ if (this.channels_.includes('email')) {
402
+ const isEmailValid = Helper.Helper.isValidEmail(this.email.value);
403
+ if (isEmailValid)
404
+ return;
405
+ !isEmailValid && this.validateField(this.email, this.emailErrorMsg);
406
+ }
407
+ if (this.channels_.includes('sms')) {
408
+ const isPhoneValid = await this.mobileInput.isValid();
409
+ if (isPhoneValid)
410
+ return;
411
+ }
412
+ throw ('Please insert required fields');
413
+ }
414
+ validateField(field, errorMsg) {
415
+ field.classList.add('s-has-error');
416
+ field.nextElementSibling['innerText'] = '* ' + errorMsg;
417
+ }
418
+ render() {
419
+ return (index.h(index.Host, { class: "s-product-availability-wrap" }, this.isSubscribed || this.isVisitorSubscribed
420
+ ? index.h("div", { class: "s-product-availability-subscribed" }, index.h("i", { class: "sicon-bell-ring s-product-availability-subs-icon" }), " ", this.subscribedMessage)
421
+ :
422
+ index.h("salla-button", { width: "wide", onClick: () => this.isUser ? this.submit() : this.modal.show(), ref: btn => this.inlineBtn = btn }, salla.lang.get('pages.products.notify_availability')), this.isUser || this.isSubscribed || this.isVisitorSubscribed ? '' : this.renderModal()));
423
+ }
424
+ renderModal() {
425
+ return (index.h("salla-modal", { ref: modal => this.modal = modal, "modal-title": this.title_, subTitle: this.subTitle, icon: "sicon-bell-ring", width: "sm" }, index.h("div", { class: "s-product-availability-body" }, this.channels_.includes('email') ? [
426
+ index.h("label", { class: "s-product-availability-label" }, this.emailLabel),
427
+ index.h("input", { class: "s-product-availability-input", onKeyDown: e => this.typing(e, this.submit), placeholder: this.emailPlaceholder, ref: el => this.email = el, type: "email" }),
428
+ index.h("span", { class: "s-product-availability-error-msg" })
429
+ ] : '', this.channels_.includes('sms') ? [
430
+ index.h("label", { class: "s-product-availability-label" }, this.mobileLabel),
431
+ index.h("salla-tel-input", { ref: el => this.mobileInput = el, onKeyDown: e => this.typing(e, this.submit) })
432
+ ] : ''), index.h("div", { slot: "footer", class: "s-product-availability-footer" }, index.h("salla-button", { width: "wide", color: "light", fill: "outline", onClick: () => this.modal.hide(), ref: btn => this.cancelBtn = btn }, salla.lang.get('common.elements.cancel')), index.h("salla-button", { "loader-position": 'center', width: "wide", ref: btn => this.btn = btn, onClick: () => this.submit() }, salla.lang.get('common.elements.submit')))));
433
+ }
434
+ get host() { return index.getElement(this); }
435
+ static get watchers() { return {
436
+ "channels": ["channelsWatcher"]
437
+ }; }
438
+ };
439
+ SallaProductAvailability.style = sallaProductAvailabilityCss;
440
+
441
+ const sallaSearchCss = "#s-search-modal .s-search-inline{border:1px solid #eee}#s-search-modal .s-search-no-results .s-search-input,#s-search-modal .s-search-container-open .s-search-input{border-bottom:1px solid #f4f4f5}#s-search-modal .s-search-product-image{font-size:0;position:relative}#s-search-modal .s-search-product-image:before{content:\"\";position:absolute;width:100%;height:100%;left:0;top:0;background:#eee}#s-search-modal .s-modal-wrapper{align-items:flex-start;padding:0}#s-search-modal .s-modal-spacer{display:inline}#s-search-modal .s-modal-body{padding:0;max-width:90%;margin-top:3.2rem;border-radius:0.5rem;background:transparent;overflow:visible}#s-search-modal .s-modal-close{top:50%;transform:translateY(-50%)}";
442
+
443
+ const SallaSearch = class {
444
+ constructor(hostRef) {
445
+ index.registerInstance(this, hostRef);
446
+ var _a;
447
+ this.inputValue = '';
448
+ this.inline = false;
449
+ this.oval = false;
450
+ this.height = 60;
451
+ Helper.Helper.setHost(this.host);
452
+ this.productSlot = ((_a = Helper.Helper.getElement('[slot="product"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || this.getDefaultProductSlot();
453
+ salla.event.on('search::show', () => this.modal.show());
454
+ salla.event.on('languages::translations.loaded', () => {
455
+ this.placeholder = salla.lang.get('blocks.header.search_placeholder');
456
+ this.noResultsText = salla.lang.get('common.elements.no_options');
457
+ });
458
+ }
459
+ onModalOpen() {
460
+ this.modal.querySelector('.s-search-input').focus();
461
+ }
462
+ onModalClose() {
463
+ this.modal.querySelector('.s-search-input').value = '';
464
+ this.results = undefined;
465
+ this.afterSearching();
466
+ this.container.classList.remove('s-search-no-results');
467
+ }
468
+ getDefaultProductSlot() {
469
+ return '<div class="s-search-product-image-container">' +
470
+ ' <img class="s-search-product-image" src="{image}" alt="{name}"/>' +
471
+ '</div>' +
472
+ '<div class="s-search-product-details">' +
473
+ ' <div class="s-search-product-title">{name}</div> <div class="s-search-product-price">{price} <span class="s-search-product-regular-price">{regular_price}</span></div>' +
474
+ '</div>';
475
+ }
476
+ search(e) {
477
+ this.inputValue = e.target.value;
478
+ Helper.Helper.hideElement(this.noResults);
479
+ if (e.target.value.length === 0) {
480
+ this.results = undefined;
481
+ this.afterSearching();
482
+ return;
483
+ }
484
+ if (e.target.value.length <= 2) {
485
+ return;
486
+ }
487
+ //run loading spinner or stop it
488
+ Helper.Helper.toggleElementClassIf(this.searchIcon, 's-search-spinner-loader', 'sicon-search', () => true);
489
+ salla.search.api.products(e.target.value)
490
+ .then(response => this.results = response)
491
+ .catch(err => err !== 'Query is same as previous one!' ? this.results = undefined : null)
492
+ .finally(() => this.afterSearching(/*isEmpty*/ false));
493
+ }
494
+ afterSearching(isEmpty = true) {
495
+ var _a;
496
+ this.noResults.style.display = isEmpty || ((_a = this.results) === null || _a === void 0 ? void 0 : _a.data.length) > 0 ? 'none' : 'block';
497
+ Helper.Helper.toggleElementClassIf(this.container, 's-search-container-open', 's-search-no-results', () => { var _a; return (_a = this.results) === null || _a === void 0 ? void 0 : _a.data.length; })
498
+ .toggleElementClassIf(this.searchIcon, 's-search-spinner-loader', 'sicon-search', () => false); //stop searching anime
499
+ salla.search.api.previousQuery = ''; //avoid having error 'Query is same as previous one!' after reopen modal;
500
+ this.inputValue.length == 0 ? this.container.classList.remove('s-search-no-results') : '';
501
+ }
502
+ render() {
503
+ var _a;
504
+ const searchContent = index.h("div", { class: { 's-search-container': true, 's-search-inline': this.inline }, ref: container => this.container = container, style: this.oval ? { borderRadius: this.height / 2 + 'px' } : {} }, index.h("input", { class: "s-search-input", type: "text", placeholder: this.placeholder, onInput: e => this.search(e), style: { height: this.height + 'px' } }), index.h("span", { class: "s-search-icon-wrap" }, index.h("i", { class: "s-search-icon sicon-search", ref: el => this.searchIcon = el })), index.h("div", { class: "s-search-results" }, (_a = this.results) === null || _a === void 0 ? void 0 :
505
+ _a.data.map(item => index.h("a", { href: item.url, class: { "s-search-product": true, 's-search-product-not-available': !item.is_available }, innerHTML: this.productSlot
506
+ .replace(/\{name\}/g, item.name)
507
+ .replace(/\{price\}/g, salla.money(item.price))
508
+ .replace(/\{regular_price\}/g, item.has_special_price ? salla.money(item.regular_price) : '')
509
+ .replace(/\{image\}/g, item.thumbnail) })), index.h("p", { ref: el => this.noResults = el, class: "s-search-no-results-placeholder" }, this.noResultsText)));
510
+ return (this.inline ?
511
+ index.h("div", { id: "s-search-modal" }, searchContent)
512
+ :
513
+ index.h("salla-modal", { position: "top", id: "s-search-modal", ref: modal => this.modal = modal }, searchContent));
514
+ }
515
+ /**
516
+ * Run it one time after load
517
+ */
518
+ componentDidLoad() {
519
+ this.afterSearching();
520
+ }
521
+ get host() { return index.getElement(this); }
522
+ };
523
+ SallaSearch.style = sallaSearchCss;
524
+
11
525
  function createCommonjsModule(fn, basedir, module) {
12
526
  return module = {
13
527
  path: basedir,
@@ -1475,4 +1989,9 @@ const SallaTelInput = class {
1475
1989
  };
1476
1990
  SallaTelInput.style = sallaTelInputCss;
1477
1991
 
1992
+ exports.salla_add_product_button = SallaAddProductButton;
1993
+ exports.salla_button = SallaButton;
1994
+ exports.salla_modal = SallaModal;
1995
+ exports.salla_product_availability = SallaProductAvailability;
1996
+ exports.salla_search = SallaSearch;
1478
1997
  exports.salla_tel_input = SallaTelInput;
@@ -126,7 +126,7 @@ const SallaLoginModal = class {
126
126
  if (salla.auth.event.getTypeActionOnVerified() !== 'redirect') {
127
127
  return;
128
128
  }
129
- if (event.data.redirect_url) {
129
+ if (event.detail.data.redirect_url) {
130
130
  return window.location.href = event.data.redirect_url;
131
131
  }
132
132
  window.location.reload();
@@ -157,7 +157,7 @@ const SallaLoginModal = class {
157
157
  this.regType = tab === this.mobileTab ? 'phone' : 'email';
158
158
  }
159
159
  let isRegistrationTab = tab == this.registrationTab;
160
- isRegistrationTab && ((_a = this.firstName) === null || _a === void 0 ? void 0 : _a.focus());
160
+ (_a = tab.querySelector('input')) === null || _a === void 0 ? void 0 : _a.focus(); // focus the first input in tab
161
161
  (_b = this.modal) === null || _b === void 0 ? void 0 : _b.setTitle(isRegistrationTab ? salla.lang.get('common.titles.registration') : this.title);
162
162
  if (!isRegistrationTab) {
163
163
  Helper.Helper.toggleElementClassIf(this.regMobileBlock, 's-hidden', 's-show', () => this.regType === 'phone')
@@ -19,7 +19,7 @@ const SallaVerifyModal = class {
19
19
  /**
20
20
  * Verifying method
21
21
  */
22
- this.by = 'sms';
22
+ this.type = 'mobile';
23
23
  /**
24
24
  * should auto reloading the page after success verification
25
25
  */
@@ -53,8 +53,7 @@ const SallaVerifyModal = class {
53
53
  async show(data) {
54
54
  var _a;
55
55
  this.data = data;
56
- //dirty way to set the by;
57
- this.by = (data === null || data === void 0 ? void 0 : data.type) == 'mobile' ? 'sms' : (data === null || data === void 0 ? void 0 : data.type) || this.by;
56
+ this.data.type = this.data.type || this.type;
58
57
  this.resendTimer();
59
58
  this.otpInputs = this.host.querySelectorAll('.s-verify-modal-input');
60
59
  if (!this.initiated) {
@@ -122,7 +121,7 @@ const SallaVerifyModal = class {
122
121
  this.otpInputs.forEach(input => input.value = '');
123
122
  this.otpInputs[0].focus();
124
123
  })
125
- .then(() => salla.api.auth.resend(Object.assign({ resend_by: this.by }, this.data)))
124
+ .then(() => salla.api.auth.resend(this.data))
126
125
  .then(() => this.resendTimer())
127
126
  .catch(() => this.resendTimer());
128
127
  }
@@ -132,7 +131,7 @@ const SallaVerifyModal = class {
132
131
  .then(() => this.btn.disable())
133
132
  .then(() => this.url
134
133
  ? salla.api.auth.request(this.url, data)
135
- : salla.api.auth.verify(this.by == 'sms' ? 'mobile' : this.by, data, true))
134
+ : salla.api.auth.verify(data, true))
136
135
  .then(response => this.verified.emit(response))
137
136
  .then(() => this.btn.stop() && this.btn.disable())
138
137
  .then(() => this.modal.hide())
@@ -18,5 +18,5 @@ const patchBrowser = () => {
18
18
  };
19
19
 
20
20
  patchBrowser().then(options => {
21
- return index.bootstrapLazy([["salla-modal_2.cjs",[[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[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],"show":[64],"hide":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-login-modal.cjs",[[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],"show":[64]},[[0,"verified","onVerified"]]]]],["salla-product-availability.cjs",[[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]}]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-branches.cjs",[[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]}]]],["salla-localization-modal.cjs",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"show":[64],"hide":[64],"submit":[64]}]]],["salla-offer-modal.cjs",[[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],"show":[64],"showOffer":[64]}]]],["salla-conditional-fields.cjs",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"nextPageAutoload":[1028,"next-page-autoload"],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-installment.cjs",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-quantity-input.cjs",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]],["salla-button.cjs",[[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["salla-verify-modal.cjs",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"url":[513],"by":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}]]],["salla-rating-stars.cjs",[[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}]]],["salla-tel-input.cjs",[[0,"salla-tel-input",{"mobile":[1025],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}]]]], options);
21
+ return index.bootstrapLazy([["salla-add-product-button_6.cjs",[[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"],"disabled":[516]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[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]}],[0,"salla-tel-input",{"mobile":[1025],"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"],"wide":[4],"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],"show":[64],"hide":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-login-modal.cjs",[[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],"show":[64]},[[0,"verified","onVerified"]]]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-branches.cjs",[[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]}]]],["salla-localization-modal.cjs",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"show":[64],"hide":[64],"submit":[64]}]]],["salla-offer-modal.cjs",[[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],"show":[64],"showOffer":[64]}]]],["salla-conditional-fields.cjs",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"nextPageAutoload":[1028,"next-page-autoload"],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-installment.cjs",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-quantity-input.cjs",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]],["salla-verify-modal.cjs",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"url":[513],"type":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}]]],["salla-rating-stars.cjs",[[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}]]]], options);
22
22
  });
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "entries": [
3
+ "./components/salla-add-product-button/salla-add-product-button.js",
3
4
  "./components/salla-branches/salla-branches.js",
4
5
  "./components/salla-button/salla-button.js",
5
6
  "./components/salla-conditional-fields/salla-conditional-fields.js",