/*!For license information please see widget.js.LICENSE.txt*/var lsNetvisioGTM;(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(){r=function(){return t};var t={},e=Object.prototype,o=e.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},l=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),l=new L(r||[]);return i(a,"_invoke",{value:k(t,n,l)}),a}function v(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var m={};function p(){}function f(){}function _(){}var h={};d(h,l,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(x([])));y&&y!==e&&o.call(y,l)&&(h=y);var w=_.prototype=p.prototype=Object.create(h);function b(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(i,a,l,c){var u=v(t[i],t,a);if("throw"!==u.type){var d=u.arg,s=d.value;return s&&"object"==n(s)&&o.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,l,c)}),(function(t){r("throw",t,l,c)})):e.resolve(s).then((function(t){d.value=t,l(d)}),(function(t){return r("throw",t,l,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var l=I(a,n);if(l){if(l===m)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=v(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function I(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,I(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=v(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,m;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,m):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function x(t){if(t){var e=t[l];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:D}}function D(){return{value:void 0,done:!0}}return f.prototype=_,i(w,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:f,configurable:!0}),f.displayName=d(_,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,d(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},b(S.prototype),d(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(s(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(w),d(w,u,"Generator"),d(w,l,(function(){return this})),d(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=x,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(j),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),m}},t}function o(t,e,n,r,o,i,a){try{var l=t[i](a),c=l.value}catch(t){return void n(t)}l.done?e(c):Promise.resolve(c).then(r,o)}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){l(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function l(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===n(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}t.r(e),t.d(e,{setCustomer:()=>d});function u(t){var e="; ".concat(document.cookie).split("; ".concat(t,"="));if(2===e.length)return e.pop().split(";").shift()}function d(t){console.log("🚀 ~ file: index.js:42 ~ setCustomer ~ customer:",t)}Promise.all([fetch("".concat("https://sp.stape.io","/widget/setting?shop=").concat("fandiem.com","&shop_id=").concat("50221678757"),{method:"GET"}).then((function(t){return t.json()})),fetch("/cart.js").then((function(t){return t.json()}))]).then((function(t){var e,n,i,l,d,s=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,u=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),v=s[0],m=s[1],p=v.generate,f=v.data_layer,_=v.webhook;function h(t){try{if(["purchase_stape","begin_checkout_plus_stape"].includes(null==t?void 0:t.event)&&(window.dataLayer||[]).some((function(e){return(null==e?void 0:e.event)==(null==t?void 0:t.event)})))return void console.log("Not creted event");window.dataLayer.push(t)}catch(e){window.dataLayer.push(t)}}window.dataLayer=window.dataLayer||[];var g=location.pathname;if(localStorage.getItem("cartToken")!=m.token&&g.indexOf("/checkouts")<0&&localStorage.setItem("cartToken",m.token),null!=v&&null!==(e=v.generate)&&void 0!==e&&e.insert_gtm_snipper){var y=document.createElement("script"),w=(null==p?void 0:p.is_custom_domain)&&(null==p?void 0:p.custom_domain)||"https://www.googletagmanager.com",b=null!=p&&p.is_custom_domain&&null!=p&&p.custom_domain&&null!=p&&p.is_custom_loaded&&null!=p&&p.custom_loaded?((null==p?void 0:p.gtm_id)||"").replace("GTM-","").trim():(null==p?void 0:p.gtm_id)||"",S=(null==p?void 0:p.is_custom_loaded)&&(null==p?void 0:p.custom_loaded)||"gtm",k=Boolean((null==p?void 0:p.is_custom_domain)&&(null==p?void 0:p.custom_domain)&&(null==p?void 0:p.is_custom_loaded)&&(null==p?void 0:p.custom_loaded));if(p.is_cookie_keeper&&null!=p&&p.is_custom_loaded){var I='!function(){"use strict";function l(e){for(var t=e,r=0,n=document.cookie.split(";");r<n.length;r++){var o=n[r].split("=");if(o[0].trim()===t)return o[1]}}function s(e){return localStorage.getItem(e)}function u(e){return window[e]}function d(e,t){e=document.querySelector(e);return t?null==e?void 0:e.getAttribute(t):null==e?void 0:e.textContent}var e=window,t=document,r="script",n="dataLayer",o="{{WEB_GTM_ID}}",a="{{DOMAIN}}",i="",c="{{CONTAINER_ID}}",E="cookie",I=["_y","_shopify_y"],v="",g=!1;try{var g=!!E&&(m=navigator.userAgent,!!(m=new RegExp("Version/([0-9._]+)(.*Mobile)?.*Safari.*").exec(m)))&&16.4<=parseFloat(m[1]),A="stapeUserId"===E,f=g&&!A?function(e,t,r){void 0===t&&(t="");var n={cookie:l,localStorage:s,jsVariable:u,cssSelector:d},t=Array.isArray(t)?t:[t];if(e&&n[e])for(var o=n[e],a=0,i=t;a<i.length;a++){var c=i[a],c=r?o(c,r):o(c);if(c)return c}else console.warn("invalid uid source",e)}(E,I,v):void 0;g=g&&(!!f||A)}catch(e){console.error(e)}var m=e,E=(m[n]=m[n]||[],m[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"}),t.getElementsByTagName(r)[0]),I="dataLayer"===n?"":"&l="+n,v=f?"&bi="+encodeURIComponent(f):"",A=t.createElement(r),e=g?"kp"+c:c,n=!g&&i?i:a;A.async=!0,A.src=n+"/"+e+".js?st="+o+I+v,null!=(f=E.parentNode)&&f.insertBefore(A,E)}();'.replace("{{DOMAIN}}",w).replace("{{WEB_GTM_ID}}",b).replace("{{CONTAINER_ID}}",S);y.innerHTML=I}else{var O="(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='{{DOMAIN}}/{{CONTAINER_ID}}.js?".concat(k?"st":"id","='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','{{WEB_GTM_ID}}');").replace("{{DOMAIN}}",w).replace("{{WEB_GTM_ID}}",b).replace("{{CONTAINER_ID}}",S);y.innerHTML=O}document.head.appendChild(y)}console.log("+++++++++++lsNet_1.0.9+++++++++++++",window.lsData),window.lsData||(window.lsData={});var j,L,x,D={};if(null!==(n=window)&&void 0!==n&&null!==(i=n.lsData)&&void 0!==i&&i.customer&&null!==(l=window)&&void 0!==l&&null!==(d=l.lsData)&&void 0!==d&&d.customer.email&&null!=f&&f.user_data){var E=window.lsData.customer||{};D.user_data={email:E.email,first_name:E.first_name,last_name:E.last_name,customer_id:E.customer_id},localStorage.getItem("customerLoginId")||(localStorage.setItem("customerLoginId",E.customer_id),localStorage.getItem("customerRegisterId")&&localStorage.getItem("customerRegisterId")==E.customer_id?h({event:"login",user_data:D.user_data}):(localStorage.setItem("customerRegisterId",E.customer_id),h({event:"sign_up",user_data:D.user_data})))}else g.indexOf("/checkouts/")<0&&localStorage.removeItem("customerLoginId");if(f.ecommerce||f.user_data){var T=function(){var t,e,n,r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"begin_checkout_stape";if(null!==(t=window)&&void 0!==t&&null!==(e=t.lsData)&&void 0!==e&&e.cart||null!==(n=window)&&void 0!==n&&null!==(r=n.lsData)&&void 0!==r&&r.checkout){f.ecommerce&&h({ecommerce:null});var i=void 0;if(f.ecommerce){var l,c,u,d,s,v,m,p,_,g=(null===(l=window)||void 0===l||null===(c=l.lsData)||void 0===c?void 0:c.cart)||(null===(u=window)||void 0===u||null===(d=u.lsData)||void 0===d?void 0:d.checkout)||{},y=[];if(null!==(s=window)&&void 0!==s&&null!==(v=s.lsData)&&void 0!==v&&v.cart)y=((null===(_=window.lsData.cart)||void 0===_?void 0:_.items)||[]).map((function(t){return{item_id:t.product_id+"",item_sku:t.sku,item_name:t.product_title,item_brand:t.vendor,item_category:t.product_type,item_variant:t.variant_id+"",price:t.price/100,quantity:t.quantity}}));else if(null!==(m=window)&&void 0!==m&&null!==(p=m.lsData)&&void 0!==p&&p.checkout){var w;y=((null===(w=window.lsData.checkout)||void 0===w?void 0:w.line_items)||[]).map((function(t){return{item_id:t.item_id+"",item_sku:t.item_sku,item_name:t.item_name,item_brand:t.item_brand,item_category:t.item_category,item_variant:t.item_variant+"",price:t.price,quantity:t.quantity}}))}i={cart_total:g.total_price/100,currency:window.lsData.currency||g.currency,cart_quantity:g.item_count,items:y}}h(a(a({},D),{},{ecommerce:i,event:o}))}},N=function(){var t,e=(t=r().mark((function t(e){var n,o,i,l,c,u,d;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(window.Shopify.routes.root+"cart.js").then((function(t){return t.json()})).then((function(t){return t}));case 3:n=t.sent,window.lsData.cart=n||{},o=parseInt(localStorage.getItem("cartForStape")||0),localStorage.getItem("cartToken")!=n.token&&localStorage.setItem("cartToken",n.token),i=(n&&n.items||[]).find((function(t){return((null==e?void 0:e.items)||[]).some((function(e){return e.quantity!=t.quantity}))||!((null==e?void 0:e.items)||[]).some((function(e){return e.id==t.id}))})),l=(e&&e.items||[]).find((function(t){return(n&&(null==n?void 0:n.items)||[]).some((function(e){return e.quantity!=t.quantity}))||!((null==n?void 0:n.items)||[]).some((function(e){return e.id==t.id}))})),i||l?(f.ecommerce&&h({ecommerce:null}),c=i||l,u=void 0,f.ecommerce&&(u={currency:window.lsData.currency,items:[{item_id:c.product_id,item_sku:c.sku,item_name:c.product_title,item_brand:c.vendor,item_category:c.product_type,item_variant:c.variant_id+"",price:c.price/100,quantity:c.quantity}]}),d="add_to_cart_stape",(null==i?void 0:i.id)==(null==l?void 0:l.id)&&(d=i.quantity<l.quantity?"remove_from_cart_stape":"add_to_cart_stape"),!i&&l&&(d="remove_from_cart_stape"),h(a(a({},D),{},{ecommerce:u,event:d}))):setTimeout((function(){o<5&&(localStorage.setItem("cartForStape",o+1),N(e))}),500),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),console.log("🚀 ~ file: index.js:418 ~ equelCart ~ error:",t.t0);case 15:case"end":return t.stop()}}),t,null,[[0,12]])})),function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function l(t){o(a,r,i,l,c,"next",t)}function c(t){o(a,r,i,l,c,"throw",t)}l(void 0)}))});return function(t){return e.apply(this,arguments)}}();if(g.indexOf("/cart")>-1){f.ecommerce&&h({ecommerce:null});var q=void 0;if(f.ecommerce){var P,A,M=(null===(P=window)||void 0===P||null===(A=P.lsData)||void 0===A?void 0:A.cart)||{};q={cart_total:M.total_price/100,currency:window.lsData.currency,cart_quantity:M.item_count,items:((null==M?void 0:M.items)||[]).map((function(t){return{item_id:t.product_id+"",item_sku:t.sku,item_name:t.product_title,item_brand:t.vendor,item_category:t.product_type,item_variant:t.variant_id+"",price:t.price/100,quantity:t.quantity}}))}}h(a(a({},D),{},{ecommerce:q,event:"view_cart_stape"}))}if(g.indexOf("/collections/")>-1){var R,C;f.ecommerce&&h({ecommerce:null});var G,F=(null===(R=window.lsData)||void 0===R?void 0:R.collection)||[],H=(null===(C=window.lsData)||void 0===C?void 0:C.collection_title)||"",B=void 0;f.ecommerce&&(B={currency:null===(G=window.lsData)||void 0===G?void 0:G.currency,item_list_name:H,items:(F||[]).map((function(t){return{item_name:t.title,item_id:t.id,item_sku:t.variants&&t.variants[0]&&t.variants[0].sku?t.variants[0].sku:"",price:(t.price/100).toFixed(2),item_variant:t.variants[0].id+""}}))}),h(a(a({},D),{},{ecommerce:B,event:"view_collection_stape"}))}if(g.indexOf("/products/")>-1){var X;f.ecommerce&&h({ecommerce:null});var z,W,J,U=(null===(X=window.lsData)||void 0===X?void 0:X.product)||{},V=void 0;f.ecommerce&&(V={currency:null===(z=window.lsData)||void 0===z||null===(W=z.cart)||void 0===W?void 0:W.currency,items:[{item_name:U.title,item_id:null==U||null===(J=U.id)||void 0===J?void 0:J.toString(),item_sku:U.variants&&U.variants[0]&&U.variants[0].sku?U.variants[0].sku:"",item_brand:U.vendor,item_category:U.type,price:(U.price/100).toFixed(2),item_variant:U.variants&&U.variants[0]?U.variants[0].id+"":""}]}),h(a(a({},D),{},{ecommerce:V,event:"view_item_stape"}))}if(g.indexOf("/checkouts")>-1&&location.href.indexOf("step=payment_method")>-1){var Y,$,K,Q,Z,tt,et,nt,rt,ot,it,at,lt,ct,ut,dt,st,vt,mt,pt,ft,_t=(null===(Y=window)||void 0===Y||null===($=Y.lsData)||void 0===$?void 0:$.checkout)||{},ht=(null===(K=window)||void 0===K||null===(Q=K.lsData)||void 0===Q?void 0:Q.customer)||{};D.event="payment_info_stape",f.ecommerce&&h({ecommerce:null}),f.user_data&&(D.user_data={email:_t.email,first_name:(null==_t||null===(Z=_t.shipping_address)||void 0===Z?void 0:Z.first_name)||(null==_t||null===(tt=_t.billing_address)||void 0===tt?void 0:tt.first_name)||"",last_name:(null==_t||null===(et=_t.shipping_address)||void 0===et?void 0:et.last_name)||(null==_t||null===(nt=_t.billing_address)||void 0===nt?void 0:nt.last_name)||"",phone:(null==_t||null===(rt=_t.shipping_address)||void 0===rt?void 0:rt.phone)||(null==_t||null===(ot=_t.billing_address)||void 0===ot?void 0:ot.phone)||"",country:(null==_t||null===(it=_t.shipping_address)||void 0===it?void 0:it.country_code)||(null==_t||null===(at=_t.billing_address)||void 0===at?void 0:at.country_code)||"",region:(null==_t||null===(lt=_t.shipping_address)||void 0===lt?void 0:lt.province)||(null==_t||null===(ct=_t.billing_address)||void 0===ct?void 0:ct.province)||"",city:(null==_t||null===(ut=_t.shipping_address)||void 0===ut?void 0:ut.city)||(null==_t||null===(dt=_t.billing_address)||void 0===dt?void 0:dt.city)||"",street:(null==_t||null===(st=_t.shipping_address)||void 0===st?void 0:st.street)||(null==_t||null===(vt=_t.shipping_address)||void 0===vt?void 0:vt.address1)||(null==_t||null===(mt=_t.billing_address)||void 0===mt?void 0:mt.address1)||"",zip:(null==_t||null===(pt=_t.shipping_address)||void 0===pt?void 0:pt.zip)||(null==_t||null===(ft=_t.billing_address)||void 0===ft?void 0:ft.zip)||"",customer_id:(null==ht?void 0:ht.id)||(null==_t?void 0:_t.customer_id)||""}),f.ecommerce&&(D.ecommerce={currency:null==_t?void 0:_t.currency,cart_total:(null==_t?void 0:_t.total_price)/100,cart_quantity:_t.item_count,items:(null==_t?void 0:_t.line_items)||[]}),h(a({},D))}var gt=window.fetch;window.fetch=function(t,e){var n=t+"";try{if("/cart/add"==n||"/cart/change"==n||"/cart/add.js"==n||"/cart/change.js"==n||0==n.indexOf("/cart/update.js")){var r,o,i=(null===(r=window)||void 0===r||null===(o=r.lsData)||void 0===o?void 0:o.cart)||{};localStorage.setItem("oldCartStape",JSON.stringify(i))}}catch(t){console.log("🚀 ~ file: index.js:356 ~ .then ~ error:",t)}return gt(t,e)},j=function(t){if("/cart/add.js"==t._url||"/cart/change.js"==t._url){var e=window.lsData.cart||{};localStorage.setItem("oldCartStape",JSON.stringify(e))}},XMLHttpRequest.callbacks?XMLHttpRequest.callbacks.push(j):(XMLHttpRequest.callbacks=[j],L=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.send=function(){var t;if(null!==(t=XMLHttpRequest)&&void 0!==t&&t.callbacks&&XMLHttpRequest.callbacks.length)for(x=0;x<XMLHttpRequest.callbacks.length;x++)XMLHttpRequest.callbacks[x](this);L.apply(this,arguments)}),document.addEventListener("submit",(function(t){if(t.target.action.indexOf("/cart/add")>-1){var e=window.lsData.cart||{};localStorage.setItem("oldCartStape",JSON.stringify(e))}else t.target.action.indexOf("/cart")>-1&&T()})),window.location.href.includes("/checkout")&&!localStorage.getItem("begin_checkout_plus_stape")?(localStorage.setItem("begin_checkout_plus_stape","true"),T("begin_checkout_plus_stape")):localStorage.removeItem("begin_checkout_plus_stape"),setInterval((function(){var t=localStorage.getItem("oldCartStape");if(t)try{t=JSON.parse(t),localStorage.removeItem("oldCartStape"),localStorage.setItem("cartForStape",0),N(t)}catch(t){}}),500)}if(g.indexOf("/thank_you")>-1){var yt,wt,bt,St,kt=(null===(yt=window)||void 0===yt||null===(wt=yt.Shopify)||void 0===wt?void 0:wt.checkout)||{},It=(null===(bt=window)||void 0===bt||null===(St=bt.lsData)||void 0===St?void 0:St.customer)||{};f.ecommerce&&h({ecommerce:null});var Ot,jt,Lt,xt,Dt,Et,Tt,Nt,qt,Pt,At,Mt,Rt,Ct,Gt,Ft,Ht,Bt,Xt={event:"purchase_stape"};if(f.user_data&&(Xt.user_data={email:kt.email||(null==kt||null===(Ot=kt.billing_address)||void 0===Ot?void 0:Ot.email)||(null==kt||null===(jt=kt.shipping_address)||void 0===jt?void 0:jt.email),first_name:(null==It?void 0:It.first_name)||(null==kt||null===(Lt=kt.billing_address)||void 0===Lt?void 0:Lt.first_name)||(null==kt||null===(xt=kt.shipping_address)||void 0===xt?void 0:xt.first_name),last_name:(null==It?void 0:It.last_name)||(null==kt||null===(Dt=kt.billing_address)||void 0===Dt?void 0:Dt.last_name)||(null==kt||null===(Et=kt.shipping_address)||void 0===Et?void 0:Et.last_name),phone:(null==It?void 0:It.phone)||(null==kt||null===(Tt=kt.billing_address)||void 0===Tt?void 0:Tt.phone)||(null==kt||null===(Nt=kt.shipping_address)||void 0===Nt?void 0:Nt.phone),country:(null==kt||null===(qt=kt.billing_address)||void 0===qt?void 0:qt.country_code)||(null==kt||null===(Pt=kt.shipping_address)||void 0===Pt?void 0:Pt.country_code),region:"US"==kt.billing_address.country_code?null==kt||null===(At=kt.billing_address)||void 0===At?void 0:At.province_code:null==kt||null===(Mt=kt.billing_address)||void 0===Mt?void 0:Mt.province,city:(null==kt||null===(Rt=kt.billing_address)||void 0===Rt?void 0:Rt.city)||(null==kt||null===(Ct=kt.shipping_address)||void 0===Ct?void 0:Ct.city),street:(null==kt||null===(Gt=kt.billing_address)||void 0===Gt?void 0:Gt.address1)||(null==kt||null===(Ft=kt.shipping_address)||void 0===Ft?void 0:Ft.address1),zip:(null==kt||null===(Ht=kt.billing_address)||void 0===Ht?void 0:Ht.zip)||(null==kt||null===(Bt=kt.shipping_address)||void 0===Bt?void 0:Bt.zip),customer_id:(null==It?void 0:It.id)||(null==kt?void 0:kt.customer_id)}),f.ecommerce){var zt,Wt,Jt,Ut,Vt,Yt,$t=null===(zt=window)||void 0===zt||null===(Wt=zt.Shopify)||void 0===Wt?void 0:Wt.shop;Xt.ecommerce={transaction_id:null==kt?void 0:kt.order_id,affiliation:$t,value:null==kt?void 0:kt.total_price,tax:null==kt?void 0:kt.total_tax,shipping:(null==kt||null===(Jt=kt.shipping)||void 0===Jt?void 0:Jt.price)||(null==kt||null===(Ut=kt.shipping_rate)||void 0===Ut?void 0:Ut.price),discount_amount:null==kt||null===(Vt=kt.discount)||void 0===Vt?void 0:Vt.amount,discount:null==kt||null===(Yt=kt.discount)||void 0===Yt?void 0:Yt.code,currency:null==kt?void 0:kt.currency,items:((null==kt?void 0:kt.line_items)||[]).map((function(t){return{item_id:t.product_id,item_sku:t.sku,item_name:t.title,item_brand:t.vendor,item_variant:t.variant_id+"",price:t.price,quantity:t.quantity}}))}}(f.ecommerce||f.user_data)&&h(a({},Xt));try{var Kt=Xt.user_data.customer_id;!localStorage.getItem("customerLoginId")&&Kt&&(localStorage.setItem("customerLoginId",Kt),localStorage.getItem("customerRegisterId")&&localStorage.getItem("customerRegisterId")==Kt?h({event:"login",user_data:Xt.user_data}):(localStorage.setItem("customerRegisterId",Kt),h({event:"sign_up",user_data:Xt.user_data})))}catch(t){}if(_.send_webhook&&_.url&&_.purchase_webhook){var Qt={fbc:u("fbc"),fbp:u("fbp"),FPGCLAW:u("FPGCLAW"),_gcl_aw:u("_gcl_aw"),ttclid:u("ttclid")};fetch(_.url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a(a({},Xt),{},{cookies:Qt,cart_id:localStorage.getItem("cartToken")}))})}}})).catch((function(t){console.log("🚀 ~ file: index.js ~ line 184 ~ ]).then ~ err",t)})),lsNetvisioGTM=e})();