@salla.sa/twilight-components 2.13.20 → 2.13.21

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 (36) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/salla-add-product-button_47.cjs.entry.js +13 -6
  3. package/dist/cjs/salla-add-product-button_47.cjs.entry.js.map +1 -1
  4. package/dist/cjs/twilight.cjs.js +1 -1
  5. package/dist/collection/components/salla-login-modal/salla-login-modal.js +12 -6
  6. package/dist/collection/components/salla-login-modal/salla-login-modal.js.map +1 -1
  7. package/dist/collection/components/salla-tel-input/salla-tel-input.js +19 -0
  8. package/dist/collection/components/salla-tel-input/salla-tel-input.js.map +1 -1
  9. package/dist/components/salla-login-modal.js +12 -6
  10. package/dist/components/salla-login-modal.js.map +1 -1
  11. package/dist/components/salla-tel-input2.js +3 -0
  12. package/dist/components/salla-tel-input2.js.map +1 -1
  13. package/dist/esm/loader.js +1 -1
  14. package/dist/esm/salla-add-product-button_47.entry.js +13 -6
  15. package/dist/esm/salla-add-product-button_47.entry.js.map +1 -1
  16. package/dist/esm/twilight.js +1 -1
  17. package/dist/esm-es5/loader.js +1 -1
  18. package/dist/esm-es5/loader.js.map +1 -1
  19. package/dist/esm-es5/salla-add-product-button_47.entry.js +1 -1
  20. package/dist/esm-es5/salla-add-product-button_47.entry.js.map +1 -1
  21. package/dist/esm-es5/twilight.js +1 -1
  22. package/dist/esm-es5/twilight.js.map +1 -1
  23. package/dist/twilight/{p-b8aec437.system.entry.js → p-94a6d86e.system.entry.js} +2 -2
  24. package/dist/twilight/p-94a6d86e.system.entry.js.map +1 -0
  25. package/dist/twilight/{p-daa1888f.entry.js → p-cf1b9755.entry.js} +2 -2
  26. package/dist/twilight/p-cf1b9755.entry.js.map +1 -0
  27. package/dist/twilight/p-e550d2df.system.js +1 -1
  28. package/dist/twilight/p-e550d2df.system.js.map +1 -1
  29. package/dist/twilight/twilight.esm.js +1 -1
  30. package/dist/twilight/twilight.esm.js.map +1 -1
  31. package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +1 -0
  32. package/dist/types/components/salla-tel-input/salla-tel-input.d.ts +4 -0
  33. package/dist/types/components.d.ts +8 -0
  34. package/package.json +5 -5
  35. package/dist/twilight/p-b8aec437.system.entry.js.map +0 -1
  36. package/dist/twilight/p-daa1888f.entry.js.map +0 -1
