if (!window['dpoObserver']) window.dpoObserver = {
productConfig: [],
loadedResources: [],
jsLoadCounter: [],
availableVariants: [],
defaultMoneyFormat: '${{amount}}',
customerId: 0,
selectors: {
form: 'form[action*="cart/add"]',
submitBtnContainer: 'form[action*="cart/add"] div:has([type="submit"])',
submitBtn: 'form[action*="cart/add"] [type="submit"], form[action*="cart/add"] .ajax-submit, form[action*="cart/add"] .addtocart-js',
buyNowButtonContainer: '.shopify-payment-button',
swatchElement: '.radio-wrapper, .variant-wrapper, .selector-wrapper, .swatches-container, .product-form__item:has(.single-option-selector), .swatch',
priceBox: '.product__price, .product-price, .product-single__prices, [data-price-container], .product-single__price-product-template',
regularPrice: '.product__info-wrapper .price__sale .price-item--regular:visible',
specialPrice: '#dpo_price, .product__info-wrapper .price__regular .price-item--regular:visible, .product__info-wrapper .price__sale .price-item--sale:visible, #itoris_dynamicproductoptions_popup_price .product-price',
variantId: '[name="id"]',
qtyContainer: '.product-form__item--quantity, .product-single__quantity, .product-form__quantity-selector',
qty: 'input[name="quantity"]',
currencySwitcher: '[name="currencies"]',
cartTableRow: '#main-cart-items .cart-item:visible',
cartMetaText: '.product-option dd',
cartRemoveBtn: 'a[href*="cart/change"]',
cartUpdateBtn: 'form[action*="cart"] [name="update"]',
cartCheckoutBtn: 'form[action*="cart"] [name="checkout"]'
},
globalJS: 'jQuery(\'[data-value*="(D#"], [for*="(D#"], .cart-item__media > .cart-item__link\').remove();jQuery(\'.product-details__item--variant-option:contains("Title:"), .product-option:contains("Title"), variant-radios > fieldset:contains("Default Title"), variant-selects:contains("Default Title")\').hide();jQuery(\'.cart-item__media > .cart-item__link\').remove();\njQuery(\'.product-option:contains("Title"), variant-radios > fieldset:contains("Title"), variant-selects:contains("Title")\').hide();\n\ntry{\n window.money_formats = {USD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} USD"},EUR:{money_format:"€{{amount_with_comma_separator}}",money_with_currency_format:"€{{amount_with_comma_separator}} EUR"},GBP:{money_format:"£{{amount}}",money_with_currency_format:"£{{amount}} GBP"},CAD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} CAD"},ALL:{money_format:"Lek {{amount}}",money_with_currency_format:"Lek {{amount}} ALL"},DZD:{money_format:"DA {{amount}}",money_with_currency_format:"DA {{amount}} DZD"},AOA:{money_format:"Kz{{amount}}",money_with_currency_format:"Kz{{amount}} AOA"},ARS:{money_format:"${{amount_with_comma_separator}}",money_with_currency_format:"${{amount_with_comma_separator}} ARS"},AMD:{money_format:"{{amount}} AMD",money_with_currency_format:"{{amount}} AMD"},AWG:{money_format:"Afl{{amount}}",money_with_currency_format:"Afl{{amount}} AWG"},AUD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} AUD"},BBD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} Bds"},AZN:{money_format:"m.{{amount}}",money_with_currency_format:"m.{{amount}} AZN"},BDT:{money_format:"Tk {{amount}}",money_with_currency_format:"Tk {{amount}} BDT"},BSD:{money_format:"BS${{amount}}",money_with_currency_format:"BS${{amount}} BSD"},BHD:{money_format:"{{amount}} BD",money_with_currency_format:"{{amount}} BHD"},BYR:{money_format:"Br {{amount}}",money_with_currency_format:"Br {{amount}} BYR"},BZD:{money_format:"BZ${{amount}}",money_with_currency_format:"BZ${{amount}} BZD"},BTN:{money_format:"Nu {{amount}}",money_with_currency_format:"Nu {{amount}} BTN"},BAM:{money_format:"KM {{amount_with_comma_separator}}",money_with_currency_format:"KM {{amount_with_comma_separator}} BAM"},BRL:{money_format:"R$ {{amount_with_comma_separator}}",money_with_currency_format:"R$ {{amount_with_comma_separator}} BRL"},BOB:{money_format:"Bs{{amount_with_comma_separator}}",money_with_currency_format:"Bs{{amount_with_comma_separator}} BOB"},BWP:{money_format:"P{{amount}}",money_with_currency_format:"P{{amount}} BWP"},BND:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} BND"},BGN:{money_format:"{{amount}} лв",money_with_currency_format:"{{amount}} лв BGN"},MMK:{money_format:"K{{amount}}",money_with_currency_format:"K{{amount}} MMK"},KHR:{money_format:"KHR{{amount}}",money_with_currency_format:"KHR{{amount}}"},KYD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} KYD"},XAF:{money_format:"FCFA{{amount}}",money_with_currency_format:"FCFA{{amount}} XAF"},CLP:{money_format:"${{amount_no_decimals}}",money_with_currency_format:"${{amount_no_decimals}} CLP"},CNY:{money_format:"¥{{amount}}",money_with_currency_format:"¥{{amount}} CNY"},COP:{money_format:"${{amount_with_comma_separator}}",money_with_currency_format:"${{amount_with_comma_separator}} COP"},CRC:{money_format:"₡ {{amount_with_comma_separator}}",money_with_currency_format:"₡ {{amount_with_comma_separator}} CRC"},HRK:{money_format:"{{amount_with_comma_separator}} kn",money_with_currency_format:"{{amount_with_comma_separator}} kn HRK"},CZK:{money_format:"{{amount_with_comma_separator}} Kč",money_with_currency_format:"{{amount_with_comma_separator}} Kč"},DKK:{money_format:"{{amount_with_comma_separator}}",money_with_currency_format:"kr.{{amount_with_comma_separator}}"},DOP:{money_format:"RD$ {{amount}}",money_with_currency_format:"RD$ {{amount}}"},XCD:{money_format:"${{amount}}",money_with_currency_format:"EC${{amount}}"},EGP:{money_format:"LE {{amount}}",money_with_currency_format:"LE {{amount}} EGP"},ETB:{money_format:"Br{{amount}}",money_with_currency_format:"Br{{amount}} ETB"},XPF:{money_format:"{{amount_no_decimals_with_comma_separator}} XPF",money_with_currency_format:"{{amount_no_decimals_with_comma_separator}} XPF"},FJD:{money_format:"${{amount}}",money_with_currency_format:"FJ${{amount}}"},GMD:{money_format:"D {{amount}}",money_with_currency_format:"D {{amount}} GMD"},GHS:{money_format:"GH₵{{amount}}",money_with_currency_format:"GH₵{{amount}}"},GTQ:{money_format:"Q{{amount}}",money_with_currency_format:"{{amount}} GTQ"},GYD:{money_format:"G${{amount}}",money_with_currency_format:"${{amount}} GYD"},GEL:{money_format:"{{amount}} GEL",money_with_currency_format:"{{amount}} GEL"},HNL:{money_format:"L {{amount}}",money_with_currency_format:"L {{amount}} HNL"},HKD:{money_format:"${{amount}}",money_with_currency_format:"HK${{amount}}"},HUF:{money_format:"{{amount_no_decimals_with_comma_separator}}",money_with_currency_format:"{{amount_no_decimals_with_comma_separator}} Ft"},ISK:{money_format:"{{amount_no_decimals}} kr",money_with_currency_format:"{{amount_no_decimals}} kr ISK"},INR:{money_format:"Rs. {{amount}}",money_with_currency_format:"Rs. {{amount}}"},IDR:{money_format:"{{amount_with_comma_separator}}",money_with_currency_format:"Rp {{amount_with_comma_separator}}"},ILS:{money_format:"{{amount}} NIS",money_with_currency_format:"{{amount}} NIS"},JMD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} JMD"},JPY:{money_format:"¥{{amount_no_decimals}}",money_with_currency_format:"¥{{amount_no_decimals}} JPY"},JEP:{money_format:"£{{amount}}",money_with_currency_format:"£{{amount}} JEP"},JOD:{money_format:"{{amount}} JD",money_with_currency_format:"{{amount}} JOD"},KZT:{money_format:"{{amount}} KZT",money_with_currency_format:"{{amount}} KZT"},KES:{money_format:"KSh{{amount}}",money_with_currency_format:"KSh{{amount}}"},KWD:{money_format:"{{amount}} KD",money_with_currency_format:"{{amount}} KWD"},KGS:{money_format:"лв{{amount}}",money_with_currency_format:"лв{{amount}}"},LVL:{money_format:"Ls {{amount}}",money_with_currency_format:"Ls {{amount}} LVL"},LBP:{money_format:"L£{{amount}}",money_with_currency_format:"L£{{amount}} LBP"},LTL:{money_format:"{{amount}} Lt",money_with_currency_format:"{{amount}} Lt"},MGA:{money_format:"Ar {{amount}}",money_with_currency_format:"Ar {{amount}} MGA"},MKD:{money_format:"ден {{amount}}",money_with_currency_format:"ден {{amount}} MKD"},MOP:{money_format:"MOP${{amount}}",money_with_currency_format:"MOP${{amount}}"},MVR:{money_format:"Rf{{amount}}",money_with_currency_format:"Rf{{amount}} MRf"},MXN:{money_format:"$ {{amount}}",money_with_currency_format:"$ {{amount}} MXN"},MYR:{money_format:"RM{{amount}} MYR",money_with_currency_format:"RM{{amount}} MYR"},MUR:{money_format:"Rs {{amount}}",money_with_currency_format:"Rs {{amount}} MUR"},MDL:{money_format:"{{amount}} MDL",money_with_currency_format:"{{amount}} MDL"},MAD:{money_format:"{{amount}} dh",money_with_currency_format:"Dh {{amount}} MAD"},MNT:{money_format:"{{amount_no_decimals}} ₮",money_with_currency_format:"{{amount_no_decimals}} MNT"},MZN:{money_format:"{{amount}} Mt",money_with_currency_format:"Mt {{amount}} MZN"},NAD:{money_format:"N${{amount}}",money_with_currency_format:"N${{amount}} NAD"},NPR:{money_format:"Rs{{amount}}",money_with_currency_format:"Rs{{amount}} NPR"},ANG:{money_format:"ƒ{{amount}}",money_with_currency_format:"{{amount}} NAƒ"},NZD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} NZD"},NIO:{money_format:"C${{amount}}",money_with_currency_format:"C${{amount}} NIO"},NGN:{money_format:"₦{{amount}}",money_with_currency_format:"₦{{amount}} NGN"},NOK:{money_format:"kr {{amount_with_comma_separator}}",money_with_currency_format:"kr {{amount_with_comma_separator}} NOK"},OMR:{money_format:"{{amount_with_comma_separator}} OMR",money_with_currency_format:"{{amount_with_comma_separator}} OMR"},PKR:{money_format:"Rs.{{amount}}",money_with_currency_format:"Rs.{{amount}} PKR"},PGK:{money_format:"K {{amount}}",money_with_currency_format:"K {{amount}} PGK"},PYG:{money_format:"Gs. {{amount_no_decimals_with_comma_separator}}",money_with_currency_format:"Gs. {{amount_no_decimals_with_comma_separator}} PYG"},PEN:{money_format:"S/. {{amount}}",money_with_currency_format:"S/. {{amount}} PEN"},PHP:{money_format:"₱{{amount}}",money_with_currency_format:"₱{{amount}} PHP"},PLN:{money_format:"{{amount_with_comma_separator}} zl",money_with_currency_format:"{{amount_with_comma_separator}} zl PLN"},QAR:{money_format:"QAR {{amount_with_comma_separator}}",money_with_currency_format:"QAR {{amount_with_comma_separator}}"},RON:{money_format:"{{amount_with_comma_separator}} lei",money_with_currency_format:"{{amount_with_comma_separator}} lei RON"},RUB:{money_format:"руб{{amount_with_comma_separator}}",money_with_currency_format:"руб{{amount_with_comma_separator}} RUB"},RWF:{money_format:"{{amount_no_decimals}} RF",money_with_currency_format:"{{amount_no_decimals}} RWF"},WST:{money_format:"WS$ {{amount}}",money_with_currency_format:"WS$ {{amount}} WST"},SAR:{money_format:"{{amount}} SR",money_with_currency_format:"{{amount}} SAR"},STD:{money_format:"Db {{amount}}",money_with_currency_format:"Db {{amount}} STD"},RSD:{money_format:"{{amount}} RSD",money_with_currency_format:"{{amount}} RSD"},SCR:{money_format:"Rs {{amount}}",money_with_currency_format:"Rs {{amount}} SCR"},SGD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} SGD"},SYP:{money_format:"S£{{amount}}",money_with_currency_format:"S£{{amount}} SYP"},ZAR:{money_format:"R {{amount}}",money_with_currency_format:"R {{amount}} ZAR"},KRW:{money_format:"₩{{amount_no_decimals}}",money_with_currency_format:"₩{{amount_no_decimals}} KRW"},LKR:{money_format:"Rs {{amount}}",money_with_currency_format:"Rs {{amount}} LKR"},SEK:{money_format:"{{amount_no_decimals}} kr",money_with_currency_format:"{{amount_no_decimals}} kr SEK"},CHF:{money_format:"{{amount}} CHF",money_with_currency_format:"{{amount}} CHF"},TWD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} TWD"},THB:{money_format:"{{amount}} ฿",money_with_currency_format:"{{amount}} ฿ THB"},TZS:{money_format:"{{amount}} TZS",money_with_currency_format:"{{amount}} TZS"},TTD:{money_format:"${{amount}}",money_with_currency_format:"${{amount}} TTD"},TND:{money_format:"{{amount}}",money_with_currency_format:"{{amount}} DT"},TRY:{money_format:"{{amount}}TL",money_with_currency_format:"{{amount}}TL"},UGX:{money_format:"Ush {{amount_no_decimals}}",money_with_currency_format:"Ush {{amount_no_decimals}} UGX"},UAH:{money_format:"₴{{amount}}",money_with_currency_format:"{{amount}} UAH"},AED:{money_format:"Dhs. {{amount}}",money_with_currency_format:"Dhs. {{amount}} AED"},UYU:{money_format:"${{amount_with_comma_separator}}",money_with_currency_format:"${{amount_with_comma_separator}} UYU"},VUV:{money_format:"{{amount}} VT",money_with_currency_format:"{{amount}} VT"},VEF:{money_format:"Bs. {{amount_with_comma_separator}}",money_with_currency_format:"Bs. {{amount_with_comma_separator}} VEF"},VND:{money_format:"{{amount_no_decimals_with_comma_separator}}₫",money_with_currency_format:"{{amount_no_decimals_with_comma_separator}} VND"},XBT:{money_format:"{{amount_no_decimals}} BTC",money_with_currency_format:"{{amount_no_decimals}} BTC"},XOF:{money_format:"CFA{{amount}}",money_with_currency_format:"CFA{{amount}} XOF"},ZMW:{money_format:"K{{amount_no_decimals_with_comma_separator}}",money_with_currency_format:"ZMW{{amount_no_decimals_with_comma_separator}}"}};\n window.money_format = window.money_formats[Shopify.currency.active].money_format;\n window.money_with_currency_format = window.money_formats[Shopify.currency.active].money_with_currency_format;\n} catch(e){}\n\njQuery(window).on(\'dpo_no_options\', function(){jQuery(\'.product-form__item--submit, .selector-wrapper\').css(\'visibility\', \'visible\');});\nwindow.dpo_before_initialize = function(){\n jQuery(\'.product-form__item--submit, .selector-wrapper\').css(\'visibility\', \'visible\');\n jQuery(\'product-form form\').first().prepend(jQuery(\'.product-form__quantity\')).prepend(jQuery(\'.dpo-container\'));\n if (window.meta.product) jQuery(\'.product__title\').first().after(\'
\'+dpoOptions.formatPrice(meta.product.variants[0].price)+\'
\');\n //currency conversion\n setTimeout(function(){\n if (window.Currency) return;\n window.Currency = {rates: {}, moneyFormats: {}, convert: function(val){return val*Shopify.currency.rate;}};\n window.Currency.rates[Shopify.currency.active] = Shopify.currency.rate;\n if (meta.product) jQuery.each(meta.product.variants, function(){this.price/=Shopify.currency.rate;});\n window.Currency.moneyFormats[Shopify.currency.active] = {money_format: window.money_format};\n dpoOptions.baseCurrency = dpoOptions.currentCurrency = \'CAD\';\n jQuery(\'#itoris_dynamicproductoptions\')[0].dpoProductInitialPrices = false;\n dpoOptions.switchCurrency(Shopify.currency.active);\n dpoOptions.updatePrice();\n }, 200);\n jQuery(\'body\').on(\'keyup paste change\', \'.cq input, .sz input\', function(){\n if (this.value && \'a\'+this.value.replace(\'.\',\'\') != \'a\'+parseFloat(this.value.replace(\'.\',\'\'))) {\n this.value = parseFloat(this.value);\n if (this.value >= 0) ; else this.value = "";\n jQuery(this).trigger(\'keyup\');\n }\n });\n var cd = jQuery(\'.dpo-cart\').data(\'line_item\');\n if (cd && cd.properties) jQuery.each(cd.properties, function(k, v){\n if (k.indexOf(\'Uploaded\')>-1) jQuery(\'#itoris_dynamicproductoptions\').append(\'\');\n });\n //if (cd && cd.properties && cd.properties["Uploaded file"]) jQuery(\'#itoris_dynamicproductoptions\').append(\'\');\n //if (cd && cd.properties && cd.properties["_Uploaded file (direct link)"]) jQuery(\'#itoris_dynamicproductoptions\').append(\'\');\n}\n\n//cart speed improvements\nwindow.fm = function(t,e){function n(t,e){return void 0===t?e:t}function o(t,e,o,i){if(e=n(e,2),o=n(o,","),i=n(i,"."),isNaN(t)||null==t)return 0;var r=(t=(t/100).toFixed(e)).split(".");return r[0].replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g,"$1"+o)+(r[1]?i+r[1]:"")}"string"==typeof t&&(t=t.replace(".",""));var i="",r=/\\{\\{\\s*(\\w+)\\s*\\}\\}/,a=e||this.money_format;switch(a.match(r)[1]){case"amount":i=o(t,2);break;case"amount_no_decimals":i=o(t,0);break;case"amount_with_comma_separator":i=o(t,2,".",",");break;case"amount_with_space_separator":i=o(t,2," ",",");break;case"amount_with_period_and_space_separator":i=o(t,2," ",".");break;case"amount_no_decimals_with_comma_separator":i=o(t,0,".",",");break;case"amount_no_decimals_with_space_separator":i=o(t,0," ");break;case"amount_with_apostrophe_separator":i=o(t,2,"\'",".")}return a.replace(r,i)}\nvar rows = jQuery(window.dpoObserver.selectors.cartTableRow);\nif (rows[0]) jQuery.ajax({url: (window.Shopify && Shopify.routes && Shopify.routes.root ? Shopify.routes.root : \'/\')+\'cart/update.json\', method: \'GET\', async: false, dataType: \'json\', success: function(cart) {\n var needs_update = false;\n jQuery.each(cart.items, function(i){\n if (this.title.indexOf(\'D#\') == -1 && this.title.indexOf(\'T#\') == -1 /*|| rows.eq(i).html().indexOf(\'href=""\') == -1*/) return; else needs_update = true;\n var p=this.title.indexOf(\'- (D#\'); if (p>-1) this.title = this.title.substr(0, p);\n var p=this.title.indexOf(\'(D#\'); if (p>-1) this.title = this.title.substr(0, p)+this.title.substr(p+11);\n var p=this.url.indexOf(\'?\'); if (p>-1) this.url = this.url.substr(0, p);\n rows.eq(i).find(\'.cart-item__name\').eq(0).attr(\'href\', this.url).text(this.title);\n //rows.eq(i).find(\'[data-product-sku]\').eq(0).text(this.sku);\n if (!rows.eq(i).find(\'.cart-item__media img\')[0]) rows.eq(i).find(\'.cart-item__media\').html(\'\');\n if (this.image) rows.eq(i).find(\'.cart-item__media svg, .cart-item__media img, img[src*="no-image"]\').replaceWith(\'\');\n if (this.image) rows.eq(i).find(\'img.cart__image\').first().attr(\'src\', this.image).css({position:\'static\', opacity:1, \'max-width\':\'100%\'});//.parent().css({\'padding\':0}).parent().css({\'max-width\':\'100%\'});\n rows.eq(i).find(\'.price, .cart-item__name+.product-option\').html(window.fm(this.final_price, window.money_format));\n rows.eq(i).find(\'.price\').last().html(window.fm(this.final_price*this.quantity, window.money_format));\n });\n if (needs_update) jQuery(\'.totals__subtotal-value\').last().html(window.fm(cart.total_price, window.money_with_currency_format));\n}});',
globalCSS: '.dpo-loader {display:block; width:100%; clear:both; height:40px; background:url(https://node1.itoris.com/dpo/storefront/assets/images/loading.gif) no-repeat left center transparent;}[data-value*="(D#"], [for*="(D#"], [data-value*="Default Title"], [for*="default-title"], input[type="radio"][value*="Default Title"] + label, input[type="radio"][value*="Default Title"] + span, [value*="(D#"] + label, [value*="D#"] + span {display:none !important;} {display:none !important} .dpo_remove_link {font-size:14px; margin-left:10px; text-decoration:underline;}button[onclick*="dpoObject"] {display:inline-block !important; opacity:1 !important;}button[onclick*="dpoObject"] + button, .dpo-container.dpo-cart {display:none !important;} .bold_hidden[dpo_add2cart] {display:block !important;} .bold_hidden[dpo_add2cart] ~ button {display:none !important;}#itoris_dynamicproductoptions [type="checkbox"], #itoris_dynamicproductoptions [type="radio"] {margin:8px 4px 0 0 !important;}\n.dpo_cart_edit {background:#fa1111; color:#fff; border:none; padding:10px 20px;}\n#itoris_dynamicproductoptions_popup button {box-shadow: none; min-height:auto; min-width:auto}\n#itoris_dynamicproductoptions div:empty, #itoris_dynamicproductoptions span:empty, #itoris_dynamicproductoptions_popup div:empty {display:initial}\n.itoris-dynamicoptions-thumbnail-color {display:inline-block !important;}\n#itoris_dynamicproductoptions .field:before, #itoris_dynamicproductoptions .field:after {display:none}\n#itoris_dynamicproductoptions .field {display:block}\n.has_dpo_options #product-form-installment {display:none}\n#itoris_dynamicproductoptions select, #itoris_dynamicproductoptions input, #itoris_dynamicproductoptions textarea {background:#fff; color:#000;}\n#dpo_price{font-size:30px; margin:10px 0 -20px 0; font-weight:bold;}',
directAddToCartSubmit: '3',
checkoutMethod: '0',
forceOptionsInCart: '0',
addOptionsToUrl: '0',
showOptionSKUsInCart: '0',
showOptionPricesInCart: '0',
skuSeparator: '|',
formValidateUrl: 'https://node1.itoris.com/dpo/storefront/include.js?controller=ValidateForm&shop=siramerge.myshopify.com',
allowProductIds: ["1770759159843","1770758340643","1770758570019","1773564362787","1773579304995","1773485326371","1770751492131","1770750345251","1770758144035","1770750967843","1823333416995","1814860824611","1823331811363","1814861283363","1814866100259","1823334924323","1823333875747","4174818869283","4201956802595","4410295844907","4438856237099","4436640497707","4438854205483","4443613724715","4504658149419","4509607821355","4512832520235","4513302773803","4514878816299","4799190466603","4799231459371","6538715562170","6540055511226","6574155399354","6574207959226","6574207074490","6574200062138","6574197342394","6620078964922","6695789953210","6694331318458","6574188986554","6781239230650","6804301906106","6821815582906","6892247154874","8041805447385","8108380717273","4509683679275"],
forceLoadingTemplate: 0,
skipAssocDataCheck: false,
loadJS: function(urls, callback){
window.dpoObserver.jsLoadCounter[callback] = urls.length;
for(var i=0; i').html(window.dpoObserver.globalCSS).appendTo('body');
}
/*var x = document.getElementsByTagName('script')[0].parentNode;
if (!x.dpoInsertBefore) {
x.dpoInsertBefore = x.insertBefore;
x.insertBefore = function(a, b) { if (a && a.getAttribute) { var s = a.getAttribute('src'); if (s && s.indexOf('/dpo/storefront/include.js') > -1) return; } this.dpoInsertBefore(a, b); }
}*/
if (!window['jQuery'] || !jQuery.ajax) return window.dpoObserver.loadJS(['https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js'], function(){ jQuery.noConflict(); window.dpoObserver.init(); });
window.dpoObserver.directAddToCartSubmit-=0; window.dpoObserver.checkoutMethod-=0; window.dpoObserver.addOptionsToUrl-=0;
window.dpoObserver.customerId = window['meta'] && window['meta']['page'] && window['meta']['page']['customerId'] ? window['meta']['page']['customerId'] : 0;
if (window.dpoObserver.globalJS) try {eval(window.dpoObserver.globalJS)} catch (e) {console.log(e)}
window.dpoObserver.hideSystemVariants();
jQuery(window).on('dpo_initialized', function(){
jQuery('#dpo_placeholder').first().after(jQuery('.dpo-container'));
jQuery('.dpo-container').css({display:'block'});
jQuery('.dpo-loader').remove();
if (!jQuery('.dpo-container').is(':visible')) {
var p = jQuery('.dpo-container').parent();
while (!p.is(':visible') && p.parent()[0]) p = p.parent();
if (p.is(':visible')) p.after(jQuery('.dpo-container'));
}
});
window.dpoObserver.loadOptions();
if (!window.dpoCartLoaded && jQuery(window.dpoObserver.selectors.cartTableRow)[0]) {
jQuery.ajax({url: '/cart/update.json', method: 'GET', async: false, dataType: 'json', success: function(cart) {
window.dpoObserver.cartItems = cart && cart.items ? cart.items : false;
window.dpoObserver.parseCartMetaText();
window.dpoObserver.cartObserver();
window.dpoCartLoaded = true;
}});
}
window.dpoObserver.variantOptionLoader();
},
loadOptions: function() {
window.dpoObserver.variantObj = jQuery(window.dpoObserver.selectors.variantId);
if (window.dpoObserver.variantObj[0] && (!window.dpoObserver.variantId || window.dpoObserver.variantId != window.dpoObserver.variantObj.val())) {
window.dpoLoaded = true;
window.dpoObserver.variantId = window.dpoObserver.variantObj.val();
var productId = window.meta && window.meta.product && window.meta.product.id ? window.meta.product.id : 0;
if (!window.dpoObserver.forceLoadingTemplate && (!productId || window.dpoObserver.allowProductIds.indexOf(''+productId) == -1)) return jQuery(window).trigger('dpo_no_options');
window.dpoObserver.productId = productId;
jQuery(window).trigger('dpo_loading_started');
jQuery(window.dpoObserver.selectors.submitBtn).prop('disabled', true);
var dpoPlaceholder = window.dpoObserver.getPlaceHolder();
dpoPlaceholder.after(jQuery('').addClass('dpo-loader'));
jQuery.ajax({
type: 'POST',
url: 'https://node1.itoris.com/dpo/storefront/include.js?controller=GetOptionConfig&shop=siramerge.myshopify.com',
async: false,
data: {product_id: productId, variant_id: window.dpoObserver.variantId, customer_id: window.dpoObserver.customerId, template_id: window.dpoObserver.forceLoadingTemplate, skip_assoc_data_check: window.dpoObserver.skipAssocDataCheck ? 1 : 0},
success: function( data ) {
jQuery('.dpo-container').remove();
var dpoPlaceholder = window.dpoObserver.getPlaceHolder();
dpoPlaceholder.after(jQuery('').css({display:'none'}).addClass('dpo-container').html(data));
jQuery('.dpo-loader').remove();
jQuery(window.dpoObserver.selectors.submitBtn).prop('disabled', false);
if (!jQuery('#itoris_dynamicproductoptions')[0]) return;
jQuery(window.dpoObserver.selectors.form).find('input[type="text"], input[type="number"]').on('keypress', function(ev){if (ev.keyCode == 13) ev.preventDefault();});
var qtyContainer = jQuery(window.dpoObserver.selectors.qtyContainer);
if (qtyContainer[0]) jQuery('.dpo-container').after(qtyContainer);
}
});
} else jQuery(window).trigger('dpo_no_options');
},
getPlaceHolder: function(){
var dpoPlaceholder = jQuery('#dpo_placeholder').first(); if (dpoPlaceholder[0]) return dpoPlaceholder;
var variantObj = window.dpoObserver.variantObj.first(), dpoPlaceholder = variantObj.closest('form').find(window.dpoObserver.selectors.swatchElement).last();
if (!dpoPlaceholder[0]) dpoPlaceholder = variantObj;
return dpoPlaceholder;
},
hideSystemVariants: function(){
try {
jQuery('select').each(function(){var needsUpdate=false; jQuery(this).find('option').each(function(){if (this.innerHTML.indexOf('(D#') > 0) {jQuery(this).remove(); needsUpdate=true;}}); if (needsUpdate) jQuery(this).trigger('change'); });
jQuery(window.dpoObserver.selectors.swatchElement).find('label').each(function(){if (this.innerHTML.indexOf('(D#') > 0) jQuery(this).hide()});
jQuery('body').on('click mousedown', 'select', function(){ jQuery(this).find('option').each(function(){if (this.innerHTML.indexOf('(D#') > 0) jQuery(this).remove();}); });
var variantSelect = jQuery(window.dpoObserver.selectors.variantId);
if (variantSelect[0] && variantSelect[0].options && variantSelect[0].options.length == 1 && jQuery.trim(variantSelect[0].options[0].innerText).indexOf('Default') > -1) jQuery(window.dpoObserver.selectors.swatchElement).addClass('dpo-hidden').css({display:'none'});
jQuery('select:has(option:contains("Default Title"))').hide();
jQuery('option:contains("D#")').remove();
} catch (e) {}
},
parseCartMetaText: function(){
jQuery(window.dpoObserver.selectors.cartTableRow).each(function(i, row){
jQuery(row).attr('vid', window.dpoObserver.cartItems[i].variant_id);
if (window.dpoObserver.cartItems && window.dpoObserver.cartItems[i] && window.dpoObserver.cartItems[i].properties && window.dpoObserver.cartItems[i].properties['_pvid']) jQuery(row).attr('pvid', window.dpoObserver.cartItems[i].properties['_pvid']).addClass('dpo_child_item');
var text = jQuery(row).html(), pos = text.indexOf('(D#');
if (pos > -1) {
var dpoCartId = text.substr(pos + 3), dpoCartId = dpoCartId.indexOf(')') ? dpoCartId.substr(0, dpoCartId.indexOf(')')) : dpoCartId;
jQuery(row).addClass('has_dpo').find(window.dpoObserver.selectors.cartMetaText).each(function(){
var text = '';
jQuery.each(jQuery(this).html().split("\n"), function(o, l){
var line = jQuery.trim(l);
if (!line) return;
var isLabel = line.substr(-1) == ':', pos = line.indexOf('- (D#');
if (pos > -1) line = line.substr(0, pos) + line.substr(pos + 13); else { pos = line.indexOf('(D#'); if (pos > -1) line = line.substr(0, pos) + line.substr(pos + 11);}
if (isLabel) text += (text ? '
' : '')+line + ' '; else text += line + "\n";
});
jQuery(this).html(text.replace('- Default Title', '').replace('Default Title', ''));
});
} else {
if (window.dpoObserver.cartItems && window.dpoObserver.cartItems[i]) {
var text = window.dpoObserver.cartItems[i].title, pos = text !== null ? text.indexOf('(D#') : -1;
if (pos > -1) {
var dpoCartId = text.substr(pos + 3), dpoCartId = dpoCartId.indexOf(')') ? dpoCartId.substr(0, dpoCartId.indexOf(')')) : dpoCartId;
jQuery(row).addClass('has_dpo');
} else return;
} else return;
}
window.dpoObserver.loadCSS('https://node1.itoris.com/dpo/storefront/assets/css/main.css');
//jQuery(row).find(':contains("Default Title")').last().hide();
var removeBtn = jQuery(row).find(window.dpoObserver.selectors.cartRemoveBtn), lineItemQtyField = jQuery(row).find('[name*="updates["]');
if (dpoCartId /*&& removeBtn[0]*/) {
jQuery(row).attr({dpo_cart_id: dpoCartId});
var editBtn = jQuery('');//.attr({dpo_cart_id: dpoCartId});//.data({dpo_cart_id: dpoCartId, line_item_qty_field: lineItemQtyField});
var productLink = jQuery(row).find('a[href*="/products"]:not(:has(img)):visible').first();
if (productLink[0]) {
productLink.after(jQuery('').addClass('dpo_cart_edit_container').css({clear: 'both'}).append(editBtn));
} else {
jQuery(removeBtn[0]).before(jQuery('').addClass('dpo_cart_edit_container').css({clear: 'both'}).append(editBtn));
}
if (!removeBtn[0]) {removeBtn = jQuery('Remove'); editBtn.after(removeBtn);}
editBtn.on('click', function(ev){
ev.preventDefault();
editBtn.addClass('dpo-loading');
jQuery.post('https://node1.itoris.com/dpo/storefront/include.js?controller=GetOptionConfig&shop=siramerge.myshopify.com', {dpo_cart_id: dpoCartId, customer_id: window.dpoObserver.customerId, skip_assoc_data_check: window.dpoObserver.skipAssocDataCheck ? 1 : 0}).done(function( data ) {
editBtn.removeClass('dpo-loading');
jQuery('.dpo-container').remove();
editBtn.before(jQuery('').css({display:'none'}).addClass('dpo-container dpo-cart').data({dpo_cart_id: dpoCartId, line_item_index: i + 1, line_item_qty_field: lineItemQtyField, line_item: window.dpoObserver.cartItems[i]}).html(data));
});
});
removeBtn.attr({_href: removeBtn.attr('href'), href: "javascript://", vid: window.dpoObserver.cartItems && window.dpoObserver.cartItems[i] ? window.dpoObserver.cartItems[i].variant_id : ''});
removeBtn.on('click', function(ev){
ev.preventDefault();
this.disabled = true;
this.style.pointerEvents = 'none';
var vid = jQuery(this).attr('vid'); if (vid) jQuery.each(window.dpoObserver.cartItems, function(){if (this.properties && this.properties['_pvid'] && this.properties['_pvid'] == vid) jQuery.ajax({url: '/cart/change.js', method: 'POST', async: false, dataType: 'json', data: { quantity: 0, id: this.key }}); });
jQuery.post('https://node1.itoris.com/dpo/storefront/include.js?controller=RemoveCartItem&shop=siramerge.myshopify.com', {dpo_cart_id: dpoCartId}).done(function( data ) {
if (!data['notice']) jQuery('