@salla.sa/twilight-components 2.14.593 → 2.14.594
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/{filepond-Dh9Ih7bu.js → filepond-DtGoIKEP.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-C6Sx5vF0.js → filepond-plugin-file-poster-DMejMF1-.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DdzdetN6.js → filepond-plugin-file-validate-size-J_fE6OBS.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DRWFKOpQ.js → filepond-plugin-file-validate-type-BpewyAzF.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-B4vaf2kZ.js → filepond-plugin-image-edit-DPNUTWCK.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BXfm40Ut.js → filepond-plugin-image-exif-orientation-CZ6YRu70.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-DQLCCOAs.js → filepond-plugin-image-preview-CgV-oWXK.js} +1 -1
- package/dist/cjs/{index-CLrjVXN1.js → index-BziKkkwT.js} +21 -7
- package/dist/cjs/{intlTelInput-o62W18dw.js → intlTelInput-BLuZALMt.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +10 -10
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +286 -20
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_9.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-summary.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-FCNrUTtN.js → vanilla-picker-36O-wrIX.js} +1 -1
- package/dist/collection/components/salla-bullet-delivery/location-distance-warning.js +28 -0
- package/dist/collection/components/salla-bullet-delivery/location-icon.svg +26 -0
- package/dist/collection/components/salla-bullet-delivery/location-permission-notice.js +103 -0
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.css +136 -0
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +133 -19
- package/dist/collection/global/app.js +2 -0
- package/dist/collection/global/app.spec.ts +33 -0
- package/dist/collection/global/app.ts +2 -0
- package/dist/collection/global/chunk-errors.js +14 -0
- package/dist/collection/global/chunk-errors.spec.ts +47 -0
- package/dist/collection/global/chunk-errors.ts +13 -0
- package/dist/components/index.js +15 -2
- package/dist/components/salla-bullet-delivery.js +288 -20
- package/dist/docs.json +1 -1
- package/dist/esm/{filepond-DTcw03Zq.js → filepond-DZJO0NDO.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-Csk5cMw9.js → filepond-plugin-file-poster-BGjhc2cd.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-FFrf5LrW.js → filepond-plugin-file-validate-size-s9w1K7Bl.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-DeZP4xXd.js → filepond-plugin-file-validate-type-OfI6GFgP.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-DRKyd_1I.js → filepond-plugin-image-edit-Cfselyr4.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-CxVz7OAy.js → filepond-plugin-image-exif-orientation-ConUo4eP.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CsKN7em3.js → filepond-plugin-image-preview-BJ4T10Ty.js} +1 -1
- package/dist/esm/{index-0Tl_yZW8.js → index-Bxge4xib.js} +21 -7
- package/dist/esm/{intlTelInput-CBN9egFg.js → intlTelInput-B-IoM3ox.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +1 -1
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-applied-filters.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +10 -10
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_3.entry.js +286 -20
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/salla-comment-form_9.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_3.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.entry.js +1 -1
- package/dist/esm/salla-order-cancel.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-options-modal.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-card.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-products-slider.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-review-factors-tags.entry.js +1 -1
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search-product-card.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/salla-wishlist-summary.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-CiLp9ysz.js → vanilla-picker-D1RSTlum.js} +1 -1
- package/dist/twilight/global/app.spec.ts +33 -0
- package/dist/twilight/global/app.ts +2 -0
- package/dist/twilight/global/chunk-errors.spec.ts +47 -0
- package/dist/twilight/global/chunk-errors.ts +13 -0
- package/dist/twilight/{p-821e9049.entry.js → p-00cb1c25.entry.js} +1 -1
- package/dist/twilight/{p-a263bdbb.entry.js → p-0835d9ab.entry.js} +1 -1
- package/dist/twilight/{p-e955b287.entry.js → p-09e56514.entry.js} +1 -1
- package/dist/twilight/{p-3d533d87.entry.js → p-0bbd0d06.entry.js} +1 -1
- package/dist/twilight/{p-4d879cd3.entry.js → p-0d464350.entry.js} +1 -1
- package/dist/twilight/{p-80f27669.entry.js → p-0e1a454b.entry.js} +1 -1
- package/dist/twilight/{p-e8fa4bd0.entry.js → p-106ea7ed.entry.js} +1 -1
- package/dist/twilight/{p-52e7b4f6.entry.js → p-125482ce.entry.js} +1 -1
- package/dist/twilight/{p-2d2db627.entry.js → p-15824030.entry.js} +1 -1
- package/dist/twilight/{p-eb590773.entry.js → p-1769ead6.entry.js} +1 -1
- package/dist/twilight/{p-933807d7.entry.js → p-1b56374e.entry.js} +1 -1
- package/dist/twilight/{p-ce9b6ac6.entry.js → p-1d551b52.entry.js} +1 -1
- package/dist/twilight/{p-aec2d723.entry.js → p-21d1a687.entry.js} +1 -1
- package/dist/twilight/{p-99e615a1.entry.js → p-22f21c95.entry.js} +1 -1
- package/dist/twilight/{p-c394f30a.entry.js → p-2510973e.entry.js} +1 -1
- package/dist/twilight/{p-0cc42e36.entry.js → p-2c2f0608.entry.js} +1 -1
- package/dist/twilight/{p-0fe961e0.entry.js → p-2c8b8935.entry.js} +1 -1
- package/dist/twilight/{p-179595d9.entry.js → p-2e5bace8.entry.js} +1 -1
- package/dist/twilight/{p-fea37c8c.entry.js → p-2ef59b30.entry.js} +1 -1
- package/dist/twilight/{p-449eae1d.entry.js → p-30b7383a.entry.js} +1 -1
- package/dist/twilight/{p-8e013db1.entry.js → p-30f24d97.entry.js} +1 -1
- package/dist/twilight/{p-2da1eb61.entry.js → p-3162901e.entry.js} +1 -1
- package/dist/twilight/{p-d744234e.entry.js → p-34454493.entry.js} +1 -1
- package/dist/twilight/{p-4701a008.entry.js → p-35bc566f.entry.js} +1 -1
- package/dist/twilight/{p-bf3fdf6d.entry.js → p-35c0ca9a.entry.js} +1 -1
- package/dist/twilight/{p-7c06ad6a.entry.js → p-3e02b792.entry.js} +1 -1
- package/dist/twilight/{p-299e7413.entry.js → p-42162de9.entry.js} +1 -1
- package/dist/twilight/{p-5cc28510.entry.js → p-4362756f.entry.js} +1 -1
- package/dist/twilight/{p-775f9b02.entry.js → p-4457a289.entry.js} +1 -1
- package/dist/twilight/{p-cc7c4469.entry.js → p-4543b3b3.entry.js} +1 -1
- package/dist/twilight/{p-44afcd79.entry.js → p-4cedf139.entry.js} +1 -1
- package/dist/twilight/{p-e9372ca0.entry.js → p-51243641.entry.js} +1 -1
- package/dist/twilight/{p-3b5fe2ef.entry.js → p-51e8c2b2.entry.js} +1 -1
- package/dist/twilight/{p-af12fce1.entry.js → p-52012794.entry.js} +1 -1
- package/dist/twilight/{p-35d5e339.entry.js → p-530b513d.entry.js} +1 -1
- package/dist/twilight/{p-95b89c32.entry.js → p-57097563.entry.js} +1 -1
- package/dist/twilight/{p-0c26bedf.entry.js → p-572a1f84.entry.js} +1 -1
- package/dist/twilight/{p-6db61be2.entry.js → p-59256d82.entry.js} +1 -1
- package/dist/twilight/{p-b566bc10.entry.js → p-5b3a04cd.entry.js} +1 -1
- package/dist/twilight/p-614b7b61.entry.js +4 -0
- package/dist/twilight/{p-f4cff5cf.entry.js → p-64c76ad9.entry.js} +1 -1
- package/dist/twilight/{p-fb527b4d.entry.js → p-66131771.entry.js} +1 -1
- package/dist/twilight/{p-b0d66765.entry.js → p-6b90f160.entry.js} +1 -1
- package/dist/twilight/{p-42426756.entry.js → p-6bfcdb38.entry.js} +1 -1
- package/dist/twilight/{p-01b4b05f.entry.js → p-6d3d5a0b.entry.js} +1 -1
- package/dist/twilight/{p-183e02ac.entry.js → p-6e42d70f.entry.js} +1 -1
- package/dist/twilight/{p-7c038d9d.entry.js → p-6e57ff9f.entry.js} +1 -1
- package/dist/twilight/{p-f92d1971.entry.js → p-751ff32d.entry.js} +1 -1
- package/dist/twilight/{p-fef5c118.entry.js → p-78963d5d.entry.js} +1 -1
- package/dist/twilight/{p-bc3ad6d2.entry.js → p-790ea507.entry.js} +1 -1
- package/dist/twilight/{p-b01764d0.entry.js → p-79bb0c41.entry.js} +1 -1
- package/dist/twilight/{p-a735c70e.entry.js → p-7ed0db2e.entry.js} +1 -1
- package/dist/twilight/{p-17f2114f.entry.js → p-84308a79.entry.js} +1 -1
- package/dist/twilight/{p-918fa44a.entry.js → p-8c229520.entry.js} +1 -1
- package/dist/twilight/{p-aee17b8b.entry.js → p-94970458.entry.js} +1 -1
- package/dist/twilight/{p-8d369871.entry.js → p-94e85b3c.entry.js} +1 -1
- package/dist/twilight/{p-deb1139c.entry.js → p-988f6193.entry.js} +1 -1
- package/dist/twilight/{p-b9d2ae8a.entry.js → p-9f0459ec.entry.js} +1 -1
- package/dist/twilight/{p-YTWgVZ0u.js → p-B5twlAuI.js} +2 -2
- package/dist/twilight/{p-Cbnu3aaI.js → p-BXAODWDa.js} +1 -1
- package/dist/twilight/{p-fP9RBas5.js → p-BkWctmFE.js} +1 -1
- package/dist/twilight/{p-0Tl_yZW8.js → p-Bxge4xib.js} +2 -2
- package/dist/twilight/{p-CxpHph5p.js → p-CINox5XU.js} +1 -1
- package/dist/twilight/{p-BABHygiN.js → p-CWLJmpv-.js} +1 -1
- package/dist/twilight/{p-BZHrTB2v.js → p-DKEu8h4M.js} +1 -1
- package/dist/twilight/{p-MugjBhYh.js → p-DnoH14HK.js} +1 -1
- package/dist/twilight/{p-CZkK9lyS.js → p-EiLe0Yi_.js} +1 -1
- package/dist/twilight/{p-BDO2BBmv.js → p-W-AkIawg.js} +1 -1
- package/dist/twilight/{p-26adf02d.entry.js → p-a37bc663.entry.js} +1 -1
- package/dist/twilight/{p-1abcc81d.entry.js → p-a3a69984.entry.js} +1 -1
- package/dist/twilight/{p-1892ea42.entry.js → p-a912d6a3.entry.js} +1 -1
- package/dist/twilight/{p-253a352c.entry.js → p-aa96807e.entry.js} +1 -1
- package/dist/twilight/{p-e8cb4cd9.entry.js → p-aafa69d6.entry.js} +1 -1
- package/dist/twilight/{p-fe27963f.entry.js → p-abfbba72.entry.js} +1 -1
- package/dist/twilight/{p-65665ee3.entry.js → p-b1dc78db.entry.js} +1 -1
- package/dist/twilight/{p-85ab4182.entry.js → p-b2322278.entry.js} +1 -1
- package/dist/twilight/{p-7f59893d.entry.js → p-b3213fee.entry.js} +1 -1
- package/dist/twilight/{p-288627a2.entry.js → p-b6918b2b.entry.js} +1 -1
- package/dist/twilight/{p-75fc9b99.entry.js → p-b8661b67.entry.js} +1 -1
- package/dist/twilight/{p-f828fefc.entry.js → p-be3f6dbe.entry.js} +1 -1
- package/dist/twilight/{p-e429b1e5.entry.js → p-bff2400f.entry.js} +1 -1
- package/dist/twilight/{p-220338b4.entry.js → p-c0274022.entry.js} +1 -1
- package/dist/twilight/{p-14c9ed90.entry.js → p-c16b9f4a.entry.js} +1 -1
- package/dist/twilight/{p-a764bfe7.entry.js → p-c476eaab.entry.js} +1 -1
- package/dist/twilight/{p-f176c43e.entry.js → p-c4bf8d24.entry.js} +1 -1
- package/dist/twilight/{p-1bf7cce7.entry.js → p-c903b6bb.entry.js} +1 -1
- package/dist/twilight/{p-2cbed601.entry.js → p-d1e4e15e.entry.js} +1 -1
- package/dist/twilight/{p-4d852a57.entry.js → p-d2e929bd.entry.js} +1 -1
- package/dist/twilight/{p-7bee2390.entry.js → p-d38b5aaa.entry.js} +1 -1
- package/dist/twilight/{p-d05e1bfd.entry.js → p-d6d7c6a1.entry.js} +1 -1
- package/dist/twilight/{p-9a818822.entry.js → p-d9188e76.entry.js} +1 -1
- package/dist/twilight/{p-2ac1eac9.entry.js → p-db53740d.entry.js} +1 -1
- package/dist/twilight/{p-d851751c.entry.js → p-df313b00.entry.js} +1 -1
- package/dist/twilight/{p-31253c2d.entry.js → p-df407f01.entry.js} +1 -1
- package/dist/twilight/{p-f445e7a3.entry.js → p-e19a980b.entry.js} +1 -1
- package/dist/twilight/{p-636ffc46.entry.js → p-e1b0dafc.entry.js} +1 -1
- package/dist/twilight/{p-4432411c.entry.js → p-e7e52491.entry.js} +1 -1
- package/dist/twilight/{p-0433773a.entry.js → p-ebbb25fc.entry.js} +1 -1
- package/dist/twilight/{p-dc129d7a.entry.js → p-f046edd3.entry.js} +1 -1
- package/dist/twilight/{p-40be8baa.entry.js → p-f22ec479.entry.js} +1 -1
- package/dist/twilight/{p-ddc61bff.entry.js → p-f4c94e30.entry.js} +1 -1
- package/dist/twilight/{p-9434c23f.entry.js → p-fae38591.entry.js} +1 -1
- package/dist/twilight/{p-6561d5d3.entry.js → p-fb119c27.entry.js} +1 -1
- package/dist/twilight/{p-ad9dcb47.entry.js → p-fd615606.entry.js} +1 -1
- package/dist/twilight/{p-ae22bfeb.entry.js → p-fd6fc043.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-bullet-delivery/location-distance-warning.d.ts +12 -0
- package/dist/types/components/salla-bullet-delivery/location-permission-notice.d.ts +39 -0
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +31 -0
- package/dist/types/global/chunk-errors.d.ts +2 -0
- package/package.json +5 -5
- package/dist/twilight/p-b81474c4.entry.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r,h as t}from"./p-
|
|
4
|
+
import{r,h as t}from"./p-Bxge4xib.js";import{i as e}from"./p-DqDX5na4.js";import{i as s}from"./p-BsXh13x8.js";const a=class{constructor(t){r(this,t),this.codeCopied=null,this.noItemFound=!0,this.order_items=[],this.isDigitalCard=r=>"codes"===r.product.type,this.isDigitalProduct=r=>"digital"===r.product.type}async componentWillLoad(){return salla.lang.onLoaded((()=>{this.codes_text=salla.lang.get("pages.thank_you.codes"),this.copy_text=salla.lang.get("common.elements.copy"),this.files_text=salla.lang.get("pages.thank_you.files"),this.download_text=salla.lang.get("pages.thank_you.download")})),await this.getOrderItems()}copyToClipboardHandler(r){if(navigator&&"clipboard"in navigator)try{navigator.clipboard.writeText(r).then((()=>{this.codeCopied=r,this.copyCodeButtonTimeout=setTimeout((()=>{this.codeCopied=null}),3e3)}))}catch(r){salla.loggers.error("copy functionality is not supported by the browser")}}async getOrderItems(){const r=this.orderId||salla.config.get("page.id"),t="Failed to fetch order items";if(!r)throw salla.logger.error(t),new Error(t);try{const{data:{items:t=[]}}=await salla.api.request(`orders/${r}`);t.some((r=>this.isDigitalCard(r)||this.isDigitalProduct(r)))&&(this.order_items=t,this.noItemFound=!1)}catch(r){salla.logger.error(t)}}disconnectedCallback(){this.copyCodeButtonTimeout&&clearTimeout(this.copyCodeButtonTimeout)}render(){return t("ul",{key:"09314d7241f730cc2dcd220542d02ca44565ae9c",class:"s-order-summary-wrapper"},this.noItemFound?t("salla-placeholder",{alignment:"center"},t("span",{slot:"title"})):this.order_items.map((r=>this.isDigitalCard(r)?t("li",{key:r.product.id,class:"s-order-summary-item"},t("h2",{class:"s-order-summary-item-title"},this.codes_text," (",r.name,")"),r.codes.map((r=>t("div",{key:r.code,class:"s-order-summary-code-item-wrapper"},t("p",null,t("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>debit-card-back</title>\n<path d="M30 28h-28c-1.105 0-2-0.895-2-2v0-18c0-1.105 0.895-2 2-2v0h28c1.105 0 2 0.895 2 2v0 18c0 1.105-0.895 2-2 2v0zM30 26v0zM2 8v18h28v-18zM31 14h-30c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h30c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM11 22h-6c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h6c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM24 24c-2.209 0-4-1.791-4-4s1.791-4 4-4c2.209 0 4 1.791 4 4v0c0 2.209-1.791 4-4 4v0zM24 18c-1.105 0-2 0.895-2 2s0.895 2 2 2c1.105 0 2-0.895 2-2v0c0-1.105-0.895-2-2-2v0zM20 24c-2.209 0-4-1.791-4-4s1.791-4 4-4v0c0.002 0 0.005 0 0.007 0 1.032 0 1.972 0.398 2.673 1.048l-0.003-0.002c0.191 0.183 0.311 0.439 0.311 0.724 0 0.552-0.448 1-1 1-0.257 0-0.492-0.097-0.669-0.257l0.001 0.001c-0.345-0.319-0.807-0.514-1.315-0.514-0.002 0-0.003 0-0.005 0h0c-1.105 0-2 0.895-2 2s0.895 2 2 2v0c0.002 0 0.004 0 0.007 0 0.508 0 0.971-0.195 1.317-0.515l-0.001 0.001c0.179-0.171 0.422-0.276 0.689-0.276 0.552 0 1 0.448 1 1 0 0.295-0.128 0.56-0.331 0.743l-0.001 0.001c-0.699 0.648-1.638 1.046-2.671 1.046-0.003 0-0.007 0-0.010 0h0.001z"></path>\n</svg>\n'}),t("span",null,r.code)),t("salla-button",{class:"s-order-summary-item-copy-button "+(this.codeCopied===r.code?"copied":""),onClick:()=>this.copyToClipboardHandler(r.code),shape:"link"},t("span",{innerHTML:this.codeCopied===r.code?s:e}),t("span",null,this.copy_text)))))):this.isDigitalProduct(r)?t("li",{key:r.product.id,class:"s-order-summary-item"},t("h2",{class:"s-order-summary-item-title"},this.files_text," (",r.name,")"),t("ul",null,r.files.map((r=>t("li",{class:"s-order-summary-digital-item-wrapper"},t("div",null,t("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-archive</title>\n<path d="M17.333 16h-5.333c-0.737 0-1.333 0.597-1.333 1.333v2.667c0 2.205 1.795 4 4 4s4-1.795 4-4v-2.667c0-0.736-0.596-1.333-1.333-1.333zM16 20c0 0.735-0.597 1.333-1.333 1.333s-1.333-0.599-1.333-1.333v-1.333h2.667zM17.333 12h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM28.943 8.391l-8-8c-0.249-0.251-0.588-0.391-0.943-0.391h-13.333c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h18.667c2.205 0 4-1.795 4-4v-18.667c0-0.353-0.14-0.693-0.391-0.943zM26.667 28c0 0.735-0.597 1.333-1.333 1.333h-18.667c-0.736 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.597-1.333 1.333-1.333h12.781l7.219 7.219zM17.333 8h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM17.333 4h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333z"></path>\n</svg>\n'}),t("span",null,r.name)),t("a",{href:r.url,target:"_blank",class:"s-order-summary-item-download"},t("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>download</title>\n<path d="M15.056 20.941c0.123 0.124 0.271 0.221 0.435 0.289 0.163 0.067 0.336 0.103 0.509 0.103s0.347-0.036 0.509-0.103c0.164-0.068 0.311-0.165 0.435-0.289l5.332-5.332c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-3.057 3.057v-12.781c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v12.781l-3.057-3.057c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885zM25.333 26.667h-18.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h18.667c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n'}),t("span",null,this.download_text))))))):null)))}};a.style='/*!twlt*/:host{display:block}.s-order-summary-wrapper{display:grid;gap:0.625rem}.s-order-summary-item{border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding:1.25rem;text-align:start}.s-order-summary-item-title{font-weight:bold;margin-bottom:1.25rem;unicode-bidi:plaintext}.s-order-summary-item-download{font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary)}.s-order-summary-code-item-wrapper{margin-bottom:0.5rem;align-items:center;justify-content:space-between;border-bottom-width:1px;--tw-border-opacity:1;border-bottom-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-bottom:0.5rem}.s-order-summary-code-item-wrapper:last-child{margin-bottom:0px;border-width:0px;padding-bottom:0px}@media (min-width: 768px){.s-order-summary-code-item-wrapper{display:flex}}.s-order-summary-code-item-wrapper p{display:flex;align-items:center;font-size:1rem;line-height:1.5rem;line-height:1}.s-order-summary-digital-item-wrapper{display:flex;justify-content:space-between;padding-top:1rem;padding-bottom:1rem}.s-order-summary-digital-item-wrapper:last-child{padding-bottom:0px}.s-order-summary-item-copy-button span svg{pointer-events:none;display:inline;height:12px;width:12px;vertical-align:baseline}.s-order-summary-item-copy-button span svg:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}.s-order-summary-item-copy-button span svg:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}.s-order-summary-code-item-wrapper p span svg{display:inline;height:1.25rem;width:1.25rem;fill:#6b7280;vertical-align:baseline}.s-order-summary-code-item-wrapper p span svg:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}.s-order-summary-code-item-wrapper p span svg:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}.s-order-summary-digital-item-wrapper div span:last-of-type{display:inline-block}.s-order-summary-digital-item-wrapper span svg{display:inline-block;height:14px;width:14px;vertical-align:baseline}.s-order-summary-digital-item-wrapper span svg:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}.s-order-summary-digital-item-wrapper span svg:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}.s-order-summary-item-copy-button.copied .s-button-text{--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-order-summary-digital-item-wrapper .s-order-summary-item-download span{position:relative;top:1px}.s-order-summary-digital-item-wrapper .s-order-summary-item-download span svg{margin-left:0px;margin-right:0px;height:18px;width:18px;--tw-translate-y:2px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));fill:var(--color-primary)}';export{a as salla_order_summary}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as i,h as s,H as e,a as r}from"./p-0Tl_yZW8.js";const a=class{constructor(s){t(this,s),this.giftCardRedeemed=i(this,"giftCardRedeemed"),this.code="",this.inlineForm=!1,this.pending=!1,this.error=null,this.redeemedOnce=!1,this.isDesktop=!1,this.modalView=null,this.result=null,this.mediaQueryList=null,this.mqlChangeHandler=t=>{this.isDesktop=t.matches,"form"===this.modalView&&this.isDesktop?(this.modalView=null,this.inlineForm=!0):this.inlineForm&&!this.isDesktop&&(this.inlineForm=!1,this.openModal("form"))},this.closeModal=()=>{this.modalView=null,this.modal?.close?.()},this.start=()=>{if(this.error=null,this.code="",this.isDesktop)return this.inlineForm=!0,void setTimeout((()=>this.field?.focus()),0);this.openModal("form")},this.cancel=()=>{this.inlineForm=!1,this.code="",this.error=null,this.closeModal()},this.handleInput=t=>{const i=t.target;this.code=(i.value||"").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,16),i.value=this.code,this.error=null},this.onKeyUp=t=>{"Enter"===t.key&&(t.preventDefault(),this.redeem())},this.shopNow=()=>{this.closeModal(),window.location.href=salla.url.get("/")}}breakpointPx(){return 768}async componentWillLoad(){await salla.onReady(),this.mediaQueryList=window.matchMedia(`(min-width: ${this.breakpointPx()}px)`),this.isDesktop=this.mediaQueryList.matches,this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.mqlChangeHandler):this.mediaQueryList.addListener&&this.mediaQueryList.addListener(this.mqlChangeHandler),await salla.lang.onLoaded()}disconnectedCallback(){this.mediaQueryList?.removeEventListener?this.mediaQueryList.removeEventListener("change",this.mqlChangeHandler):this.mediaQueryList?.removeListener&&this.mediaQueryList.removeListener(this.mqlChangeHandler)}tFirst(t,i){for(const s of t){const t=salla.lang.get(s,i);if(t&&t!==s)return t}return""}t(t,i){return this.tFirst([`pages.checkout.${t}`],i)}get canRedeem(){const t=salla.config.get("store.features",[]);return!salla.config.isGuest()&&t.includes("wallet-gift-card")&&t.includes("giftcard-redemption-form-enabled")}get isValidCode(){return/^[A-Z0-9]{16}$/.test(this.code)}get addLabel(){return this.t(this.redeemedOnce?"gift_card_add_another":"gift_card_add")}openModal(t){this.modalView=t,this.modal?.open?.(),"form"===t&&setTimeout((()=>this.field?.focus()),0)}toDate(t){if(!t)return null;const i="object"==typeof t?t.date??t.datetime??null:t;if("number"==typeof i){const t=new Date(i<1e12?1e3*i:i);return isNaN(t.getTime())?null:t}if("string"!=typeof i)return null;const s=new Date(i.replace(" ","T"));return isNaN(s.getTime())?null:s}expiryMonths(t){const i=this.toDate(t);if(!i)return null;const s=Math.round((i.getTime()-Date.now())/2630016e3);return s>0?s:null}formatMoney(t){try{return salla.money(t)||""}catch(t){return salla.logger?.warn?.("gift-card: could not format amount",t),""}}trackRedeem(t,i,s={}){salla.event.dispatch("giftcard::redeemed",{status:t,code:i?i.slice(0,4)+"X".repeat(Math.max(0,i.length-4)):"",...s})}async redeem(){if(this.pending||!this.isValidCode||!this.canRedeem)return;this.pending=!0,this.error=null;const t=this.code;try{const i=await salla.api.request("wallet/gift-card/redeem",{code:this.code},"post"),s=i?.data||{};this.code="",this.field&&(this.field.value=""),this.inlineForm=!1,this.redeemedOnce=!0,this.result=s,this.openModal("success"),this.giftCardRedeemed.emit(s),this.trackRedeem("success",t,{amount:s.amount,new_balance:s.new_balance,expires_at:s.expires_at})}catch(i){const s=i?.response?.data?.error?.fields;this.error=s?Object.values(s).flat().join(", "):i?.response?.data?.error?.message||this.t("gift_card_redeem_error"),this.inlineForm=!1,this.openModal("error"),this.trackRedeem("failed",t,{reason:this.error})}finally{this.pending=!1}}renderPrompt(){return s("div",{class:"s-gift-card-prompt"},s("div",{class:"s-gift-card-intro"},s("span",{class:"s-gift-card-mark"},s("i",{class:"sicon-gift","aria-hidden":"true"})),s("div",{class:"s-gift-card-copy"},s("p",{class:"s-gift-card-title"},this.t("gift_card_title")),s("p",{class:"s-gift-card-subtitle"},this.t("gift_card_subtitle")))),s("salla-button",{class:"s-gift-card-trigger",color:"primary",fill:"outline",onClick:this.start},s("span",null,this.addLabel)))}renderField(){return[s("label",{class:"s-gift-card-label",htmlFor:"gift_card_redeem_field"},this.tFirst(["pages.gift.code"])),s("input",{id:"gift_card_redeem_field",ref:t=>this.field=t,type:"text",maxlength:16,autocomplete:"off",class:"s-gift-card-input",value:this.code,disabled:this.pending,placeholder:this.t("gift_card_redeem_placeholder"),onInput:this.handleInput,onKeyUp:this.onKeyUp})]}renderSubmit(t=!1){return s("salla-button",{id:"gift_card_redeem_submit",color:"primary",width:t?"wide":"normal",loading:this.pending,"loader-position":"center",disabled:this.pending||!this.isValidCode,onClick:()=>this.redeem()},s("span",null,this.t("gift_card_redeem_confirm")))}renderInlineForm(){return s("div",{class:"s-gift-card-form"},s("div",{class:"s-gift-card-field"},this.renderField()),this.renderSubmit(),s("button",{type:"button",class:"s-gift-card-cancel",disabled:this.pending,onClick:this.cancel},this.t("gift_card_cancel")))}renderSheetForm(){return s("div",{class:"s-gift-card-sheet"},s("div",{class:"s-gift-card-field"},this.renderField()),this.renderSubmit(!0))}renderSuccess(){const t=this.formatMoney(this.result?.amount),i=this.expiryMonths(this.result?.expires_at),e=this.t("gift_card_success_title");return s("div",{class:"s-gift-card-result"},s("span",{class:"s-gift-card-result-mark s-gift-card-result-mark-success",innerHTML:'\n<svg viewBox="0 0 96 96" width="72" height="72" role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">\n \x3c!-- burst --\x3e\n <g fill="#F5C242">\n <path d="M48 8l3.2 7.6L59 18l-6.2 5.3L54 31l-6-4-6 4 1.2-7.7L37 18l7.8-2.4z"/>\n <path d="M71 26l1.9 4.4L77 32l-3.6 3 .7 4.5-4.1-2.3-4.1 2.3.7-4.5L63 32l4.1-1.6z"/>\n <path d="M25 26l1.9 4.4L31 32l-3.6 3 .7 4.5L24 37.2 19.9 39.5l.7-4.5L17 32l4.1-1.6z"/>\n </g>\n <g fill="#E4572E" opacity=".9">\n <circle cx="30" cy="18" r="2.4"/>\n <circle cx="66" cy="18" r="2.4"/>\n <circle cx="48" cy="44" r="2.2"/>\n </g>\n \x3c!-- lid --\x3e\n <rect x="20" y="46" width="56" height="12" rx="3" fill="#2E8B57"/>\n \x3c!-- box --\x3e\n <path d="M25 58h46v26a4 4 0 0 1-4 4H29a4 4 0 0 1-4-4z" fill="#3AA76D"/>\n \x3c!-- ribbon --\x3e\n <rect x="44" y="46" width="8" height="42" fill="#F5F7F6"/>\n <rect x="20" y="46" width="56" height="12" rx="3" fill="#2E8B57" opacity="0"/>\n <rect x="44" y="46" width="8" height="12" fill="#E9EFEB"/>\n</svg>\n'}),e&&s("h3",{class:"s-gift-card-result-title"},e),s("p",{class:"s-gift-card-result-text",innerHTML:i?this.tFirst(["pages.checkout.gift_card_success_body_expiring","pages.checkout.gift_card_success_body","pages.checkout.gift_card_redeem_success"],{amount:t,months:i}):this.tFirst(["pages.checkout.gift_card_success_body","pages.checkout.gift_card_redeem_success"],{amount:t})}),s("salla-button",{color:"primary",width:"wide",onClick:this.shopNow},s("span",null,this.tFirst(["pages.loyalty_program.shop_now"]))))}renderError(){return s("div",{class:"s-gift-card-result"},s("span",{class:"s-gift-card-result-mark s-gift-card-result-mark-error"},s("i",{class:"sicon-cancel","aria-hidden":"true"})),s("h3",{class:"s-gift-card-result-title"},this.tFirst(["pages.checkout.gift_card_failure_title","pages.checkout.gift_card_redeem_error"])),s("p",{class:"s-gift-card-result-text"},this.error))}render(){return this.canRedeem?s(e,{class:"s-gift-card"},s("div",{class:"s-gift-card-panel"},this.inlineForm&&this.isDesktop?this.renderInlineForm():this.renderPrompt()),s("salla-modal",{ref:t=>this.modal=t,class:"s-gift-card-modal",width:"sm",position:this.isDesktop?"middle":"bottom","modal-title":this.t("gift_card_redeem_label"),onModalVisibilityChanged:t=>{t.detail||(this.modalView=null)}},s("div",{class:"s-gift-card-modal-body"},"form"===this.modalView&&this.renderSheetForm(),"success"===this.modalView&&this.renderSuccess(),"error"===this.modalView&&this.renderError()))):null}};a.style='/*!twlt*/@charset "UTF-8";.s-gift-card{display:block;flex:1 1 auto;min-width:0}.s-gift-card-panel{height:100%;background:#fff;border-radius:12px;padding:20px;box-sizing:border-box}.s-gift-card-prompt{display:flex;flex-direction:column;align-items:stretch;gap:16px;height:100%}.s-gift-card-intro{display:flex;align-items:center;gap:12px}.s-gift-card-mark{flex:0 0 auto;width:48px;height:48px;border-radius:9999px;background:#fdecef;color:#e8637c;display:inline-flex;align-items:center;justify-content:center;font-size:22px}.s-gift-card-copy{min-width:0}.s-gift-card-title{margin:0;font-weight:700;font-size:15px;color:#1c1c1c}.s-gift-card-subtitle{margin:2px 0 0;font-size:12px;color:#9aa0a6}.s-gift-card-trigger{display:block}.s-gift-card-form{display:flex;align-items:flex-end;gap:12px}.s-gift-card-field{flex:1 1 auto;min-width:0}.s-gift-card-label{display:block;margin-bottom:6px;font-size:13px;font-weight:700;color:#1c1c1c}.s-gift-card-input{width:100%;height:44px;padding:0 14px;box-sizing:border-box;border:1px solid #e6e8eb;border-radius:8px;background:#fff;font-size:13px;color:#1c1c1c}.s-gift-card-input::placeholder{color:#b7bcc2}.s-gift-card-input:focus{outline:none;border-color:var(--color-primary, #2e8b57)}.s-gift-card-cancel{flex:0 0 auto;height:44px;padding:0 8px;border:0;background:none;color:#6b7280;font-size:13px;cursor:pointer}.s-gift-card-cancel:disabled{opacity:0.5;cursor:default}.s-gift-card-sheet{display:flex;flex-direction:column;gap:16px;padding-top:4px}.s-gift-card-result{display:flex;flex-direction:column;align-items:center;text-align:center;padding:12px 8px 8px}.s-gift-card-result-mark{width:120px;height:120px;border-radius:9999px;display:inline-flex;align-items:center;justify-content:center;margin-bottom:20px}.s-gift-card-result-mark-success{background:#eaf7f0}.s-gift-card-result-mark-error{background:#fdeaea;color:#fff;font-size:34px}.s-gift-card-result-mark-error i{width:72px;height:72px;border-radius:9999px;background:#ea4b4b;display:inline-flex;align-items:center;justify-content:center}.s-gift-card-result-title{margin:0 0 10px;font-size:19px;font-weight:700;color:#1c1c1c}.s-gift-card-result-text{margin:0 0 22px;font-size:13px;line-height:1.7;color:#6b7280}@media screen and (min-width: 768px){.s-gift-card-panel{padding:22px 24px;display:flex;align-items:center}.s-gift-card-prompt{flex-direction:row;align-items:center;justify-content:space-between;gap:24px;width:100%}.s-gift-card-trigger{flex:0 0 auto}.s-gift-card-form{width:100%}.s-gift-card-result{padding:8px 24px 16px}}.inline{display:inline}.contents{display:contents}.resize{resize:both}.uppercase{text-transform:uppercase}.outline{outline-style:solid}';const l=class{constructor(i){t(this,i),this.theme="default",this.show=!1,this.targetElement=null}handleMouseOver(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!0)}handleMouseOut(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!1)}componentDidLoad(){this.targetElement=document.getElementById(this.targetId)}render(){const t=["default","dark"].includes(this.theme)?this.theme:"default";return s("div",{key:"d689900a8fdad37c6396eb55d8140b48f3eda8b8",class:"s-tooltip-container"},s("div",{key:"0ae14c42d03c5f81ce4f19fa90b0260a21ac1c1e",class:`s-tooltip-item s-tooltip-item--${t}`,style:{display:this.show?"block":"none"}},this.text?s("span",null,this.text):s("slot",null)))}get el(){return r(this)}};l.style='/*!twlt*/.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-63%) translateY(-50%);background-color:var(--color-primary);color:var(--color-primary-reverse);bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--color-primary) transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}.s-tooltip-item--dark{background-color:#555555;color:white;padding:5px 15px;border-radius:8px;font-size:12px;font-weight:normal;max-width:330px;width:max-content}.s-tooltip-item--dark::after{border-color:#555555 transparent transparent transparent}.block{display:block}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}';export{a as salla_gift_card_redeem,l as salla_tooltip}
|
|
4
|
+
import{r as t,c as i,h as s,H as e,a as r}from"./p-Bxge4xib.js";const a=class{constructor(s){t(this,s),this.giftCardRedeemed=i(this,"giftCardRedeemed"),this.code="",this.inlineForm=!1,this.pending=!1,this.error=null,this.redeemedOnce=!1,this.isDesktop=!1,this.modalView=null,this.result=null,this.mediaQueryList=null,this.mqlChangeHandler=t=>{this.isDesktop=t.matches,"form"===this.modalView&&this.isDesktop?(this.modalView=null,this.inlineForm=!0):this.inlineForm&&!this.isDesktop&&(this.inlineForm=!1,this.openModal("form"))},this.closeModal=()=>{this.modalView=null,this.modal?.close?.()},this.start=()=>{if(this.error=null,this.code="",this.isDesktop)return this.inlineForm=!0,void setTimeout((()=>this.field?.focus()),0);this.openModal("form")},this.cancel=()=>{this.inlineForm=!1,this.code="",this.error=null,this.closeModal()},this.handleInput=t=>{const i=t.target;this.code=(i.value||"").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,16),i.value=this.code,this.error=null},this.onKeyUp=t=>{"Enter"===t.key&&(t.preventDefault(),this.redeem())},this.shopNow=()=>{this.closeModal(),window.location.href=salla.url.get("/")}}breakpointPx(){return 768}async componentWillLoad(){await salla.onReady(),this.mediaQueryList=window.matchMedia(`(min-width: ${this.breakpointPx()}px)`),this.isDesktop=this.mediaQueryList.matches,this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.mqlChangeHandler):this.mediaQueryList.addListener&&this.mediaQueryList.addListener(this.mqlChangeHandler),await salla.lang.onLoaded()}disconnectedCallback(){this.mediaQueryList?.removeEventListener?this.mediaQueryList.removeEventListener("change",this.mqlChangeHandler):this.mediaQueryList?.removeListener&&this.mediaQueryList.removeListener(this.mqlChangeHandler)}tFirst(t,i){for(const s of t){const t=salla.lang.get(s,i);if(t&&t!==s)return t}return""}t(t,i){return this.tFirst([`pages.checkout.${t}`],i)}get canRedeem(){const t=salla.config.get("store.features",[]);return!salla.config.isGuest()&&t.includes("wallet-gift-card")&&t.includes("giftcard-redemption-form-enabled")}get isValidCode(){return/^[A-Z0-9]{16}$/.test(this.code)}get addLabel(){return this.t(this.redeemedOnce?"gift_card_add_another":"gift_card_add")}openModal(t){this.modalView=t,this.modal?.open?.(),"form"===t&&setTimeout((()=>this.field?.focus()),0)}toDate(t){if(!t)return null;const i="object"==typeof t?t.date??t.datetime??null:t;if("number"==typeof i){const t=new Date(i<1e12?1e3*i:i);return isNaN(t.getTime())?null:t}if("string"!=typeof i)return null;const s=new Date(i.replace(" ","T"));return isNaN(s.getTime())?null:s}expiryMonths(t){const i=this.toDate(t);if(!i)return null;const s=Math.round((i.getTime()-Date.now())/2630016e3);return s>0?s:null}formatMoney(t){try{return salla.money(t)||""}catch(t){return salla.logger?.warn?.("gift-card: could not format amount",t),""}}trackRedeem(t,i,s={}){salla.event.dispatch("giftcard::redeemed",{status:t,code:i?i.slice(0,4)+"X".repeat(Math.max(0,i.length-4)):"",...s})}async redeem(){if(this.pending||!this.isValidCode||!this.canRedeem)return;this.pending=!0,this.error=null;const t=this.code;try{const i=await salla.api.request("wallet/gift-card/redeem",{code:this.code},"post"),s=i?.data||{};this.code="",this.field&&(this.field.value=""),this.inlineForm=!1,this.redeemedOnce=!0,this.result=s,this.openModal("success"),this.giftCardRedeemed.emit(s),this.trackRedeem("success",t,{amount:s.amount,new_balance:s.new_balance,expires_at:s.expires_at})}catch(i){const s=i?.response?.data?.error?.fields;this.error=s?Object.values(s).flat().join(", "):i?.response?.data?.error?.message||this.t("gift_card_redeem_error"),this.inlineForm=!1,this.openModal("error"),this.trackRedeem("failed",t,{reason:this.error})}finally{this.pending=!1}}renderPrompt(){return s("div",{class:"s-gift-card-prompt"},s("div",{class:"s-gift-card-intro"},s("span",{class:"s-gift-card-mark"},s("i",{class:"sicon-gift","aria-hidden":"true"})),s("div",{class:"s-gift-card-copy"},s("p",{class:"s-gift-card-title"},this.t("gift_card_title")),s("p",{class:"s-gift-card-subtitle"},this.t("gift_card_subtitle")))),s("salla-button",{class:"s-gift-card-trigger",color:"primary",fill:"outline",onClick:this.start},s("span",null,this.addLabel)))}renderField(){return[s("label",{class:"s-gift-card-label",htmlFor:"gift_card_redeem_field"},this.tFirst(["pages.gift.code"])),s("input",{id:"gift_card_redeem_field",ref:t=>this.field=t,type:"text",maxlength:16,autocomplete:"off",class:"s-gift-card-input",value:this.code,disabled:this.pending,placeholder:this.t("gift_card_redeem_placeholder"),onInput:this.handleInput,onKeyUp:this.onKeyUp})]}renderSubmit(t=!1){return s("salla-button",{id:"gift_card_redeem_submit",color:"primary",width:t?"wide":"normal",loading:this.pending,"loader-position":"center",disabled:this.pending||!this.isValidCode,onClick:()=>this.redeem()},s("span",null,this.t("gift_card_redeem_confirm")))}renderInlineForm(){return s("div",{class:"s-gift-card-form"},s("div",{class:"s-gift-card-field"},this.renderField()),this.renderSubmit(),s("button",{type:"button",class:"s-gift-card-cancel",disabled:this.pending,onClick:this.cancel},this.t("gift_card_cancel")))}renderSheetForm(){return s("div",{class:"s-gift-card-sheet"},s("div",{class:"s-gift-card-field"},this.renderField()),this.renderSubmit(!0))}renderSuccess(){const t=this.formatMoney(this.result?.amount),i=this.expiryMonths(this.result?.expires_at),e=this.t("gift_card_success_title");return s("div",{class:"s-gift-card-result"},s("span",{class:"s-gift-card-result-mark s-gift-card-result-mark-success",innerHTML:'\n<svg viewBox="0 0 96 96" width="72" height="72" role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">\n \x3c!-- burst --\x3e\n <g fill="#F5C242">\n <path d="M48 8l3.2 7.6L59 18l-6.2 5.3L54 31l-6-4-6 4 1.2-7.7L37 18l7.8-2.4z"/>\n <path d="M71 26l1.9 4.4L77 32l-3.6 3 .7 4.5-4.1-2.3-4.1 2.3.7-4.5L63 32l4.1-1.6z"/>\n <path d="M25 26l1.9 4.4L31 32l-3.6 3 .7 4.5L24 37.2 19.9 39.5l.7-4.5L17 32l4.1-1.6z"/>\n </g>\n <g fill="#E4572E" opacity=".9">\n <circle cx="30" cy="18" r="2.4"/>\n <circle cx="66" cy="18" r="2.4"/>\n <circle cx="48" cy="44" r="2.2"/>\n </g>\n \x3c!-- lid --\x3e\n <rect x="20" y="46" width="56" height="12" rx="3" fill="#2E8B57"/>\n \x3c!-- box --\x3e\n <path d="M25 58h46v26a4 4 0 0 1-4 4H29a4 4 0 0 1-4-4z" fill="#3AA76D"/>\n \x3c!-- ribbon --\x3e\n <rect x="44" y="46" width="8" height="42" fill="#F5F7F6"/>\n <rect x="20" y="46" width="56" height="12" rx="3" fill="#2E8B57" opacity="0"/>\n <rect x="44" y="46" width="8" height="12" fill="#E9EFEB"/>\n</svg>\n'}),e&&s("h3",{class:"s-gift-card-result-title"},e),s("p",{class:"s-gift-card-result-text",innerHTML:i?this.tFirst(["pages.checkout.gift_card_success_body_expiring","pages.checkout.gift_card_success_body","pages.checkout.gift_card_redeem_success"],{amount:t,months:i}):this.tFirst(["pages.checkout.gift_card_success_body","pages.checkout.gift_card_redeem_success"],{amount:t})}),s("salla-button",{color:"primary",width:"wide",onClick:this.shopNow},s("span",null,this.tFirst(["pages.loyalty_program.shop_now"]))))}renderError(){return s("div",{class:"s-gift-card-result"},s("span",{class:"s-gift-card-result-mark s-gift-card-result-mark-error"},s("i",{class:"sicon-cancel","aria-hidden":"true"})),s("h3",{class:"s-gift-card-result-title"},this.tFirst(["pages.checkout.gift_card_failure_title","pages.checkout.gift_card_redeem_error"])),s("p",{class:"s-gift-card-result-text"},this.error))}render(){return this.canRedeem?s(e,{class:"s-gift-card"},s("div",{class:"s-gift-card-panel"},this.inlineForm&&this.isDesktop?this.renderInlineForm():this.renderPrompt()),s("salla-modal",{ref:t=>this.modal=t,class:"s-gift-card-modal",width:"sm",position:this.isDesktop?"middle":"bottom","modal-title":this.t("gift_card_redeem_label"),onModalVisibilityChanged:t=>{t.detail||(this.modalView=null)}},s("div",{class:"s-gift-card-modal-body"},"form"===this.modalView&&this.renderSheetForm(),"success"===this.modalView&&this.renderSuccess(),"error"===this.modalView&&this.renderError()))):null}};a.style='/*!twlt*/@charset "UTF-8";.s-gift-card{display:block;flex:1 1 auto;min-width:0}.s-gift-card-panel{height:100%;background:#fff;border-radius:12px;padding:20px;box-sizing:border-box}.s-gift-card-prompt{display:flex;flex-direction:column;align-items:stretch;gap:16px;height:100%}.s-gift-card-intro{display:flex;align-items:center;gap:12px}.s-gift-card-mark{flex:0 0 auto;width:48px;height:48px;border-radius:9999px;background:#fdecef;color:#e8637c;display:inline-flex;align-items:center;justify-content:center;font-size:22px}.s-gift-card-copy{min-width:0}.s-gift-card-title{margin:0;font-weight:700;font-size:15px;color:#1c1c1c}.s-gift-card-subtitle{margin:2px 0 0;font-size:12px;color:#9aa0a6}.s-gift-card-trigger{display:block}.s-gift-card-form{display:flex;align-items:flex-end;gap:12px}.s-gift-card-field{flex:1 1 auto;min-width:0}.s-gift-card-label{display:block;margin-bottom:6px;font-size:13px;font-weight:700;color:#1c1c1c}.s-gift-card-input{width:100%;height:44px;padding:0 14px;box-sizing:border-box;border:1px solid #e6e8eb;border-radius:8px;background:#fff;font-size:13px;color:#1c1c1c}.s-gift-card-input::placeholder{color:#b7bcc2}.s-gift-card-input:focus{outline:none;border-color:var(--color-primary, #2e8b57)}.s-gift-card-cancel{flex:0 0 auto;height:44px;padding:0 8px;border:0;background:none;color:#6b7280;font-size:13px;cursor:pointer}.s-gift-card-cancel:disabled{opacity:0.5;cursor:default}.s-gift-card-sheet{display:flex;flex-direction:column;gap:16px;padding-top:4px}.s-gift-card-result{display:flex;flex-direction:column;align-items:center;text-align:center;padding:12px 8px 8px}.s-gift-card-result-mark{width:120px;height:120px;border-radius:9999px;display:inline-flex;align-items:center;justify-content:center;margin-bottom:20px}.s-gift-card-result-mark-success{background:#eaf7f0}.s-gift-card-result-mark-error{background:#fdeaea;color:#fff;font-size:34px}.s-gift-card-result-mark-error i{width:72px;height:72px;border-radius:9999px;background:#ea4b4b;display:inline-flex;align-items:center;justify-content:center}.s-gift-card-result-title{margin:0 0 10px;font-size:19px;font-weight:700;color:#1c1c1c}.s-gift-card-result-text{margin:0 0 22px;font-size:13px;line-height:1.7;color:#6b7280}@media screen and (min-width: 768px){.s-gift-card-panel{padding:22px 24px;display:flex;align-items:center}.s-gift-card-prompt{flex-direction:row;align-items:center;justify-content:space-between;gap:24px;width:100%}.s-gift-card-trigger{flex:0 0 auto}.s-gift-card-form{width:100%}.s-gift-card-result{padding:8px 24px 16px}}.inline{display:inline}.contents{display:contents}.resize{resize:both}.uppercase{text-transform:uppercase}.outline{outline-style:solid}';const l=class{constructor(i){t(this,i),this.theme="default",this.show=!1,this.targetElement=null}handleMouseOver(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!0)}handleMouseOut(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!1)}componentDidLoad(){this.targetElement=document.getElementById(this.targetId)}render(){const t=["default","dark"].includes(this.theme)?this.theme:"default";return s("div",{key:"d689900a8fdad37c6396eb55d8140b48f3eda8b8",class:"s-tooltip-container"},s("div",{key:"0ae14c42d03c5f81ce4f19fa90b0260a21ac1c1e",class:`s-tooltip-item s-tooltip-item--${t}`,style:{display:this.show?"block":"none"}},this.text?s("span",null,this.text):s("slot",null)))}get el(){return r(this)}};l.style='/*!twlt*/.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-63%) translateY(-50%);background-color:var(--color-primary);color:var(--color-primary-reverse);bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--color-primary) transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}.s-tooltip-item--dark{background-color:#555555;color:white;padding:5px 15px;border-radius:8px;font-size:12px;font-weight:normal;max-width:330px;width:max-content}.s-tooltip-item--dark::after{border-color:#555555 transparent transparent transparent}.block{display:block}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}';export{a as salla_gift_card_redeem,l as salla_tooltip}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as r,h as e,H as i,a as s}from"./p-
|
|
4
|
+
import{r as t,c as r,h as e,H as i,a as s}from"./p-Bxge4xib.js";import{H as o,F as a}from"./p-Brgf4SAC.js";import"./p-CgtvEd63.js";const l=class{constructor(e){t(this,e),this.changed=r(this,"changed"),this.isReady=!1,this.isInitialFetch=!0,this.filtersData={},salla.event.on("filters::hidden",(()=>this.host.style.display="none")),salla.lang.onLoaded((()=>{this.apply=salla.lang.get("pages.checkout.apply")})),salla.event.on("filters::fetched",(({filters:t})=>{this.host.style.display="";let r={};this.filters=o.resolveFilterLabels(t).map((t=>{this.filtersData.variants&&t.type==a.VARIANTS&&(r.variants=this.filtersData.variants),this.filtersData[t.key]&&t.type!==a.VARIANTS&&(r[t.key]=this.filtersData[t.key]);let e=new URLSearchParams(window.location.search),i=!1;for(let t of e.keys())if(t.includes("filters")){i=!0;break}if(this.isInitialFetch&&"product.index"==salla.config.get("page.slug")&&0==Object.keys(r).length&&!i){let t=window.location.href,e=salla.config.get("page.id"),i=-1!==t.indexOf("?")?"&":"?",s=t+i+"filters[category_id]="+e;r.category_id=e,window.history.pushState({path:s},"",s)}return t})),this.isInitialFetch=!1,this.filtersData=r,this.host.childNodes.forEach((async t=>t.setWidgetHeight&&await t.setWidgetHeight()))}))}async componentWillLoad(){try{const t=new URLSearchParams(window.location.search);this.filtersData=await o.extractFiltersFromUrl(t)}catch(t){console.warn("failed to get filters from URL",t.message)}}async getFilters(){return this.filtersData}async applyFilters(){if(!this.isReady)return;let t=Object.keys(this.filtersData).length>0;setTimeout((()=>{if(t){let t=new URL(window.location.href);for(const[r]of t.searchParams.entries())r.startsWith("filters")&&t.searchParams.delete(r);let r=this.encodeFilters(this.filtersData),e=t.search.split("&").filter((t=>!t.includes("filters"))).join("&");t.search=e?t.search.split("&filters")[0]+"&"+r:`?${r}`,window.history.pushState({},"",t.href)}else{let t=new URL(window.location.href);t.searchParams?.delete("filters"),window.history.pushState({},"",t.toString())}salla.event.emit("salla-filters::changed",this.filtersData),this.changed.emit(this.filtersData)}),300)}encodeFilters(t,r="filters"){const e=[];for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const s=t[i],o=r?`${r}[${i}]`:i;Array.isArray(s)?s.forEach((t=>e.push(`${o}[]=${t}`))):e.push("object"==typeof s&&null!==s?this.encodeFilters(s,o):`${o}=${s}`)}return e.join("&")}async resetFilters(){return this.removeFiltersQueryParams(),this.filtersData={},this.host.childNodes.forEach((t=>t.reset&&t.reset())),salla.event.emit("salla-filters::reset"),this.applyFilters()}removeFiltersQueryParams(){const t=new URLSearchParams(window.location.search),r=Array.from(t.keys()).filter((t=>!t.startsWith("filters["))).map((r=>`${encodeURIComponent(r)}=${encodeURIComponent(t.get(r))}`)).join("&"),e=r?`${window.location.pathname}?${r}`:window.location.pathname;window.history.pushState({},"",e)}handleOptionChange(t,r,e){r.type===a.RANGE&&(this.filtersData[r.key]=e);let i=t.target.checked;if(r.type===a.VARIANTS)this.filtersData.variants=this.filtersData.variants||{},i&&(this.filtersData.variants[r.key]=e),i||delete this.filtersData.variants[r.key];else if("radio"==t.target.type)i&&(this.filtersData[r.key]=e),i||delete this.filtersData[r.key];else if("checkbox"==t.target.type){const t=this.filtersData[r.key];this.filtersData[r.key]=Array.isArray(t)?t:null!=t?[t]:[],i?this.filtersData[r.key].push(e):this.filtersData[r.key]=this.filtersData[r.key].filter((t=>t!=e)),this.filtersData[r.key].length||delete this.filtersData[r.key]}this.filtersData={...this.filtersData},this.applyFilters()}async removeFilter(t){if(t.type===a.VARIANTS)this.filtersData.variants&&(delete this.filtersData.variants[t.variantKey],Object.keys(this.filtersData.variants).length||delete this.filtersData.variants);else if(t.type===a.RANGE)delete this.filtersData[t.key];else{const r=this.filtersData[t.key];Array.isArray(r)?(this.filtersData[t.key]=r.filter((r=>r!=t.value)),this.filtersData[t.key].length||delete this.filtersData[t.key]):delete this.filtersData[t.key]}this.filtersData={...this.filtersData},this.applyFilters()}render(){return e(i,{key:"ef7f2cf7241193cb8b2fe24fdb0713d8c92c04c9"},this.filters?.map((t=>e("salla-filters-widget",{option:t,filtersData:this.filtersData,onChanged:({detail:{event:t,option:r,value:e}})=>{this.handleOptionChange(t,r,e)}}))))}componentDidLoad(){this.isReady=!0}get host(){return s(this)}};l.style='/*!twlt*/:host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-filters-checkbox{height:1.25rem;width:1.25rem;border-radius:6px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));color:var(--color-primary)}.s-filters-checkbox:focus{--tw-ring-color:transparent}.s-filters-radio{position:relative;height:1rem;width:1rem;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1)) !important;color:var(--color-primary)}.s-filters-radio:focus{--tw-ring-color:transparent}.s-filters-radio:where([dir="ltr"],[dir="ltr"] *){margin-right:0.75rem}.s-filters-radio:where([dir="rtl"],[dir="rtl"] *){margin-left:0.75rem}.s-filters-radio:checked{border-color:var(--color-primary)}.s-filters-radio:checked::after{position:absolute;left:0.125rem;top:0.125rem;display:block;height:0.625rem;width:0.625rem;border-radius:9999px;background-color:var(--color-primary);--tw-content:\'\';content:var(--tw-content)}.s-filters-radio:checked:hover{border-color:var(--color-primary)}.s-filters-radio:checked:focus{border-color:var(--color-primary)}.s-filters-label{position:relative;margin-bottom:0.75rem;display:flex;cursor:pointer;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:500}.s-filters-label:last-child{margin-bottom:0px}.s-filters-option-name{margin-left:0.5rem;margin-right:0.5rem;--tw-text-opacity:1;color:rgb(129 127 127 / var(--tw-text-opacity, 1))}.s-filters-footer{margin-top:1rem;display:flex}.s-filters-footer salla-button{flex:1 1 0%}.s-filters-footer salla-button button{width:100%}';export{l as salla_filters}
|