@@ -23,7 +23,7 @@ const patchBrowser = () => {
23
23
 
24
24
  patchBrowser().then(options => {
25
25
  appGlobals.globalScripts();
26
- return index.bootstrapLazy(JSON.parse("[[\"salla-offer.cjs\",[[0,\"salla-offer\",{\"productId\":[1538,\"product-id\"],\"offer\":[32],\"offersList\":[32],\"userCurrency\":[32],\"isMultipleBank\":[32],\"title\":[32],\"offer_with_price_text\":[32],\"with_discount_text\":[32],\"product_discount_text\":[32],\"special_offer_text\":[32],\"buy_quantity_text\":[32]}]]],[\"salla-products-slider.cjs\",[[0,\"salla-products-slider\",{\"blockTitle\":[1,\"block-title\"],\"subTitle\":[1,\"sub-title\"],\"sliderId\":[1,\"slider-id\"],\"displayAllUrl\":[1,\"display-all-url\"],\"autoplay\":[1028],\"source\":[1537],\"sourceValue\":[1,\"source-value\"],\"limit\":[1026],\"sliderConfig\":[520,\"slider-config\"],\"productCardComponent\":[1,\"product-card-component\"],\"productsData\":[32],\"isReady\":[32],\"sourceValueIsValid\":[32],\"hasCustomComponent\":[32],\"apiUrl\":[32],\"parsedSourceValue\":[32]}]]],[\"salla-product-options.cjs\",[[0,\"salla-product-options\",{\"productId\":[2,\"product-id\"],\"options\":[1],\"optionsData\":[32],\"outOfStockText\":[32],\"donationAmount\":[32],\"selectDonationAmount\":[32],\"selectAmount\":[32],\"isCustomDonation\":[32],\"selectedOptions\":[32],\"canDisabled\":[32],\"selectedSkus\":[32],\"selectedOutSkus\":[32],\"getSelectedOptionsData\":[64],\"reportValidity\":[64],\"hasOutOfStockOption\":[64],\"getSelectedOptions\":[64],\"getOption\":[64]}]]],[\"salla-filters.cjs\",[[0,\"salla-filters\",{\"filters\":[1040],\"isSidebarOpen\":[32],\"filtersData\":[32],\"apply\":[32],\"reset\":[32],\"getFilters\":[64],\"applyFilters\":[64],\"resetFilters\":[64]}]]],[\"salla-notifications.cjs\",[[0,\"salla-notifications\",{\"loadMoreText\":[1,\"load-more-text\"],\"itemPerPage\":[2,\"item-per-page\"],\"notifications\":[32],\"pagination\":[32],\"hasInfiniteScroll\":[32],\"total\":[32],\"showPlaceholder\":[32],\"nextPage\":[32],\"no_notifications_trans\":[32],\"load_more_text_trans\":[32]}]]],[\"salla-order-summary.cjs\",[[0,\"salla-order-summary\",{\"orderId\":[514,\"order-id\"],\"codeCopied\":[32],\"noItemFound\":[32],\"order_items\":[32]}]]],[\"salla-advertisement.cjs\",[[0,\"salla-advertisement\",{\"position\":[32],\"advertisements\":[32],\"advertIcon\":[32],\"currentSlug\":[32]}]]],[\"salla-app-install-alert.cjs\",[[0,\"salla-app-install-alert\",{\"data\":[32],\"ctaLink\":[32],\"open\":[32],\"closing\":[32]}]]],[\"salla-apps-icons.cjs\",[[0,\"salla-apps-icons\",{\"hideTitle\":[4,\"hide-title\"],\"appsTitle\":[1,\"apps-title\"],\"vertical\":[4],\"apps\":[32]}]]],[\"salla-contacts.cjs\",[[0,\"salla-contacts\",{\"contactsTitle\":[1025,\"contacts-title\"],\"hideTitle\":[4,\"hide-title\"],\"isHeader\":[4,\"is-header\"],\"horizontal\":[4],\"iconsOnly\":[4,\"icons-only\"],\"contacts\":[32],\"iconsList\":[32]}]]],[\"salla-installment.cjs\",[[0,\"salla-installment\",{\"price\":[1],\"language\":[1],\"currency\":[1],\"tamaraIsActive\":[32],\"tabbyIsActive\":[32],\"spotiiIsActive\":[32],\"mispayActive\":[32],\"installment_sheria_text\":[32]}]]],[\"salla-loyalty-prize-item.cjs\",[[0,\"salla-loyalty-prize-item\",{\"item\":[16]}]]],[\"salla-payments.cjs\",[[0,\"salla-payments\",{\"withSbc\":[4,\"with-sbc\"],\"sbcId\":[1,\"sbc-id\"],\"withMadeInKsa\":[4,\"with-made-in-ksa\"],\"payments\":[32],\"placeholderImage\":[32]}]]],[\"salla-products-list.cjs\",[[0,\"salla-products-list\",{\"source\":[1537],\"sourceValue\":[1032,\"source-value\"],\"limit\":[1026],\"sortBy\":[1025,\"sort-by\"],\"filtersResults\":[1540,\"filters-results\"],\"horizontalCards\":[516,\"horizontal-cards\"],\"autoload\":[1028],\"loadMoreText\":[1,\"load-more-text\"],\"productCardComponent\":[1,\"product-card-component\"],\"page\":[32],\"nextPage\":[32],\"hasInfiniteScroll\":[32],\"hasCustomComponent\":[32],\"sourceValueIsValid\":[32],\"placeholderText\":[32],\"endOfText\":[32],\"failedLoadMore\":[32],\"currentPage\":[32],\"currentCategoryIdFilter\":[32],\"isReady\":[32],\"showPlaceholder\":[32],\"parsedFilters\":[32],\"setFilters\":[64],\"reload\":[64]}]]],[\"salla-social.cjs\",[[0,\"salla-social\",{\"links\":[32],\"iconsList\":[32]}]]],[\"salla-filters-widget.cjs\",[[4,\"salla-filters-widget\",{\"withLoadMore\":[1028,\"with-load-more\"],\"filtersData\":[16],\"option\":[16],\"isOpen\":[32],\"isShowMore\":[32],\"showMoreLabel\":[32],\"showLessLabel\":[32],\"page\":[32],\"setWidgetHeight\":[64],\"reset\":[64],\"showMore\":[64],\"toggleWidget\":[64]}]]],[\"salla-conditional-fields.cjs\",[[4,\"salla-conditional-fields\",null,[[0,\"change\",\"changeHandler\"]]]]],[\"salla-notification-item.cjs\",[[0,\"salla-notification-item\",{\"notification\":[16]}]]],[\"salla-price-range.cjs\",[[0,\"salla-price-range\",{\"minPrice\":[1032,\"min-price\"],\"maxPrice\":[1032,\"max-price\"],\"option\":[16],\"filtersData\":[520,\"filters-data\"],\"min\":[32],\"max\":[32],\"priceOptions\":[32],\"moreThanLabel\":[32],\"lessThanLabel\":[32],\"toLabel\":[32],\"fromLabel\":[32],\"typing\":[32],\"debounce\":[32],\"reset\":[64]}]]],[\"salla-add-product-button_47.cjs\",[[4,\"salla-gifting\",{\"productId\":[2,\"product-id\"],\"widgetTitle\":[1,\"widget-title\"],\"widgetSubtitle\":[1,\"widget-subtitle\"],\"sectionTitle\":[32],\"sectionSubtitle\":[32],\"sectionBtnText\":[32],\"giftDetails\":[32],\"selectImageForYourGift\":[32],\"selectImageOrUpload\":[32],\"selectGiftMessage\":[32],\"giftCustomText\":[32],\"textId\":[32],\"incorrectGiftText\":[32],\"nextStep\":[32],\"senderNameLabel\":[32],\"receiverNameFieldLabel\":[32],\"receiverMobileFieldLabel\":[32],\"receiverEmailFieldLabel\":[32],\"emailPlaceholder\":[32],\"sendLater\":[32],\"selectSendDateAndTime\":[32],\"canNotEditOrderAfterSelectDate\":[32],\"sendGift\":[32],\"donationRequired\":[32],\"currentStep\":[32],\"showCalendar\":[32],\"showGiftText\":[32],\"currentLang\":[32],\"parentClass\":[32],\"errors\":[32],\"gift\":[32],\"selectedGiftTextOption\":[32],\"showTextArea\":[32],\"selectedImage\":[32],\"uploadedImage\":[32],\"selectedText\":[32],\"senderName\":[32],\"errorMessage\":[32],\"hasError\":[32],\"quantity\":[32],\"deliveryDate\":[32],\"timeZone\":[32],\"receiverName\":[32],\"receiverMobile\":[32],\"receiverCountryCode\":[32],\"receiverEmail\":[32],\"open\":[64],\"close\":[64],\"goToStep2\":[64]}],[4,\"salla-loyalty\",{\"prizePoints\":[1544,\"prize-points\"],\"customerPoints\":[1538,\"customer-points\"],\"prizeTitle\":[1537,\"prize-title\"],\"allowEmail\":[4,\"allow-email\"],\"allowMobile\":[4,\"allow-mobile\"],\"requireEmail\":[4,\"require-email\"],\"guestMessage\":[1025,\"guest-message\"],\"loyaltyProgram\":[32],\"buttonLoading\":[32],\"selectedItem\":[32],\"askConfirmation\":[32],\"is_loggedin\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64],\"resetExchange\":[64],\"exchangeLoyaltyPoint\":[64]}],[0,\"salla-menu\",{\"source\":[1],\"sourceValue\":[1,\"source-value\"],\"topnav\":[4],\"useReactLink\":[4,\"use-react-link\"],\"menus\":[32],\"hasCustomComponent\":[32],\"setMenuContent\":[64]}],[4,\"salla-product-size-guide\",{\"guides\":[32],\"productId\":[32],\"placeholder_title\":[32],\"placeholder_description\":[32],\"modal_title\":[32],\"hasError\":[32],\"open\":[64],\"close\":[64]}],[4,\"salla-login-modal\",{\"isEmailAllowed\":[1028,\"is-email-allowed\"],\"isMobileAllowed\":[1028,\"is-mobile-allowed\"],\"isEmailRequired\":[1028,\"is-email-required\"],\"supportWebAuth\":[516,\"support-web-auth\"],\"inline\":[516],\"withoutReload\":[4,\"without-reload\"],\"currentTabName\":[32],\"regType\":[32],\"translationLoaded\":[32],\"currentPhone\":[32],\"currentEmail\":[32],\"title\":[32],\"emailErrorMsg\":[32],\"firstNameErrorMsg\":[32],\"lastNameErrorMsg\":[32],\"hasError\":[32],\"errorMessage\":[32],\"dragAndDrop\":[32],\"browseFromFiles\":[32],\"customFields\":[32],\"uploadedImage\":[32],\"open\":[64]},[[8,\"verified\",\"onVerified\"]]],[0,\"salla-offer-modal\",{\"offer\":[32],\"offer_name\":[32],\"offer_message\":[32],\"hasError\":[32],\"errorMessage\":[32],\"productID\":[32],\"offer_type\":[32],\"translationLoaded\":[32],\"addToCartLabel\":[32],\"open\":[64],\"showOffer\":[64]}],[0,\"salla-rating-modal\",{\"orderId\":[2,\"order-id\"],\"order\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64]}],[4,\"salla-scopes\",{\"selection\":[1],\"searchDisplayLimit\":[2,\"search-display-limit\"],\"translationLoaded\":[32],\"mode\":[32],\"current_scope\":[32],\"scopes\":[32],\"originalScopesList\":[32],\"selected_scope\":[32],\"isOpenedBefore\":[32],\"hasError\":[32],\"loading\":[32],\"close\":[64],\"open\":[64],\"handleSubmit\":[64]}],[0,\"salla-localization-modal\",{\"language\":[1537],\"currency\":[1537],\"translationLoaded\":[32],\"languages\":[32],\"currencies\":[32],\"hasError\":[32],\"errorMessage\":[32],\"open\":[64],\"close\":[64],\"submit\":[64]}],[0,\"salla-bottom-alert\",{\"type\":[513],\"icon\":[513],\"message\":[513],\"actionUrl\":[513,\"action-url\"],\"actionLabel\":[513,\"action-label\"],\"storeId\":[32],\"template\":[32],\"loading\":[32],\"templateData\":[32],\"defaultMessage\":[32],\"defaultActionLabel\":[32],\"storeFeatures\":[32],\"storeDetails\":[32],\"storePrice\":[32],\"theDeveloper\":[32],\"templateInformation\":[32],\"buyTheTemplate\":[32],\"isRtl\":[32]}],[0,\"salla-comments\",{\"itemId\":[2,\"item-id\"],\"loadMoreText\":[1,\"load-more-text\"],\"hideForm\":[4,\"hide-form\"],\"type\":[1],\"comments\":[32],\"pagination\":[32],\"total\":[32],\"showPlaceholder\":[32],\"nextPage\":[32],\"noComments\":[32],\"comment_title\":[32],\"comment_name\":[32],\"placeholder_text\":[32]}],[0,\"salla-quick-order\",{\"quickOrderTitle\":[1025,\"quick-order-title\"],\"subTitle\":[1025,\"sub-title\"],\"payButtonTitle\":[1025,\"pay-button-title\"],\"confirmPayButtonTitle\":[1025,\"confirm-pay-button-title\"],\"agreementText\":[1025,\"agreement-text\"],\"isEmailRequired\":[1028,\"is-email-required\"],\"productId\":[1025,\"product-id\"],\"thanksMessage\":[1025,\"thanks-message\"],\"quickOrderStyle\":[1025,\"quick-order-style\"],\"user\":[32],\"isAvailable\":[32],\"oneClick\":[32],\"expanded\":[32],\"isTermsRequired\":[32],\"countryCode\":[32],\"submitSucess\":[32],\"placeHolderEmail\":[32],\"emailOptional\":[32],\"agreementShowText\":[32],\"agreementModalHead\":[32],\"userNameLabel\":[32],\"termsChecked\":[32]}],[0,\"salla-user-profile\",{\"customFields\":[1,\"custom-fields\"],\"userData\":[32],\"userDefinedFields\":[32],\"disableAction\":[32],\"first_name_trans\":[32],\"last_name_trans\":[32],\"birthday_trans\":[32],\"birthday_placeholder_trans\":[32],\"gender_trans\":[32],\"gender_placeholder_trans\":[32],\"male_trans\":[32],\"female_trans\":[32],\"email_trans\":[32],\"mobile_trans\":[32],\"save_btn_trans\":[32],\"drag_and_drop_trans\":[32],\"browse_trans\":[32],\"email_required_trans\":[32],\"invalid_email_trans\":[32],\"setCustomFields\":[64]}],[0,\"salla-user-settings\",{\"isNotifiable\":[516,\"is-notifiable\"],\"deactivateAccount\":[32],\"promotionalMsgs\":[32],\"deactivateDesc\":[32],\"promotionalMsgsDesc\":[32],\"sorryForLeavingText\":[32],\"warningText\":[32],\"keepAccount\":[32],\"buttonLoading\":[32]}],[0,\"salla-search\",{\"inline\":[4],\"oval\":[4],\"height\":[2],\"maxWords\":[2,\"max-words\"],\"showAction\":[4,\"show-action\"],\"translationLoaded\":[32],\"results\":[32],\"loading\":[32],\"typing\":[32],\"debounce\":[32],\"search_term\":[32]},[[0,\"keydown\",\"handleKeyDown\"]]],[4,\"salla-social-share\",{\"url\":[513],\"urlName\":[513,\"url-name\"],\"platforms\":[513],\"opened\":[32],\"allPlatforms\":[32],\"platformIcons\":[32],\"convertedPlatforms\":[32],\"open\":[64],\"refresh\":[64]}],[0,\"salla-breadcrumb\",{\"items\":[1],\"breadcrumbs\":[32],\"currentPage\":[32],\"isRtl\":[32]}],[4,\"salla-cart-summary\",{\"showCartLabel\":[4,\"show-cart-label\"],\"cartSummaryCount\":[32],\"cartSummaryTotal\":[32],\"cartLabel\":[32],\"animateToCart\":[64]}],[4,\"salla-infinite-scroll\",{\"nextPage\":[1,\"next-page\"],\"autoload\":[1028],\"container\":[1],\"loadMoreText\":[1,\"load-more-text\"],\"item\":[1],\"loadMore\":[32],\"noMore\":[32],\"failedToLoad\":[32]}],[0,\"salla-maintenance-alert\",{\"title\":[32],\"message\":[32],\"buttonTitle\":[32]}],[4,\"salla-quantity-input\",{\"cartItemId\":[8,\"cart-item-id\"],\"quantity\":[32],\"fireChangeEvent\":[32],\"decrease\":[64],\"increase\":[64],\"setValue\":[64]}],[4,\"salla-user-menu\",{\"inline\":[516],\"avatarOnly\":[516,\"avatar-only\"],\"showHeader\":[516,\"show-header\"],\"relativeDropdown\":[516,\"relative-dropdown\"],\"accountLoading\":[32],\"opened\":[32],\"notifications\":[32],\"orders\":[32],\"pending_orders\":[32],\"wishlist\":[32],\"profile\":[32],\"rating\":[32],\"logout\":[32],\"hello\":[32],\"first_name\":[32],\"last_name\":[32],\"avatar\":[32],\"is_loggedIn\":[32],\"badges\":[32],\"hasBadges\":[32],\"OrderUpdate\":[32]}],[4,\"salla-map\",{\"name\":[1],\"required\":[4],\"readonly\":[4],\"searchable\":[1028],\"lat\":[1026],\"lng\":[1026],\"apiKey\":[1025,\"api-key\"],\"modalTitle\":[1,\"modal-title\"],\"zoom\":[1026],\"theme\":[1025],\"modalActivityTitle\":[32],\"confirmButtonTitle\":[32],\"locateButtonTitle\":[32],\"locateButtonEdit\":[32],\"searchPlaceholder\":[32],\"searchInputValue\":[32],\"formattedAddress\":[32],\"geolocationError\":[32],\"searchInput\":[32],\"mapInput\":[32],\"mapElement\":[32],\"selectedLat\":[32],\"selectedLng\":[32],\"open\":[64]}],[4,\"salla-verify\",{\"display\":[1],\"type\":[1025],\"autoReload\":[4,\"auto-reload\"],\"supportWebAuth\":[4,\"support-web-auth\"],\"translationLoaded\":[32],\"title\":[32],\"resendAfter\":[32],\"hasError\":[32],\"errorMessage\":[32],\"isProfileVerify\":[32],\"getCode\":[64],\"open\":[64]}],[0,\"salla-comment-form\",{\"type\":[1537],\"showAvatar\":[4,\"show-avatar\"],\"itemId\":[1544,\"item-id\"],\"placeholder\":[32],\"submitText\":[32],\"canComment\":[32]}],[4,\"salla-color-picker\",{\"name\":[1],\"required\":[4],\"color\":[1537],\"format\":[1],\"showCancelButton\":[4,\"show-cancel-button\"],\"showTextField\":[4,\"show-text-field\"],\"enableAlpha\":[4,\"enable-alpha\"],\"widgetColor\":[32],\"setPickerOption\":[64],\"movePopUp\":[64],\"setColorValue\":[64],\"openPicker\":[64],\"closePicker\":[64],\"destroyPicker\":[64]}],[0,\"salla-comment-item\",{\"comment\":[16],\"has_bought_trans\":[32],\"rated_trans\":[32],\"waiting_approval_trans\":[32],\"has_order_trans\":[32]}],[4,\"salla-tab-content\",{\"name\":[1],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tab-header\",{\"name\":[1],\"activeClass\":[1,\"active-class\"],\"height\":[8],\"centered\":[4],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tabs\",{\"backgroundColor\":[1,\"background-color\"],\"vertical\":[4]},[[0,\"tabSelected\",\"onSelectedTab\"]]],[4,\"salla-product-card\",{\"product\":[1],\"horizontal\":[4],\"shadowOnHover\":[4,\"shadow-on-hover\"],\"hideAddBtn\":[4,\"hide-add-btn\"],\"fullImage\":[4,\"full-image\"],\"minimal\":[4],\"isSpecial\":[4,\"is-special\"],\"showQuantity\":[4,\"show-quantity\"],\"productData\":[32],\"fitImageHeight\":[32],\"remained\":[32],\"outOfStock\":[32],\"donationAmount\":[32],\"startingPrice\":[32],\"addToCart\":[32],\"placeholder\":[32]}],[0,\"salla-datetime-picker\",{\"value\":[1537],\"required\":[4],\"name\":[513],\"placeholder\":[1],\"allowInput\":[4,\"allow-input\"],\"allowInvalidPreload\":[4,\"allow-invalid-preload\"],\"altFormat\":[1,\"alt-format\"],\"altInput\":[4,\"alt-input\"],\"altInputClass\":[1,\"alt-input-class\"],\"appendTo\":[16],\"ariaDateFormat\":[1,\"aria-date-format\"],\"autoFillDefaultTime\":[4,\"auto-fill-default-time\"],\"clickOpens\":[4,\"click-opens\"],\"closeOnSelect\":[4,\"close-on-select\"],\"conjunction\":[1],\"dateFormat\":[1,\"date-format\"],\"defaultDate\":[8,\"default-date\"],\"defaultHour\":[2,\"default-hour\"],\"defaultMinute\":[2,\"default-minute\"],\"defaultSeconds\":[2,\"default-seconds\"],\"disable\":[16],\"disableMobile\":[4,\"disable-mobile\"],\"enable\":[16],\"enableSeconds\":[4,\"enable-seconds\"],\"enableTime\":[4,\"enable-time\"],\"formatDate\":[16],\"hourIncrement\":[2,\"hour-increment\"],\"inline\":[4],\"locale\":[1],\"maxDate\":[8,\"max-date\"],\"maxTime\":[8,\"max-time\"],\"minDate\":[8,\"min-date\"],\"minTime\":[8,\"min-time\"],\"minuteIncrement\":[2,\"minute-increment\"],\"mode\":[1],\"monthSelectorType\":[1,\"month-selector-type\"],\"nextArrow\":[1,\"next-arrow\"],\"noCalendar\":[4,\"no-calendar\"],\"dateParser\":[16],\"position\":[1],\"positionElement\":[16],\"prevArrow\":[1,\"prev-arrow\"],\"shorthandCurrentMonth\":[4,\"shorthand-current-month\"],\"static\":[4],\"showMonths\":[2,\"show-months\"],\"time_24hr\":[4,\"time_-2-4hr\"],\"weekNumbers\":[4,\"week-numbers\"],\"wrap\":[4]}],[4,\"salla-add-product-button\",{\"channels\":[513],\"subscribedOptions\":[1,\"subscribed-options\"],\"quickBuy\":[1540,\"quick-buy\"],\"quantity\":[514],\"donatingAmount\":[514,\"donating-amount\"],\"notifyOptionsAvailability\":[516,\"notify-options-availability\"],\"productId\":[520,\"product-id\"],\"supportStickyBar\":[516,\"support-sticky-bar\"],\"productStatus\":[513,\"product-status\"],\"productType\":[513,\"product-type\"],\"hasOutOfStockOption\":[32],\"hasSubscribedOptions\":[32],\"selectedOptions\":[32],\"showQuickBuy\":[32]}],[0,\"salla-count-down\",{\"date\":[1],\"boxed\":[4],\"size\":[1],\"color\":[1],\"labeled\":[4],\"endText\":[1,\"end-text\"],\"digits\":[1],\"endOfDay\":[4,\"end-of-day\"],\"daysLabel\":[32],\"hoursLabel\":[32],\"minutesLabel\":[32],\"secondsLabel\":[32],\"endLabel\":[32],\"invalidDate\":[32],\"offerEnded\":[32],\"countInterval\":[32],\"days\":[32],\"hours\":[32],\"minutes\":[32],\"seconds\":[32],\"endCountDown\":[64]}],[0,\"salla-file-upload\",{\"value\":[1537],\"files\":[513],\"height\":[513],\"cartItemId\":[1,\"cart-item-id\"],\"profileImage\":[516,\"profile-image\"],\"name\":[1537],\"payloadName\":[1,\"payload-name\"],\"accept\":[1537],\"fileId\":[2,\"file-id\"],\"url\":[1025],\"method\":[1],\"formData\":[1,\"form-data\"],\"required\":[4],\"maxFileSize\":[1,\"max-file-size\"],\"disabled\":[4],\"allowDrop\":[4,\"allow-drop\"],\"allowBrowse\":[4,\"allow-browse\"],\"allowPaste\":[4,\"allow-paste\"],\"allowMultiple\":[4,\"allow-multiple\"],\"allowReplace\":[4,\"allow-replace\"],\"allowRevert\":[4,\"allow-revert\"],\"allowRemove\":[4,\"allow-remove\"],\"allowProcess\":[4,\"allow-process\"],\"allowReorder\":[4,\"allow-reorder\"],\"storeAsFile\":[4,\"store-as-file\"],\"forceRevert\":[4,\"force-revert\"],\"maxFilesCount\":[2,\"max-files-count\"],\"maxParallelUploads\":[2,\"max-parallel-uploads\"],\"checkValidity\":[4,\"check-validity\"],\"itemInsertLocation\":[1,\"item-insert-location\"],\"itemInsertInterval\":[2,\"item-insert-interval\"],\"credits\":[4],\"dropOnPage\":[4,\"drop-on-page\"],\"dropOnElement\":[4,\"drop-on-element\"],\"dropValidation\":[4,\"drop-validation\"],\"ignoredFiles\":[16],\"instantUpload\":[1028,\"instant-upload\"],\"chunkUploads\":[4,\"chunk-uploads\"],\"chunkForce\":[4,\"chunk-force\"],\"chunkSize\":[2,\"chunk-size\"],\"chunkRetryDelays\":[16],\"labelDecimalSeparator\":[1,\"label-decimal-separator\"],\"labelThousandsSeparator\":[1,\"label-thousands-separator\"],\"labelIdle\":[1025,\"label-idle\"],\"iconRemove\":[1,\"icon-remove\"],\"iconProcess\":[1,\"icon-process\"],\"iconRetry\":[1,\"icon-retry\"],\"iconUndo\":[1,\"icon-undo\"],\"setOption\":[64]}],[4,\"salla-list-tile\",{\"href\":[1],\"target\":[1]}],[0,\"salla-product-availability\",{\"channels\":[1],\"notifyOptionsAvailability\":[4,\"notify-options-availability\"],\"productId\":[2,\"product-id\"],\"isSubscribed\":[1028,\"is-subscribed\"],\"translationLoaded\":[32],\"title_\":[32],\"isVisitorSubscribed\":[32]}],[0,\"salla-quick-buy\",{\"type\":[1025],\"productId\":[1025,\"product-id\"],\"cartId\":[1025,\"cart-id\"],\"amount\":[1538],\"currency\":[1025],\"options\":[16],\"isRequireShipping\":[1028,\"is-require-shipping\"],\"applePayOnly\":[1028,\"apple-pay-only\"],\"isApplePayActive\":[32],\"quickBuy\":[32]}],[0,\"salla-progress-bar\",{\"donation\":[1],\"target\":[1026],\"value\":[1026],\"height\":[1025],\"header\":[1025],\"stripped\":[1028],\"message\":[1025],\"unit\":[1025],\"color\":[1025]}],[0,\"salla-rating-stars\",{\"name\":[1],\"size\":[1],\"value\":[2],\"reviews\":[2]}],[4,\"salla-slider\",{\"blockTitle\":[513,\"block-title\"],\"listenToThumbnailsOption\":[516,\"listen-to-thumbnails-option\"],\"blockSubtitle\":[513,\"block-subtitle\"],\"displayAllUrl\":[513,\"display-all-url\"],\"arrowsCentered\":[516,\"arrows-centered\"],\"verticalThumbs\":[516,\"vertical-thumbs\"],\"gridThumbs\":[516,\"grid-thumbs\"],\"vertical\":[516],\"autoHeight\":[516,\"auto-height\"],\"showControls\":[516,\"show-controls\"],\"controlsOuter\":[516,\"controls-outer\"],\"showThumbsControls\":[4,\"show-thumbs-controls\"],\"autoPlay\":[4,\"auto-play\"],\"slidesPerView\":[1,\"slides-per-view\"],\"pagination\":[4],\"centered\":[4],\"loop\":[4],\"direction\":[1537],\"type\":[1],\"sliderConfig\":[520,\"slider-config\"],\"thumbsConfig\":[520,\"thumbs-config\"],\"currentIndex\":[32],\"isEnd\":[32],\"isBeginning\":[32],\"swiperScript\":[32],\"displayAllTitle\":[32],\"windowWidth\":[32],\"slideTo\":[64],\"slideNext\":[64],\"slidePrev\":[64],\"slideToLoop\":[64],\"slideNextLoop\":[64],\"slidePrevLoop\":[64],\"slideReset\":[64],\"slideToClosest\":[64],\"update\":[64],\"updateAutoHeight\":[64],\"updateSlides\":[64],\"updateProgress\":[64],\"updateSlidesClasses\":[64],\"getSlides\":[64]}],[0,\"salla-skeleton\",{\"type\":[1],\"width\":[1],\"height\":[1]}],[4,\"salla-placeholder\",{\"icon\":[1],\"alignment\":[1],\"iconSize\":[1,\"icon-size\"],\"translationLoaded\":[32]}],[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-modal\",{\"isClosable\":[1028,\"is-closable\"],\"width\":[513],\"position\":[513],\"visible\":[516],\"hasSkeleton\":[516,\"has-skeleton\"],\"isLoading\":[1540,\"is-loading\"],\"subTitleFirst\":[4,\"sub-title-first\"],\"noPadding\":[4,\"no-padding\"],\"subTitle\":[1,\"sub-title\"],\"centered\":[4],\"iconStyle\":[1,\"icon-style\"],\"modalTitle\":[32],\"open\":[64],\"close\":[64],\"setTitle\":[64],\"loading\":[64],\"stopLoading\":[64]},[[0,\"keyup\",\"handleKeyUp\"]]],[0,\"salla-loading\",{\"size\":[8],\"width\":[8],\"color\":[1],\"bgColor\":[1,\"bg-color\"]}],[4,\"salla-button\",{\"shape\":[513],\"color\":[513],\"fill\":[513],\"size\":[513],\"width\":[513],\"loading\":[516],\"disabled\":[516],\"loaderPosition\":[1,\"loader-position\"],\"href\":[1],\"type\":[513],\"load\":[64],\"stop\":[64],\"setText\":[64],\"disable\":[64],\"enable\":[64]}]]]]"), options);
26
+ return index.bootstrapLazy(JSON.parse("[[\"salla-offer.cjs\",[[0,\"salla-offer\",{\"productId\":[1538,\"product-id\"],\"offer\":[32],\"offersList\":[32],\"userCurrency\":[32],\"isMultipleBank\":[32],\"title\":[32],\"offer_with_price_text\":[32],\"with_discount_text\":[32],\"product_discount_text\":[32],\"special_offer_text\":[32],\"buy_quantity_text\":[32]}]]],[\"salla-products-slider.cjs\",[[0,\"salla-products-slider\",{\"blockTitle\":[1,\"block-title\"],\"subTitle\":[1,\"sub-title\"],\"sliderId\":[1,\"slider-id\"],\"displayAllUrl\":[1,\"display-all-url\"],\"autoplay\":[1028],\"source\":[1537],\"sourceValue\":[1,\"source-value\"],\"limit\":[1026],\"sliderConfig\":[520,\"slider-config\"],\"productCardComponent\":[1,\"product-card-component\"],\"productsData\":[32],\"isReady\":[32],\"sourceValueIsValid\":[32],\"hasCustomComponent\":[32],\"apiUrl\":[32],\"parsedSourceValue\":[32]}]]],[\"salla-product-options.cjs\",[[0,\"salla-product-options\",{\"productId\":[2,\"product-id\"],\"options\":[1],\"optionsData\":[32],\"outOfStockText\":[32],\"donationAmount\":[32],\"selectDonationAmount\":[32],\"selectAmount\":[32],\"isCustomDonation\":[32],\"selectedOptions\":[32],\"canDisabled\":[32],\"selectedSkus\":[32],\"selectedOutSkus\":[32],\"getSelectedOptionsData\":[64],\"reportValidity\":[64],\"hasOutOfStockOption\":[64],\"getSelectedOptions\":[64],\"getOption\":[64]}]]],[\"salla-filters.cjs\",[[0,\"salla-filters\",{\"filters\":[1040],\"isSidebarOpen\":[32],\"filtersData\":[32],\"apply\":[32],\"reset\":[32],\"getFilters\":[64],\"applyFilters\":[64],\"resetFilters\":[64]}]]],[\"salla-notifications.cjs\",[[0,\"salla-notifications\",{\"loadMoreText\":[1,\"load-more-text\"],\"itemPerPage\":[2,\"item-per-page\"],\"notifications\":[32],\"pagination\":[32],\"hasInfiniteScroll\":[32],\"total\":[32],\"showPlaceholder\":[32],\"nextPage\":[32],\"no_notifications_trans\":[32],\"load_more_text_trans\":[32]}]]],[\"salla-order-summary.cjs\",[[0,\"salla-order-summary\",{\"orderId\":[514,\"order-id\"],\"codeCopied\":[32],\"noItemFound\":[32],\"order_items\":[32]}]]],[\"salla-advertisement.cjs\",[[0,\"salla-advertisement\",{\"position\":[32],\"advertisements\":[32],\"advertIcon\":[32],\"currentSlug\":[32]}]]],[\"salla-app-install-alert.cjs\",[[0,\"salla-app-install-alert\",{\"data\":[32],\"ctaLink\":[32],\"open\":[32],\"closing\":[32]}]]],[\"salla-apps-icons.cjs\",[[0,\"salla-apps-icons\",{\"hideTitle\":[4,\"hide-title\"],\"appsTitle\":[1,\"apps-title\"],\"vertical\":[4],\"apps\":[32]}]]],[\"salla-contacts.cjs\",[[0,\"salla-contacts\",{\"contactsTitle\":[1025,\"contacts-title\"],\"hideTitle\":[4,\"hide-title\"],\"isHeader\":[4,\"is-header\"],\"horizontal\":[4],\"iconsOnly\":[4,\"icons-only\"],\"contacts\":[32],\"iconsList\":[32]}]]],[\"salla-installment.cjs\",[[0,\"salla-installment\",{\"price\":[1],\"language\":[1],\"currency\":[1],\"tamaraIsActive\":[32],\"tabbyIsActive\":[32],\"spotiiIsActive\":[32],\"mispayActive\":[32],\"installment_sheria_text\":[32]}]]],[\"salla-loyalty-prize-item.cjs\",[[0,\"salla-loyalty-prize-item\",{\"item\":[16]}]]],[\"salla-payments.cjs\",[[0,\"salla-payments\",{\"withSbc\":[4,\"with-sbc\"],\"sbcId\":[1,\"sbc-id\"],\"withMadeInKsa\":[4,\"with-made-in-ksa\"],\"payments\":[32],\"placeholderImage\":[32]}]]],[\"salla-products-list.cjs\",[[0,\"salla-products-list\",{\"source\":[1537],\"sourceValue\":[1032,\"source-value\"],\"limit\":[1026],\"sortBy\":[1025,\"sort-by\"],\"filtersResults\":[1540,\"filters-results\"],\"horizontalCards\":[516,\"horizontal-cards\"],\"autoload\":[1028],\"loadMoreText\":[1,\"load-more-text\"],\"productCardComponent\":[1,\"product-card-component\"],\"page\":[32],\"nextPage\":[32],\"hasInfiniteScroll\":[32],\"hasCustomComponent\":[32],\"sourceValueIsValid\":[32],\"placeholderText\":[32],\"endOfText\":[32],\"failedLoadMore\":[32],\"currentPage\":[32],\"currentCategoryIdFilter\":[32],\"isReady\":[32],\"showPlaceholder\":[32],\"parsedFilters\":[32],\"setFilters\":[64],\"reload\":[64]}]]],[\"salla-social.cjs\",[[0,\"salla-social\",{\"links\":[32],\"iconsList\":[32]}]]],[\"salla-filters-widget.cjs\",[[4,\"salla-filters-widget\",{\"withLoadMore\":[1028,\"with-load-more\"],\"filtersData\":[16],\"option\":[16],\"isOpen\":[32],\"isShowMore\":[32],\"showMoreLabel\":[32],\"showLessLabel\":[32],\"page\":[32],\"setWidgetHeight\":[64],\"reset\":[64],\"showMore\":[64],\"toggleWidget\":[64]}]]],[\"salla-conditional-fields.cjs\",[[4,\"salla-conditional-fields\",null,[[0,\"change\",\"changeHandler\"]]]]],[\"salla-notification-item.cjs\",[[0,\"salla-notification-item\",{\"notification\":[16]}]]],[\"salla-price-range.cjs\",[[0,\"salla-price-range\",{\"minPrice\":[1032,\"min-price\"],\"maxPrice\":[1032,\"max-price\"],\"option\":[16],\"filtersData\":[520,\"filters-data\"],\"min\":[32],\"max\":[32],\"priceOptions\":[32],\"moreThanLabel\":[32],\"lessThanLabel\":[32],\"toLabel\":[32],\"fromLabel\":[32],\"typing\":[32],\"debounce\":[32],\"reset\":[64]}]]],[\"salla-add-product-button_47.cjs\",[[4,\"salla-gifting\",{\"productId\":[2,\"product-id\"],\"widgetTitle\":[1,\"widget-title\"],\"widgetSubtitle\":[1,\"widget-subtitle\"],\"sectionTitle\":[32],\"sectionSubtitle\":[32],\"sectionBtnText\":[32],\"giftDetails\":[32],\"selectImageForYourGift\":[32],\"selectImageOrUpload\":[32],\"selectGiftMessage\":[32],\"giftCustomText\":[32],\"textId\":[32],\"incorrectGiftText\":[32],\"nextStep\":[32],\"senderNameLabel\":[32],\"receiverNameFieldLabel\":[32],\"receiverMobileFieldLabel\":[32],\"receiverEmailFieldLabel\":[32],\"emailPlaceholder\":[32],\"sendLater\":[32],\"selectSendDateAndTime\":[32],\"canNotEditOrderAfterSelectDate\":[32],\"sendGift\":[32],\"donationRequired\":[32],\"currentStep\":[32],\"showCalendar\":[32],\"showGiftText\":[32],\"currentLang\":[32],\"parentClass\":[32],\"errors\":[32],\"gift\":[32],\"selectedGiftTextOption\":[32],\"showTextArea\":[32],\"selectedImage\":[32],\"uploadedImage\":[32],\"selectedText\":[32],\"senderName\":[32],\"errorMessage\":[32],\"hasError\":[32],\"quantity\":[32],\"deliveryDate\":[32],\"timeZone\":[32],\"receiverName\":[32],\"receiverMobile\":[32],\"receiverCountryCode\":[32],\"receiverEmail\":[32],\"open\":[64],\"close\":[64],\"goToStep2\":[64]}],[4,\"salla-loyalty\",{\"prizePoints\":[1544,\"prize-points\"],\"customerPoints\":[1538,\"customer-points\"],\"prizeTitle\":[1537,\"prize-title\"],\"allowEmail\":[4,\"allow-email\"],\"allowMobile\":[4,\"allow-mobile\"],\"requireEmail\":[4,\"require-email\"],\"guestMessage\":[1025,\"guest-message\"],\"loyaltyProgram\":[32],\"buttonLoading\":[32],\"selectedItem\":[32],\"askConfirmation\":[32],\"is_loggedin\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64],\"resetExchange\":[64],\"exchangeLoyaltyPoint\":[64]}],[0,\"salla-menu\",{\"source\":[1],\"sourceValue\":[1,\"source-value\"],\"topnav\":[4],\"useReactLink\":[4,\"use-react-link\"],\"menus\":[32],\"hasCustomComponent\":[32],\"setMenuContent\":[64]}],[4,\"salla-product-size-guide\",{\"guides\":[32],\"productId\":[32],\"placeholder_title\":[32],\"placeholder_description\":[32],\"modal_title\":[32],\"hasError\":[32],\"open\":[64],\"close\":[64]}],[4,\"salla-login-modal\",{\"isEmailAllowed\":[1028,\"is-email-allowed\"],\"isMobileAllowed\":[1028,\"is-mobile-allowed\"],\"isEmailRequired\":[1028,\"is-email-required\"],\"supportWebAuth\":[516,\"support-web-auth\"],\"inline\":[516],\"withoutReload\":[4,\"without-reload\"],\"currentTabName\":[32],\"regType\":[32],\"translationLoaded\":[32],\"isModalOpen\":[32],\"currentPhone\":[32],\"currentEmail\":[32],\"title\":[32],\"emailErrorMsg\":[32],\"firstNameErrorMsg\":[32],\"lastNameErrorMsg\":[32],\"hasError\":[32],\"errorMessage\":[32],\"dragAndDrop\":[32],\"browseFromFiles\":[32],\"customFields\":[32],\"uploadedImage\":[32],\"open\":[64]},[[8,\"verified\",\"onVerified\"]]],[0,\"salla-offer-modal\",{\"offer\":[32],\"offer_name\":[32],\"offer_message\":[32],\"hasError\":[32],\"errorMessage\":[32],\"productID\":[32],\"offer_type\":[32],\"translationLoaded\":[32],\"addToCartLabel\":[32],\"open\":[64],\"showOffer\":[64]}],[0,\"salla-rating-modal\",{\"orderId\":[2,\"order-id\"],\"order\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64]}],[4,\"salla-scopes\",{\"selection\":[1],\"searchDisplayLimit\":[2,\"search-display-limit\"],\"translationLoaded\":[32],\"mode\":[32],\"current_scope\":[32],\"scopes\":[32],\"originalScopesList\":[32],\"selected_scope\":[32],\"isOpenedBefore\":[32],\"hasError\":[32],\"loading\":[32],\"close\":[64],\"open\":[64],\"handleSubmit\":[64]}],[0,\"salla-localization-modal\",{\"language\":[1537],\"currency\":[1537],\"translationLoaded\":[32],\"languages\":[32],\"currencies\":[32],\"hasError\":[32],\"errorMessage\":[32],\"open\":[64],\"close\":[64],\"submit\":[64]}],[0,\"salla-bottom-alert\",{\"type\":[513],\"icon\":[513],\"message\":[513],\"actionUrl\":[513,\"action-url\"],\"actionLabel\":[513,\"action-label\"],\"storeId\":[32],\"template\":[32],\"loading\":[32],\"templateData\":[32],\"defaultMessage\":[32],\"defaultActionLabel\":[32],\"storeFeatures\":[32],\"storeDetails\":[32],\"storePrice\":[32],\"theDeveloper\":[32],\"templateInformation\":[32],\"buyTheTemplate\":[32],\"isRtl\":[32]}],[0,\"salla-comments\",{\"itemId\":[2,\"item-id\"],\"loadMoreText\":[1,\"load-more-text\"],\"hideForm\":[4,\"hide-form\"],\"type\":[1],\"comments\":[32],\"pagination\":[32],\"total\":[32],\"showPlaceholder\":[32],\"nextPage\":[32],\"noComments\":[32],\"comment_title\":[32],\"comment_name\":[32],\"placeholder_text\":[32]}],[0,\"salla-quick-order\",{\"quickOrderTitle\":[1025,\"quick-order-title\"],\"subTitle\":[1025,\"sub-title\"],\"payButtonTitle\":[1025,\"pay-button-title\"],\"confirmPayButtonTitle\":[1025,\"confirm-pay-button-title\"],\"agreementText\":[1025,\"agreement-text\"],\"isEmailRequired\":[1028,\"is-email-required\"],\"productId\":[1025,\"product-id\"],\"thanksMessage\":[1025,\"thanks-message\"],\"quickOrderStyle\":[1025,\"quick-order-style\"],\"user\":[32],\"isAvailable\":[32],\"oneClick\":[32],\"expanded\":[32],\"isTermsRequired\":[32],\"countryCode\":[32],\"submitSucess\":[32],\"placeHolderEmail\":[32],\"emailOptional\":[32],\"agreementShowText\":[32],\"agreementModalHead\":[32],\"userNameLabel\":[32],\"termsChecked\":[32]}],[0,\"salla-user-profile\",{\"customFields\":[1,\"custom-fields\"],\"userData\":[32],\"userDefinedFields\":[32],\"disableAction\":[32],\"first_name_trans\":[32],\"last_name_trans\":[32],\"birthday_trans\":[32],\"birthday_placeholder_trans\":[32],\"gender_trans\":[32],\"gender_placeholder_trans\":[32],\"male_trans\":[32],\"female_trans\":[32],\"email_trans\":[32],\"mobile_trans\":[32],\"save_btn_trans\":[32],\"drag_and_drop_trans\":[32],\"browse_trans\":[32],\"email_required_trans\":[32],\"invalid_email_trans\":[32],\"setCustomFields\":[64]}],[0,\"salla-user-settings\",{\"isNotifiable\":[516,\"is-notifiable\"],\"deactivateAccount\":[32],\"promotionalMsgs\":[32],\"deactivateDesc\":[32],\"promotionalMsgsDesc\":[32],\"sorryForLeavingText\":[32],\"warningText\":[32],\"keepAccount\":[32],\"buttonLoading\":[32]}],[0,\"salla-search\",{\"inline\":[4],\"oval\":[4],\"height\":[2],\"maxWords\":[2,\"max-words\"],\"showAction\":[4,\"show-action\"],\"translationLoaded\":[32],\"results\":[32],\"loading\":[32],\"typing\":[32],\"debounce\":[32],\"search_term\":[32]},[[0,\"keydown\",\"handleKeyDown\"]]],[4,\"salla-social-share\",{\"url\":[513],\"urlName\":[513,\"url-name\"],\"platforms\":[513],\"opened\":[32],\"allPlatforms\":[32],\"platformIcons\":[32],\"convertedPlatforms\":[32],\"open\":[64],\"refresh\":[64]}],[0,\"salla-breadcrumb\",{\"items\":[1],\"breadcrumbs\":[32],\"currentPage\":[32],\"isRtl\":[32]}],[4,\"salla-cart-summary\",{\"showCartLabel\":[4,\"show-cart-label\"],\"cartSummaryCount\":[32],\"cartSummaryTotal\":[32],\"cartLabel\":[32],\"animateToCart\":[64]}],[4,\"salla-infinite-scroll\",{\"nextPage\":[1,\"next-page\"],\"autoload\":[1028],\"container\":[1],\"loadMoreText\":[1,\"load-more-text\"],\"item\":[1],\"loadMore\":[32],\"noMore\":[32],\"failedToLoad\":[32]}],[0,\"salla-maintenance-alert\",{\"title\":[32],\"message\":[32],\"buttonTitle\":[32]}],[4,\"salla-quantity-input\",{\"cartItemId\":[8,\"cart-item-id\"],\"quantity\":[32],\"fireChangeEvent\":[32],\"decrease\":[64],\"increase\":[64],\"setValue\":[64]}],[4,\"salla-user-menu\",{\"inline\":[516],\"avatarOnly\":[516,\"avatar-only\"],\"showHeader\":[516,\"show-header\"],\"relativeDropdown\":[516,\"relative-dropdown\"],\"accountLoading\":[32],\"opened\":[32],\"notifications\":[32],\"orders\":[32],\"pending_orders\":[32],\"wishlist\":[32],\"profile\":[32],\"rating\":[32],\"logout\":[32],\"hello\":[32],\"first_name\":[32],\"last_name\":[32],\"avatar\":[32],\"is_loggedIn\":[32],\"badges\":[32],\"hasBadges\":[32],\"OrderUpdate\":[32]}],[4,\"salla-map\",{\"name\":[1],\"required\":[4],\"readonly\":[4],\"searchable\":[1028],\"lat\":[1026],\"lng\":[1026],\"apiKey\":[1025,\"api-key\"],\"modalTitle\":[1,\"modal-title\"],\"zoom\":[1026],\"theme\":[1025],\"modalActivityTitle\":[32],\"confirmButtonTitle\":[32],\"locateButtonTitle\":[32],\"locateButtonEdit\":[32],\"searchPlaceholder\":[32],\"searchInputValue\":[32],\"formattedAddress\":[32],\"geolocationError\":[32],\"searchInput\":[32],\"mapInput\":[32],\"mapElement\":[32],\"selectedLat\":[32],\"selectedLng\":[32],\"open\":[64]}],[4,\"salla-verify\",{\"display\":[1],\"type\":[1025],\"autoReload\":[4,\"auto-reload\"],\"supportWebAuth\":[4,\"support-web-auth\"],\"translationLoaded\":[32],\"title\":[32],\"resendAfter\":[32],\"hasError\":[32],\"errorMessage\":[32],\"isProfileVerify\":[32],\"getCode\":[64],\"open\":[64]}],[0,\"salla-comment-form\",{\"type\":[1537],\"showAvatar\":[4,\"show-avatar\"],\"itemId\":[1544,\"item-id\"],\"placeholder\":[32],\"submitText\":[32],\"canComment\":[32]}],[4,\"salla-color-picker\",{\"name\":[1],\"required\":[4],\"color\":[1537],\"format\":[1],\"showCancelButton\":[4,\"show-cancel-button\"],\"showTextField\":[4,\"show-text-field\"],\"enableAlpha\":[4,\"enable-alpha\"],\"widgetColor\":[32],\"setPickerOption\":[64],\"movePopUp\":[64],\"setColorValue\":[64],\"openPicker\":[64],\"closePicker\":[64],\"destroyPicker\":[64]}],[0,\"salla-comment-item\",{\"comment\":[16],\"has_bought_trans\":[32],\"rated_trans\":[32],\"waiting_approval_trans\":[32],\"has_order_trans\":[32]}],[4,\"salla-tab-content\",{\"name\":[1],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tab-header\",{\"name\":[1],\"activeClass\":[1,\"active-class\"],\"height\":[8],\"centered\":[4],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tabs\",{\"backgroundColor\":[1,\"background-color\"],\"vertical\":[4]},[[0,\"tabSelected\",\"onSelectedTab\"]]],[4,\"salla-product-card\",{\"product\":[1],\"horizontal\":[4],\"shadowOnHover\":[4,\"shadow-on-hover\"],\"hideAddBtn\":[4,\"hide-add-btn\"],\"fullImage\":[4,\"full-image\"],\"minimal\":[4],\"isSpecial\":[4,\"is-special\"],\"showQuantity\":[4,\"show-quantity\"],\"productData\":[32],\"fitImageHeight\":[32],\"remained\":[32],\"outOfStock\":[32],\"donationAmount\":[32],\"startingPrice\":[32],\"addToCart\":[32],\"placeholder\":[32]}],[0,\"salla-datetime-picker\",{\"value\":[1537],\"required\":[4],\"name\":[513],\"placeholder\":[1],\"allowInput\":[4,\"allow-input\"],\"allowInvalidPreload\":[4,\"allow-invalid-preload\"],\"altFormat\":[1,\"alt-format\"],\"altInput\":[4,\"alt-input\"],\"altInputClass\":[1,\"alt-input-class\"],\"appendTo\":[16],\"ariaDateFormat\":[1,\"aria-date-format\"],\"autoFillDefaultTime\":[4,\"auto-fill-default-time\"],\"clickOpens\":[4,\"click-opens\"],\"closeOnSelect\":[4,\"close-on-select\"],\"conjunction\":[1],\"dateFormat\":[1,\"date-format\"],\"defaultDate\":[8,\"default-date\"],\"defaultHour\":[2,\"default-hour\"],\"defaultMinute\":[2,\"default-minute\"],\"defaultSeconds\":[2,\"default-seconds\"],\"disable\":[16],\"disableMobile\":[4,\"disable-mobile\"],\"enable\":[16],\"enableSeconds\":[4,\"enable-seconds\"],\"enableTime\":[4,\"enable-time\"],\"formatDate\":[16],\"hourIncrement\":[2,\"hour-increment\"],\"inline\":[4],\"locale\":[1],\"maxDate\":[8,\"max-date\"],\"maxTime\":[8,\"max-time\"],\"minDate\":[8,\"min-date\"],\"minTime\":[8,\"min-time\"],\"minuteIncrement\":[2,\"minute-increment\"],\"mode\":[1],\"monthSelectorType\":[1,\"month-selector-type\"],\"nextArrow\":[1,\"next-arrow\"],\"noCalendar\":[4,\"no-calendar\"],\"dateParser\":[16],\"position\":[1],\"positionElement\":[16],\"prevArrow\":[1,\"prev-arrow\"],\"shorthandCurrentMonth\":[4,\"shorthand-current-month\"],\"static\":[4],\"showMonths\":[2,\"show-months\"],\"time_24hr\":[4,\"time_-2-4hr\"],\"weekNumbers\":[4,\"week-numbers\"],\"wrap\":[4]}],[4,\"salla-add-product-button\",{\"channels\":[513],\"subscribedOptions\":[1,\"subscribed-options\"],\"quickBuy\":[1540,\"quick-buy\"],\"quantity\":[514],\"donatingAmount\":[514,\"donating-amount\"],\"notifyOptionsAvailability\":[516,\"notify-options-availability\"],\"productId\":[520,\"product-id\"],\"supportStickyBar\":[516,\"support-sticky-bar\"],\"productStatus\":[513,\"product-status\"],\"productType\":[513,\"product-type\"],\"hasOutOfStockOption\":[32],\"hasSubscribedOptions\":[32],\"selectedOptions\":[32],\"showQuickBuy\":[32]}],[0,\"salla-count-down\",{\"date\":[1],\"boxed\":[4],\"size\":[1],\"color\":[1],\"labeled\":[4],\"endText\":[1,\"end-text\"],\"digits\":[1],\"endOfDay\":[4,\"end-of-day\"],\"daysLabel\":[32],\"hoursLabel\":[32],\"minutesLabel\":[32],\"secondsLabel\":[32],\"endLabel\":[32],\"invalidDate\":[32],\"offerEnded\":[32],\"countInterval\":[32],\"days\":[32],\"hours\":[32],\"minutes\":[32],\"seconds\":[32],\"endCountDown\":[64]}],[0,\"salla-file-upload\",{\"value\":[1537],\"files\":[513],\"height\":[513],\"cartItemId\":[1,\"cart-item-id\"],\"profileImage\":[516,\"profile-image\"],\"name\":[1537],\"payloadName\":[1,\"payload-name\"],\"accept\":[1537],\"fileId\":[2,\"file-id\"],\"url\":[1025],\"method\":[1],\"formData\":[1,\"form-data\"],\"required\":[4],\"maxFileSize\":[1,\"max-file-size\"],\"disabled\":[4],\"allowDrop\":[4,\"allow-drop\"],\"allowBrowse\":[4,\"allow-browse\"],\"allowPaste\":[4,\"allow-paste\"],\"allowMultiple\":[4,\"allow-multiple\"],\"allowReplace\":[4,\"allow-replace\"],\"allowRevert\":[4,\"allow-revert\"],\"allowRemove\":[4,\"allow-remove\"],\"allowProcess\":[4,\"allow-process\"],\"allowReorder\":[4,\"allow-reorder\"],\"storeAsFile\":[4,\"store-as-file\"],\"forceRevert\":[4,\"force-revert\"],\"maxFilesCount\":[2,\"max-files-count\"],\"maxParallelUploads\":[2,\"max-parallel-uploads\"],\"checkValidity\":[4,\"check-validity\"],\"itemInsertLocation\":[1,\"item-insert-location\"],\"itemInsertInterval\":[2,\"item-insert-interval\"],\"credits\":[4],\"dropOnPage\":[4,\"drop-on-page\"],\"dropOnElement\":[4,\"drop-on-element\"],\"dropValidation\":[4,\"drop-validation\"],\"ignoredFiles\":[16],\"instantUpload\":[1028,\"instant-upload\"],\"chunkUploads\":[4,\"chunk-uploads\"],\"chunkForce\":[4,\"chunk-force\"],\"chunkSize\":[2,\"chunk-size\"],\"chunkRetryDelays\":[16],\"labelDecimalSeparator\":[1,\"label-decimal-separator\"],\"labelThousandsSeparator\":[1,\"label-thousands-separator\"],\"labelIdle\":[1025,\"label-idle\"],\"iconRemove\":[1,\"icon-remove\"],\"iconProcess\":[1,\"icon-process\"],\"iconRetry\":[1,\"icon-retry\"],\"iconUndo\":[1,\"icon-undo\"],\"setOption\":[64]}],[4,\"salla-list-tile\",{\"href\":[1],\"target\":[1]}],[0,\"salla-product-availability\",{\"channels\":[1],\"notifyOptionsAvailability\":[4,\"notify-options-availability\"],\"productId\":[2,\"product-id\"],\"isSubscribed\":[1028,\"is-subscribed\"],\"translationLoaded\":[32],\"title_\":[32],\"isVisitorSubscribed\":[32]}],[0,\"salla-quick-buy\",{\"type\":[1025],\"productId\":[1025,\"product-id\"],\"cartId\":[1025,\"cart-id\"],\"amount\":[1538],\"currency\":[1025],\"options\":[16],\"isRequireShipping\":[1028,\"is-require-shipping\"],\"applePayOnly\":[1028,\"apple-pay-only\"],\"isApplePayActive\":[32],\"quickBuy\":[32]}],[0,\"salla-progress-bar\",{\"donation\":[1],\"target\":[1026],\"value\":[1026],\"height\":[1025],\"header\":[1025],\"stripped\":[1028],\"message\":[1025],\"unit\":[1025],\"color\":[1025]}],[0,\"salla-rating-stars\",{\"name\":[1],\"size\":[1],\"value\":[2],\"reviews\":[2]}],[4,\"salla-slider\",{\"blockTitle\":[513,\"block-title\"],\"listenToThumbnailsOption\":[516,\"listen-to-thumbnails-option\"],\"blockSubtitle\":[513,\"block-subtitle\"],\"displayAllUrl\":[513,\"display-all-url\"],\"arrowsCentered\":[516,\"arrows-centered\"],\"verticalThumbs\":[516,\"vertical-thumbs\"],\"gridThumbs\":[516,\"grid-thumbs\"],\"vertical\":[516],\"autoHeight\":[516,\"auto-height\"],\"showControls\":[516,\"show-controls\"],\"controlsOuter\":[516,\"controls-outer\"],\"showThumbsControls\":[4,\"show-thumbs-controls\"],\"autoPlay\":[4,\"auto-play\"],\"slidesPerView\":[1,\"slides-per-view\"],\"pagination\":[4],\"centered\":[4],\"loop\":[4],\"direction\":[1537],\"type\":[1],\"sliderConfig\":[520,\"slider-config\"],\"thumbsConfig\":[520,\"thumbs-config\"],\"currentIndex\":[32],\"isEnd\":[32],\"isBeginning\":[32],\"swiperScript\":[32],\"displayAllTitle\":[32],\"windowWidth\":[32],\"slideTo\":[64],\"slideNext\":[64],\"slidePrev\":[64],\"slideToLoop\":[64],\"slideNextLoop\":[64],\"slidePrevLoop\":[64],\"slideReset\":[64],\"slideToClosest\":[64],\"update\":[64],\"updateAutoHeight\":[64],\"updateSlides\":[64],\"updateProgress\":[64],\"updateSlidesClasses\":[64],\"getSlides\":[64]}],[0,\"salla-skeleton\",{\"type\":[1],\"width\":[1],\"height\":[1]}],[4,\"salla-placeholder\",{\"icon\":[1],\"alignment\":[1],\"iconSize\":[1,\"icon-size\"],\"translationLoaded\":[32]}],[0,\"salla-tel-input\",{\"phone\":[1025],\"autofocus\":[516],\"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-modal\",{\"isClosable\":[1028,\"is-closable\"],\"width\":[513],\"position\":[513],\"visible\":[516],\"hasSkeleton\":[516,\"has-skeleton\"],\"isLoading\":[1540,\"is-loading\"],\"subTitleFirst\":[4,\"sub-title-first\"],\"noPadding\":[4,\"no-padding\"],\"subTitle\":[1,\"sub-title\"],\"centered\":[4],\"iconStyle\":[1,\"icon-style\"],\"modalTitle\":[32],\"open\":[64],\"close\":[64],\"setTitle\":[64],\"loading\":[64],\"stopLoading\":[64]},[[0,\"keyup\",\"handleKeyUp\"]]],[0,\"salla-loading\",{\"size\":[8],\"width\":[8],\"color\":[1],\"bgColor\":[1,\"bg-color\"]}],[4,\"salla-button\",{\"shape\":[513],\"color\":[513],\"fill\":[513],\"size\":[513],\"width\":[513],\"loading\":[516],\"disabled\":[516],\"loaderPosition\":[1,\"loader-position\"],\"href\":[1],\"type\":[513],\"load\":[64],\"stop\":[64],\"setText\":[64],\"disable\":[64],\"enable\":[64]}]]]]"), options);
27
27
  });
28
28
 
29
29
  exports.setNonce = index.setNonce;
@@ -87,6 +87,7 @@ export class SallaLoginModal {
87
87
  this.currentTabName = 'home';
88
88
  this.regType = 'phone';
89
89
  this.translationLoaded = false;
90
+ this.isModalOpen = false;
90
91
  this.currentPhone = '';
91
92
  this.currentEmail = '';
92
93
  this.title = undefined;
@@ -118,6 +119,7 @@ export class SallaLoginModal {
118
119
  return;
119
120
  }
120
121
  this.withoutReload = (_a = data === null || data === void 0 ? void 0 : data.withoutReload) !== null && _a !== void 0 ? _a : this.withoutReload;
122
+ this.isModalOpen = true;
121
123
  this.open(data);
122
124
  });
