Как удалить мертвых блох с собаки
    Милая пастушья собака нашла свой дом навсегда – усыновлена
    Могут ли кошки есть куркуму? Узнайте невероятную правду об этом
    Могут ли кошки есть сыр? Вот все, что вам нужно знать
    Почему собаки кусают незнакомцев

    5-минутное экспертное руководство для владельцев собак по лечению остеоартрита

    {% endraw %}\"}", "bundle":{}, "labels":`{\"appstle.subscription.wg.cartHiddenAttributesSelectorV2\":\"\",\"appstle.subscription.wg.daysFrequencyTextV2\":\"Days\",\"appstle.subscription.wg.subscribeAndSaveSuccessV2\":\"Подписаться успех\",\"appstle.subscription.wg.addToShipmentSuccessTextV2\":\"Success\",\"appstle.subscription.wg.monthFrequencyTextV2\":\"Month\",\"appstle.subscription.wg.addToShipmentButtonTextV2\":\"Добавить в Отгрузка\",\"appstle.subscription.wg.onetimeDescriptionTextV2\":\"\",\"appstle.subscription.wg.oneTimePurchaseTextV2\":\"Однократная покупка\",\"appstle.subscription.wg.loyaltyPerkDescriptionTextV2\":\"{{#isDiscountTypeFreeProduct}

    5-минутное экспертное руководство для владельцев собак по лечению остеоартрита <\/img><\/div>

    После заказа {{{billingCycleBlock}}} получите БЕСПЛАТНО {{freeProductName}} <\/span><\/div>

    {{\/isDiscountTypeFreeProduct}}{{#isDiscountTypePercentage}}После {{{billingCycleBlock}}}<\/span> заказа<\/span> получите скидку {{{discount}}}% на весь заказ<\/span><\/span>.{{\/isDiscountTypePercentage}}{{#isDiscountTypeShipping}}After {{{billingCycleBlock}}}<\/span> заказ<\/span>, получите доставку по цене {{{formatDiscountedPrice}}}<\/span><\/span>.{{\/isDiscountTypeShipping}}{{#isDiscountTypeFixed}}После {{{billingCycleBlock}}}<\/span> заказа<\/span> получите {{{formatDiscountedPrice}}} ВЫКЛ на весь ваш заказ<\/span><\/span>.{{\/isDiscountTypeFixed}}\",\"appstle.subscription.wg.atcButtonTextSelectorV2\":\"\",\"appstle.subscription.wg.oneTimeFrequencyTextV2\":\"One Time\",\"appstle.subscription.wg.allowFulfilmentCountViaPropertiesV2\":\"false\",\"appstle.subscription.wg.valdiateFormSelectorV2\":\"\",\"appstle.subscription.wg.monthsFrequencyTextV2\":\"Months\",\"appstle.subscription.wg.prepaidSaveBadgeTextV2\":\"SAVE {{selectedDiscountPercentage}}\",\"appstle.subscription.wg.manageSubscriptionButtonTextV2\":\"Управление Subscription\",\"appstle.subscription.wg.yearFrequencyTextV2\":\"Year\",\"appstle.subscription.wg.widgetPriceChangeListenerSelectorV2\":\"\",\"appstle.subscription.wg.atcButtonTextV2\":\"\",\"appstle.subscription.wg.noSubscriptionLabelTextV2\":\"Нет Подписка\",\"appstle.subscription.wg.cancelAnytimeLabelTextV2\":\"Отмена В любое время\",\"appstle.subscription.wg.addToShipmentErrorTextV2\":\"Error\",\"appstle.subscription.wg.weeksFrequencyTextV2\":\"Weeks\",\"appstle.subscription.wg.weeklyLabelTextV2\":\"еженедельно\",\"appstle.subscription.wg.displayAddToExistingSubs criptionButtonForNotLoggedInV2\":\"false\",\"appstle.subscription.wg.addToShipmentProcessingV2\":\"Обработка...\",\"appstle.subscription.wg.showWidgetStaticV2\":\"false\",\"appstle.subscription.wg.deliveryEveryFrequencyTextV2\":\"Delivery Every\",\"appstle.subscription.wg.subscribeAndSaveInitalV2\":\"Подписаться и save\",\"appstle.subscription.wg.allowRefreshOnCartPageV2\":\"false\",\"appstle.subscription.wg.prepaidLabelTextV2\":\"Prepaid\",\"appstle.subscription.wg.monthlyLabelTextV2\":\"Monthly\",\"appstle.subsc ription.wg.displayAddToExistingSubscriptionButtonToSubscribersOnlyV2\":\"false\",\"appstle.subscription.wg.yearsFrequencyTextV2\":\"Years\",\"appstle.subscription.wg.addToShipmentTooltipTextV2\":\"Пожалуйста избегайте двойной оплаты доставки! Войдите, чтобы добавить этот продукт в предстоящий доставка.\",\"appstle.subscription.wg.weekFrequencyTextV2\":\"Неделя\",\"appstle.subscription.wg.unsubscribeFrequencyTextV2\":\"unsubscription\",\"appstle.subscription.wg.widgetVariantChangeListenerSelectorV2\":\"\",\ "appstle.subscription.wg.atcButtonTextSelectorObserverV2\":\"\",\"appstle.subscription.wg.dayFrequencyTextV2\":\"day\",\"appstle.subscription.wg.showPrepidPerDeliveryProductPriceV2\":\"false\",\"appstle.subscript ion.wg.offFrequencyTextV2\":\"Выкл.\",\"appstle.subscription.wg.prepayLabelTextV2\":\"Prepay\",\"appstle.subscription.wg.productPageUnitPriceSelectorV2\":\"\",\"appstle.subscription.wg. FrequencyCombinedWidgetTextV2 \":\"Частота\",\"appstle.subscription.wg.showNewLoyaltyUI\":\"false\",\"appstle.subscription.wg.sellingPlanTitleTextNonPrepaid\":\"{{sellingPlanName}}\",\"appstle.subscription.wg.selectDeliverOptionV2\":\"select option доставки\",\"appstle.subscription.wg.yearlyLabelTextV2\":\"Ежегодно\"}`, "css":{ "appstle_subscription_widget":{ "margin-top":"" , "margin-bottom":"", }, "appstle_subscription_wrapper":{ "border-width":"", "border-color":"", }, "appstle_circle":{ "border-color":"", }, "appstle_dot":{ "background-color":"", }, "appstle_select":{ "padding-top":"", "padding-bottom":"", "padding-left":"", "padding-right":"", "border-width":"", "border-style":"", "border-color":"", "border-radius":"", }, "tooltip_subscription_svg":{ "fill":"", }, "appstle_tooltip":{ "color":"", "background-color":"", }, "appstle_tooltip_border_top_color":{ "border-top-color":"", }, "appstle_subscription_final_price":{ "color":"", }, "appstle_widget_text_color":{ "color":"", }, "appstle_selected_background":{ "background":"transparent", }, "elementCSS":"[]", "customCSS":"a.appstle_manageSubBtn {\n border:2px Solid #A94500 !important;\n}", "customerPortalCss":"", "externalStyleTag":"", "themeCss":"", } }; window.AppstleSubscription =window.AppstleSubscription || JSON.parse(JSON.stringify(RS)); sessionStorage['appstleSubscriptionConfig'] =JSON.stringify(RS.Config); попробуйте { window.appstle_build_a_box_labels ={"perDeliveryLabelTextV2":"\\/delivery","variantNotAvailable":"Недоступно","saveDiscountText":"{{discount}}","bundleSummaryTextV2":"Ваш пакет пуст. Добавьте продукты в свои пакеты, чтобы просмотреть сводку пакетов здесь.","freeProductLabelTextV2":"Free","bundleDescriptionTextV2":"Наш набор всех пакетов The Ultimate Superfood Bundle обеспечивает именно то, что обещает — комплексное решение для суперпродуктов. Каждая из 7 смесей суперпродуктов создана для улучшения всех аспектов вашего здоровья и благополучия — от иммунитета и здоровья кишечника до энергии и лучшей концентрации.","productDetails":"Product Details","failedToAddMsgText":"Ваша корзина не может быть более {{maxProduct}} продуктов","cart":"Cart","reviewBundleTextV2":"Review Bundle","addButtonText":"Add","minimumQuantityToCheckoutV2":"Минимальное количество {{quantity}} для оформления заказа","buildBoxErrormsgV2":"Создать токен Box недействительно, свяжитесь с нами support.","continueShopping":"Продолжить покупки","failedToAddTitleText":"Не удалось добавить","spendAmountGetDiscount":"Потратьте {{amount}} и получите скидку {{percent}}%","maxiumQuantityToCheckoutV2":"Максимальное количество {{quantity}} для checkout","contentsOnModalTextV2":"Contents","nextStepButtonTextV2":"Следующий шаг","choosePlanLifeStyleTextV2":"Выберите план, соответствующий вашему образу жизни","selectMinimumProductButtonText":"Пожалуйста, выберите {{minProduct}} минимальный продукт","subtotal":"Subtotal","buyQuantityGetDiscount":"Купить {{quantity}} получите скидку {{percent}}%","loyaltyTablePercentageTextV2":"После {{billingCycle}}<\\/span> заказа<\\/span> получите скидку {{discount}}%<\\/span><\\/span>.","loyaltyTablePercentageTextV2":"После {{billingCycle}}<\\/span> order<\\/span>, получите по {{price}}<\\/span><\\/span>.","myDeliveryText":"Моя доставка {{selectedSellingPlanDisplayName}}","removeItem":"Remove","productsToProceedText":"Выберите продукты для продолжения","previousStepButtonTextV2":"Предыдущий шаг","loadMoreTextV2":"Загрузить больше","selectedFrequencyLabelText":"Выбранная частота","addToCartButtonTextV2":"Добавить в Cart","basePriceFormatFieldV2":"{{unitPrice}}\\/{{quantityUnit}}","title":"Build-A-Box","productPriceFormatField":"{{price}}","reviewOrdeDescriptionTextV2":"Проверьте свои товары и выберите требуемую частоту plan","quantityLabelV2":"Quantity","minimumOrderAmountLabelTextV2":"Минимальная сумма заказа {{minOrderAmount}}.","subscriptionNotAvailableButtonV2":"Подписка недоступна","shoppingCart":"Корзина","checkoutMessage":"Доставка и налоги рассчитываются в checkout.","discountPopupCheckoutMessageV2":"Discount","selectedButtonTextV2":"Selected","congratsMessageText":null,"okBtnText":"Ok","tieredDiscount":"Многоуровневая скидка","choosePlanLifeStyleDescriptionTextV2":"Каждую неделю ограничение на внесение изменений в питание - полночь четверга (График доставки:следующим образом:Голд-Кост – понедельник | Брисбен и Саншайн-Кост – среда)","orderNoteLabelTextV2":"Примечание к заказу","minimumToCheckoutV2":"Минимум {{quantity}} для оформления заказа","loyaltyTableFixedTextV2":"После {{billingCycle}}<\\/span> заказа<\\/span> получите {{price}} off<\\/span><\\/span>.","editQuantity":"Редактировать количество","chooseProductsTextV2":"Выберите продукты","loyaltyTableFreeProductTextV2":"После {{billingCycle}}<\\/span> заказа<\\/span> получите БЕСПЛАТНЫЙ ПРОДУКТ ({{productName}})<\\/span><\\/span>.","loyaltyTableShippingTextV2":"После {{billingCycle}}<\\/span> заказа<\\/span> получите доставку в {{price}}<\\/span><\\/span>.","spentText":null,"quantityLabel":null,"addButtonV2":"Add","loyaltyTableFreeTrailTextV2":"Получите {{discount}} {{discountType}} <\\/span><\\/span> бесплатно пробная версия.<\\/span>","bundleCheckoutTextV2":"Оформить заказ","reviewOrderTextV2":"Просмотр заказа","goBackButtonText":"Вернуться","selectPlanTextV2":"Выбрать план","viewProduct":"Просмотреть продукт","oneTimePurchaseTextV2":"Один раз Purchase","bundleOnModalTextV2":"Bundle","proceedToCheckoutButtonText":"Перейти к оформлению заказа","pleaseWaitLabelTextV2":"Пожалуйста, подождите...","typeToSearchPlaceholderTextV2":"Введите текст для поиска","selectedProgressLabelTextV2":"Выбрано","outOfStockTextV2":"Нет в наличии"}; } catch (e) { console.error("Ошибка синтаксического анализа меток блока:", e); } вар _RSConfig =_RSConfig || {}; _RSConfig.shop ='petsmont.myshopify.com'; _RSConfig.shopMoneyFormat ='${{amount}}'; _RSConfig.shopMoneyFormatWithCurrencyFormat ='${{amount}} долларов США'; }

    `; document.querySelector('body').insertAdjacentHTML('beforeend', SnackBarHtml); window.addEventListener('сообщение', toasterEventListener, false); function toasterEventListener(event) { if (event?.data &&typeof event?.data.indexOf ==='function' &&event?.data?.indexOf('appstle_message_for_notification') !==-1) { var message =event?.data?.split('|')[1]; showAppstleLoyaltyToaster (сообщение); } } Пусть SnackBarIndex =0; функция showAppstleLoyaltyToaster(msg) { var SnackBar =document.getElementById('snackbar'); SnackBar.classList.add('показать'); SnackBar.insertAdjacentHTML('beforeend', ``); const el =SnackBarIndex; setTimeout(function() { if (document.getElementById(`elem${el}`)) document.getElementById(`elem${el}`).remove(); }, 5000); закускаБарИндекс++; } const closeSnackBar =(el) => document.getElementById(el).remove(); document.addEventListener('DOMContentLoaded', () => { }); const выполненияLoyaltyWidget =() => { const parseHtmlStringContent =(content) => { if (typeof content !=='string') return content; попробуйте { const htmlDecoded =content?.replace(/\\\//g, '/'); return JSON.parse(`"${htmlDecoded}"`); } catch (error) { console.error('Ошибка анализа содержимого:', error); возврат контента; } }; const formatNumberByPointRoundType =num => { if (typeof num!=='number') return num; const roundType =_ALConfig?.pointRoundType || "НЕТ_РАУНД"; const rounded =roundType ==='ROUND_UP' ? Math.ceil(num):roundType ==='ROUND_DOWN' ? Math.floor(num):число; return (Number.isInteger(rounded) || округлено % 1 ===0) ? rounded.toFixed(0) :rounded.toFixed(2); }; const лояльностьWidgetStyles =``; document.querySelector('body').insertAdjacentHTML('beforeend', лояльностьWidgetStyles); const mainHTMLString =``; document.querySelector('body').insertAdjacentHTML('beforeend', mainHTMLString); window.addEventListener('сообщение', widgetEventListener, false); function widgetEventListener(event) { if (event?.data &&typeof event?.data.indexOf ==='function' &&event?.data?.indexOf('appstle_message_for_showWidget') !==-1) { } else if (event?.data &&typeof event?.data.indexOf ==='function' &&event?.data?.indexOf('appstle_widget_showHide') !==-1) { toggleWidget(); } else if (event?.data &&typeof event?.data.indexOf ==='function' &&event?.data?.indexOf('refresh_appstle_loyalty_widget') !==-1 &&_ALConfig?.widget_setting?.widgetType ==='LAUNCHER') { loadAppstleLoyaltyWidget(); console.log('ОБНОВИТЬ ВИДЖЕТ'); } else if (event?.data &&typeof event?.data.indexOf ==='function' &&event?.data?.indexOf('show_appstle_loyalty_widget') !==-1) { loadAppstleLoyaltyWidget(); включитьВиджет(); } } function removeAppstleLoyaltyWidget() { document.querySelector('#appstle-loyalty-button')?.classList?.add('appstle-loyalty-hidden'); document.querySelector('#appstle_loyalty_iframe')?.classList?.add('appstle-loyalty-hidden'); } (функция checkForWidgetRestrictions() { let isShowWidget =true; if (_ALConfig?.customerLoyalty?.customerStatus ==='EXCLUDED') { isShowWidget =false; } if (!_ALConfig?.customerId) { isShowWidget =!(_ALConfig?.widget_setting?.restrictedCustomersTag || _ALConfig?.widget_setting?.allowedCustomersTag); } if (_ALConfig?.widget_setting?.allowedCustomersTag?.length &&isShowWidget) { let AllowTags =_ALConfig?.widget_setting?.allowedCustomersTag.split(','); if (allowedTags?.length> 0 &&!_ALConfig?.customerTags?.some((tag) => разрешенные теги?.some((allowedTag) => разрешенный тег?.trim()?.toLowerCase() ===tag?.trim()?.toLowerCase()))) { isShowWidget =false; } } if (_ALConfig?.widget_setting?.restrictedCustomersTag?.length &&isShowWidget) { let ограниченные теги =_ALConfig?.widget_setting?.restrictedCustomersTag?.split(','); if (restrictedTags?.length> 0 &&_ALConfig?.customerTags?.some((tag) => ограниченные теги?.some((restrictedTag) => ограниченный тег?.trim()?.toLowerCase() ===tag?.trim()?.toLowerCase()))) { isShowWidget =false; } } if (_ALConfig?.widget_setting?.blockWidgetOnPages?.length &&isShowWidget) { letstrictPages =_ALConfig?.widget_setting?.blockWidgetOnPages?.split(','); const currentPage =window?.location?.pathname; (restrictedPages?.length> 0) { if (restrictedPages?.includes('/homepage') &¤tPage ==='/') { isShowWidget =false; } else if (restrictedPages?.some((page) => currentPage?.includes(page))) { isShowWidget =false; (_ALConfig?.widget_setting?.allowWidgetOnSpecificPages?.length &&isShowWidget) { let AllowPages =_ALConfig?.widget_setting?.allowWidgetOnSpecificPages?.split(','); const currentPage =window?.location?.pathname if (allowedPages?.length> 0) { if (allowedPages?.includes('/homepage') &¤tPage ==='/') { isShowWidget =true; } else if (allowedPages?.some((page) => currentPage?.includes(page))) { isShowWidget =true; } else { isShowWidget =false; } } } if (!_ALConfig?.customerId &&_ALConfig?.widget_setting?.showToLoggedInCustomerOnly) { isShowWidget =false; } window.__APPSTLE_LOYALTY_LAUNCHER_ALLOWED =!!isShowWidget; if (isShowWidget) { showAppstleLoyaltyWidget(); function EnableWidget() { document.querySelector('#appstle_loyalty_iframe')?.classList?.add('open'); document.querySelector('#appstle_loyalty_iframe')?.classList?.remove('appstle-loyalty-hidden'); setTimeout(function() { document.querySelector('#appstle_loyalty_iframe')?.classList?.toggle('show-close-icon'); }, 900); } function showAppstleLoyaltyWidget() { const launcherAllowed =window?.['__APPSTLE_LOYALTY_LAUNCHER_ALLOWED'] !==false; document.querySelector('#appstle_loyalty_iframe')?.classList?.remove('appstle-loyalty-hidden'); const btn =document.querySelector('#appstle-loyalty-button'); если (!btn) возврат; if (launcherAllowed) { btn.classList.remove('appstle-loyalty-hidden'); } else { btn.classList.add('appstle-loyalty-hidden'); } } document.querySelector('.appstle-loyalty-button').addEventListener('click', toggleWidget); if (_ALConfig?.widget_setting?.widgetPosition ==='LEFT') { document.getElementById('appstle_loyalty_iframe')?.classList?.add('appstle-loyalty-left'); document.querySelector('.appstle-loyalty-button')?.classList?.add('appstle-loyalty-left'); document.getElementById('appstle_loyalty_iframe')?.classList?.add('appstle-loyalty-left'); document.getElementById('snackbar')?.classList?.add('left_snackbar'); } else { document.getElementById('appstle_loyalty_iframe')?.classList?.add('appstle-loyalty-right'); document.querySelector('.appstle-loyalty-button')?.classList?.add('appstle-loyalty-right'); document.getElementById('snackbar')?.classList?.add('right_snackbar'); } const alIframeSrc =`

    `; функция toggleWidget() { loadAppstleLoyaltyWidget(); if (_ALConfig?.widget_setting?.widgetType?.toUpperCase() ==='LAUNCHER' ​​&&_ALConfig?.widget_setting?.forceRedirectDedicatedPage ===true) { window.open(`/${_ALConfig?.proxy_path_prefix}`); } else { document.querySelector('#appstle_loyalty_iframe')?.classList?.toggle('open'); showAppstleLoyaltyWidget(); setTimeout(function() { document.querySelector('#appstle_loyalty_iframe')?.classList?.toggle('show-close-icon'); }, 900); } } const loadAppstleLoyaltyWidget =() => { var iframe =document.querySelectorAll('#appstle_loyalty_iframe'); iframe.forEach(function(item) { item.contentWindow._ALConfig =_ALConfig; item.contentWindow.document.open('text/html', 'replace'); item.contentWindow.document.write(alIframeSrc); item.contentWindow.document.close(); }); }; const launcherDataType =_ALConfig?.widget_setting?.launcherDataType || «ОЧКИ»; const лояльностьButtonTitle =document.getElementById('loyalty-widget-title'); if (_ALConfig?.shop_labels?.widgetTitle) { лояльностьButtonTitle.innerHTML =parseHtmlStringContent(_ALConfig?.shop_labels?.widgetTitle); } (function() { const { customerLoyalty, widget_setting } =_ALConfig || {}; if (!customerLoyalty) return; const showTier =widget_setting?.showTierName; const launcherButtonElement =document.querySelector('#appstle-loyalty-button'); const PointsEl =document.querySelector('.loyalty_widget_available_points'); if (!pointsEl) return; const fmt =new Intl.NumberFormat(); const {storeCreditBalance =0, AvailablePoints =0, currentVipTier ='' } =customerLoyalty; let displayValue; if (launcherDataType ==='STORE_CREDITS') { const n =Number(storeCreditBalance) || 0; displayValue =fmt.format(formatNumberByPointRoundType(n)); else if ((launcherDataType ==='VIP_TIER') &¤tVipTier) { displayValue =String(currentVipTier); } else { const n =Number(availablePoints) || =fmt.format(formatNumberByPointRoundType(n)); } PointsEl.textContent =displayValue; launcherButtonElement?.classList.add('appstle_show_points' })(); function handleDeepLink() { const лояльностьDeepLinks =[ '#appstle-loyalty', '#appstle-refer', '#appstle-loyalty-earn-rewards', '#appstle-loyalty-redeem-rewards', '#appstle-loyalty-referrals', '#appstle-loyalty-vip-program' ]; if (!_ALConfig?.widget_setting?.showWidget || !loyaltyDeepLinks.some(hash => location?.hash?.includes(hash))) { return; } loadAppstleLoyaltyWidget(); включитьВиджет(); setTimeout(() => { document.querySelector('#appstle_loyalty_iframe')?.classList?.add('show-close-icon'); }, 900); } HandleDeepLink(); const widgetReferralUrl =новый URL(window.location.href); if (_ALConfig?.referralEnabled &&widgetReferralUrl?.searchParams.get('appstle_referral') &&_ALConfig?.widget_setting?.widgetType ==='LAUNCHER') { let ReferralRedirectUrl =_ALConfig?.widget_setting?.referralRedirectUrl; пусть redirectURL =ReferralRedirectUrl + window.location.search; если (referralRedirectUrl) {let ReferralUrlObj; попробуйте {referralUrlObj =новый URL (referralRedirectUrl, window.location.origin); } Задвижка {referralUrlObj =null; } Пусть ReferralPath =ReferralUrlObj? ReferralUrlObj.pathname.replace(/\/+$/, '') :ReferralRedirectUrl.replace(/\/+$/, ''); let currentPath =window.location.pathname.replace(/\/+$/, ''); if (referralPath &¤tPath !==ReferralPath) { window.open(redirectURL, '_self'); } } setTimeout(() => { loadAppstleLoyaltyWidget(); EnableWidget(); }, 200); } (function ObserveURLChanges() { let LastUrl =location.href; const handleUrlChange =() => { if (location.href !==LastUrl) { handleDeepLink(); LastUrl =location.href; } }; new MutationObserver(handleUrlChange).observe(document.body, {subtree:true, childList:true }); window.addEventListener('popstate', handleUrlChange); window.addEventListener('hashchange', handleUrlChange })(); const alDOMObserver =new MutationObserver(function(mutations_list) {mutations_list.forEach(function(mutation) {mutation.addedNodes.forEach(function(added_node) { if (added_node.id ==='appstle_loyalty_iframe') { var iframe =document.querySelectorAll('#appstle_loyalty_iframe'); iframe.forEach(function(item) { item.contentWindow._ALConfig =_ALConfig; item.contentWindow.document.open('text/html', 'replace'); item.contentWindow.document.write(alIframeSrc); item.contentWindow.document.close(); }); alDOMObserver.disconnect() } }); alDOMObserver.observe(document.querySelector('body'), {поддерево:true, childList:true });

    } попробуйте { const versionUrl =`${location.origin}/${_ALConfig?.proxy_path_prefix || 'apps/loyalty'}/app-loyalty-version`; fetch(versionUrl) .then(res => res.json()) .then(data => { if (data) { const widgetJsUrl =новый URL(_ALConfig.widgetJsPath); const widgetCssUrl =новый URL(_ALConfig.widgetCssPath); widgetJsUrl.searchParams.set('v', data); widgetCssUrl.searchParams.set('v', data); _ALConfig.widgetJsPath =widgetJsUrl.toString(); _ALConfig.widgetCssPath =widgetCssUrl.toString(); } }) .catch(() => { }) .finally(() => {executeLoyaltyWidget(); }); } Задвижка (ошибка) {executeLoyaltyWidget(); } const storeCreditMismatch =_ALConfig?.customerId &&_ALConfig?.customerStoreCreditBalance>=0 &&_ALConfig?.customerLoyalty?.storeCreditBalance>=0 &&_ALConfig?.customerLoyalty?.storeCreditBalance !==_ALConfig?.customerStoreCreditBalance; if (storeCreditMismatch &&_ALConfig.shop ==='olineloyalty27.myshopify.com') { const updateCustomerUrl =`/${_ALConfig?.proxy_path_prefix || 'apps/loyalty'}/cp/api/update-customer`; try { fetch(updateCustomerUrl, { метод:'POST' }) .then((response) => { if(response.ok) {} }) .catch(() => {}); } поймать (ошибиться) {} }

    const выделенныйPageURL =новый URL-адрес (window.location.href); const decodeUrl =(content) => { if (typeof content !=='string') возвращает содержимое; попробуйте { const htmlDecoded =content?.replace(/\\\//g, '/'); return JSON.parse(`"${htmlDecoded}"`); } catch (error) { console.error('Ошибка анализа содержимого:', error); возврат контента; } }; if (dedicatedPageURL?.searchParams?.get('appstle_referral') &&_ALConfig?.widget_setting?.widgetType ==='DEDICATED_PAGE') { const customUrl =decodeUrl(_ALConfig?.widget_setting?.referralCustomRedirectUrl); если (customUrl) { constnormalizedCustomPath =customUrl.startsWith('/')? customUrl:`/${customUrl}`; if (window.location.pathname!==normalizedCustomPath) {const redirectUrl =новый URL-адрес(window.location.href); redirectUrl.pathname =нормализованныйCustomPath; window.open(redirectUrl.toString(), '_self'); } } else if (dedicatedPageURL?.searchParams?.get('appstle_referral') &&_ALConfig?.widget_setting?.widgetType ==='DEDICATED_PAGE' &&!window.location.href.includes(_ALConfig?.proxy_path_prefix)) { window.open(`/${_ALConfig?.proxy_path_prefix}${window.location.search}`, '_self'); } } const выделенныйPageEventListener =(event) => { if (event?.data &&typeof event?.data.indexOf ==='function' &&event?.data?.indexOf('refresh_appstle_loyalty_page') !==-1) { ignoreAppstleLoyaltyPage(); console.log('ОБНОВИТЬ СТРАНИЦУ'); } }; window.addEventListener('сообщение', выделенныйPageEventListener, false); function ignoreAppstleLoyaltyPage() { if (document.querySelector('#appstleLoyaltyPage')) { const appstleLoyaltyPageElement =document.getElementById('appstleLoyaltyPage'); в то время как (appstleLoyaltyPageElement.firstChild) {appstleLoyaltyPageElement.firstChild.remove(); } if (appstleLoyaltyPageElement) { const ExecuteDedicatedPageScript =() => { const s =document.createElement('script'); s.setAttribute('src', _ALConfig?.widgetJsPath); s.setAttribute('отложить', 'отложить'); document.body.appendChild(s); константная голова =document.head; const link =document.createElement('link'); link.type ='текст/css'; link.rel ='таблица стилей'; link.href =_ALConfig?.widgetCssPath; head.appendChild (ссылка); } попробуйте { const versionUrl =`${location.origin}/${_ALConfig?.proxy_path_prefix || 'apps/loyalty'}/app-loyalty-version`; fetch(versionUrl).then(res => res.json()).then(data => { if (data) { const widgetJsUrl =новый URL(_ALConfig.widgetJsPath); const widgetCssUrl =новый URL(_ALConfig.widgetCssPath); widgetJsUrl.searchParams.set('v', data); widgetCssUrl.searchParams.set('v', data); _ALConfig.widgetJsPath =widgetJsUrl.toString(); _ALConfig.widgetCssPath =widgetCssUrl.toString(); } }).catch(() => {}).finally(() => {executedPageScript(); }); } Задвижка (ошибка) {executedDedicatedPageScript(); } } } else { setTimeout(() => {nititiateAppstleLoyaltyPage(); }, 2000); } } const выделенныйPageReferralUrl =новый URL(window.location.href)?.searchParams.get('appstle_referral'); если (_ALConfig?.widget_setting?.showWidget ===true) { инициироватьAppstleLoyaltyPage();

    (async function() { const isAvailableVisitShop =_ALConfig?.pointEarnRules?.length> 0 &&_ALConfig?.pointEarnRules?.find((rule) => rule?.type ==='VISIT_SHOP' &&rule?.status ==='ACTIVE'); if (_ALConfig?.customerId &&isAvailableVisitShop) { if (!sessionStorage.getItem('syncVisitStore') &&((_ALConfig?.customerId &&isAvailableVisitShop &&isAvailableVisitShop?.id) || (_ALConfig?.referralEnabled &&_ALConfig?.referralLoyalty?.referralType ==='VISIT_SHOP'))) { try { const response =await fetch(`/${_ALConfig?.proxy_path_prefix || 'apps/loyalty'}/cp/api/customer-visit-store`, { метод:'POST', headers:{'Content-Type':'application/json'}, }); if (response?.ok) { sessionStorage.setItem('syncVisitStore', 'true') } } catch (error) { console.error('Error:', error);

    `; document.querySelector('body').insertAdjacentHTML('beforeend', лояльностьCustomStyles);