PageSourceSearch

https://anthoshop.gr/cdn/shop/t/193/assets/jquery.cart.min.js?v=166679848951413287571783519860

js anthoshop.gr collected 2026-10-07 00:18:20 UTC 5,867 bytes, 18 lines download raw bytes

1/**
2 * Module to add a shipping rates calculator to cart page.
3 *
4 * Copyright (c) 2011-2016 Caroline Schnapp (11heavens.com)
5 * Dual licensed under the MIT and GPL licenses:
6 * http://www.opensource.org/licenses/mit-license.php
7 * http://www.gnu.org/licenses/gpl.html
8 *
9 */
10typeof Countries === 'object' && (Countries.updateProvinceLabel = function (e, r) { if (typeof e === 'string' && Countries[e] && Countries[e].provinces) { if (typeof r !== 'object' && (r = document.getElementById('address_province_label')) === null) return; r.innerHTML = Countries[e].label; const t = jQuery(r).parent(); t.find('select'), t.find('.custom-style-select-box-inner').html(Countries[e].provinces[0]); } }), void 0 === Shopify.Cart && (Shopify.Cart = {}), Shopify.Cart.ShippingCalculator = (function () {
11  const _config = {
12    submitButton: 'Calculate shipping', submitButtonDisabled: 'Calculating...', templateId: 'shipping-calculator-response-template', wrapperId: 'wrapper-response', customerIsLoggedIn: !1, moneyFormat: '${{amount}}',
13  }; const _render = function (e) { const r = jQuery(`#${_config.templateId}`); const t = jQuery(`#${_config.wrapperId}`); if (r.length && t.length) { _.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }; const n = _.template(jQuery.trim(r.text()))(e); if (jQuery(n).appendTo(t), typeof Currency !== 'undefined' && typeof Currency.convertAll === 'function') { let a = ''; jQuery('[name=currencies]').length ? a = jQuery('[name=currencies]').val() : jQuery('#currencies span.selected').length && (a = jQuery('#currencies span.selected').attr('data-currency')), a !== '' && Currency.convertAll(shopCurrency, a, '#wrapper-response span.money, #estimated-shipping span.money'); }(Currency.show_multiple_currencies || Currency.native_multi_currency) && currencyConverter.convertCurrencies(); } }; const _enableButtons = function () { jQuery('.get-rates').removeAttr('disabled').removeClass('disabled').val(_config.submitButton); }; const _disableButtons = function () { jQuery('.get-rates').val(_config.submitButtonDisabled).attr('disabled', 'disabled').addClass('disabled'); }; const _getCartShippingRatesForDestination = function (e) {
14    const r = {
15      type: 'POST', url: `${window.PXUTheme.routes.cart_url}/prepare_shipping_rates`, data: jQuery.param({ shipping_address: e }), success: _pollForCartShippingRatesForDestination(e), error: _onError,
16    }; jQuery.ajax(r);
17  }; var _pollForCartShippingRatesForDestination = function (e) { var r = function () { jQuery.ajax(`${window.PXUTheme.routes.cart_url}/async_shipping_rates`, { dataType: 'json', success(t, n, a) { a.status === 200 ? _onCartShippingRatesUpdate(t.shipping_rates, e) : setTimeout(r, 500); }, error: _onError }); }; return r; }; const _fullMessagesFromErrors = function (e) { const r = []; return jQuery.each(e, (e, t) => { jQuery.each(t, (t, n) => { r.push(`${e} ${n}`); }); }), r; }; var _onError = function (XMLHttpRequest, textStatus) { jQuery('#estimated-shipping').hide(), jQuery('#estimated-shipping em').empty(), _enableButtons(); let feedback = ''; const data = eval(`(${XMLHttpRequest.responseText})`); feedback = data.message ? `${data.message}(${data.status}): ${data.description}` : `Error : ${_fullMessagesFromErrors(data).join('; ')}.`, feedback === 'Error : country is not supported.' && (feedback = 'We do not ship to this destination.'), _render({ rates: [], errorFeedback: feedback, success: !1 }), jQuery(`#${_config.wrapperId}`).show(); }; var _onCartShippingRatesUpdate = function (e, r) { _enableButtons(); let t = ''; if (r.zip && (t += `${r.zip}, `), r.province && (t += `${r.province}, `), t += r.country, e.length) { e[0].price == '0.00' ? jQuery('#estimated-shipping em').html('FREE') : jQuery('#estimated-shipping em').html(_formatRate(e[0].price)); for (let n = 0; n < e.length; n++)e[n].price = _formatRate(e[n].price); }_render({ rates: e, address: t, success: !0 }), jQuery(`#${_config.wrapperId}, #estimated-shipping`).fadeIn(); }; var _formatRate = function (e) { function r(e, r) { return void 0 === e ? r : e; } function t(e, t, n, a) { if (t = r(t, 2), n = r(n, ','), a = r(a, '.'), isNaN(e) || e == null) return 0; const i = (e = (e / 100).toFixed(t)).split('.'); return i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, `$1${n}`) + (i[1] ? a + i[1] : ''); } if (typeof Shopify.formatMoney === 'function') return Shopify.formatMoney(e, _config.moneyFormat); typeof e === 'string' && (e = e.replace('.', '')); let n = '';
17 const a = /\{\{\s*(\w+)\s*\}\}/; const i = _config.moneyFormat; switch (i.match(a)[1]) { case 'amount': n = t(e, 2); break; case 'amount_no_decimals': n = t(e, 0); break; case 'amount_with_comma_separator': n = t(e, 2, '.', ','); break; case 'amount_no_decimals_with_space_separator': n = t(e, 0, '.', ' '); break; case 'amount_no_decimals_with_comma_separator': n = t(e, 0, '.', ','); } return i.replace(a, n); }; return _init = function () { new Shopify.CountryProvinceSelector('address_country', 'address_province', { hideElement: 'address_province_container' }); const e = jQuery('#address_country'); const r = jQuery('#address_province_label').get(0); typeof Countries !== 'undefined' && (Countries.updateProvinceLabel(e.val(), r), e.change(() => { Countries.updateProvinceLabel(e.val(), r); })), jQuery('.get-rates').click(() => { _disableButtons(), jQuery(`#${_config.wrapperId}`).empty().hide(); const e = {}; e.zip = jQuery('#address_zip').val() || '', e.country = jQuery('#address_country').val() || '', e.province = jQuery('#address_province').val() || '', _getCartShippingRatesForDestination(e); }), _config.customerIsLoggedIn && jQuery('.get-rates:eq(0)').trigger('click'); }, { show(e) { e = e || {}, jQuery.extend(_config, e), jQuery(() => { _init(); }); }, getConfig() { return _config; }, formatRate(e) { return _formatRate(e); } };
18}());

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.