@salla.sa/twilight-components 2.12.74 → 2.12.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-36ab7ecf.js → app-globals-6f163c1c.js} +2 -2
- package/dist/cjs/app-globals-6f163c1c.js.map +1 -0
- package/dist/cjs/index-40f35e63.js +4 -0
- package/dist/cjs/{interfaces-56469cd9.js → interfaces-c3b1e489.js} +6 -5
- package/dist/cjs/interfaces-c3b1e489.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +82 -0
- package/dist/cjs/salla-app-install-alert.cjs.entry.js.map +1 -0
- package/dist/cjs/salla-filters-widget.cjs.entry.js +4 -4
- package/dist/cjs/salla-filters-widget.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +5 -5
- package/dist/cjs/salla-filters.cjs.entry.js.map +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-app-install-alert/salla-app-install-alert.css +3 -0
- package/dist/collection/components/salla-app-install-alert/salla-app-install-alert.js +89 -0
- package/dist/collection/components/salla-app-install-alert/salla-app-install-alert.js.map +1 -0
- package/dist/collection/components/salla-app-install-alert/test/salla-app-install-alert.e2e.js +13 -0
- package/dist/collection/components/salla-app-install-alert/test/salla-app-install-alert.e2e.js.map +1 -0
- package/dist/collection/components/salla-app-install-alert/test/salla-app-install-alert.spec.js +21 -0
- package/dist/collection/components/salla-app-install-alert/test/salla-app-install-alert.spec.js.map +1 -0
- package/dist/collection/components/salla-filters/interfaces.js +3 -2
- package/dist/collection/components/salla-filters/interfaces.js.map +1 -1
- package/dist/collection/components/salla-filters/salla-filters.js +5 -5
- package/dist/collection/components/salla-filters/salla-filters.js.map +1 -1
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +4 -4
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-app-install-alert.d.ts +11 -0
- package/dist/components/salla-app-install-alert.js +100 -0
- package/dist/components/salla-app-install-alert.js.map +1 -0
- package/dist/components/salla-filters-widget2.js +7 -6
- package/dist/components/salla-filters-widget2.js.map +1 -1
- package/dist/components/salla-filters.js +5 -5
- package/dist/components/salla-filters.js.map +1 -1
- package/dist/esm/{app-globals-3843d7b4.js → app-globals-efc9607d.js} +2 -2
- package/dist/esm/app-globals-efc9607d.js.map +1 -0
- package/dist/esm/index-e6c3f002.js +4 -0
- package/dist/esm/{interfaces-cb9e8802.js → interfaces-3159d022.js} +5 -4
- package/dist/esm/interfaces-3159d022.js.map +1 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/salla-app-install-alert.entry.js +78 -0
- package/dist/esm/salla-app-install-alert.entry.js.map +1 -0
- package/dist/esm/salla-filters-widget.entry.js +4 -4
- package/dist/esm/salla-filters-widget.entry.js.map +1 -1
- package/dist/esm/salla-filters.entry.js +5 -5
- package/dist/esm/salla-filters.entry.js.map +1 -1
- package/dist/esm/twilight.js +2 -2
- package/dist/esm-es5/{app-globals-3843d7b4.js → app-globals-efc9607d.js} +3 -3
- package/dist/esm-es5/app-globals-efc9607d.js.map +1 -0
- package/dist/esm-es5/index-e6c3f002.js +1 -1
- package/dist/esm-es5/index-e6c3f002.js.map +1 -1
- package/dist/esm-es5/{interfaces-cb9e8802.js → interfaces-3159d022.js} +2 -2
- package/dist/esm-es5/interfaces-3159d022.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/salla-app-install-alert.entry.js +5 -0
- package/dist/esm-es5/salla-app-install-alert.entry.js.map +1 -0
- package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
- package/dist/esm-es5/salla-filters-widget.entry.js.map +1 -1
- package/dist/esm-es5/salla-filters.entry.js +1 -1
- package/dist/esm-es5/salla-filters.entry.js.map +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/esm-es5/twilight.js.map +1 -1
- package/dist/twilight/{p-75f5e4ac.system.js → p-14ba306c.system.js} +4 -4
- package/dist/twilight/p-14ba306c.system.js.map +1 -0
- package/dist/twilight/p-2f09d51a.entry.js +5 -0
- package/dist/twilight/p-2f09d51a.entry.js.map +1 -0
- package/dist/twilight/p-30db60a1.system.entry.js +5 -0
- package/dist/twilight/p-30db60a1.system.entry.js.map +1 -0
- package/dist/twilight/p-456195ae.system.js +5 -0
- package/dist/twilight/{p-2059b78a.system.js.map → p-456195ae.system.js.map} +1 -1
- package/dist/twilight/p-6900d691.system.entry.js +5 -0
- package/dist/twilight/p-6900d691.system.entry.js.map +1 -0
- package/dist/twilight/{p-61ac07f6.js → p-6cf5973f.js} +2 -2
- package/dist/twilight/p-6cf5973f.js.map +1 -0
- package/dist/twilight/p-82b08e0b.system.js +5 -0
- package/dist/twilight/p-82b08e0b.system.js.map +1 -0
- package/dist/twilight/p-88169663.entry.js +5 -0
- package/dist/twilight/p-88169663.entry.js.map +1 -0
- package/dist/twilight/p-9f54aa1e.system.entry.js +5 -0
- package/dist/twilight/p-9f54aa1e.system.entry.js.map +1 -0
- package/dist/twilight/p-c2c2f116.entry.js +5 -0
- package/dist/twilight/p-c2c2f116.entry.js.map +1 -0
- package/dist/twilight/{p-66395721.js → p-e6534d30.js} +3 -3
- package/dist/twilight/p-e6534d30.js.map +1 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.esm.js.map +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/dist/types/components/salla-app-install-alert/salla-app-install-alert.d.ts +22 -0
- package/dist/types/components/salla-filters/interfaces.d.ts +11 -11
- package/dist/types/components.d.ts +13 -0
- package/package.json +5 -5
- package/dist/cjs/app-globals-36ab7ecf.js.map +0 -1
- package/dist/cjs/interfaces-56469cd9.js.map +0 -1
- package/dist/esm/app-globals-3843d7b4.js.map +0 -1
- package/dist/esm/interfaces-cb9e8802.js.map +0 -1
- package/dist/esm-es5/app-globals-3843d7b4.js.map +0 -1
- package/dist/esm-es5/interfaces-cb9e8802.js.map +0 -1
- package/dist/twilight/p-2059b78a.system.js +0 -5
- package/dist/twilight/p-4de34318.entry.js +0 -5
- package/dist/twilight/p-4de34318.entry.js.map +0 -1
- package/dist/twilight/p-61ac07f6.js.map +0 -1
- package/dist/twilight/p-65b34312.system.entry.js +0 -5
- package/dist/twilight/p-65b34312.system.entry.js.map +0 -1
- package/dist/twilight/p-66395721.js.map +0 -1
- package/dist/twilight/p-75f5e4ac.system.js.map +0 -1
- package/dist/twilight/p-89c5b834.system.entry.js +0 -5
- package/dist/twilight/p-89c5b834.system.entry.js.map +0 -1
- package/dist/twilight/p-8f18fe08.system.js +0 -5
- package/dist/twilight/p-8f18fe08.system.js.map +0 -1
- package/dist/twilight/p-c868470b.entry.js +0 -5
- package/dist/twilight/p-c868470b.entry.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
var FilterOptionTypes;(function(t){t["VALUES"]="values";t["VARIANTS"]="variants";t["MINIMUM"]="minimum";t["RANGE"]="range"})(FilterOptionTypes||(FilterOptionTypes={}));var FilterOptionInputType;(function(t){t["
|
|
5
|
-
//# sourceMappingURL=interfaces-
|
|
4
|
+
var FilterOptionTypes;(function(t){t["VALUES"]="values";t["VARIANTS"]="variants";t["MINIMUM"]="minimum";t["RANGE"]="range"})(FilterOptionTypes||(FilterOptionTypes={}));var FilterOptionInputType;(function(t){t["VALUES"]="values";t["VARIANT"]="variants";t["RANGE"]="range"})(FilterOptionInputType||(FilterOptionInputType={}));export{FilterOptionTypes as F};
|
|
5
|
+
//# sourceMappingURL=interfaces-3159d022.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FilterOptionTypes","FilterOptionInputType"],"sources":["src/components/salla-filters/interfaces.ts"],"sourcesContent":["export enum FilterOptionTypes {\n // CATEGORIES = \"categories\",\n // BRANDs = \"brands\",\n // RATING = \"rating\",\n // PRICE = \"price\",\n // RADIO = \"radio\",\n VALUES = \"values\",\n VARIANTS = \"variants\",\n MINIMUM = \"minimum\",\n RANGE = \"range\",\n}\n\nexport enum FilterOptionInputType {\n VALUES = \"values\",\n VARIANT = \"variants\",\n RANGE = \"range\",\n}\n\nexport interface FilterValue {\n key?: string,\n count?: number,\n value?: string,\n from?: number| \"*\",\n to?: number | \"*\"\n}\n\n\nexport interface Filter {\n key?: string;\n label?: string;\n type?: FilterOptionTypes;\n values?: FilterValue[];\n max?: number;\n min?: number;\n}\n"],"mappings":";;;IAAYA,mBAAZ,SAAYA,GAMVA,EAAA,mBACAA,EAAA,uBACAA,EAAA,qBACAA,EAAA,gBACD,EAVD,CAAYA,sCAAiB,KAY7B,IAAYC,uBAAZ,SAAYA,GACVA,EAAA,mBACAA,EAAA,sBACAA,EAAA,gBACD,EAJD,CAAYA,8CAAqB,Y"}
|
package/dist/esm-es5/loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{b as bootstrapLazy}from"./index-e6c3f002.js";export{s as setNonce}from"./index-e6c3f002.js";import{g as globalScripts}from"./app-globals-3843d7b4.js";import"./_commonjsHelpers-1415ffd3.js";var defineCustomElements=function(e,a){if(typeof window==="undefined")return undefined;globalScripts();return bootstrapLazy(JSON.parse('[["salla-products-slider",[[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",[[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",[[0,"salla-filters",{"filters":[1040],"isSidebarOpen":[32],"filtersData":[32],"apply":[32],"reset":[32],"getFilters":[64],"applyFilters":[64],"resetFilters":[64]}]]],["salla-notifications",[[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-advertisement",[[0,"salla-advertisement",{"position":[32],"advertisements":[32],"advertIcon":[32],"currentSlug":[32]}]]],["salla-apps-icons",[[0,"salla-apps-icons",{"hideTitle":[4,"hide-title"],"appsTitle":[1,"apps-title"],"vertical":[4],"apps":[32]}]]],["salla-contacts",[[0,"salla-contacts",{"contactsTitle":[1,"contacts-title"],"hideTitle":[4,"hide-title"],"isHeader":[4,"is-header"],"horizontal":[4],"iconsOnly":[4,"icons-only"],"contacts":[32],"iconsList":[32]}]]],["salla-installment",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-loyalty-prize-item",[[0,"salla-loyalty-prize-item",{"item":[16]}]]],["salla-payments",[[0,"salla-payments",{"withSbc":[4,"with-sbc"],"sbcId":[1,"sbc-id"],"withMadeInKsa":[4,"with-made-in-ksa"],"payments":[32],"placeholderImage":[32]}]]],["salla-products-list",[[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],"isReady":[32],"showPlaceholder":[32],"parsedFilters":[32],"setFilters":[64],"reload":[64]}]]],["salla-social",[[0,"salla-social",{"links":[32],"iconsList":[32]}]]],["salla-conditional-fields",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-notification-item",[[0,"salla-notification-item",{"notification":[16]}]]],["salla-price-range",[[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",[[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]}],[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-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-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-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]}],[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-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-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]}]]],["salla-filters-widget",[[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]}]]]]'),a)};export{defineCustomElements};
|
|
4
|
+
import{b as bootstrapLazy}from"./index-e6c3f002.js";export{s as setNonce}from"./index-e6c3f002.js";import{g as globalScripts}from"./app-globals-efc9607d.js";import"./_commonjsHelpers-1415ffd3.js";var defineCustomElements=function(e,a){if(typeof window==="undefined")return undefined;globalScripts();return bootstrapLazy(JSON.parse('[["salla-products-slider",[[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",[[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",[[0,"salla-filters",{"filters":[1040],"isSidebarOpen":[32],"filtersData":[32],"apply":[32],"reset":[32],"getFilters":[64],"applyFilters":[64],"resetFilters":[64]}]]],["salla-notifications",[[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-advertisement",[[0,"salla-advertisement",{"position":[32],"advertisements":[32],"advertIcon":[32],"currentSlug":[32]}]]],["salla-app-install-alert",[[0,"salla-app-install-alert",{"data":[32],"ctaLink":[32],"open":[32],"closing":[32]}]]],["salla-apps-icons",[[0,"salla-apps-icons",{"hideTitle":[4,"hide-title"],"appsTitle":[1,"apps-title"],"vertical":[4],"apps":[32]}]]],["salla-contacts",[[0,"salla-contacts",{"contactsTitle":[1,"contacts-title"],"hideTitle":[4,"hide-title"],"isHeader":[4,"is-header"],"horizontal":[4],"iconsOnly":[4,"icons-only"],"contacts":[32],"iconsList":[32]}]]],["salla-installment",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-loyalty-prize-item",[[0,"salla-loyalty-prize-item",{"item":[16]}]]],["salla-payments",[[0,"salla-payments",{"withSbc":[4,"with-sbc"],"sbcId":[1,"sbc-id"],"withMadeInKsa":[4,"with-made-in-ksa"],"payments":[32],"placeholderImage":[32]}]]],["salla-products-list",[[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],"isReady":[32],"showPlaceholder":[32],"parsedFilters":[32],"setFilters":[64],"reload":[64]}]]],["salla-social",[[0,"salla-social",{"links":[32],"iconsList":[32]}]]],["salla-price-range",[[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-filters-widget",[[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",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-notification-item",[[0,"salla-notification-item",{"notification":[16]}]]],["salla-add-product-button_47",[[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]}],[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-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-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-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]}],[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-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-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]}]]]]'),a)};export{defineCustomElements};
|
|
5
5
|
//# sourceMappingURL=loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["defineCustomElements","win","options","window","undefined","globalScripts","bootstrapLazy","JSON","parse"],"sources":["@lazy-external-entrypoint?app-data=conditional"],"sourcesContent":["export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\nexport const defineCustomElements = (win, options) => {\n if (typeof window === 'undefined') return undefined;\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n};\n"],"mappings":";;;oMAGY,IAACA,qBAAuB,SAACC,EAAKC,GACxC,UAAWC,SAAW,YAAa,OAAOC,UAC1CC,gBACA,OAAOC,cAAcC,KAAAC,MAAA
|
|
1
|
+
{"version":3,"names":["defineCustomElements","win","options","window","undefined","globalScripts","bootstrapLazy","JSON","parse"],"sources":["@lazy-external-entrypoint?app-data=conditional"],"sourcesContent":["export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\nexport const defineCustomElements = (win, options) => {\n if (typeof window === 'undefined') return undefined;\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n};\n"],"mappings":";;;oMAGY,IAACA,qBAAuB,SAACC,EAAKC,GACxC,UAAWC,SAAW,YAAa,OAAOC,UAC1CC,gBACA,OAAOC,cAAcC,KAAAC,MAAA,m7mBAAuCN,EAC9D,S"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-e6c3f002.js";var sallaAppInstallAlertCss=":host{display:block}";var SallaAppInstallAlert=function(){function t(t){registerInstance(this,t);this.data=salla.config.get("store.app_install_prompt");this.ctaLink=undefined;this.open=false;this.closing=false}t.prototype.connectedCallback=function(){var t=this;salla.onReady((function(){t.data=salla.config.get("store.app_install_prompt");if(!t.isMobileOrTabletDevice()){return}t.ctaLink=salla.config.get("store.apps")[t.getMobileOS()==="iOS"?"appstore":"googleplay"];setTimeout((function(){return t.open=true}),3e3)}))};t.prototype.getMobileOS=function(){var t=navigator.userAgent;if(/android/i.test(t)){return"Android"}else if(/iPad|iPhone|iPod/.test(t)||/Macintosh/i.test(navigator.userAgent)&&"ontouchend"in document){return"iOS"}return"Other"};t.prototype.isMobileOrTabletDevice=function(t){if(t===void 0){t=1024}var a=window.innerWidth<=t;var e=/Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);var n="ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0;return e&&a&&n};t.prototype.closeAlert=function(){var t=this;salla.storage.set("app_install_prompt_disabled",true);if(this.data.position==="top"){this.open=false}else{this.closing=true;this.host.addEventListener("animationend",(function(){t.closing=false;t.open=false}),{once:true})}};t.prototype.render=function(){var t=this;return h(Host,{class:"s-app-install-alert-wrapper ".concat(this.open?"open":""," ").concat(this.closing?"closing":""),position:this.data.position},h("div",null,h("img",{src:this.data.icon,width:"58",height:"58",alt:"".concat(salla.config.get("store.name"))})),h("div",null,h("h2",{class:"s-app-install-alert-title"},this.data.title),h("p",{class:"s-app-install-alert-sub-title"},this.data.sub_title,h("a",{href:this.ctaLink,target:"_blank","aria-label":"download app",class:"s-app-install-alert-cta"},salla.lang.getWithDefault("blocks.footer.download_app_now","حمله الآن")))),h("button",{class:"s-app-install-alert-cancel-button",onClick:function(){return t.closeAlert()}},h("i",{class:"sicon-cancel"})))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaAppInstallAlert.style=sallaAppInstallAlertCss;export{SallaAppInstallAlert as salla_app_install_alert};
|
|
5
|
+
//# sourceMappingURL=salla-app-install-alert.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["sallaAppInstallAlertCss","SallaAppInstallAlert","salla","config","get","prototype","connectedCallback","_this","this","onReady","data","isMobileOrTabletDevice","ctaLink","getMobileOS","setTimeout","open","ua","navigator","userAgent","test","document","screen","screenWidth","window","innerWidth","userAgentCheck","hasTouch","maxTouchPoints","closeAlert","storage","set","position","closing","host","addEventListener","once","render","h","Host","class","concat","src","icon","width","height","alt","title","sub_title","href","target","lang","getWithDefault","onClick"],"sources":["src/components/salla-app-install-alert/salla-app-install-alert.scss?tag=salla-app-install-alert","src/components/salla-app-install-alert/salla-app-install-alert.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, h, State, Element, Host } from '@stencil/core';\n\n@Component({\n tag: 'salla-app-install-alert',\n styleUrl: 'salla-app-install-alert.scss',\n})\nexport class SallaAppInstallAlert {\n connectedCallback() {\n salla.onReady(() => {\n this.data = salla.config.get('store.app_install_prompt');\n if (!this.isMobileOrTabletDevice()) {\n return;\n }\n\n this.ctaLink = salla.config.get('store.apps')[this.getMobileOS() === 'iOS' ? 'appstore' : 'googleplay'];\n setTimeout(() => (this.open = true), 3000);\n });\n }\n @State() data: any = salla.config.get('store.app_install_prompt');\n @State() ctaLink: string;\n @State() open: boolean = false;\n @State() closing: boolean = false;\n @Element() private host: HTMLElement;\n\n\n\n /**\n * Get the OS of device (android/ios).\n * @returns {string} returns iOS/Android/Other\n */\n private getMobileOS(): string {\n const ua = navigator.userAgent;\n if (/android/i.test(ua)) {\n return 'Android';\n } else if (\n /iPad|iPhone|iPod/.test(ua) ||\n (/Macintosh/i.test(navigator.userAgent) && 'ontouchend' in document)\n ) {\n return 'iOS';\n }\n return 'Other';\n }\n\n /**\n * Check if the website opens from mobile or tablet devices only (android/ios).\n *\n * @param {number} screen the width of the biggest screen to be checked\n * @returns {boolean} true if it is mobile or tablet else false\n */\n private isMobileOrTabletDevice(screen = 1024): boolean {\n const screenWidth = window.innerWidth <= screen;\n const userAgentCheck = /Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);\n const hasTouch =\n 'ontouchstart' in window ||\n 'ontouchend' in document ||\n navigator.maxTouchPoints > 0;\n\n return userAgentCheck && screenWidth && hasTouch;\n }\n\n closeAlert() {\n salla.storage.set('app_install_prompt_disabled', true);\n if (this.data.position === 'top') {\n this.open = false;\n } else {\n // handle closing animation first, then close the banner\n this.closing = true;\n this.host.addEventListener(\n 'animationend',\n () => {\n this.closing = false\n this.open = false;\n },\n { once: true }\n );\n }\n }\n\n\n render() {\n return (\n <Host class={`s-app-install-alert-wrapper ${this.open ? 'open' : ''} ${this.closing ? 'closing' : ''}`} position={this.data.position}>\n <div>\n <img src={this.data.icon} width=\"58\" height=\"58\" alt={`${salla.config.get('store.name')}`} />\n </div>\n <div>\n <h2 class=\"s-app-install-alert-title\">{this.data.title}</h2>\n <p class=\"s-app-install-alert-sub-title\">\n {this.data.sub_title}\n <a href={this.ctaLink} target=\"_blank\" aria-label=\"download app\" class=\"s-app-install-alert-cta\">\n {salla.lang.getWithDefault('blocks.footer.download_app_now', 'حمله الآن')}\n </a>\n </p>\n </div>\n <button class=\"s-app-install-alert-cancel-button\" onClick={() => this.closeAlert()}>\n <i class=\"sicon-cancel\"></i>\n </button>\n </Host>\n );\n }\n}\n"],"mappings":";;;mFAAA,IAAMA,wBAA0B,uB,ICMnBC,qBAAoB,W,iDAYVC,MAAMC,OAAOC,IAAI,4B,iCAEb,M,aACG,K,CAd5BH,EAAAI,UAAAC,kBAAA,eAAAC,EAAAC,KACEN,MAAMO,SAAQ,WACZF,EAAKG,KAAOR,MAAMC,OAAOC,IAAI,4BAC7B,IAAKG,EAAKI,yBAA0B,CAClC,M,CAGFJ,EAAKK,QAAUV,MAAMC,OAAOC,IAAI,cAAcG,EAAKM,gBAAkB,MAAQ,WAAa,cAC1FC,YAAW,kBAAOP,EAAKQ,KAAO,IAAnB,GAA0B,I,KAejCd,EAAAI,UAAAQ,YAAA,WACN,IAAMG,EAAKC,UAAUC,UACrB,GAAI,WAAWC,KAAKH,GAAK,CACvB,MAAO,S,MACF,GACL,mBAAmBG,KAAKH,IACvB,aAAaG,KAAKF,UAAUC,YAAc,eAAgBE,SAC3D,CACA,MAAO,K,CAET,MAAO,O,EASDnB,EAAAI,UAAAM,uBAAA,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__awaiter||function(t,e,i,n){function s(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function o(t){try{l(n.next(t))}catch(t){r(t)}}function a(t){try{l(n["throw"](t))}catch(t){r(t)}}function l(t){t.done?i(t.value):s(t.value).then(o,a)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(e){return l([t,e])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;s=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];s=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-e6c3f002.js";import{H as Helper}from"./Helper-a7076e76.js";import{
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-e6c3f002.js";import{H as Helper}from"./Helper-a7076e76.js";import{F as FilterOptionTypes}from"./interfaces-3159d022.js";var sallaFiltersWidgetCss=":host{display:block}";var SallaFiltersWidget=function(){function t(t){registerInstance(this,t);this.changed=createEvent(this,"changed",7);this.initHeight=195;this.withLoadMore=undefined;this.filtersData=undefined;this.option=undefined;this.isOpen=true;this.isShowMore=false;this.showMoreLabel="عرض المزيد";this.showLessLabel="عرض أقل";this.page=salla.config.get("page")}t.prototype.connectedCallback=function(){var t=this;this.withLoadMore=this.option.key!="price"&&Array.isArray(this.option.values)&&this.option.values.length>8;salla.onReady((function(){t.page=salla.config.get("page")}));salla.lang.onLoaded((function(){t.showMoreLabel=salla.lang.getWithDefault("common.titles.more",t.showMoreLabel);t.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",t.showLessLabel)}))};t.prototype.componentDidLoad=function(){this.widgetValues.scrollHeight<this.initHeight&&(this.withLoadMore=false);this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight="".concat(this.initHeight,"px"));this.widgetContent.style.height="".concat(this.widgetContent.scrollHeight,"px")};t.prototype.setWidgetHeight=function(t){if(t===void 0){t=250}return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){this.widgetContent.removeAttribute("style");setTimeout((function(){var t=e.widgetContent.offsetHeight;e.widgetContent.style.height=t+"px"}),t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.option.type===FilterOptionTypes.RANGE){this.priceRange.reset()}Array.from(this.host.querySelectorAll("input")).forEach((function(t){return t.checked=false}));return[2]}))}))};t.prototype.showMore=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.isShowMore=!this.isShowMore;this.widgetContent.style.height="auto";this.widgetValues.style.maxHeight=this.isShowMore?"".concat(this.widgetValues.scrollHeight,"px"):"".concat(this.initHeight,"px");setTimeout((function(){t.widgetContent.style.height="".concat(t.widgetContent.scrollHeight,"px")}),400);return[2]}))}))};t.prototype.toggleWidget=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.isOpen=!this.isOpen;Helper.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(function(){return t.isOpen}));return[2]}))}))};t.prototype.renderFilterOption=function(t){var e=this;if(![FilterOptionTypes.VALUES,FilterOptionTypes.VARIANTS].includes(t.type)){return""}var i=[];var n=[];t.values.forEach((function(s,r){var o=typeof s=="number"?s:s.key||s.value;var a=e.page.slug=="product.index"&&Number(s.key)==e.page.id;var l=h("label",{class:"s-filters-label",htmlFor:"".concat(t.key,"-option-").concat(r),style:{opacity:a?"0.6":"1"}},h("input",{id:"".concat(t.key,"-option-").concat(r),name:a?"current-category":t.key,type:a?"checkbox":"radio",checked:a||e.isSelectedOption(t,o),disabled:a,class:"s-filters-".concat(a?"checkbox":t.type),onChange:function(i){return!a?e.changed.emit({event:i,option:t,value:o}):null}}),e.getOptionLabel(t,s));if(a){i.unshift(l)}else{n.push(l)}}));return i.concat(n)};t.prototype.isSelectedOption=function(t,e){if(!this.filtersData||!this.filtersData[t.key]){return false}return t.type===FilterOptionTypes.VALUES?this.filtersData[t.key].includes(e):this.filtersData[t.key]==e};t.prototype.getOptionLabel=function(t,e){if(t.key=="rating"){return h("salla-rating-stars",{size:"small",value:e})}var i=e.value||"null";return h("span",{class:"s-filters-option-name"},i)};t.prototype.render=function(){var t=this;return h(Host,{class:"s-filters-widget-container"},h("h3",{class:"s-filters-widget-title",onClick:function(){return t.toggleWidget()}},h("span",null,this.option.label),h("span",{class:"s-filters-widget-plusminus ".concat(this.isOpen?"s-filters-widget-plusminus-active":"")})),h("div",{class:"s-filters-widget-content",ref:function(e){return t.widgetContent=e}},h("div",{class:"s-filters-widget-values",ref:function(e){return t.widgetValues=e}},h("slot",null),this.option.type!==FilterOptionTypes.RANGE?this.renderFilterOption(this.option):h("salla-price-range",{onChanged:function(e){return t.changed.emit(e.detail)},ref:function(e){return t.priceRange=e},filtersData:this.filtersData,option:this.option})),this.withLoadMore&&h("a",{class:"s-filters-widget-more",onClick:function(){return t.showMore()}},!this.isShowMore?this.showMoreLabel:this.showLessLabel)))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaFiltersWidget.style=sallaFiltersWidgetCss;export{SallaFiltersWidget as salla_filters_widget};
|
|
5
5
|
//# sourceMappingURL=salla-filters-widget.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sallaFiltersWidgetCss","SallaFiltersWidget","this","initHeight","salla","config","get","class_1","prototype","connectedCallback","_this","withLoadMore","option","key","Array","isArray","values","length","onReady","page","lang","onLoaded","showMoreLabel","getWithDefault","showLessLabel","componentDidLoad","widgetValues","scrollHeight","style","maxHeight","concat","widgetContent","height","setWidgetHeight","delay","removeAttribute","setTimeout","currentWidgetHeight","offsetHeight","reset","type","FilterOptionTypes","RANGE","priceRange","from","host","querySelectorAll","forEach","input","checked","showMore","isShowMore","toggleWidget","isOpen","Helper","toggleElementClassIf","renderFilterOption","VALUES","MINIMUM","VARIANTS","includes","disabledAndSelectedOption","otherOptions","filterOption","index","value","isDisabledAndSelected","slug","Number","id","label","h","class","htmlFor","opacity","name","inputType","isSelectedOption","disabled","onChange","e","changed","emit","event","getOptionLabel","unshift","push","filtersData","FilterOptionInputType","CHECKBOX","size","render","Host","onClick","ref","el","onChanged","detail","price"],"sources":["src/components/salla-filters-widget/salla-filters-widget.scss?tag=salla-filters-widget","src/components/salla-filters-widget/salla-filters-widget.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, h, Method, State, Prop, Event, Element } from '@stencil/core';\nimport Helper from '../../Helpers/Helper';\nimport { Filter, FilterOptionInputType, FilterOptionTypes } from \"../salla-filters/interfaces\";\n\n@Component({\n tag: 'salla-filters-widget',\n styleUrl: 'salla-filters-widget.scss',\n})\nexport class SallaFiltersWidget {\n @Element() host: HTMLElement;\n\n /**\n * Show more or less filter options.\n */\n @Prop({ mutable: true }) withLoadMore: boolean;\n\n /**\n * Selected filter options value.\n */\n @Prop({ reflect: true }) filtersData: object;\n\n /**\n * Filter option along with possible values.\n */\n @Prop({ reflect: true }) option: Filter;\n\n\n priceRange: HTMLSallaPriceRangeElement\n\n\n private widgetValues: HTMLElement;\n private widgetContent: HTMLDivElement;\n private initHeight: number = 195;\n\n @State() isOpen: boolean = true;\n @State() isShowMore: boolean = false;\n @State() showMoreLabel: string = \"عرض المزيد\";\n @State() showLessLabel: string = \"عرض أقل\";\n @State() page: any = salla.config.get('page');\n\n /**\n * Custom event emitted up on filter option selection changes.\n */\n @Event() changed: any;\n\n connectedCallback() {\n //lets be smart and don't show 5 and more link for 8 options\n this.withLoadMore = this.option.key != 'price' && Array.isArray(this.option.values) && this.option.values.length > 8;\n salla.onReady(() => {\n this.page = salla.config.get('page');\n })\n salla.lang.onLoaded(() => {\n this.showMoreLabel = salla.lang.getWithDefault('common.titles.more', this.showMoreLabel)\n this.showLessLabel = salla.lang.getWithDefault('common.elements.show_less', this.showLessLabel)\n })\n }\n\n componentDidLoad() {\n this.widgetValues.scrollHeight < this.initHeight && (this.withLoadMore = false);\n (this.withLoadMore && this.widgetValues) && (this.widgetValues.style.maxHeight = `${this.initHeight}px`);\n this.widgetContent.style.height = `${this.widgetContent.scrollHeight}px`;\n }\n\n @Method()\n async setWidgetHeight(delay = 250) {\n this.widgetContent.removeAttribute('style');\n setTimeout(() => {\n let currentWidgetHeight: number = this.widgetContent.offsetHeight;\n this.widgetContent.style.height = currentWidgetHeight + 'px';\n }, delay)\n }\n\n /**\n * Reset selected filter options.\n */\n @Method()\n async reset() {\n if (this.option.type === FilterOptionTypes.RANGE) {\n this.priceRange.reset()\n }\n Array.from(this.host.querySelectorAll('input')).forEach(input => input.checked = false);\n }\n\n\n /**\n * Action to show more or less filter options.\n */\n @Method()\n async showMore() {\n this.isShowMore = !this.isShowMore\n this.widgetContent.style.height = 'auto';\n this.widgetValues.style.maxHeight = this.isShowMore ? `${this.widgetValues.scrollHeight}px` : `${this.initHeight}px`;\n setTimeout(() => {\n this.widgetContent.style.height = `${this.widgetContent.scrollHeight}px`;\n }, 400); // get height after time of collapse animtion (duration-300)\n }\n\n /**\n * Action to toggle widget open or closed (expand/ collapse).\n */\n @Method()\n async toggleWidget() {\n this.isOpen = !this.isOpen;\n Helper.toggleElementClassIf(this.widgetContent, 's-filters-widget-opened', 's-filters-widget-closed', () => this.isOpen);\n }\n\n renderFilterOption(option: Filter) {\n if (![FilterOptionTypes.VALUES, FilterOptionTypes.MINIMUM, FilterOptionTypes.VARIANTS].includes(option.type)) {\n return '';\n }\n \n const disabledAndSelectedOption = [];\n const otherOptions = [];\n \n option.values.forEach((filterOption, index) => {\n let value = typeof filterOption == 'number' ? filterOption : (filterOption.key || filterOption.value);\n \n const isDisabledAndSelected = this.page.slug == 'product.index' && Number(filterOption.key) == this.page.id;\n \n const label = (\n <label class=\"s-filters-label\" htmlFor={`${option.key}-option-${index}`} style={{\"opacity\" : isDisabledAndSelected ? \"0.6\" : \"1\"}}>\n <input\n id={`${option.key}-option-${index}`}\n name={isDisabledAndSelected ? \"current-category\" : option.key}\n type={isDisabledAndSelected ? \"checkbox\" : option.inputType}\n checked={isDisabledAndSelected || this.isSelectedOption(option, value)}\n disabled={isDisabledAndSelected}\n class={`s-filters-${isDisabledAndSelected ? \"checkbox\" : option.inputType}`}\n onChange={e => !isDisabledAndSelected ? this.changed.emit({ event: e, option: option, value: value }) : null}\n />\n {this.getOptionLabel(option, filterOption)}\n </label>\n );\n \n if (isDisabledAndSelected) {\n disabledAndSelectedOption.unshift(label); // Add to the beginning of the disabledAndSelectedOption array\n } else {\n otherOptions.push(label); // Add to the end of the otherOptions array\n }\n });\n \n return disabledAndSelectedOption.concat(otherOptions);\n }\n \n \n \n\n private isSelectedOption(option: Filter, value) {\n\n \n if (!this.filtersData || !this.filtersData[option.key]) {\n return false\n }\n\n return option.inputType === FilterOptionInputType.CHECKBOX\n ? this.filtersData[option.key].includes(value)\n : this.filtersData[option.key] == value;\n }\n\n private getOptionLabel(option: Filter, filterOption) {\n if (option.key == 'rating') {\n //in amazon has stars & up, should we add it, to avoid those people who will come to say I selected 4 why I see 5 sars products\n return <salla-rating-stars size=\"small\" value={filterOption} />;\n }\n let label = filterOption.value || 'null';\n //label+=filterOption.count ? ` (${salla.helpers.number(filterOption.count)})` : '';\n return <span class=\"s-filters-option-name\">{label}</span>;\n }\n\n render() {\n return (\n <Host class=\"s-filters-widget-container\">\n <h3 class=\"s-filters-widget-title\" onClick={() => this.toggleWidget()}>\n <span>{this.option.label}</span>\n <span class={`s-filters-widget-plusminus ${this.isOpen ? 's-filters-widget-plusminus-active' : ''}`} />\n </h3>\n <div class=\"s-filters-widget-content\" ref={(el) => this.widgetContent = el}>\n <div class=\"s-filters-widget-values\" ref={(el) => this.widgetValues = el}>\n <slot />\n {\n this.option.type !== FilterOptionTypes.RANGE\n ? this.renderFilterOption(this.option)\n : <salla-price-range onChanged={(event) => this.changed.emit(event.detail)}\n ref={price => this.priceRange = price}\n filtersData={this.filtersData}\n option={this.option} />\n }\n </div>\n {this.withLoadMore &&\n <a class=\"s-filters-widget-more\"\n onClick={() => this.showMore()}>{!this.isShowMore ? this.showMoreLabel : this.showLessLabel}</a>\n }\n </div>\n </Host>\n );\n }\n\n}\n"],"mappings":";;;6OAAA,IAAMA,sBAAwB,uB,ICQjBC,mBAAkB,W,kFAwBrBC,KAAAC,WAAqB,I,yFAEF,K,gBACI,M,mBACE,a,mBACA,U,UACZC,MAAMC,OAAOC,IAAI,O,CAOtCC,EAAAC,UAAAC,kBAAA,eAAAC,EAAAR,KAEEA,KAAKS,aAAeT,KAAKU,OAAOC,KAAO,SAAWC,MAAMC,QAAQb,KAAKU,OAAOI,SAAWd,KAAKU,OAAOI,OAAOC,OAAS,EACnHb,MAAMc,SAAQ,WACZR,EAAKS,KAAOf,MAAMC,OAAOC,IAAI,O,IAE/BF,MAAMgB,KAAKC,UAAS,WAClBX,EAAKY,cAAgBlB,MAA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AmBhD,KAAKiD,WAAajD,KAAKoB,cAAgBpB,KAAKsB,gB,kIAtL7D,G"}
|
|
1
|
+
{"version":3,"names":["sallaFiltersWidgetCss","SallaFiltersWidget","this","initHeight","salla","config","get","class_1","prototype","connectedCallback","_this","withLoadMore","option","key","Array","isArray","values","length","onReady","page","lang","onLoaded","showMoreLabel","getWithDefault","showLessLabel","componentDidLoad","widgetValues","scrollHeight","style","maxHeight","concat","widgetContent","height","setWidgetHeight","delay","removeAttribute","setTimeout","currentWidgetHeight","offsetHeight","reset","type","FilterOptionTypes","RANGE","priceRange","from","host","querySelectorAll","forEach","input","checked","showMore","isShowMore","toggleWidget","isOpen","Helper","toggleElementClassIf","renderFilterOption","VALUES","VARIANTS","includes","disabledAndSelectedOption","otherOptions","filterOption","index","value","isDisabledAndSelected","slug","Number","id","label","h","class","htmlFor","opacity","name","isSelectedOption","disabled","onChange","e","changed","emit","event","getOptionLabel","unshift","push","filtersData","size","render","Host","onClick","ref","el","onChanged","detail","price"],"sources":["src/components/salla-filters-widget/salla-filters-widget.scss?tag=salla-filters-widget","src/components/salla-filters-widget/salla-filters-widget.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, h, Method, State, Prop, Event, Element } from '@stencil/core';\nimport Helper from '../../Helpers/Helper';\nimport { Filter, FilterOptionTypes } from \"../salla-filters/interfaces\";\n\n@Component({\n tag: 'salla-filters-widget',\n styleUrl: 'salla-filters-widget.scss',\n})\nexport class SallaFiltersWidget {\n @Element() host: HTMLElement;\n\n /**\n * Show more or less filter options.\n */\n @Prop({ mutable: true }) withLoadMore: boolean;\n\n /**\n * Selected filter options value.\n */\n @Prop({ reflect: true }) filtersData: object;\n\n /**\n * Filter option along with possible values.\n */\n @Prop({ reflect: true }) option: Filter;\n\n\n priceRange: HTMLSallaPriceRangeElement\n\n\n private widgetValues: HTMLElement;\n private widgetContent: HTMLDivElement;\n private initHeight: number = 195;\n\n @State() isOpen: boolean = true;\n @State() isShowMore: boolean = false;\n @State() showMoreLabel: string = \"عرض المزيد\";\n @State() showLessLabel: string = \"عرض أقل\";\n @State() page: any = salla.config.get('page');\n\n /**\n * Custom event emitted up on filter option selection changes.\n */\n @Event() changed: any;\n\n connectedCallback() {\n //lets be smart and don't show 5 and more link for 8 options\n this.withLoadMore = this.option.key != 'price' && Array.isArray(this.option.values) && this.option.values.length > 8;\n salla.onReady(() => {\n this.page = salla.config.get('page');\n })\n salla.lang.onLoaded(() => {\n this.showMoreLabel = salla.lang.getWithDefault('common.titles.more', this.showMoreLabel)\n this.showLessLabel = salla.lang.getWithDefault('common.elements.show_less', this.showLessLabel)\n })\n }\n\n componentDidLoad() {\n this.widgetValues.scrollHeight < this.initHeight && (this.withLoadMore = false);\n (this.withLoadMore && this.widgetValues) && (this.widgetValues.style.maxHeight = `${this.initHeight}px`);\n this.widgetContent.style.height = `${this.widgetContent.scrollHeight}px`;\n }\n\n @Method()\n async setWidgetHeight(delay = 250) {\n this.widgetContent.removeAttribute('style');\n setTimeout(() => {\n let currentWidgetHeight: number = this.widgetContent.offsetHeight;\n this.widgetContent.style.height = currentWidgetHeight + 'px';\n }, delay)\n }\n\n /**\n * Reset selected filter options.\n */\n @Method()\n async reset() {\n if (this.option.type === FilterOptionTypes.RANGE) {\n this.priceRange.reset()\n }\n Array.from(this.host.querySelectorAll('input')).forEach(input => input.checked = false);\n }\n\n\n /**\n * Action to show more or less filter options.\n */\n @Method()\n async showMore() {\n this.isShowMore = !this.isShowMore\n this.widgetContent.style.height = 'auto';\n this.widgetValues.style.maxHeight = this.isShowMore ? `${this.widgetValues.scrollHeight}px` : `${this.initHeight}px`;\n setTimeout(() => {\n this.widgetContent.style.height = `${this.widgetContent.scrollHeight}px`;\n }, 400); // get height after time of collapse animtion (duration-300)\n }\n\n /**\n * Action to toggle widget open or closed (expand/ collapse).\n */\n @Method()\n async toggleWidget() {\n this.isOpen = !this.isOpen;\n Helper.toggleElementClassIf(this.widgetContent, 's-filters-widget-opened', 's-filters-widget-closed', () => this.isOpen);\n }\n\n renderFilterOption(option: Filter) {\n if (![FilterOptionTypes.VALUES, FilterOptionTypes.VARIANTS].includes(option.type)) {\n return '';\n }\n \n const disabledAndSelectedOption = [];\n const otherOptions = [];\n \n option.values.forEach((filterOption, index) => {\n let value = typeof filterOption == 'number' ? filterOption : (filterOption.key || filterOption.value);\n \n const isDisabledAndSelected = this.page.slug == 'product.index' && Number(filterOption.key) == this.page.id;\n \n const label = (\n <label class=\"s-filters-label\" htmlFor={`${option.key}-option-${index}`} style={{\"opacity\" : isDisabledAndSelected ? \"0.6\" : \"1\"}}>\n <input\n id={`${option.key}-option-${index}`}\n name={isDisabledAndSelected ? \"current-category\" : option.key}\n type={isDisabledAndSelected ? \"checkbox\" : 'radio'}\n checked={isDisabledAndSelected || this.isSelectedOption(option, value)}\n disabled={isDisabledAndSelected}\n class={`s-filters-${isDisabledAndSelected ? \"checkbox\" : option.type}`}\n onChange={e => !isDisabledAndSelected ? this.changed.emit({ event: e, option: option, value: value }) : null}\n />\n {this.getOptionLabel(option, filterOption)}\n </label>\n );\n \n if (isDisabledAndSelected) {\n disabledAndSelectedOption.unshift(label); // Add to the beginning of the disabledAndSelectedOption array\n } else {\n otherOptions.push(label); // Add to the end of the otherOptions array\n }\n });\n \n return disabledAndSelectedOption.concat(otherOptions);\n }\n \n \n \n\n private isSelectedOption(option: Filter, value) {\n\n \n if (!this.filtersData || !this.filtersData[option.key]) {\n return false\n }\n\n return option.type === FilterOptionTypes.VALUES\n ? this.filtersData[option.key].includes(value)\n : this.filtersData[option.key] == value;\n }\n\n private getOptionLabel(option: Filter, filterOption) {\n if (option.key == 'rating') {\n //in amazon has stars & up, should we add it, to avoid those people who will come to say I selected 4 why I see 5 sars products\n return <salla-rating-stars size=\"small\" value={filterOption} />;\n }\n let label = filterOption.value || 'null';\n //label+=filterOption.count ? ` (${salla.helpers.number(filterOption.count)})` : '';\n return <span class=\"s-filters-option-name\">{label}</span>;\n }\n\n render() {\n return (\n <Host class=\"s-filters-widget-container\">\n <h3 class=\"s-filters-widget-title\" onClick={() => this.toggleWidget()}>\n <span>{this.option.label}</span>\n <span class={`s-filters-widget-plusminus ${this.isOpen ? 's-filters-widget-plusminus-active' : ''}`} />\n </h3>\n <div class=\"s-filters-widget-content\" ref={(el) => this.widgetContent = el}>\n <div class=\"s-filters-widget-values\" ref={(el) => this.widgetValues = el}>\n <slot />\n {\n this.option.type !== FilterOptionTypes.RANGE\n ? this.renderFilterOption(this.option)\n : <salla-price-range onChanged={(event) => this.changed.emit(event.detail)}\n ref={price => this.priceRange = price}\n filtersData={this.filtersData}\n option={this.option} />\n }\n </div>\n {this.withLoadMore &&\n <a class=\"s-filters-widget-more\"\n onClick={() => this.showMore()}>{!this.isShowMore ? this.showMoreLabel : this.showLessLabel}</a>\n }\n </div>\n </Host>\n );\n }\n\n}\n"],"mappings":";;;kNAAA,IAAMA,sBAAwB,uB,ICQjBC,mBAAkB,W,kFAwBrBC,KAAAC,WAAqB,I,yFAEF,K,gBACI,M,mBACE,a,mBACA,U,UACZC,MAAMC,OAAOC,IAAI,O,CAOtCC,EAAAC,UAAAC,kBAAA,eAAAC,EAAAR,KAEEA,KAAKS,aAAeT,KAAKU,OAAOC,KAAO,SAAWC,MAAMC,QAAQb,KAAKU,OAAOI,SAAWd,KAAKU,OAAOI,OAAOC,OAAS,EACnHb,MAAMc,SAAQ,WACZR,EAAKS,KAAOf,MAAMC,OAAOC,IAAI,O,IAE/BF,MAAMgB,KAAKC,UAAS,WAClBX,EAAKY,cAAgBlB,MAAMgB,KAAKG,eAAe,qBAAsBb,EAAKY,eAC1EZ,EAAKc,cAAgBpB,MAAMgB,KAAKG,eAAe,4BAA6Bb,EAAKc,c,KAIrFjB,EAAAC,UAAAiB,iBAAA,WACEvB,KAAKwB,aAAaC,aAAezB,KAAKC,aAAeD,KAAKS,aAAe,OACxET,KAAKS,cAAgBT,KAAKwB,eAAkBxB,KAAKwB,aAAaE,MAAMC,UAAY,GAAAC,OAAG5B,KAAKC,W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gB,KAAK,QAAQtB,MAAOF,G,CAEjD,IAAIO,EAAQP,EAAaE,OAAS,OAElC,OAAOM,EAAA,QAAMC,MAAM,yBAAyBF,E,EAG9C9D,EAAAC,UAAA+E,OAAA,eAAA7E,EAAAR,KACE,OACEoE,EAACkB,KAAI,CAACjB,MAAM,8BACVD,EAAA,MAAIC,MAAM,yBAAyBkB,QAAS,WAAM,OAAA/E,EAAK0C,cAAL,GAChDkB,EAAA,YAAOpE,KAAKU,OAAOyD,OACnBC,EAAA,QAAMC,MAAO,8BAAAzC,OAA8B5B,KAAKmD,OAAS,oCAAsC,OAEjGiB,EAAA,OAAKC,MAAM,2BAA2BmB,IAAK,SAACC,GAAO,OAAAjF,EAAKqB,cAAgB4D,CAArB,GACjDrB,EAAA,OAAKC,MAAM,0BAA0BmB,IAAK,SAACC,GAAO,OAAAjF,EAAKgB,aAAeiE,CAApB,GAChDrB,EAAA,aAEEpE,KAAKU,OAAO4B,OAASC,kBAAkBC,MACnCxC,KAAKsD,mBAAmBtD,KAAKU,QAC7B0D,EAAA,qBAAmBsB,UAAW,SAACX,GAAU,OAAAvE,EAAKqE,QAAQC,KAAKC,EAAMY,OAAxB,EACzCH,IAAK,SAAAI,GAAS,OAAApF,EAAKiC,WAAamD,CAAlB,EACdT,YAAanF,KAAKmF,YAClBzE,OAAQV,KAAKU,UAGpBV,KAAKS,cACJ2D,EAAA,KAAGC,MAAM,wBACPkB,QAAS,WAAM,OAAA/E,EAAKwC,UAAL,IAAmBhD,KAAKiD,WAAajD,KAAKoB,cAAgBpB,KAAKsB,gB,kIAtL7D,G"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,e,r,a){function i(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,n){function s(t){try{o(a.next(t))}catch(t){n(t)}}function l(t){try{o(a["throw"](t))}catch(t){n(t)}}function o(t){t.done?r(t.value):i(t.value).then(s,l)}o((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},a,i,n,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(t){return function(e){return o([t,e])}}function o(l){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(r=0)),r)try{if(a=1,i&&(n=l[0]&2?i["return"]:l[0]?i["throw"]||((n=i["return"])&&n.call(i),0):i.next)&&!(n=n.call(i,l[1])).done)return n;if(i=0,n)l=[l[0]&2,n.value];switch(l[0]){case 0:case 1:n=l;break;case 4:r.label++;return{value:l[1],done:false};case 5:r.label++;i=l[1];l=[0];continue;case 7:l=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){r.label=l[1];break}if(l[0]===6&&r.label<n[1]){r.label=n[1];n=l;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(l);break}if(n[2])r.ops.pop();r.trys.pop();continue}l=e.call(t,r)}catch(t){l=[6,t];i=0}finally{a=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-e6c3f002.js";import{F as
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-e6c3f002.js";import{F as FilterOptionTypes}from"./interfaces-3159d022.js";var sallaFiltersCss=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";var SallaFilters=function(){function t(t){var e=this;registerInstance(this,t);this.changed=createEvent(this,"changed",7);this.isReady=false;this.filters=undefined;this.isSidebarOpen=undefined;this.filtersData={};this.apply=undefined;this.reset=undefined;salla.event.on("filters::hidden",(function(){return e.host.style.display="none"}));salla.lang.onLoaded((function(){e.apply=salla.lang.get("pages.checkout.apply");e.reset=salla.lang.get("pages.categories.filters_reset")}));salla.event.on("filters::fetched",(function(t){var r=t.filters;e.host.style.display="";var a={};e.filters=r.map((function(t){t.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[t.key]||t.label;if(t.key=="rating"){t.type=FilterOptionTypes.VALUES;var r=t.values,i=r.max,n=r.min;t.values=[5,4,3,2,1].filter((function(t){return t>=n||t<=i}))}if(e.filtersData[t.key]){a[t.key]=e.filtersData[t.key]}return t}));e.filtersData=a;e.host.childNodes.forEach((function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:e=t.setWidgetHeight;if(!e)return[3,2];return[4,t.setWidgetHeight()];case 1:e=r.sent();r.label=2;case 2:return[2,e]}}))}))}))}))}t.prototype.connectedCallback=function(){var t=this;try{var e=new URLSearchParams(window.location.search);var r={};var a=function(e,a){var i=e.replace(/\]/g,"").split("[");i.reduce((function(e,r,i,n){var s=i===n.length-1;var l=/^\d+$/.test(r)?parseInt(r,10):r;if(s){if(/^\d+$/.test(r)){t.addObjectValue(e,n[i-1],a);return e[n[i-1]]}else if(e[l]){e[l]=[e[l],a]}else{e[l]=a}}else{e[l]=e[l]||{}}return e[l]}),r)};for(var i=0,n=e.entries();i<n.length;i++){var s=n[i],l=s[0],o=s[1];a(l,o)}this.filtersData=this.flattenObject(r["filters"])||{}}catch(t){salla.logger.warn("failed to get filters from url",t.message)}};t.prototype.flattenObject=function(t){for(var e in t){if(typeof t[e]==="object"){if(t[e][e]&&Array.isArray(t[e][e])){t[e]=t[e][e]}else{this.flattenObject(t[e])}}}return t};t.prototype.addObjectValue=function(t,e,r){if(t.hasOwnProperty(e)){if(Array.isArray(t[e])){t[e].push(r)}else{t[e]=[t[e],r]}}else{t[e]=[r]}};t.prototype.getFilters=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.filtersData]}))}))};t.prototype.applyFilters=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(r){if(!this.isReady){return[2]}t=Object.keys(this.filtersData).length>0;setTimeout((function(){var r;if(t){var a=new URL(window.location.href);for(var i=0,n=a.searchParams.entries();i<n.length;i++){var s=n[i][0];if(s.startsWith("filters")){a.searchParams.delete(s)}}var l=e.encodeFilters(e.filtersData);var o=a.search.split("&").filter((function(t){return!t.includes("filters")})).join("&");if(!!o){a.search=a.search.split("&filters")[0]+"&"+l}else{a.search="?".concat(l)}window.history.pushState({},"",a.href)}else{var a=new URL(window.location.href);(r=a.searchParams)===null||r===void 0?void 0:r.delete("filters");window.history.pushState({},"",a.toString())}salla.event.emit("salla-filters::changed",e.filtersData);e.changed.emit(e.filtersData)}),300);return[2]}))}))};t.prototype.encodeFilters=function(t,e){if(e===void 0){e="filters"}var r=[];for(var a in t){if(Object.prototype.hasOwnProperty.call(t,a)){var i=t[a];var n=e?"".concat(e,"[").concat(a,"]"):a;if(Array.isArray(i)){for(var s=0;s<i.length;s++){r.push("".concat(n,"[").concat(s,"]=").concat(i[s]))}}else if(typeof i==="object"&&i!==null){r.push(this.encodeFilters(i,n))}else{var l="".concat(n,"=").concat(i);r.push(l)}}}return r.join("&")};t.prototype.resetFilters=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.removeFiltersQueryParams();this.filtersData={};this.host.childNodes.forEach((function(t){return t.reset&&t.reset()}));salla.event.emit("salla-filters::reset");return[2,this.applyFilters()]}))}))};t.prototype.removeFiltersQueryParams=function(){var t=new URLSearchParams(window.location.search);var e=Array.from(t.keys()).filter((function(t){return!t.startsWith("filters[")})).map((function(e){return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t.get(e)))})).join("&");var r=e?"".concat(window.location.pathname,"?").concat(e):window.location.pathname;window.history.pushState({},"",r)};t.prototype.handleOptionChange=function(t,e,r){if(e.type===FilterOptionTypes.RANGE){this.filtersData[e.key]=r}var a=t.target.checked;if(e.type===FilterOptionTypes.VARIANTS){this.filtersData.variants=this.filtersData.variants||{};a&&(this.filtersData.variants[e.key]=r);a||delete this.filtersData.variants[e.key]}else if(t.target.type=="radio"){a&&(this.filtersData[e.key]=r);a||delete this.filtersData[e.key]}else if(t.target.type=="checkbox"){this.filtersData[e.key]=this.filtersData[e.key]||[];if(a){this.filtersData[e.key].push(r)}this.filtersData[e.key]=this.filtersData[e.key].filter((function(t){return t!=r}))}this.applyFilters()};t.prototype.render=function(){var t=this;var e,r;return h(Host,null,(e=this.filters)===null||e===void 0?void 0:e.map((function(e){return h("salla-filters-widget",{option:e,filtersData:t.filtersData,onChanged:function(e){var r=e.detail,a=r.event,i=r.option,n=r.value;return t.handleOptionChange(a,i,n)}})})),((r=this.filters)===null||r===void 0?void 0:r.length)?h("div",{class:"s-filters-footer"},h("salla-button",{color:"gray",fill:"outline",onClick:function(){return t.resetFilters()}},this.reset)):"")};t.prototype.componentDidLoad=function(){this.isReady=true};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaFilters.style=sallaFiltersCss;export{SallaFilters as salla_filters};
|
|
5
5
|
//# sourceMappingURL=salla-filters.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sallaFiltersCss","SallaFilters","class_1","hostRef","_this","this","isReady","salla","event","on","host","style","display","lang","onLoaded","apply","get","reset","_c","filters","freshFilterData","map","filter","label","category_id","brand_id","rating","price","key","inputType","FilterOptionInputType","RADIO","values","max_1","max","min_1","min","stars","filtersData","childNodes","forEach","widget","__awaiter","__generator","_d","setWidgetHeight","sent","prototype","connectedCallback","searchParams","URLSearchParams","window","location","search","filterObject","value","keys","replace","split","reduce","obj","keyPart","index","array","isLastKey","length","finalKey","test","parseInt","addObjectValue","_i","entries","flattenObject","e","logger","warn","message","Array","isArray","hasOwnProperty","push","getFilters","applyFilters","hasFilters","Object","setTimeout","url","URL","href","startsWith","delete","encodedFilterValues","encodeFilters","sanitizedFilterValues","item","includes","join","concat","history","pushState","_a","toString","emit","changed","parentKey","encodedFilters","call","fullKey","i","result","resetFilters","removeFiltersQueryParams","newUrl","from","encodeURIComponent","finalUrl","pathname","handleOptionChange","option","type","FilterOptionTypes","RANGE","isChecked","target","checked","VARIANTS","variants","CHECKBOX","val","render","h","Host","onChanged","detail","_b","class","color","fill","onClick","componentDidLoad"],"sources":["src/components/salla-filters/salla-filters.scss?tag=salla-filters","src/components/salla-filters/salla-filters.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.s-rating-stars-small {\n line-height: 12px;\n}\n.s-filters-radio{\n background-image: none !important;\n}","import { Component, Element, h, Event, EventEmitter, Host, Method, Prop, State } from '@stencil/core';\nimport { Filter, FilterOptionInputType, FilterOptionTypes } from \"./interfaces\";\n\n@Component({\n tag: 'salla-filters',\n styleUrl: 'salla-filters.scss',\n})\nexport class SallaFilters {\n\n constructor() {\n salla.event.on('filters::hidden', () => this.host.style.display = 'none');\n\n salla.lang.onLoaded(() => {\n this.apply = salla.lang.get('pages.checkout.apply');\n this.reset = salla.lang.get('pages.categories.filters_reset');\n });\n\n salla.event.on('filters::fetched', ({ filters }) => {\n this.host.style.display = '';\n let freshFilterData = {};\n this.filters = filters\n .map((filter: Filter) => {\n filter.label = {\n category_id: salla.lang.get('common.titles.categories'),\n brand_id: salla.lang.get('common.titles.brands'),\n rating: salla.lang.get('pages.categories.filter_rating'),\n price: salla.lang.get('pages.categories.filter_price'),\n }[filter.key] || filter.label;\n filter.inputType = FilterOptionInputType.RADIO;//todo:: support FilterOptionInputType.CHECKBOX\n if (filter.key == 'rating') {\n filter.inputType = FilterOptionInputType.RADIO;\n //@ts-ignore\n let { max, min } = filter.values;\n //@ts-ignore\n filter.values = [5, 4, 3, 2, 1].filter(stars => stars >= min || stars <= max)\n }\n\n //when getting new filters, maybe less than we had, so let's get from the old one, only what is existed now.\n if (this.filtersData[filter.key]) {\n freshFilterData[filter.key] = this.filtersData[filter.key];\n }\n\n return filter;\n });\n this.filtersData = freshFilterData;\n this.host.childNodes.forEach(async (widget: HTMLSallaFiltersWidgetElement) => widget.setWidgetHeight && await widget.setWidgetHeight())\n });\n }\n\n connectedCallback() {\n try {\n const searchParams = new URLSearchParams(window.location.search);\n const filterObject = {};\n\n for (const [key, value] of searchParams.entries()) {\n const keys = key.replace(/\\]/g, '').split('[');\n keys.reduce((obj, keyPart, index, array) => {\n const isLastKey = index === array.length - 1;\n const finalKey = /^\\d+$/.test(keyPart) ? parseInt(keyPart, 10) : keyPart;\n if (isLastKey) {\n if (/^\\d+$/.test(keyPart)) {\n this.addObjectValue(obj, array[index - 1], value)\n return obj[array[index - 1]];\n } else if (obj[finalKey]) {\n obj[finalKey] = [obj[finalKey], value];\n } else {\n obj[finalKey] = value;\n }\n } else {\n obj[finalKey] = obj[finalKey] || {};\n }\n\n return obj[finalKey];\n }, filterObject);\n }\n\n this.filtersData = this.flattenObject(filterObject[\"filters\"]) || {};\n } catch (e) {\n salla.logger.warn('failed to get filters from url', e.message);\n }\n\n }\n\n private flattenObject(obj: any) {\n for (const key in obj) {\n if (typeof obj[key] === 'object') {\n if (obj[key][key] && Array.isArray(obj[key][key])) {\n obj[key] = obj[key][key];\n } else {\n this.flattenObject(obj[key]);\n }\n }\n }\n return obj;\n }\n\n\n private addObjectValue(obj, key, value) {\n if (obj.hasOwnProperty(key)) {\n if (Array.isArray(obj[key])) {\n obj[key].push(value);\n } else {\n obj[key] = [obj[key], value];\n }\n } else {\n obj[key] = [value];\n }\n }\n\n\n @Element() host: HTMLElement;\n\n /**\n * Array of filter options\n */\n @Prop({ reflect: true, mutable: true }) filters?: Filter[];\n\n private isReady = false;//to avoid triggering the changed event\n\n @State() isSidebarOpen: boolean;\n @State() filtersData: object | any = {}\n @State() apply: string;\n @State() reset: string;\n\n /**\n * Custom event fired when the selected filters are changed.\n */\n @Event() changed: EventEmitter;\n\n /**\n * Method to get filter data.\n */\n @Method()\n async getFilters() {\n return this.filtersData;\n }\n\n /**\n * Apply filter action.\n */\n @Method()\n async applyFilters() {\n if (!this.isReady) {\n return;\n }\n let hasFilters = Object.keys(this.filtersData).length > 0;\n setTimeout(() => {\n if (hasFilters) {\n let url = new URL(window.location.href);\n for (const [key] of url.searchParams.entries()) {\n if (key.startsWith(\"filters\")) {\n url.searchParams.delete(key);\n }\n }\n let encodedFilterValues = this.encodeFilters(this.filtersData)\n let sanitizedFilterValues = url.search.split(\"&\").filter(item => !item.includes('filters')).join(\"&\")\n if (!!sanitizedFilterValues) {\n url.search = url.search.split(\"&filters\")[0] + \"&\" + encodedFilterValues\n }else {\n url.search = `?${encodedFilterValues}`\n }\n window.history.pushState({}, '', url.href);\n } else {\n let url = new URL(window.location.href);\n url.searchParams?.delete('filters');\n window.history.pushState({}, '', url.toString());\n }\n salla.event.emit('salla-filters::changed', this.filtersData);\n this.changed.emit(this.filtersData);\n }, 300);\n }\n\n private encodeFilters(filters, parentKey = 'filters') {\n const encodedFilters = [];\n\n for (const key in filters) {\n if (Object.prototype.hasOwnProperty.call(filters, key)) {\n const value = filters[key];\n\n const fullKey = parentKey ? `${parentKey}[${key}]` : key;\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n encodedFilters.push(`${fullKey}[${i}]=${value[i]}`)\n }\n }\n else if (typeof value === 'object' && value !== null) {\n encodedFilters.push(this.encodeFilters(value, fullKey));\n } else {\n // const encodedKey = encodeURIComponent(fullKey);\n // const encodedValue = encodeURIComponent(value);\n let result = `${fullKey}=${value}`\n encodedFilters.push(result);\n }\n }\n }\n return encodedFilters.join('&');\n };\n\n /**\n * Reset selected filters.\n */\n @Method()\n async resetFilters() {\n this.removeFiltersQueryParams()\n this.filtersData = {};\n this.host.childNodes.forEach((widget: HTMLSallaFiltersWidgetElement) => widget.reset && widget.reset())\n salla.event.emit('salla-filters::reset');\n return this.applyFilters();\n }\n\n private removeFiltersQueryParams() {\n const searchParams = new URLSearchParams(window.location.search);\n\n const newUrl = Array.from(searchParams.keys())\n .filter(key => !key.startsWith('filters['))\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(searchParams.get(key))}`)\n .join('&');\n\n const finalUrl = newUrl ? `${window.location.pathname}?${newUrl}` : window.location.pathname;\n window.history.pushState({}, '', finalUrl);\n }\n\n /**\n * @param {{target:HTMLInputElement}} event\n * @param option\n * @param value\n * @private\n */\n private handleOptionChange(event, option: Filter, value) {\n if (option.type === FilterOptionTypes.RANGE) {\n this.filtersData[option.key] = value;\n\n }\n let isChecked = event.target.checked;\n\n if (option.type === FilterOptionTypes.VARIANTS) {\n this.filtersData.variants = this.filtersData.variants || {};\n isChecked && (this.filtersData.variants[option.key] = value);\n isChecked || (delete this.filtersData.variants[option.key]);\n\n }\n\n if (event.target.type == FilterOptionInputType.RADIO) {\n isChecked && (this.filtersData[option.key] = value);\n isChecked || (delete this.filtersData[option.key]);\n }\n\n //it's checkbox\n // add if condition to avoid error when the filter is not existed in the filtersData\n if (event.target.type == FilterOptionInputType.CHECKBOX) {\n this.filtersData[option.key] = this.filtersData[option.key] || [];\n if (isChecked) {\n this.filtersData[option.key].push(value);\n\n }\n this.filtersData[option.key] = this.filtersData[option.key].filter(val => val != value);\n }\n this.applyFilters();\n }\n\n render() {\n return <Host>\n {this.filters?.map(option => <salla-filters-widget\n option={option}\n filtersData={this.filtersData}\n onChanged={({ detail: { event, option, value } }) => this.handleOptionChange(event, option, value)} />)}\n\n {this.filters?.length ? <div class=\"s-filters-footer\">\n {/* <salla-button color='primary' onClick={() => this.applyFilters()}>{this.apply}</salla-button> */}\n <salla-button color='gray' fill='outline' onClick={() => this.resetFilters()}>{this.reset}</salla-button>\n </div> : ''}\n </Host>;\n }\n\n componentDidLoad() {\n this.isReady = true;\n }\n}\n\n"],"mappings":";;;+LAAA,IAAMA,gBAAkB,gH,ICOXC,aAAY,WAEvB,SAAAC,EAAAC,GAAA,IAAAC,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KAAK6E,c,EAGPhF,EAAA6C,UAAAkF,OAAA,eAAA7H,EAAAC,K,QACE,OAAO6H,EAACC,KAAI,MACT/B,EAAA/F,KAAKc,WAAO,MAAAiF,SAAA,S,EAAE/E,KAAI,SAAAiG,GAAU,OAAAY,EAAA,wBAC3BZ,OAAQA,EACRhF,YAAalC,EAAKkC,YAClB8F,UAAW,SAAClH,G,IAAE0B,EAAA1B,EAAAmH,OAAU7H,EAAKoC,EAAApC,MAAE8G,EAAM1E,EAAA0E,OAAE/D,EAAKX,EAAAW,MAAS,OAAAnD,EAAKiH,mBAAmB7G,EAAO8G,EAAQ/D,EAAvC,GAH1B,MAK5B+E,EAAAjI,KAAKc,WAAO,MAAAmH,SAAA,SAAAA,EAAErE,QAASiE,EAAA,OAAKK,MAAM,oBAEjCL,EAAA,gBAAcM,MAAM,OAAOC,KAAK,UAAUC,QAAS,WAAM,OAAAtI,EAAK0G,cAAL,GAAsBzG,KAAKY,QAC7E,G,EAIbf,EAAA6C,UAAA4F,iBAAA,WACEtI,KAAKC,QAAU,I,kIA5QM,G"}
|
|
1
|
+
{"version":3,"names":["sallaFiltersCss","SallaFilters","class_1","hostRef","_this","this","isReady","salla","event","on","host","style","display","lang","onLoaded","apply","get","reset","_c","filters","freshFilterData","map","filter","label","category_id","brand_id","rating","price","key","type","FilterOptionTypes","VALUES","values","max_1","max","min_1","min","stars","filtersData","childNodes","forEach","widget","__awaiter","__generator","_d","setWidgetHeight","sent","prototype","connectedCallback","searchParams","URLSearchParams","window","location","search","filterObject","value","keys","replace","split","reduce","obj","keyPart","index","array","isLastKey","length","finalKey","test","parseInt","addObjectValue","_i","entries","flattenObject","e","logger","warn","message","Array","isArray","hasOwnProperty","push","getFilters","applyFilters","hasFilters","Object","setTimeout","url","URL","href","startsWith","delete","encodedFilterValues","encodeFilters","sanitizedFilterValues","item","includes","join","concat","history","pushState","_a","toString","emit","changed","parentKey","encodedFilters","call","fullKey","i","result","resetFilters","removeFiltersQueryParams","newUrl","from","encodeURIComponent","finalUrl","pathname","handleOptionChange","option","RANGE","isChecked","target","checked","VARIANTS","variants","val","render","h","Host","onChanged","detail","_b","class","color","fill","onClick","componentDidLoad"],"sources":["src/components/salla-filters/salla-filters.scss?tag=salla-filters","src/components/salla-filters/salla-filters.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.s-rating-stars-small {\n line-height: 12px;\n}\n.s-filters-radio{\n background-image: none !important;\n}","import { Component, Element, h, Event, EventEmitter, Host, Method, Prop, State } from '@stencil/core';\nimport { Filter, FilterOptionTypes } from \"./interfaces\";\n\n@Component({\n tag: 'salla-filters',\n styleUrl: 'salla-filters.scss',\n})\nexport class SallaFilters {\n\n constructor() {\n salla.event.on('filters::hidden', () => this.host.style.display = 'none');\n\n salla.lang.onLoaded(() => {\n this.apply = salla.lang.get('pages.checkout.apply');\n this.reset = salla.lang.get('pages.categories.filters_reset');\n });\n\n salla.event.on('filters::fetched', ({ filters }) => {\n this.host.style.display = '';\n let freshFilterData = {};\n this.filters = filters\n .map((filter: Filter) => {\n filter.label = {\n category_id: salla.lang.get('common.titles.categories'),\n brand_id: salla.lang.get('common.titles.brands'),\n rating: salla.lang.get('pages.categories.filter_rating'),\n price: salla.lang.get('pages.categories.filter_price'),\n }[filter.key] || filter.label;\n // filter.type = FilterOptionTypes.VALUES;\n if (filter.key == 'rating') {\n filter.type = FilterOptionTypes.VALUES;\n //@ts-ignore\n let { max, min } = filter.values;\n //@ts-ignore\n filter.values = [5, 4, 3, 2, 1].filter(stars => stars >= min || stars <= max)\n }\n\n //when getting new filters, maybe less than we had, so let's get from the old one, only what is existed now.\n if (this.filtersData[filter.key]) {\n freshFilterData[filter.key] = this.filtersData[filter.key];\n }\n\n return filter;\n });\n this.filtersData = freshFilterData;\n this.host.childNodes.forEach(async (widget: HTMLSallaFiltersWidgetElement) => widget.setWidgetHeight && await widget.setWidgetHeight())\n });\n }\n\n connectedCallback() {\n try {\n const searchParams = new URLSearchParams(window.location.search);\n const filterObject = {};\n\n for (const [key, value] of searchParams.entries()) {\n const keys = key.replace(/\\]/g, '').split('[');\n keys.reduce((obj, keyPart, index, array) => {\n const isLastKey = index === array.length - 1;\n const finalKey = /^\\d+$/.test(keyPart) ? parseInt(keyPart, 10) : keyPart;\n if (isLastKey) {\n if (/^\\d+$/.test(keyPart)) {\n this.addObjectValue(obj, array[index - 1], value)\n return obj[array[index - 1]];\n } else if (obj[finalKey]) {\n obj[finalKey] = [obj[finalKey], value];\n } else {\n obj[finalKey] = value;\n }\n } else {\n obj[finalKey] = obj[finalKey] || {};\n }\n\n return obj[finalKey];\n }, filterObject);\n }\n\n this.filtersData = this.flattenObject(filterObject[\"filters\"]) || {};\n } catch (e) {\n salla.logger.warn('failed to get filters from url', e.message);\n }\n\n }\n\n private flattenObject(obj: any) {\n for (const key in obj) {\n if (typeof obj[key] === 'object') {\n if (obj[key][key] && Array.isArray(obj[key][key])) {\n obj[key] = obj[key][key];\n } else {\n this.flattenObject(obj[key]);\n }\n }\n }\n return obj;\n }\n\n\n private addObjectValue(obj, key, value) {\n if (obj.hasOwnProperty(key)) {\n if (Array.isArray(obj[key])) {\n obj[key].push(value);\n } else {\n obj[key] = [obj[key], value];\n }\n } else {\n obj[key] = [value];\n }\n }\n\n\n @Element() host: HTMLElement;\n\n /**\n * Array of filter options\n */\n @Prop({ reflect: true, mutable: true }) filters?: Filter[];\n\n private isReady = false;//to avoid triggering the changed event\n\n @State() isSidebarOpen: boolean;\n @State() filtersData: object | any = {}\n @State() apply: string;\n @State() reset: string;\n\n /**\n * Custom event fired when the selected filters are changed.\n */\n @Event() changed: EventEmitter;\n\n /**\n * Method to get filter data.\n */\n @Method()\n async getFilters() {\n return this.filtersData;\n }\n\n /**\n * Apply filter action.\n */\n @Method()\n async applyFilters() {\n if (!this.isReady) {\n return;\n }\n let hasFilters = Object.keys(this.filtersData).length > 0;\n setTimeout(() => {\n if (hasFilters) {\n let url = new URL(window.location.href);\n for (const [key] of url.searchParams.entries()) {\n if (key.startsWith(\"filters\")) {\n url.searchParams.delete(key);\n }\n }\n let encodedFilterValues = this.encodeFilters(this.filtersData)\n let sanitizedFilterValues = url.search.split(\"&\").filter(item => !item.includes('filters')).join(\"&\")\n if (!!sanitizedFilterValues) {\n url.search = url.search.split(\"&filters\")[0] + \"&\" + encodedFilterValues\n }else {\n url.search = `?${encodedFilterValues}`\n }\n window.history.pushState({}, '', url.href);\n } else {\n let url = new URL(window.location.href);\n url.searchParams?.delete('filters');\n window.history.pushState({}, '', url.toString());\n }\n salla.event.emit('salla-filters::changed', this.filtersData);\n this.changed.emit(this.filtersData);\n }, 300);\n }\n\n private encodeFilters(filters, parentKey = 'filters') {\n const encodedFilters = [];\n\n for (const key in filters) {\n if (Object.prototype.hasOwnProperty.call(filters, key)) {\n const value = filters[key];\n\n const fullKey = parentKey ? `${parentKey}[${key}]` : key;\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n encodedFilters.push(`${fullKey}[${i}]=${value[i]}`)\n }\n }\n else if (typeof value === 'object' && value !== null) {\n encodedFilters.push(this.encodeFilters(value, fullKey));\n } else {\n // const encodedKey = encodeURIComponent(fullKey);\n // const encodedValue = encodeURIComponent(value);\n let result = `${fullKey}=${value}`\n encodedFilters.push(result);\n }\n }\n }\n return encodedFilters.join('&');\n };\n\n /**\n * Reset selected filters.\n */\n @Method()\n async resetFilters() {\n this.removeFiltersQueryParams()\n this.filtersData = {};\n this.host.childNodes.forEach((widget: HTMLSallaFiltersWidgetElement) => widget.reset && widget.reset())\n salla.event.emit('salla-filters::reset');\n return this.applyFilters();\n }\n\n private removeFiltersQueryParams() {\n const searchParams = new URLSearchParams(window.location.search);\n\n const newUrl = Array.from(searchParams.keys())\n .filter(key => !key.startsWith('filters['))\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(searchParams.get(key))}`)\n .join('&');\n\n const finalUrl = newUrl ? `${window.location.pathname}?${newUrl}` : window.location.pathname;\n window.history.pushState({}, '', finalUrl);\n }\n\n /**\n * @param {{target:HTMLInputElement}} event\n * @param option\n * @param value\n * @private\n */\n private handleOptionChange(event, option: Filter, value) {\n if (option.type === FilterOptionTypes.RANGE) {\n this.filtersData[option.key] = value;\n\n }\n let isChecked = event.target.checked;\n\n if (option.type === FilterOptionTypes.VARIANTS) {\n this.filtersData.variants = this.filtersData.variants || {};\n isChecked && (this.filtersData.variants[option.key] = value);\n isChecked || (delete this.filtersData.variants[option.key]);\n }\n\n else if (event.target.type == \"radio\") {\n isChecked && (this.filtersData[option.key] = value);\n isChecked || (delete this.filtersData[option.key]);\n }\n\n //it's checkbox\n // add if condition to avoid error when the filter is not existed in the filtersData\n else if(event.target.type == \"checkbox\") {\n this.filtersData[option.key] = this.filtersData[option.key] || [];\n if (isChecked) {\n this.filtersData[option.key].push(value);\n\n }\n this.filtersData[option.key] = this.filtersData[option.key].filter(val => val != value);\n }\n this.applyFilters();\n }\n\n render() {\n return <Host>\n {this.filters?.map(option => <salla-filters-widget\n option={option}\n filtersData={this.filtersData}\n onChanged={({ detail: { event, option, value } }) => this.handleOptionChange(event, option, value)} />)}\n\n {this.filters?.length ? <div class=\"s-filters-footer\">\n {/* <salla-button color='primary' onClick={() => this.applyFilters()}>{this.apply}</salla-button> */}\n <salla-button color='gray' fill='outline' onClick={() => this.resetFilters()}>{this.reset}</salla-button>\n </div> : ''}\n </Host>;\n }\n\n componentDidLoad() {\n this.isReady = true;\n }\n}\n\n"],"mappings":";;;oKAAA,IAAMA,gBAAkB,gH,ICOXC,aAAY,WAEvB,SAAAC,EAAAC,GAAA,IAAAC,EAAAC,K,oEA4GQA,KAAAC,QAAU,M,qEAGmB,G,0CA9GnCC,MAAMC,MAAMC,GAAG,mBAAmB,WAAM,OAAAL,EAAKM,KAAKC,MAAMC,QAAU,MAA1B,IAExCL,MAAMM,KAAKC,UAAS,WAClBV,EAAKW,MAAQR,MAAMM,KAAKG,IAAI,wBAC5BZ,EAAKa,MAAQV,MAAMM,KAAKG,IAAI,iC,IAG9BT,MAAMC,MAAMC,G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