123
125
  salla.onReady(() => {
@@ -147,6 +149,7 @@ export class SallaLoginModal {
147
149
  if (this.inline) {
148
150
  return;
149
151
  }
152
+ this.isModalOpen = false;
150
153
  this.modal.close();
151
154
  return;
152
155
  }
@@ -165,6 +168,7 @@ export class SallaLoginModal {
165
168
  if (this.inline) {
166
169
  return;
167
170
  }
171
+ this.isModalOpen = false;
168
172
  this.modal.close();
169
173
  }
170
174
  }
@@ -208,6 +212,7 @@ export class SallaLoginModal {
208
212
  return;
209
213
  }
210
214
  this.getSelectedTab();
215
+ this.isModalOpen = true;
211
216
  return this.modal.open();
212
217
  }
213
218
  getSelectedTab() {
@@ -229,14 +234,14 @@ export class SallaLoginModal {
229
234
  if ([this.mobileTab, this.emailTab].includes(tab)) {
230
235
  this.regType = tab === this.mobileTab ? 'phone' : 'email';
231
236
  }
232
- const input = tab.querySelector('input[type="tel"], input[type="email"]');
233
- input && setTimeout(() => {
234
- input.focus();
235
- }, 100);
236
237
  if (this.inline) {
237
238
  return this;
238
239
  }
239
240
  (_a = this.modal) === null || _a === void 0 ? void 0 : _a.setTitle(this.currentTabName === 'registration' ? salla.lang.get('common.titles.registration') : this.title);
241
+ const input = tab.querySelector('input[type="tel"], input[type="email"]');
242
+ input && this.currentTabName !== 'registration' && setTimeout(() => {
243
+ input.focus();
244
+ }, 100);
240
245
  return this;
241
246
  }
242
247
  login(btn, data) {
@@ -301,11 +306,11 @@ export class SallaLoginModal {
301
306
  }
302
307
  getLoginDom() {
303
308
  return [!this.inline && h("span", { slot: 'icon', class: "s-login-modal-header-icon", innerHTML: UserIcon }), h("div", { class: this.inline ? 's-login-inline' : 's-login-modal-wrapper' }, this.isMobileAllowed ?
304
- h("div", { class: this.generateTabClasses('login-phone'), "data-name": "login-phone", ref: tab => this.mobileTab = tab }, h("slot", { name: "before-login-mobile" }), h("form", { onSubmit: (event) => this.loginBySMS(event), class: this.hasError && this.errorMessage ? 'has-error' : '', method: "POST" }, h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')), h("salla-tel-input", { tabindex: "0", ref: el => this.loginTelInput = el, onKeyDown: e => this.typing(e) }), this.hasError && this.errorMessage ? h("span", { class: "s-login-modal-error-message" }, this.errorMessage) : '', h("salla-button", { class: "s-login-modal-enter-button", type: "submit", "loader-position": 'center', width: "wide", ref: b => this.smsBtn = b }, salla.lang.get('blocks.header.enter'))), this.isEmailAllowed ?
309
+ h("div", { class: this.generateTabClasses('login-phone'), "data-name": "login-phone", ref: tab => this.mobileTab = tab }, h("slot", { name: "before-login-mobile" }), h("form", { onSubmit: (event) => this.loginBySMS(event), class: this.hasError && this.errorMessage ? 'has-error' : '', method: "POST" }, h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')), this.isModalOpen || this.inline ? (h("salla-tel-input", { autofocus: true, tabindex: "0", ref: el => this.loginTelInput = el, onKeyDown: e => this.typing(e) })) : null, this.hasError && this.errorMessage ? h("span", { class: "s-login-modal-error-message" }, this.errorMessage) : '', h("salla-button", { class: "s-login-modal-enter-button", type: "submit", "loader-position": 'center', width: "wide", ref: b => this.smsBtn = b }, salla.lang.get('blocks.header.enter'))), this.isEmailAllowed ?
305
310
  h("a", { href: "#", onClick: () => this.showTab(this.emailTab), class: "s-login-modal-link" }, salla.lang.get('blocks.header.login_by_email')) : '', h("slot", { name: "after-login-mobile" })) : '', this.isEmailAllowed ?
306
311
  h("div", { class: this.generateTabClasses('login-email'), "data-name": "login-email", ref: tab => this.emailTab = tab }, h("slot", { name: "before-login-email" }), h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')), h("form", { onSubmit: () => this.loginByEmail(event), method: "POST" }, h("input", { type: "email", ref: el => this.loginEmail = el, onKeyDown: e => this.typing(e), placeholder: "your@email.com", enterkeyhint: "next", class: { "s-login-modal-input s-ltr": true, "s-has-error": this.hasError } }), this.hasError && this.errorMessage ? h("span", { class: "s-login-modal-error-message" }, this.errorMessage) : '', h("salla-button", { class: "s-login-modal-enter-button", "loader-position": 'center', width: "wide", onClick: () => this.loginByEmail(), ref: b => this.emailBtn = b }, salla.lang.get('blocks.header.enter'))), this.isMobileAllowed ?
307
312
  h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-modal-link" }, salla.lang.get('blocks.header.login_by_sms'))
308
- : '', h("slot", { name: "after-login-email" })) : '', h("salla-verify", { display: "inline", "support-web-auth": this.supportWebAuth ? 'true' : 'false', class: this.generateTabClasses('otp'), "data-name": "otp", ref: tab => this.verifyTab = tab, autoReload: false }, h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-back", innerHTML: ArrowRightIcon, slot: "after-footer", href: "#" }), this.isMobileAllowed && this.regType == 'phone' ? h("div", { dir: "ltr", class: "s-login-modal-currentPhone", slot: "mobile" }, this.currentPhone) : '', this.isEmailAllowed && this.regType == 'email' ? h("div", { dir: "ltr", class: "s-login-modal-currentEmail", slot: "email" }, this.currentEmail) : ''), h("div", { "data-name": "registration", class: this.generateTabClasses('registration'), ref: tab => this.registrationTab = tab }, h("slot", { name: "before-registration" }), h("div", null, h("label", { class: "s-login-modal-label" }, salla.lang.get('blocks.header.your_name')), h("input", { type: "text", class: "s-login-modal-input", ref: el => this.firstName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.first_name') }), h("span", { class: "s-login-modal-error-message" })), h("div", null, h("label", { class: "s-login-modal-label" }, salla.lang.get('pages.profile.last_name')), h("input", { type: "text", class: "s-login-modal-input", ref: el => this.lastName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.last_name') }), h("span", { class: "s-login-modal-error-message" })), h("div", { class: this.generateRegClasses('phone') }, h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')), h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })), h("div", { class: this.generateRegClasses('email') }, h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')), h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), h("span", { class: "s-login-modal-error-message" })), h("div", { class: "s-login-modal-custom-fields", ref: el => this.customFieldsWrapper = el }, this.customFields.map((field) => [
313
+ : '', h("slot", { name: "after-login-email" })) : '', h("salla-verify", { display: "inline", "support-web-auth": this.supportWebAuth ? 'true' : 'false', class: this.generateTabClasses('otp'), "data-name": "otp", ref: tab => this.verifyTab = tab, autoReload: false }, h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-back", innerHTML: ArrowRightIcon, slot: "after-footer", href: "#" }), this.isMobileAllowed && this.regType == 'phone' ? h("div", { dir: "ltr", class: "s-login-modal-currentPhone", slot: "mobile" }, this.currentPhone) : '', this.isEmailAllowed && this.regType == 'email' ? h("div", { dir: "ltr", class: "s-login-modal-currentEmail", slot: "email" }, this.currentEmail) : ''), h("div", { "data-name": "registration", class: this.generateTabClasses('registration'), ref: tab => this.registrationTab = tab }, h("slot", { name: "before-registration" }), h("div", null, h("label", { class: "s-login-modal-label" }, salla.lang.get('blocks.header.your_name')), h("input", { type: "text", class: "s-login-modal-input", ref: el => this.firstName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.first_name') }), h("span", { class: "s-login-modal-error-message" })), h("div", null, h("label", { class: "s-login-modal-label" }, salla.lang.get('pages.profile.last_name')), h("input", { type: "text", class: "s-login-modal-input", ref: el => this.lastName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.last_name') }), h("span", { class: "s-login-modal-error-message" })), h("div", { class: this.generateRegClasses('phone') }, h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')), (this.isModalOpen || this.inline) && this.currentTabName === "registration" ? (h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })) : null), h("div", { class: this.generateRegClasses('email') }, h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')), h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), h("span", { class: "s-login-modal-error-message" })), h("div", { class: "s-login-modal-custom-fields", ref: el => this.customFieldsWrapper = el }, this.customFields.map((field) => [
309
314
  h("label", { class: "s-login-modal-label" }, field.label),
310
315
  field.type === CustomFieldType.PHOTO
311
316
  ? h("salla-file-upload", { name: "image", "instant-upload": true, id: `${field.id}`, title: field.label, required: field.required, url: salla.url.get('upload-image'),
@@ -449,6 +454,7 @@ export class SallaLoginModal {
449
454
  "currentTabName": {},
450
455
  "regType": {},
451
456
  "translationLoaded": {},
457
+ "isModalOpen": {},
452
458
  "currentPhone": {},
453
459
  "currentEmail": {},
454
460
  "title": {},
@@ -1 +1 @@
1
- {"version":3,"file":"salla-login-modal.js","sourceRoot":"","sources":["../../../src/components/salla-login-modal/salla-login-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AACjD,qDAAqD;AACrD,oDAAoD;AACpD,OAAO,UAAU,MAAM,6BAA6B,CAAC;AACrD,iFAAiF;AACjF,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAe,eAAe,EAAE,MAAM,aAAa,CAAC;AAE3D;;;;;;;;;;GAUG;AAOH,MAAM,OAAO,eAAe;EAC1B;IAiGQ,uBAAkB,GAAW,EAAE,CAAC;IA6HhC,WAAM,GAAG,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI,EAAE,EAAE;MAC1C,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC;MAC1C,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;MACzC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,CAAC,QAAQ,CAAC,6BAA6B,CAAC,KAAI,CAAC,KAAK,CAAC,SAAS,GAAG,EAAE,CAAC,CAAC;MACnF,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;MACtB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;MACvB,gEAAgE;MAChE,YAAY,IAAI,CAAC,CAAC,GAAG,IAAI,OAAO,IAAI,YAAY,EAAE,CAAC;IACrD,CAAC,CAAA;IAEO,eAAU,GAAG,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,EA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,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Listen, Method, Prop, State } from '@stencil/core';\nimport UserIcon from \"../../assets/svg/user.svg\";\n//import PhoneIcon from \"../../assets/svg/phone.svg\";\n//import EmailIcon from \"../../assets/svg/mail.svg\";\nimport CameraIcon from '../../assets/svg/camera.svg';\n//import KeyboardArrowRightIcon from \"../../assets/svg/keyboard_arrow_right.svg\";\nimport ArrowRightIcon from \"../../assets/svg/arrow-right.svg\";\nimport Helper from '../../Helpers/Helper';\nimport { CustomField, CustomFieldType } from './intefaces';\n\n/**\n * @slot footer - The footer of modal\n * @slot before-login-type - placeholder position\n * @slot after-login-type - placeholder position\n * @slot before-login-mobile - placeholder position\n * @slot after-login-mobile - placeholder position\n * @slot before-login-email - placeholder position\n * @slot after-login-email - placeholder position\n * @slot before-registration - placeholder position\n * @slot after-registration - placeholder position\n */\n@Component({\n tag: 'salla-login-modal',\n styleUrl: 'salla-login-modal.scss'\n})\n\n\nexport class SallaLoginModal {\n constructor() {\n\n this.title = this.host.title || salla.lang.get('blocks.header.login');\n this.host.removeAttribute('title');\n\n this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');\n this.firstNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: salla.lang.get('pages.profile.first_name') });\n this.lastNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: salla.lang.get('pages.profile.last_name') });\n\n salla.lang.onLoaded(() => {\n this.translationLoaded = true;\n this.title = salla.lang.get('blocks.header.login');\n this.dragAndDrop = salla.lang.get('common.uploader.drag_and_drop');\n this.browseFromFiles = salla.lang.get('common.uploader.browse');\n this.updateTranslations();\n });\n\n salla.event.on('login::open', (data) => {\n if(!this.isEmailAllowed && !this.isMobileAllowed){\n salla.logger.warn('Please enable atleast one login type to use this component.');\n return;\n }\n this.withoutReload = data?.withoutReload ?? this.withoutReload;\n this.open(data)\n });\n salla.onReady( () => {\n this.isEmailAllowed = salla.config.get('store.settings.auth.email_allowed', this.isEmailAllowed);\n this.isMobileAllowed = salla.config.get('store.settings.auth.mobile_allowed', this.isMobileAllowed);\n this.isEmailRequired = salla.config.get('store.settings.auth.is_email_required', this.isEmailRequired);\n });\n }\n\n @Element() host: HTMLElement;\n /**\n * Does the merchant allow to login using email\n */\n @Prop({ mutable: true }) isEmailAllowed: boolean;\n /**\n * Does the merchant/current location for visitor allow to login using mobile, By default outside KSA is `false`\n */\n @Prop({ mutable: true }) isMobileAllowed: boolean = true;\n /**\n * Does the merchant require registration with email & mobile\n */\n @Prop({ mutable: true }) isEmailRequired: boolean = false;\n\n /**\n * Once the api verify success, it will be login the customer in web pages\n */\n @Prop({ reflect: true }) supportWebAuth: boolean = true;\n\n /**\n * Display the login inline\n */\n @Prop({ reflect: true }) inline: boolean;\n\n\n /**\n * Reload after a successful login\n */\n @Prop() withoutReload: boolean = false;\n\n private modal: HTMLSallaModalElement;\n //private homeTab: HTMLDivElement;\n private mobileTab: HTMLDivElement;\n private emailTab: HTMLDivElement;\n private verifyTab: HTMLSallaVerifyElement;\n private registrationTab: HTMLDivElement;\n private regTelInput: HTMLSallaTelInputElement;\n private regEmail: HTMLInputElement;\n private customFieldsWrapper: HTMLDivElement;\n private loginTelInput: HTMLSallaTelInputElement;\n private loginEmail: HTMLInputElement;\n private firstName: HTMLInputElement;\n private lastName: HTMLInputElement;\n private smsBtn: HTMLSallaButtonElement;\n private emailBtn: HTMLSallaButtonElement;\n private regBtn: HTMLSallaButtonElement;\n\n @State() currentTabName = 'home'\n @State() regType: 'phone' | 'email' = 'phone';\n\n\n @State() translationLoaded: boolean = false;\n @State() currentPhone: string = '';\n @State() currentEmail: string = '';\n @State() title: string;\n @State() emailErrorMsg: string;\n @State() firstNameErrorMsg: string;\n @State() lastNameErrorMsg: string;\n @State() hasError: boolean;\n @State() errorMessage: string;\n\n @State() dragAndDrop: string = salla.lang.get('common.uploader.drag_and_drop');\n @State() browseFromFiles: string = salla.lang.get('common.uploader.browse');\n @State() customFields: CustomField[] = [];\n\n private customFieldsValues: Object = {};\n @State() uploadedImage: string = undefined;\n\n @Listen('verified', { target: 'window' })\n /**\n * @param {CustomEvent|{details:{case:'new_customer'|'authenticated', redirect_url:string|null}}} event\n */\n onVerified(event) {\n salla.log('verified', event);\n //there is a case when force login is activated & is new user, it will return case inside error key., so cover it.\n let verifyCase = event.detail?.data.case || event.detail?.error.case;\n if (!verifyCase) {\n salla.log('verified but without case!');\n return;\n }\n\n if (verifyCase === \"new_customer\") {\n this.customFields = event.detail?.data?.custom_fields || [];\n return this.showTab(this.registrationTab);\n }\n\n if (!salla.auth.canRedirect()) {\n salla.log('Will not auto redirect or reload, due to `salla.auth.canRedirect()`');\n if (this.inline) {\n return;\n }\n this.modal.close();\n return;\n }\n\n if (event.detail.data.redirect_url) {\n return window.location.href = event.detail.data.redirect_url;\n }\n\n /**\n * we don't want to reload the page if this is not web auth\n * because we'll need the token in the page itself and its there\n * todo :: store the user data in storage for non-web auth and set the config.user from it\n */\n if (this.supportWebAuth && !this.withoutReload) {\n window.location.reload();\n } else {\n if (this.inline) {\n return;\n }\n this.modal.close();\n }\n }\n\n updateTranslations() {\n this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');\n this.firstNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: salla.lang.get('pages.profile.first_name') });\n this.lastNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: salla.lang.get('pages.profile.last_name') });\n if (this.inline) {\n return;\n }\n this.modal?.setTitle(this.title);\n }\n componentDidLoad() {\n if (this.inline) {\n this.getSelectedTab()\n }\n }\n /**\n * Open login component\n */\n @Method()\n // @ts-ignore\n async open(event = null) {\n // todo :: support change the settings from event details\n // if(event && event.hasOwnProperty('isEmailAllowed')){\n // this.isEmailAllowed = event?.isEmailAllowed;\n // }\n //\n // if(event && event.hasOwnProperty('isMobileAllowed')){\n // this.isMobileAllowed = event?.isMobileAllowed;\n // }\n\n /**\n * This is a workaround until we remove all the user objet from twig files\n * When the user is already login, let's reload the page\n */\n if (!salla.config.isGuest()) {\n if (!this.withoutReload) {\n return location.reload();\n }\n // Fire an event if withoutReload is true\n return;\n }\n\n this.getSelectedTab();\n return this.modal.open();\n }\n private getSelectedTab() {\n if (this.isMobileAllowed) {\n this.showTab(this.mobileTab);\n } else if (this.isEmailAllowed) {\n this.showTab(this.emailTab);\n }\n }\n private showTab(tab, evt?) {\n evt?.preventDefault();\n this.hasError = false;\n this.errorMessage = '';\n this.currentTabName = tab.getAttribute('data-name');\n\n // todo:: use better way for resize the modal\n // setTimeout(() => this.modal.querySelector('.s-login-modal-wrapper')?.setAttribute('style', 'height:' + tab?.scrollHeight + 'px'));\n\n if ([this.mobileTab, this.emailTab].includes(tab)) {\n this.regType = tab === this.mobileTab ? 'phone' : 'email';\n }\n\n const input = tab.querySelector('input[type=\"tel\"], input[type=\"email\"]');\n input && setTimeout(() => {\n input.focus();\n }, 100);\n if (this.inline) {\n return this;\n }\n this.modal?.setTitle(this.currentTabName === 'registration' ? salla.lang.get('common.titles.registration') : this.title);\n\n return this;\n }\n\n private typing = (e, submitMethod = null) => {\n const error = e.target.nextElementSibling;\n e.target.classList.remove('s-has-error');\n error?.classList.contains('s-login-modal-error-message') && (error.innerText = '');\n this.hasError = false;\n this.errorMessage = '';\n //it was sending two requests for send two verification requests\n submitMethod && e.key == 'Enter' && submitMethod();\n }\n\n private loginBySMS = async (event = null) => {\n event?.preventDefault();\n const { phone, countryCode, countryKey } = await this.loginTelInput.getValues();\n const isPhoneValid = await this.loginTelInput.isValid();\n if (!isPhoneValid) {\n return;\n }\n this.currentPhone = `${countryKey} ${phone}`;\n this.login(this.smsBtn, { type: 'mobile', phone: phone, country_code: countryCode });\n\n return false;\n }\n\n private loginByEmail = (event = null) => {\n event?.preventDefault();\n if (!Helper.isValidEmail(this.loginEmail.value)) {\n // this.validateField(this.loginEmail, this.emailErrorMsg);\n this.hasError = true;\n this.errorMessage = '* ' + this.emailErrorMsg;\n return;\n }\n this.currentEmail = this.loginEmail.value;\n this.login(this.emailBtn, { type: 'email', email: this.loginEmail.value });\n }\n\n private login(btn: HTMLSallaButtonElement, data) {\n this.hasError = false;\n this.errorMessage = '';\n btn.load()\n .then(() => btn.disable())\n .then(() => salla.auth.api.login(data))\n .then(() => this.showTab(this.verifyTab))\n .then(() => this.verifyTab.open(data))\n .catch((error) => {\n this.hasError = true;\n this.errorMessage = error.response.data?.error?.message;\n })\n .finally(() => btn.stop() && btn.enable());\n }\n\n private newUser = async () => {\n const {\n phone: regPhone,\n countryCode\n } = this.regType == \"email\" ? await this.regTelInput.getValues() : await this.loginTelInput.getValues(),\n emailValue = this.regEmail.value || this.loginEmail?.value\n await this.newUserValidation();\n await this.regBtn.load();\n await this.regBtn.disable();\n\n let data: any = {\n first_name: this.firstName.value,\n last_name: this.lastName.value,\n phone: regPhone || this.loginTelInput.phone,\n country_code: countryCode,\n verified_by: this.regType,\n custom_fields: this.customFieldsValues,\n };\n emailValue && (data = { ...data, email: emailValue });\n this.verifyTab.getCode()\n .then(code => salla.auth.api.register({...data, code}))\n .then(() => salla.auth.canRedirect && !this.withoutReload && window.location.reload())\n .catch((error) => {\n salla.logger.error(error);\n this.regBtn.stop() && this.regBtn.enable()\n })\n }\n\n private async newUserValidation() {\n const isLogByPhone = this.regType == \"phone\",\n isLogByEmail = this.regType == \"email\",\n emailValue = this.regEmail.value || (isLogByEmail && this.loginEmail.value),\n isEmailValid = Helper.isValidEmail(emailValue),\n isFirstNameValid = this.firstName.value.length > 0,\n isLastNameValid = this.lastName.value.length > 0,\n isPhoneValid = await this.regTelInput.isValid() || isLogByPhone && await this.loginTelInput.isValid(),\n emailValidation = (emailValue && isEmailValid) || (!emailValue && !this.isEmailRequired);\n\n // Custom Fields Validation\n var isCustomFieldValid = true;\n //we should make sure that there is text nodes between children\n this.customFieldsWrapper.childNodes\n .forEach((field: HTMLSallaFileUploadElement | HTMLInputElement) => {\n this.customFieldsValues[field.id] = field['value'];\n if (!field.required || this.customFieldsValues[field.id].length) {\n return;\n }\n isCustomFieldValid = false;\n const errorMsg: string = salla.lang.get('common.errors.field_required', { attribute: field.title });\n this.validateField(field, errorMsg)\n });\n\n if (emailValidation && isPhoneValid && isFirstNameValid && isLastNameValid && isCustomFieldValid) return;\n !isEmailValid && this.validateField(this.regEmail, this.emailErrorMsg);\n !isFirstNameValid && this.validateField(this.firstName, this.firstNameErrorMsg);\n !isLastNameValid && this.validateField(this.lastName, this.lastNameErrorMsg);\n throw 'Please insert required fields';\n }\n\n private getFilepondPlaceholder() {\n return `<div class=\"s-login-modal-filepond-placeholder\"><span class=\"s-login-modal-filepond-placeholder-icon\">${CameraIcon}</span><p class=\"s-login-modal-filepond-placeholder-text\">${this.dragAndDrop}</p> <span class=\"filepond--label-action\">${this.browseFromFiles}</span></div>`\n }\n\n // eslint-disable-next-line @stencil/own-methods-must-be-private\n validateField(field: HTMLInputElement | HTMLSallaFileUploadElement, errorMsg: string) {\n field.classList.add('s-has-error');\n field.nextElementSibling['innerText'] = '* ' + errorMsg;\n }\n\n generateTabClasses(tabName) {\n return {\n 's-login-modal-tab': tabName !== 'registration' && tabName !== 'otp',\n \"s-hidden\": this.currentTabName !== tabName,\n \"s-show\": this.currentTabName === tabName,\n 's-login-modal-unactive': tabName !== 'registration' && tabName !== 'otp' && this.currentTabName !== tabName,\n 's-login-modal-active': tabName !== 'registration' && tabName !== 'otp' && this.currentTabName === tabName\n }\n }\n\n generateRegClasses(regType) {\n return {\n \"mb-1.5\": true,\n \"s-hidden\": this.regType === regType\n }\n }\n private getLoginDom() {\n return [!this.inline && <span slot='icon' class=\"s-login-modal-header-icon\" innerHTML={UserIcon} />,\n <div class={this.inline ? 's-login-inline' : 's-login-modal-wrapper'}>\n {/* Tab 2 (Login By Mobile)*/}\n {this.isMobileAllowed ?\n <div class={this.generateTabClasses('login-phone')} data-name=\"login-phone\"\n ref={tab => this.mobileTab = tab}>\n <slot name=\"before-login-mobile\" />\n <form onSubmit={(event) => this.loginBySMS(event)} class={this.hasError && this.errorMessage ? 'has-error' : ''} method=\"POST\">\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.mobile')}</label>\n <salla-tel-input tabindex=\"0\" ref={el => this.loginTelInput = el}\n onKeyDown={e => this.typing(e)}></salla-tel-input>\n {this.hasError && this.errorMessage ? <span class=\"s-login-modal-error-message\">\n {this.errorMessage}\n </span> : ''}\n {/* @ts-ignore */}\n <salla-button class=\"s-login-modal-enter-button\" type=\"submit\" loader-position='center' width=\"wide\" ref={b => this.smsBtn = b}>\n {salla.lang.get('blocks.header.enter')}\n </salla-button>\n </form>\n {this.isEmailAllowed ?\n <a href=\"#\" onClick={() => this.showTab(this.emailTab)}\n class=\"s-login-modal-link\">{salla.lang.get('blocks.header.login_by_email')}</a> : ''}\n <slot name=\"after-login-mobile\" />\n </div> : ''}\n\n\n {/* Tab 3 (Login By Email)*/}\n {this.isEmailAllowed ?\n <div class={this.generateTabClasses('login-email')} data-name=\"login-email\"\n ref={tab => this.emailTab = tab}>\n <slot name=\"before-login-email\" />\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.email')}</label>\n <form onSubmit={() => this.loginByEmail(event)} method=\"POST\">\n <input type=\"email\" ref={el => this.loginEmail = el} onKeyDown={e => this.typing(e)}\n \n placeholder=\"your@email.com\"\n enterkeyhint=\"next\"\n class={{\"s-login-modal-input s-ltr\": true, \"s-has-error\": this.hasError}} />\n {this.hasError && this.errorMessage ? <span class=\"s-login-modal-error-message\">\n {this.errorMessage}\n </span> : ''}\n <salla-button class=\"s-login-modal-enter-button\" loader-position='center' width=\"wide\" onClick={() => this.loginByEmail()}\n ref={b => this.emailBtn = b}>{salla.lang.get('blocks.header.enter')}</salla-button>\n </form>\n {this.isMobileAllowed ?\n <a href=\"#\" onClick={() => this.showTab(this.mobileTab)}\n class=\"s-login-modal-link\">{salla.lang.get('blocks.header.login_by_sms')}</a>\n : ''\n }\n <slot name=\"after-login-email\" />\n </div> : ''}\n {/* Tab 4 (Verify OTP)*/}\n <salla-verify display=\"inline\" support-web-auth={this.supportWebAuth ? 'true' : 'false'}\n class={this.generateTabClasses('otp')} data-name=\"otp\" ref={tab => this.verifyTab = tab}\n autoReload={false}>\n <a onClick={() => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab)}\n class=\"s-verify-back\"\n innerHTML={ArrowRightIcon}\n slot=\"after-footer\"\n href=\"#\" />\n {this.isMobileAllowed && this.regType == 'phone' ? <div dir=\"ltr\" class=\"s-login-modal-currentPhone\" slot=\"mobile\">{this.currentPhone}</div> : ''}\n {this.isEmailAllowed && this.regType == 'email' ? <div dir=\"ltr\" class=\"s-login-modal-currentEmail\" slot=\"email\">{this.currentEmail}</div> : ''}\n </salla-verify>\n\n {/* Tab 5 (Register New User)*/}\n <div data-name=\"registration\" class={this.generateTabClasses('registration')}\n ref={tab => this.registrationTab = tab}>\n <slot name=\"before-registration\" />\n <div>\n <label class=\"s-login-modal-label\">{salla.lang.get('blocks.header.your_name')}</label>\n <input type=\"text\" class=\"s-login-modal-input\" ref={el => this.firstName = el}\n onKeyDown={e => this.typing(e, this.newUser)}\n placeholder={salla.lang.get('pages.profile.first_name')} />\n <span class=\"s-login-modal-error-message\" />\n </div>\n\n <div>\n <label class=\"s-login-modal-label\">{salla.lang.get('pages.profile.last_name')}</label>\n <input type=\"text\" class=\"s-login-modal-input\" ref={el => this.lastName = el}\n onKeyDown={e => this.typing(e, this.newUser)}\n placeholder={salla.lang.get('pages.profile.last_name')} />\n <span class=\"s-login-modal-error-message\" />\n </div>\n\n <div class={this.generateRegClasses('phone')}>\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.mobile')}</label>\n <salla-tel-input ref={el => this.regTelInput = el}\n onKeyDown={e => this.typing(e, this.newUser)}></salla-tel-input>\n </div>\n\n <div class={this.generateRegClasses('email')}>\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.email')}</label>\n <input type=\"email\" ref={el => this.regEmail = el} onKeyDown={e => this.typing(e, this.newUser)}\n placeholder=\"your@email.com\"\n class=\"s-login-modal-input s-ltr\" />\n <span class=\"s-login-modal-error-message\" />\n </div>\n <div class=\"s-login-modal-custom-fields\" ref={el => this.customFieldsWrapper = el}>{\n this.customFields.map((field: CustomField) => [\n <label class=\"s-login-modal-label\">{field.label}</label>,\n field.type === CustomFieldType.PHOTO\n ? <salla-file-upload\n name=\"image\"\n instant-upload={true}\n id={`${field.id}`}\n title={field.label}\n required={field.required}\n url={salla.url.get('upload-image')}\n // onUploaded={}\n labelIdle={this.getFilepondPlaceholder()} />\n : <input\n onInput={el => field.type == CustomFieldType.NUMBER ? salla.helpers.inputDigitsOnly(el.target) : {}}\n onKeyDown={e => this.typing(e, this.newUser)}\n class=\"s-login-modal-input s-ltr\"\n maxlength={field.length || 1000}//todo:: support it by adding the maxlength or not, not setting static limit\n placeholder={field.description}\n required={field.required}\n title={field.label}\n id={`${field.id}`}\n type=\"text\" />,\n <span class=\"s-login-modal-error-message\" />\n ])\n }</div>\n\n <salla-button loader-position='center' width=\"wide\" onClick={() => this.newUser()}\n ref={b => this.regBtn = b}>{salla.lang.get('blocks.header.register')}</salla-button>\n <slot name=\"after-registration\" />\n </div>\n </div>]\n }\n render() {\n // @ts-ignore\n // @ts-ignore\n if (this.inline) {\n return this.getLoginDom();\n }\n return (\n <salla-modal class=\"s-login-modal\" modal-title={this.title} ref={modal => this.modal = modal} width=\"xs\">\n {this.getLoginDom()}\n </salla-modal>\n );\n }\n}\n\n"]}
1
+ {"version":3,"file":"salla-login-modal.js","sourceRoot":"","sources":["../../../src/components/salla-login-modal/salla-login-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,E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EAAE,CAAC;KAC3B;IACD,OAAO,CACL,mBAAa,KAAK,EAAC,eAAe,iBAAc,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,EAAE,KAAK,EAAC,IAAI,IACrG,IAAI,CAAC,WAAW,EAAE,CACP,CACf,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Listen, Method, Prop, State } from '@stencil/core';\nimport UserIcon from \"../../assets/svg/user.svg\";\n//import PhoneIcon from \"../../assets/svg/phone.svg\";\n//import EmailIcon from \"../../assets/svg/mail.svg\";\nimport CameraIcon from '../../assets/svg/camera.svg';\n//import KeyboardArrowRightIcon from \"../../assets/svg/keyboard_arrow_right.svg\";\nimport ArrowRightIcon from \"../../assets/svg/arrow-right.svg\";\nimport Helper from '../../Helpers/Helper';\nimport { CustomField, CustomFieldType } from './intefaces';\n\n/**\n * @slot footer - The footer of modal\n * @slot before-login-type - placeholder position\n * @slot after-login-type - placeholder position\n * @slot before-login-mobile - placeholder position\n * @slot after-login-mobile - placeholder position\n * @slot before-login-email - placeholder position\n * @slot after-login-email - placeholder position\n * @slot before-registration - placeholder position\n * @slot after-registration - placeholder position\n */\n@Component({\n tag: 'salla-login-modal',\n styleUrl: 'salla-login-modal.scss'\n})\n\n\nexport class SallaLoginModal {\n constructor() {\n\n this.title = this.host.title || salla.lang.get('blocks.header.login');\n this.host.removeAttribute('title');\n\n this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');\n this.firstNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: salla.lang.get('pages.profile.first_name') });\n this.lastNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: salla.lang.get('pages.profile.last_name') });\n\n salla.lang.onLoaded(() => {\n this.translationLoaded = true;\n this.title = salla.lang.get('blocks.header.login');\n this.dragAndDrop = salla.lang.get('common.uploader.drag_and_drop');\n this.browseFromFiles = salla.lang.get('common.uploader.browse');\n this.updateTranslations();\n });\n\n salla.event.on('login::open', (data) => {\n if (!this.isEmailAllowed && !this.isMobileAllowed) {\n salla.logger.warn('Please enable atleast one login type to use this component.');\n return;\n }\n this.withoutReload = data?.withoutReload ?? this.withoutReload;\n this.isModalOpen = true\n this.open(data)\n });\n salla.onReady(() => {\n this.isEmailAllowed = salla.config.get('store.settings.auth.email_allowed', this.isEmailAllowed);\n this.isMobileAllowed = salla.config.get('store.settings.auth.mobile_allowed', this.isMobileAllowed);\n this.isEmailRequired = salla.config.get('store.settings.auth.is_email_required', this.isEmailRequired);\n });\n }\n\n @Element() host: HTMLElement;\n /**\n * Does the merchant allow to login using email\n */\n @Prop({ mutable: true }) isEmailAllowed: boolean;\n /**\n * Does the merchant/current location for visitor allow to login using mobile, By default outside KSA is `false`\n */\n @Prop({ mutable: true }) isMobileAllowed: boolean = true;\n /**\n * Does the merchant require registration with email & mobile\n */\n @Prop({ mutable: true }) isEmailRequired: boolean = false;\n\n /**\n * Once the api verify success, it will be login the customer in web pages\n */\n @Prop({ reflect: true }) supportWebAuth: boolean = true;\n\n /**\n * Display the login inline\n */\n @Prop({ reflect: true }) inline: boolean;\n\n\n /**\n * Reload after a successful login\n */\n @Prop() withoutReload: boolean = false;\n\n private modal: HTMLSallaModalElement;\n //private homeTab: HTMLDivElement;\n private mobileTab: HTMLDivElement;\n private emailTab: HTMLDivElement;\n private verifyTab: HTMLSallaVerifyElement;\n private registrationTab: HTMLDivElement;\n private regTelInput: HTMLSallaTelInputElement;\n private regEmail: HTMLInputElement;\n private customFieldsWrapper: HTMLDivElement;\n private loginTelInput: HTMLSallaTelInputElement;\n private loginEmail: HTMLInputElement;\n private firstName: HTMLInputElement;\n private lastName: HTMLInputElement;\n private smsBtn: HTMLSallaButtonElement;\n private emailBtn: HTMLSallaButtonElement;\n private regBtn: HTMLSallaButtonElement;\n\n @State() currentTabName = 'home'\n @State() regType: 'phone' | 'email' = 'phone';\n\n\n @State() translationLoaded: boolean = false;\n @State() isModalOpen = false\n @State() currentPhone: string = '';\n @State() currentEmail: string = '';\n @State() title: string;\n @State() emailErrorMsg: string;\n @State() firstNameErrorMsg: string;\n @State() lastNameErrorMsg: string;\n @State() hasError: boolean;\n @State() errorMessage: string;\n\n @State() dragAndDrop: string = salla.lang.get('common.uploader.drag_and_drop');\n @State() browseFromFiles: string = salla.lang.get('common.uploader.browse');\n @State() customFields: CustomField[] = [];\n\n private customFieldsValues: Object = {};\n @State() uploadedImage: string = undefined;\n\n @Listen('verified', { target: 'window' })\n /**\n * @param {CustomEvent|{details:{case:'new_customer'|'authenticated', redirect_url:string|null}}} event\n */\n onVerified(event) {\n salla.log('verified', event);\n //there is a case when force login is activated & is new user, it will return case inside error key., so cover it.\n let verifyCase = event.detail?.data.case || event.detail?.error.case;\n if (!verifyCase) {\n salla.log('verified but without case!');\n return;\n }\n\n if (verifyCase === \"new_customer\") {\n this.customFields = event.detail?.data?.custom_fields || [];\n return this.showTab(this.registrationTab);\n }\n\n if (!salla.auth.canRedirect()) {\n salla.log('Will not auto redirect or reload, due to `salla.auth.canRedirect()`');\n if (this.inline) {\n return;\n }\n this.isModalOpen = false\n this.modal.close();\n \n return;\n }\n\n if (event.detail.data.redirect_url) {\n return window.location.href = event.detail.data.redirect_url;\n }\n\n /**\n * we don't want to reload the page if this is not web auth\n * because we'll need the token in the page itself and its there\n * todo :: store the user data in storage for non-web auth and set the config.user from it\n */\n if (this.supportWebAuth && !this.withoutReload) {\n window.location.reload();\n } else {\n if (this.inline) {\n return;\n }\n this.isModalOpen = false\n this.modal.close();\n }\n }\n\n updateTranslations() {\n this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');\n this.firstNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: salla.lang.get('pages.profile.first_name') });\n this.lastNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: salla.lang.get('pages.profile.last_name') });\n if (this.inline) {\n return;\n }\n this.modal?.setTitle(this.title);\n }\n componentDidLoad() {\n if (this.inline) {\n this.getSelectedTab()\n }\n }\n /**\n * Open login component\n */\n @Method()\n // @ts-ignore\n async open(event = null) {\n // todo :: support change the settings from event details\n // if(event && event.hasOwnProperty('isEmailAllowed')){\n // this.isEmailAllowed = event?.isEmailAllowed;\n // }\n //\n // if(event && event.hasOwnProperty('isMobileAllowed')){\n // this.isMobileAllowed = event?.isMobileAllowed;\n // }\n\n /**\n * This is a workaround until we remove all the user objet from twig files\n * When the user is already login, let's reload the page\n */\n if (!salla.config.isGuest()) {\n if (!this.withoutReload) {\n return location.reload();\n }\n // Fire an event if withoutReload is true\n return;\n }\n\n this.getSelectedTab();\n this.isModalOpen = true\n\n return this.modal.open();\n }\n private getSelectedTab() {\n if (this.isMobileAllowed) {\n this.showTab(this.mobileTab);\n } else if (this.isEmailAllowed) {\n this.showTab(this.emailTab);\n }\n }\n private showTab(tab, evt?) {\n evt?.preventDefault();\n this.hasError = false;\n this.errorMessage = '';\n this.currentTabName = tab.getAttribute('data-name');\n\n // todo:: use better way for resize the modal\n // setTimeout(() => this.modal.querySelector('.s-login-modal-wrapper')?.setAttribute('style', 'height:' + tab?.scrollHeight + 'px'));\n\n if ([this.mobileTab, this.emailTab].includes(tab)) {\n this.regType = tab === this.mobileTab ? 'phone' : 'email';\n }\n\n if (this.inline) {\n return this;\n }\n this.modal?.setTitle(this.currentTabName === 'registration' ? salla.lang.get('common.titles.registration') : this.title);\n const input = tab.querySelector('input[type=\"tel\"], input[type=\"email\"]');\n input && this.currentTabName !== 'registration' && setTimeout(() => {\n input.focus();\n }, 100);\n return this;\n }\n\n private typing = (e, submitMethod = null) => {\n const error = e.target.nextElementSibling;\n e.target.classList.remove('s-has-error');\n error?.classList.contains('s-login-modal-error-message') && (error.innerText = '');\n this.hasError = false;\n this.errorMessage = '';\n //it was sending two requests for send two verification requests\n submitMethod && e.key == 'Enter' && submitMethod();\n }\n\n private loginBySMS = async (event = null) => {\n event?.preventDefault();\n const { phone, countryCode, countryKey } = await this.loginTelInput.getValues();\n const isPhoneValid = await this.loginTelInput.isValid();\n if (!isPhoneValid) {\n return;\n }\n this.currentPhone = `${countryKey} ${phone}`;\n this.login(this.smsBtn, { type: 'mobile', phone: phone, country_code: countryCode });\n\n return false;\n }\n\n private loginByEmail = (event = null) => {\n event?.preventDefault();\n if (!Helper.isValidEmail(this.loginEmail.value)) {\n // this.validateField(this.loginEmail, this.emailErrorMsg);\n this.hasError = true;\n this.errorMessage = '* ' + this.emailErrorMsg;\n return;\n }\n this.currentEmail = this.loginEmail.value;\n this.login(this.emailBtn, { type: 'email', email: this.loginEmail.value });\n }\n\n private login(btn: HTMLSallaButtonElement, data) {\n this.hasError = false;\n this.errorMessage = '';\n btn.load()\n .then(() => btn.disable())\n .then(() => salla.auth.api.login(data))\n .then(() => this.showTab(this.verifyTab))\n .then(() => this.verifyTab.open(data))\n .catch((error) => {\n this.hasError = true;\n this.errorMessage = error.response.data?.error?.message;\n })\n .finally(() => btn.stop() && btn.enable());\n }\n\n private newUser = async () => {\n const {\n phone: regPhone,\n countryCode\n } = this.regType == \"email\" ? await this.regTelInput.getValues() : await this.loginTelInput.getValues(),\n emailValue = this.regEmail.value || this.loginEmail?.value\n await this.newUserValidation();\n await this.regBtn.load();\n await this.regBtn.disable();\n\n let data: any = {\n first_name: this.firstName.value,\n last_name: this.lastName.value,\n phone: regPhone || this.loginTelInput.phone,\n country_code: countryCode,\n verified_by: this.regType,\n custom_fields: this.customFieldsValues,\n };\n emailValue && (data = { ...data, email: emailValue });\n this.verifyTab.getCode()\n .then(code => salla.auth.api.register({ ...data, code }))\n .then(() => salla.auth.canRedirect && !this.withoutReload && window.location.reload())\n .catch((error) => {\n salla.logger.error(error);\n this.regBtn.stop() && this.regBtn.enable()\n })\n }\n\n private async newUserValidation() {\n const isLogByPhone = this.regType == \"phone\",\n isLogByEmail = this.regType == \"email\",\n emailValue = this.regEmail.value || (isLogByEmail && this.loginEmail.value),\n isEmailValid = Helper.isValidEmail(emailValue),\n isFirstNameValid = this.firstName.value.length > 0,\n isLastNameValid = this.lastName.value.length > 0,\n isPhoneValid = await this.regTelInput.isValid() || isLogByPhone && await this.loginTelInput.isValid(),\n emailValidation = (emailValue && isEmailValid) || (!emailValue && !this.isEmailRequired);\n\n // Custom Fields Validation\n var isCustomFieldValid = true;\n //we should make sure that there is text nodes between children\n this.customFieldsWrapper.childNodes\n .forEach((field: HTMLSallaFileUploadElement | HTMLInputElement) => {\n this.customFieldsValues[field.id] = field['value'];\n if (!field.required || this.customFieldsValues[field.id].length) {\n return;\n }\n isCustomFieldValid = false;\n const errorMsg: string = salla.lang.get('common.errors.field_required', { attribute: field.title });\n this.validateField(field, errorMsg)\n });\n\n if (emailValidation && isPhoneValid && isFirstNameValid && isLastNameValid && isCustomFieldValid) return;\n !isEmailValid && this.validateField(this.regEmail, this.emailErrorMsg);\n !isFirstNameValid && this.validateField(this.firstName, this.firstNameErrorMsg);\n !isLastNameValid && this.validateField(this.lastName, this.lastNameErrorMsg);\n throw 'Please insert required fields';\n }\n\n private getFilepondPlaceholder() {\n return `<div class=\"s-login-modal-filepond-placeholder\"><span class=\"s-login-modal-filepond-placeholder-icon\">${CameraIcon}</span><p class=\"s-login-modal-filepond-placeholder-text\">${this.dragAndDrop}</p> <span class=\"filepond--label-action\">${this.browseFromFiles}</span></div>`\n }\n\n // eslint-disable-next-line @stencil/own-methods-must-be-private\n validateField(field: HTMLInputElement | HTMLSallaFileUploadElement, errorMsg: string) {\n field.classList.add('s-has-error');\n field.nextElementSibling['innerText'] = '* ' + errorMsg;\n }\n\n generateTabClasses(tabName) {\n return {\n 's-login-modal-tab': tabName !== 'registration' && tabName !== 'otp',\n \"s-hidden\": this.currentTabName !== tabName,\n \"s-show\": this.currentTabName === tabName,\n 's-login-modal-unactive': tabName !== 'registration' && tabName !== 'otp' && this.currentTabName !== tabName,\n 's-login-modal-active': tabName !== 'registration' && tabName !== 'otp' && this.currentTabName === tabName\n }\n }\n\n generateRegClasses(regType) {\n return {\n \"mb-1.5\": true,\n \"s-hidden\": this.regType === regType\n }\n }\n private getLoginDom() {\n return [!this.inline && <span slot='icon' class=\"s-login-modal-header-icon\" innerHTML={UserIcon} />,\n <div class={this.inline ? 's-login-inline' : 's-login-modal-wrapper'}>\n {/* Tab 2 (Login By Mobile)*/}\n {this.isMobileAllowed ?\n <div class={this.generateTabClasses('login-phone')} data-name=\"login-phone\"\n ref={tab => this.mobileTab = tab}>\n <slot name=\"before-login-mobile\" />\n <form onSubmit={(event) => this.loginBySMS(event)} class={this.hasError && this.errorMessage ? 'has-error' : ''} method=\"POST\">\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.mobile')}</label>\n {this.isModalOpen || this.inline ? (<salla-tel-input autofocus tabindex=\"0\" ref={el => this.loginTelInput = el}\n onKeyDown={e => this.typing(e)}></salla-tel-input>) : null}\n {this.hasError && this.errorMessage ? <span class=\"s-login-modal-error-message\">\n {this.errorMessage}\n </span> : ''}\n {/* @ts-ignore */}\n <salla-button class=\"s-login-modal-enter-button\" type=\"submit\" loader-position='center' width=\"wide\" ref={b => this.smsBtn = b}>\n {salla.lang.get('blocks.header.enter')}\n </salla-button>\n </form>\n {this.isEmailAllowed ?\n <a href=\"#\" onClick={() => this.showTab(this.emailTab)}\n class=\"s-login-modal-link\">{salla.lang.get('blocks.header.login_by_email')}</a> : ''}\n <slot name=\"after-login-mobile\" />\n </div> : ''}\n\n\n {/* Tab 3 (Login By Email)*/}\n {this.isEmailAllowed ?\n <div class={this.generateTabClasses('login-email')} data-name=\"login-email\"\n ref={tab => this.emailTab = tab}>\n <slot name=\"before-login-email\" />\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.email')}</label>\n <form onSubmit={() => this.loginByEmail(event)} method=\"POST\">\n <input type=\"email\" ref={el => this.loginEmail = el} onKeyDown={e => this.typing(e)}\n\n placeholder=\"your@email.com\"\n enterkeyhint=\"next\"\n class={{ \"s-login-modal-input s-ltr\": true, \"s-has-error\": this.hasError }} />\n {this.hasError && this.errorMessage ? <span class=\"s-login-modal-error-message\">\n {this.errorMessage}\n </span> : ''}\n <salla-button class=\"s-login-modal-enter-button\" loader-position='center' width=\"wide\" onClick={() => this.loginByEmail()}\n ref={b => this.emailBtn = b}>{salla.lang.get('blocks.header.enter')}</salla-button>\n </form>\n {this.isMobileAllowed ?\n <a href=\"#\" onClick={() => this.showTab(this.mobileTab)}\n class=\"s-login-modal-link\">{salla.lang.get('blocks.header.login_by_sms')}</a>\n : ''\n }\n <slot name=\"after-login-email\" />\n </div> : ''}\n {/* Tab 4 (Verify OTP)*/}\n <salla-verify display=\"inline\" support-web-auth={this.supportWebAuth ? 'true' : 'false'}\n class={this.generateTabClasses('otp')} data-name=\"otp\" ref={tab => this.verifyTab = tab}\n autoReload={false}>\n <a onClick={() => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab)}\n class=\"s-verify-back\"\n innerHTML={ArrowRightIcon}\n slot=\"after-footer\"\n href=\"#\" />\n {this.isMobileAllowed && this.regType == 'phone' ? <div dir=\"ltr\" class=\"s-login-modal-currentPhone\" slot=\"mobile\">{this.currentPhone}</div> : ''}\n {this.isEmailAllowed && this.regType == 'email' ? <div dir=\"ltr\" class=\"s-login-modal-currentEmail\" slot=\"email\">{this.currentEmail}</div> : ''}\n </salla-verify>\n\n {/* Tab 5 (Register New User)*/}\n <div data-name=\"registration\" class={this.generateTabClasses('registration')}\n ref={tab => this.registrationTab = tab}>\n <slot name=\"before-registration\" />\n <div>\n <label class=\"s-login-modal-label\">{salla.lang.get('blocks.header.your_name')}</label>\n <input type=\"text\" class=\"s-login-modal-input\" ref={el => this.firstName = el}\n onKeyDown={e => this.typing(e, this.newUser)}\n placeholder={salla.lang.get('pages.profile.first_name')} />\n <span class=\"s-login-modal-error-message\" />\n </div>\n\n <div>\n <label class=\"s-login-modal-label\">{salla.lang.get('pages.profile.last_name')}</label>\n <input type=\"text\" class=\"s-login-modal-input\" ref={el => this.lastName = el}\n onKeyDown={e => this.typing(e, this.newUser)}\n placeholder={salla.lang.get('pages.profile.last_name')} />\n <span class=\"s-login-modal-error-message\" />\n </div>\n\n <div class={this.generateRegClasses('phone')}>\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.mobile')}</label>\n {(this.isModalOpen || this.inline) && this.currentTabName === \"registration\" ? (<salla-tel-input ref={el => this.regTelInput = el}\n onKeyDown={e => this.typing(e, this.newUser)}></salla-tel-input>) : null}\n </div>\n\n <div class={this.generateRegClasses('email')}>\n <label class=\"s-login-modal-label\">{salla.lang.get('common.elements.email')}</label>\n <input type=\"email\" ref={el => this.regEmail = el} onKeyDown={e => this.typing(e, this.newUser)}\n placeholder=\"your@email.com\"\n class=\"s-login-modal-input s-ltr\" />\n <span class=\"s-login-modal-error-message\" />\n </div>\n <div class=\"s-login-modal-custom-fields\" ref={el => this.customFieldsWrapper = el}>{\n this.customFields.map((field: CustomField) => [\n <label class=\"s-login-modal-label\">{field.label}</label>,\n field.type === CustomFieldType.PHOTO\n ? <salla-file-upload\n name=\"image\"\n instant-upload={true}\n id={`${field.id}`}\n title={field.label}\n required={field.required}\n url={salla.url.get('upload-image')}\n // onUploaded={}\n labelIdle={this.getFilepondPlaceholder()} />\n : <input\n onInput={el => field.type == CustomFieldType.NUMBER ? salla.helpers.inputDigitsOnly(el.target) : {}}\n onKeyDown={e => this.typing(e, this.newUser)}\n class=\"s-login-modal-input s-ltr\"\n maxlength={field.length || 1000}//todo:: support it by adding the maxlength or not, not setting static limit\n placeholder={field.description}\n required={field.required}\n title={field.label}\n id={`${field.id}`}\n type=\"text\" />,\n <span class=\"s-login-modal-error-message\" />\n ])\n }</div>\n\n <salla-button loader-position='center' width=\"wide\" onClick={() => this.newUser()}\n ref={b => this.regBtn = b}>{salla.lang.get('blocks.header.register')}</salla-button>\n <slot name=\"after-registration\" />\n </div>\n </div>]\n }\n render() {\n // @ts-ignore\n // @ts-ignore\n if (this.inline) {\n return this.getLoginDom();\n }\n return (\n <salla-modal class=\"s-login-modal\" modal-title={this.title} ref={modal => this.modal = modal} width=\"xs\">\n {this.getLoginDom()}\n </salla-modal>\n );\n }\n}\n\n"]}
@@ -6,6 +6,7 @@ import TelInput from "intl-tel-input";
6
6
  export class SallaTelInput {
7
7
  constructor() {
8
8
  this.phone = undefined;
9
+ this.autofocus = undefined;
9
10
  this.name = 'phone';
10
11
  this.countryCode = salla.config.get('user.country_code', 'SA') || 'SA';
11
12
  this.mobileRequired = undefined;
@@ -68,6 +69,7 @@ export class SallaTelInput {
68
69
  autoPlaceholder: 'aggressive',
69
70
  utilsScript: 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/18.2.1/js/utils.min.js',
70
71
  });
72
+ this.autofocus && this.phoneInput.focus();
71
73
  this.phoneInput.addEventListener("countrychange", () => {
72
74
  let data = this.iti.getSelectedCountryData();
73
75
  let value = data.iso2.toUpperCase();
@@ -130,6 +132,23 @@ export class SallaTelInput {
130
132
  "attribute": "phone",
131
133
  "reflect": false
132
134
  },
135
+ "autofocus": {
136
+ "type": "boolean",
137
+ "mutable": false,
138
+ "complexType": {
139
+ "original": "boolean",
140
+ "resolved": "boolean",
141
+ "references": {}
142
+ },
143
+ "required": false,
144
+ "optional": false,
145
+ "docs": {
146
+ "tags": [],
147
+ "text": "Automatically focus telephone input"
148
+ },
149
+ "attribute": "autofocus",
150
+ "reflect": true
151
+ },
133
152
  "name": {
134
153
  "type": "string",
135
154
  "mutable": false,
@@ -1 +1 @@
1
- {"version":3,"file":"salla-tel-input.js","sourceRoot":"","sources":["../../../src/components/salla-tel-input/salla-tel-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EA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AAM,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;KACvF;EACH,CAAC;EAGD,MAAM;IACJ,OAAO,CACL,EAAC,IAAI,IAAC,KAAK,EAAC,aAAa;MACvB,aAAO,IAAI,EAAC,KAAK,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,GAAG,EAAE,EACxI,YAAY,EAAC,MAAM,EACnB,YAAY,EAAC,KAAK,EAClB,KAAK,EAAC,qCAAqC,GAAG;MAC/C,YAAM,KAAK,EAAC,uBAAuB,EAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAE,GAAG;MACrE,aAAO,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,GAAG,EAAE,EACrG,KAAK,EAAC,cAAc,GAAG,CACpB,CACR,CAAC;EACJ,CAAC;EAED,gBAAgB;IACd,IAAI,CAAC,YAAY,EAAE,CAAC;EACtB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Element, Component, Host, h, Prop, Method, Event, EventEmitter, State } from '@stencil/core';\nimport TelInput from \"intl-tel-input\";\nimport { Phone } from './interfaces';\n\n@Component({ tag: 'salla-tel-input', styleUrl: 'salla-tel-input.scss' })\n\nexport class SallaTelInput {\n constructor() {\n salla.lang.onLoaded(() => {\n this.mobileLabel = salla.lang.get('common.elements.mobile');\n this.countryCodeLabel = salla.lang.get('common.elements.country_code');\n this.invalidNumber = salla.lang.get('common.errors.invalid_value', { attribute: this.mobileLabel });\n this.invalidCountryCode = salla.lang.get('common.errors.invalid_value', { attribute: this.countryCodeLabel });\n this.tooShort = salla.lang.get('common.errors.too_short', { attribute: this.mobileLabel });\n this.tooLong = salla.lang.get('common.errors.too_long', { attribute: this.mobileLabel });\n this.mobileRequired = salla.lang.get('common.errors.field_required', { attribute: this.mobileLabel });\n this.errorMap = [this.invalidNumber, this.invalidCountryCode, this.tooShort, this.tooLong, this.invalidNumber];\n });\n }\n\n /**\n * Current mobile number\n */\n @Prop({ mutable: true }) phone: string;\n /**\n * input name\n */\n @Prop() name: string = 'phone';\n /**\n * Current country_code\n */\n @Prop({ mutable: true }) countryCode: string = salla.config.get('user.country_code', 'SA') || 'SA';\n\n /**\n * Event emmitted when user enters a phone number.\n */\n @Event() phoneEntered: EventEmitter<Phone>;\n\n\n @Element() host: HTMLElement;\n @State() mobileRequired: string;\n @State() countryCodeLabel: string = salla.lang.get('common.country_code');\n @State() mobileLabel: string = salla.lang.get('common.elements.mobile');\n @State() tooShort: string = salla.lang.get('common.errors.too_short', { attribute: this.mobileLabel });\n @State() tooLong: string = salla.lang.get('common.errors.too_long', { attribute: this.mobileLabel });\n @State() invalidCountryCode: string = salla.lang.get('common.errors.invalid_value', { attribute: this.countryCodeLabel });\n @State() invalidNumber: string = salla.lang.get('common.errors.invalid_value', { attribute: this.mobileLabel });\n @State() errorMap: string[] = [this.invalidNumber, this.invalidCountryCode, this.tooShort, this.tooLong, this.invalidNumber];\n\n private phoneInput: HTMLInputElement;\n private countryCodeInput: HTMLInputElement;\n private errorMsg: any;\n private iti: any;\n\n\n /**\n * Get current values\n * @return {{mobile:number,countryCode:'SA'|string}}\n */\n @Method()\n async getValues() {\n return {\n [this.name]: this.phone = this.phoneInput.value,\n countryCode: this.countryCode = this.countryCodeInput.value,\n countryKey: (this.host.querySelector('.iti__selected-dial-code') as any).innerText\n }\n }\n\n /**\n * Is current data valid or not\n * @return {boolean}\n */\n @Method()\n async isValid() {\n this.reset();\n if (this.iti.isValidNumber()) return true;\n\n if (!this.phoneInput.value.trim()) {\n this.phoneInput.classList.add(\"s-has-error\");\n this.errorMsg.innerText = this.mobileRequired || 'The mobile is required';\n return;\n }\n\n this.phoneInput.classList.add(\"s-has-error\");\n let errorCode = this.iti.getValidationError();\n this.errorMsg.innerText = this.errorMap[errorCode] || '';\n\n salla.logger.info('Phone number (' + this.countryCode + ' - ' + this.phone + ') is not valid, error code ' + errorCode);\n return false;\n }\n\n private initTelInput() {\n salla.helpers.inputDigitsOnly(this.phoneInput);\n this.iti = TelInput(this.phoneInput, {\n initialCountry: this.countryCode || 'sa',\n preferredCountries: ['sa', 'ae', 'kw', 'bh', 'qa', 'iq', 'om', 'ye', 'eg', 'jo', 'ps', 'sd', 'lb', 'dz', 'tn', 'ma', 'ly'],\n excludeCountries: ['sy', 'ir', 'cu', 'kp'],\n formatOnDisplay: false,\n separateDialCode: true,\n autoPlaceholder: 'aggressive',\n utilsScript: 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/18.2.1/js/utils.min.js',\n });\n this.phoneInput.addEventListener(\"countrychange\", () => {\n let data = this.iti.getSelectedCountryData();\n let value = data.iso2.toUpperCase();\n this.countryCodeInput.value = value\n this.countryCode = value;\n this.phoneEntered.emit({ number: this.phone, country_code: value })\n });\n\n // on blur: validate\n // this.phoneInput.addEventListener('blur', () => this.isValid());\n\n // on keyup / change flag: reset\n this.phoneInput.addEventListener('input', (e: Event) => {\n salla.helpers.inputDigitsOnly(e.target);\n this.reset();\n this.phoneEntered.emit({ number: (e.target as HTMLInputElement).value, country_code: this.countryCode })\n });\n\n }\n\n private reset() {\n this.phoneInput.classList.remove(\"s-has-error\");\n this.errorMsg.innerHTML = \"\";\n };\n\n private handleCountryInput(event) {\n if (!!this.phone) {\n this.phoneEntered.emit({ number: event.target.value, country_code: this.countryCode })\n }\n }\n\n\n render() {\n return (\n <Host class=\"s-tel-input\">\n <input type=\"tel\" name={this.name} value={this.phone} onChange={(event) => this.handleCountryInput(event)} ref={el => this.phoneInput = el}\n enterkeyhint=\"next\"\n autocomplete=\"tel\"\n class=\"s-tel-input-control tel-input s-ltr\" />\n <span class=\"s-tel-input-error-msg\" ref={el => this.errorMsg = el}/>\n <input type=\"hidden\" name=\"country_code\" value={this.countryCode} ref={el => this.countryCodeInput = el}\n class=\"country_code\" />\n </Host>\n );\n }\n\n componentDidLoad() {\n this.initTelInput();\n }\n}\n"]}
1
+ {"version":3,"file":"salla-tel-input.js","sourceRoot":"","sources":["../../../src/components/salla-tel-input/salla-tel-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAKtC,MAAM,OAAO,aAAa;EACxB;;;gBAwBuB,OAAO;uBAIiB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,IAAI,IAAI;;4BAU9D,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC;uBAC1C,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC;oBAC3C,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,yBAAyB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;mBAC3E,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,wBAAwB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;8BAC9D,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,6BAA6B,EAAE,EAAE,SAAS,EAAE,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AC,uBAAuB,EAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAE,GAAG;MACrE,aAAO,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,GAAG,EAAE,EACrG,KAAK,EAAC,cAAc,GAAG,CACpB,CACR,CAAC;EACJ,CAAC;EAED,gBAAgB;IACd,IAAI,CAAC,YAAY,EAAE,CAAC;EACtB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Element, Component, Host, h, Prop, Method, Event, EventEmitter, State } from '@stencil/core';\nimport TelInput from \"intl-tel-input\";\nimport { Phone } from './interfaces';\n\n@Component({ tag: 'salla-tel-input', styleUrl: 'salla-tel-input.scss' })\n\nexport class SallaTelInput {\n constructor() {\n salla.lang.onLoaded(() => {\n this.mobileLabel = salla.lang.get('common.elements.mobile');\n this.countryCodeLabel = salla.lang.get('common.elements.country_code');\n this.invalidNumber = salla.lang.get('common.errors.invalid_value', { attribute: this.mobileLabel });\n this.invalidCountryCode = salla.lang.get('common.errors.invalid_value', { attribute: this.countryCodeLabel });\n this.tooShort = salla.lang.get('common.errors.too_short', { attribute: this.mobileLabel });\n this.tooLong = salla.lang.get('common.errors.too_long', { attribute: this.mobileLabel });\n this.mobileRequired = salla.lang.get('common.errors.field_required', { attribute: this.mobileLabel });\n this.errorMap = [this.invalidNumber, this.invalidCountryCode, this.tooShort, this.tooLong, this.invalidNumber];\n });\n }\n\n /**\n * Current mobile number\n */\n @Prop({ mutable: true }) phone: string;\n /**\n * Automatically focus telephone input\n */\n @Prop({ reflect:true }) autofocus: boolean;\n /**\n * input name\n */\n @Prop() name: string = 'phone';\n /**\n * Current country_code\n */\n @Prop({ mutable: true }) countryCode: string = salla.config.get('user.country_code', 'SA') || 'SA';\n\n /**\n * Event emmitted when user enters a phone number.\n */\n @Event() phoneEntered: EventEmitter<Phone>;\n\n\n @Element() host: HTMLElement;\n @State() mobileRequired: string;\n @State() countryCodeLabel: string = salla.lang.get('common.country_code');\n @State() mobileLabel: string = salla.lang.get('common.elements.mobile');\n @State() tooShort: string = salla.lang.get('common.errors.too_short', { attribute: this.mobileLabel });\n @State() tooLong: string = salla.lang.get('common.errors.too_long', { attribute: this.mobileLabel });\n @State() invalidCountryCode: string = salla.lang.get('common.errors.invalid_value', { attribute: this.countryCodeLabel });\n @State() invalidNumber: string = salla.lang.get('common.errors.invalid_value', { attribute: this.mobileLabel });\n @State() errorMap: string[] = [this.invalidNumber, this.invalidCountryCode, this.tooShort, this.tooLong, this.invalidNumber];\n\n private phoneInput: HTMLInputElement;\n private countryCodeInput: HTMLInputElement;\n private errorMsg: any;\n private iti: any;\n\n\n /**\n * Get current values\n * @return {{mobile:number,countryCode:'SA'|string}}\n */\n @Method()\n async getValues() {\n return {\n [this.name]: this.phone = this.phoneInput.value,\n countryCode: this.countryCode = this.countryCodeInput.value,\n countryKey: (this.host.querySelector('.iti__selected-dial-code') as any).innerText\n }\n }\n\n /**\n * Is current data valid or not\n * @return {boolean}\n */\n @Method()\n async isValid() {\n this.reset();\n if (this.iti.isValidNumber()) return true;\n\n if (!this.phoneInput.value.trim()) {\n this.phoneInput.classList.add(\"s-has-error\");\n this.errorMsg.innerText = this.mobileRequired || 'The mobile is required';\n return;\n }\n\n this.phoneInput.classList.add(\"s-has-error\");\n let errorCode = this.iti.getValidationError();\n this.errorMsg.innerText = this.errorMap[errorCode] || '';\n\n salla.logger.info('Phone number (' + this.countryCode + ' - ' + this.phone + ') is not valid, error code ' + errorCode);\n return false;\n }\n\n private initTelInput() {\n salla.helpers.inputDigitsOnly(this.phoneInput);\n this.iti = TelInput(this.phoneInput, {\n initialCountry: this.countryCode || 'sa',\n preferredCountries: ['sa', 'ae', 'kw', 'bh', 'qa', 'iq', 'om', 'ye', 'eg', 'jo', 'ps', 'sd', 'lb', 'dz', 'tn', 'ma', 'ly'],\n excludeCountries: ['sy', 'ir', 'cu', 'kp'],\n formatOnDisplay: false,\n separateDialCode: true,\n autoPlaceholder: 'aggressive',\n utilsScript: 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/18.2.1/js/utils.min.js',\n });\n\n this.autofocus && this.phoneInput.focus()\n\n this.phoneInput.addEventListener(\"countrychange\", () => {\n let data = this.iti.getSelectedCountryData();\n let value = data.iso2.toUpperCase();\n this.countryCodeInput.value = value\n this.countryCode = value;\n this.phoneEntered.emit({ number: this.phone, country_code: value })\n });\n\n // on blur: validate\n // this.phoneInput.addEventListener('blur', () => this.isValid());\n\n // on keyup / change flag: reset\n this.phoneInput.addEventListener('input', (e: Event) => {\n salla.helpers.inputDigitsOnly(e.target);\n this.reset();\n this.phoneEntered.emit({ number: (e.target as HTMLInputElement).value, country_code: this.countryCode })\n });\n\n }\n\n private reset() {\n this.phoneInput.classList.remove(\"s-has-error\");\n this.errorMsg.innerHTML = \"\";\n };\n\n private handleCountryInput(event) {\n if (!!this.phone) {\n this.phoneEntered.emit({ number: event.target.value, country_code: this.countryCode })\n }\n }\n\n\n render() {\n return (\n <Host class=\"s-tel-input\">\n <input type=\"tel\" name={this.name} value={this.phone} onChange={(event) => this.handleCountryInput(event)} ref={el => this.phoneInput = el}\n enterkeyhint=\"next\"\n autocomplete=\"tel\"\n class=\"s-tel-input-control tel-input s-ltr\" />\n <span class=\"s-tel-input-error-msg\" ref={el => this.errorMsg = el}/>\n <input type=\"hidden\" name=\"country_code\" value={this.countryCode} ref={el => this.countryCodeInput = el}\n class=\"country_code\" />\n </Host>\n );\n }\n\n componentDidLoad() {\n this.initTelInput();\n }\n}\n"]}