(()=>{(function(b){var u={};function e(t){if(u[t])return u[t].exports;var s=u[t]={i:t,l:!1,exports:{}};return b[t].call(s.exports,s,s.exports,e),s.l=!0,s.exports}return e.m=b,e.c=u,e.d=function(t,s,p){e.o(t,s)||Object.defineProperty(t,s,{enumerable:!0,get:p})},e.r=function(t){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,s){if(s&1&&(t=e(t)),s&8||s&4&&typeof t=="object"&&t&&t.__esModule)return t;var p=Object.create(null);if(e.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:t}),s&2&&typeof t!="string")for(var f in t)e.d(p,f,function(A){return t[A]}.bind(null,f));return p},e.n=function(t){var s=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(s,"a",s),s},e.o=function(t,s){return Object.prototype.hasOwnProperty.call(t,s)},e.p="",e(e.s=22)})([function(b,u,e){"use strict";e.d(u,"h",function(){return s}),e.d(u,"d",function(){return p}),e.d(u,"e",function(){return f}),e.d(u,"j",function(){return A}),e.d(u,"g",function(){return w}),e.d(u,"c",function(){return I}),e.d(u,"f",function(){return P}),e.d(u,"i",function(){return L}),e.d(u,"k",function(){return N}),e.d(u,"b",function(){return S}),e.d(u,"a",function(){return R});var t=function(l,E,c,h){function v(O){return O instanceof c?O:new c(function(y){y(O)})}return new(c||(c=Promise))(function(O,y){function x(r){try{o(h.next(r))}catch(i){y(i)}}function D(r){try{o(h.throw(r))}catch(i){y(i)}}function o(r){r.done?O(r.value):v(r.value).then(x,D)}o((h=h.apply(l,E||[])).next())})};function s(l){return typeof l=="undefined"}function p(l){return typeof l=="function"}function f(l){return l===null}const A=(l,E={})=>{if(Number.isFinite(+l))return E;try{return JSON.parse(l)}catch(c){}return E};function w(l){const E=function(){return t(this,void 0,void 0,function*(){})}.constructor;return typeof l=="object"&&!f(l)&&!Array.isArray(l)&&!(l instanceof E)&&l.constructor!=="function"&&Object.prototype.toString.call(l)==="[object Object]"}function I(l,E,c=void 0){if(f(l)||s(l))return c;const v=(E!=null?E:"").replace(/\[([^[\]]*)]/g,".$1.").split(".").filter(O=>O!=="").reduce((O,y)=>O&&O[y],l);return s(v)?c:v}function P(l){return typeof l=="number"&&Number.isFinite(l)}function L(l){return typeof l=="string"&&l.length>0}const N=(l,E="",c)=>{const h=E&&E.length>0?E.split("."):[];let v=l;return h.slice(0,h.length-1).forEach(O=>{let y=v[O];(f(y)||s(y))&&(y={}),v[O]=y,v=v[O]}),v[h.pop()]=c,l};function S(l,E){let c;return(...h)=>{clearTimeout(c),c=setTimeout(()=>{l(...h)},E)}}const R=l=>{var E,c,h;return(h=(c=(E=l.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))===null||E===void 0?void 0:E.map(v=>v.toLowerCase()))===null||c===void 0?void 0:c.join("_"))!==null&&h!==void 0?h:l}},function(b,u,e){(function(t,s){s(u)})(this,function(t){"use strict";var s,p,f,A,w,I,P,L,N,S,R,l,E,c,h;t.AlignValue=void 0,(s=t.AlignValue||(t.AlignValue={})).LEFT="left",s.RIGHT="right",s.CENTER="center",t.AlignPosition=void 0,(p=t.AlignPosition||(t.AlignPosition={})).NATURAL="natural",p.CANVAS="canvas",t.ShapeKind=void 0,(f=t.ShapeKind||(t.ShapeKind={})).CIRCLE="circle",f.RECTANGLE="rectangle",f.POLYGON="polygon",t.ObjectType=void 0,(A=t.ObjectType||(t.ObjectType={})).TEXT="text",A.SHAPE="shape",A.IMAGE="image",A.GROUP="group",t.SizeUnit=void 0,(w=t.SizeUnit||(t.SizeUnit={})).PX="px",w.PERCENT="%",t.LogicalOp=void 0,(I=t.LogicalOp||(t.LogicalOp={})).AND="and",I.OR="or",t.ComparisonOp=void 0,(P=t.ComparisonOp||(t.ComparisonOp={})).GT="gt",P.LT="lt",P.GE="ge",P.LE="le",P.EQ="eq",P.NE="ne",t.ConditionVariable=void 0,(L=t.ConditionVariable||(t.ConditionVariable={})).H="h",L.W="w",L.AR="ar",t.CartUpdateAction=void 0,(N=t.CartUpdateAction||(t.CartUpdateAction={})).ADD_TO_CART="addToCart",N.INCREMENT_QUANTITY="increaseQuantity",N.DECREMENT_QUANTITY="decreaseQuantity",N.UPDATE_QUANTITY="updateQuantity",N.CHANGE_QUANTITY="changeQuantity",N.CHANGE_CART="changeCart",t.WidgetFeature=void 0,(S=t.WidgetFeature||(t.WidgetFeature={})).AUTOMATED_DISCOUNTS="cart_discounts_inclusion",S.MANUAL_DISCOUNT_ALLOCATIONS="allow_manual_discount_allocations",S.PRODUCT_VARIANTS="product_variants",S.EXCLUDE_OOS="exclude_oos",S.TIMER="timer",S.EMBEDDED_PRICE_DROP="embed-price-drop",S.PRODUCT_SELECTION="product_selection",S.RECOMMENDATION_REMINDER="recommendation_reminder",S.QUIZ_TIMER="quiz-timer",S.FS_FLOATING="fullscreen-floating",S.FLOATING_LAUNCHER="floating-launcher",S.SINGLE_SELECTION_DISCOUNT="single_selection_discount",S.EXCLUDE_DOUBLE_SELECTION_DISCOUNT="exclude_double_selection_discount",S.TIERED_DISCOUNT="tiered_discount",S.NO_DEFAULT_SELECTION="no_default_selection",S.PRODUCT_DISCOUNT="product_discount",S.NEW_USER_VIEW="new_user_view",S.TIMED_VIEW="timed_view",S.MOBILE_BOTTOM_DRAWER="mobile_bottom_drawer",S.USER_SPECIFIC="user-specific",S.COD_HIDDEN="cod_hidden",t.WidgetCategory=void 0,(R=t.WidgetCategory||(t.WidgetCategory={})).CUSTOM_QUIZ="custom_recommendation-quiz",R.QUIZ="quiz",R.PRODUCT_BUNDLE="bundle",R.AB_CART="cart",R.SIDE_CART="side-cart",R.FORM="form",R.PRICE_DROP="price-drop",R.NEW_ARRIVALS="newarrivals",R.BESTSELLER="recommended",R.GENERIC="generic",R.FBT="fbt",R.REWARD_QUIZ="reward-quiz",R.BULK_BUY="bulk-buy",R.SPIN_WHEEL="spin-the-wheel",R.STICKY_CART_BUTTON="sticky-cart-button",R.PLAYBOOK="playbook",t.WidgetType=void 0,(l=t.WidgetType||(t.WidgetType={})).STORE_BANNER="store",l.PRODUCT_BANNER="product",l.WIDGET="widget",t.InsertType=void 0,(E=t.InsertType||(t.InsertType={})).ABOVE="above",E.BELOW="below",E.REPLACE_CHILDREN="replaceChildren",E.LAST_CHILD="lastChild",E.FIRST_CHILD="firstChild",E.PAGE_TOP="pageTop",E.PAGE_BOTTOM="pageBottom",E.PAGE_HOVER_TOP="pageHoverTop",E.PAGE_HOVER_BOTTOM="pageHoverBottom",E.FLOATING="floating",E.SLIDE_IN="slideIn",t.WidgetTimingAction=void 0,(c=t.WidgetTimingAction||(t.WidgetTimingAction={})).CLICK="click",c.SCROLL="scroll",c.DELAY="delay",c.AB_CART="abcart",t.TargetType=void 0,(h=t.TargetType||(t.TargetType={})).PAGES="pages",h.PRODUCTS="products",h.COLLECTIONS="collections";var v,O,y,x,D,o,r,i,n,m;t.BreakpointId=void 0,(v=t.BreakpointId||(t.BreakpointId={})).XS="xs",v.M="m",v.L="l",v.XL="xl",t.FloatingPositionTypes=void 0,(O=t.FloatingPositionTypes||(t.FloatingPositionTypes={})).TOP="top",O.RIGHT="right",O.BOTTOM="bottom",O.LEFT="left",t.AddOn=void 0,(y=t.AddOn||(t.AddOn={})).RECOMMENDED="recommended",y.UPSELL="upsell",y.FBT="fbt",t.WidgetEntityState=void 0,(x=t.WidgetEntityState||(t.WidgetEntityState={})).ENABLED="enabled",x.DISABLED="disabled",x.SYSTEM_DISABLED="system_disabled",x.DELETED="deleted",t.ApplyType=void 0,(D=t.ApplyType||(t.ApplyType={})).MANUAL="manual",D.AUTOMATION="automation",t.PublishAs=void 0,(o=t.PublishAs||(t.PublishAs={})).BADGE="badge",o.FEATURE_CARD="feature-card",o.TRUST_BADGE="trust-badges",o.STORE_BANNER="store-banner",o.PRODUCT_BANNER="product-banner",o.STANDALONE="standalone",o.WIDGET="widget",t.AddonStatus=void 0,(r=t.AddonStatus||(t.AddonStatus={})).ENABLED="enabled",r.DISABLED="disabled",t.DiscountType=void 0,(i=t.DiscountType||(t.DiscountType={})).FIXED="fixed_amount",i.PERCENTAGE="percentage",i.TIERED="tiered",t.ChannelMethod=void 0,(n=t.ChannelMethod||(t.ChannelMethod={})).INITIALIZE="initialize",n.RESIZE="resize",n.TIMER_EXPIRED="timerExpired",n.CART_UPDATE="onCartUpdate",n.ORDER_CREATED="orderCreated",n.DISCOUNT_UPDATION="discountUpdation",n.FETCH_CART="getCart",n.CLOSE="closeWidget",n.CHANGE_VARIANT="onChangeVariant",n.SELECT_PRODUCT="onProductSelect",n.FORM_SUBMIT="onFormSubmit",n.UPDATE_WIDGET="update",n.URL_CHANGE="urlchange",n.WINDOW_RESIZED="window-resized",n.TIMER_STATE_UPDATE="timer-state-update",n.SPIN_WHEEL_STATE_UPDATE="spin-wheel-state-update",n.QUIZ_STATE_UPDATE="quiz-state-update",n.IN_VIEW="in-view",n.OUT_OF_VIEW="out-of-view",n.GET_QUERY_PARAMS="get-query-params",n.LINK_DATA_UPDATE="link-data-update",n.GET_STOREFRONT_DATA="get-storefront-data",t.CheckoutType=void 0,(m=t.CheckoutType||(t.CheckoutType={})).SWIFT="swift",m.FASTRR="fastrr",m.DEFAULT="default";var g,U,W,Q;t.ScriptName=void 0,(g=t.ScriptName||(t.ScriptName={})).ANALYTICS="analytics",g.LOADER="loader",g.LOFOODS="lofoods",g.OVERLAY="overlay",g.PREVIEW="preview",g.REPLACE="replace",g.SIDECART="sidecart",g.THANKYOU="thankyou",g.TRUSTBADGES="trustbadges",g.WIDGETS="widgets",g.QUIZ="quiz",t.FeaturesAPIApp=void 0,(U=t.FeaturesAPIApp||(t.FeaturesAPIApp={})).MODEMAGIC="modemagic",U.QUIZ_MASTER="quizmaster",t.CacheEntryVersion=void 0,(W=t.CacheEntryVersion||(t.CacheEntryVersion={})).ONE="1.0",W.TWO="2.0",t.TBAlign=void 0,(Q=t.TBAlign||(t.TBAlign={})).CENTER="center",Q.RIGHT="right",Q.LEFT="left",t.LauncherPositions={BOTTOM_LEFT:"bottomLeft",BOTTOM_RIGHT:"bottomRight"},t.Platforms={SHOPIFY:"shopify",BIGCOMMERCE:"bigcommerce",UNKNOWN:"--unknown--"}})},function(b,u,e){"use strict";e.d(u,"a",function(){return p});var t=e(4);const p=["info","debug","error","log","group","groupEnd"].reduce((f,A)=>(f[A]=(...w)=>{t.h||window.console[A](...w)},f),{})},,function(b,u,e){"use strict";(function(t){e.d(u,"h",function(){return P}),e.d(u,"a",function(){return N}),e.d(u,"f",function(){return l}),e.d(u,"j",function(){return y}),e.d(u,"e",function(){return o}),e.d(u,"b",function(){return i}),e.d(u,"c",function(){return n}),e.d(u,"d",function(){return m}),e.d(u,"i",function(){return g}),e.d(u,"g",function(){return W}),e.d(u,"k",function(){return Q});var s=e(2),p=e(5),f,A,w,I;const P=((f=t==null?void 0:{USER_FEATURES_API:"https://app.getmodemagic.com/api/features",APP_URL:"https://app.getmodemagic.com",NODE_ENV:"production"})===null||f===void 0?void 0:f.NODE_ENV)==="production",L=((A=t==null?void 0:{USER_FEATURES_API:"https://app.getmodemagic.com/api/features",APP_URL:"https://app.getmodemagic.com",NODE_ENV:"production"})===null||A===void 0?void 0:A.NODE_ENV)==="test",N=(I=(w=t==null?void 0:{USER_FEATURES_API:"https://app.getmodemagic.com/api/features",APP_URL:"https://app.getmodemagic.com",NODE_ENV:"production"})===null||w===void 0?void 0:w.NODE_ENV)!==null&&I!==void 0?I:"development",S=["ase","art","bmp","blp","cd5","cit","cpt","cr2","cut","dds","dib","djvu","egt","exif","gif","gpl","grf","icns","ico","iff","jng","jpeg","jpg","jfif","jp2","jps","lbm","max","miff","mng","msp","nef","nitf","ota","pbm","pc1","pc2","pc3","pcf","pcx","pdn","pgm","PI1","PI2","PI3","pict","pct","pnm","pns","ppm","psb","psd","pdd","psp","px","pxm","pxr","qfx","raw","rle","sct","sgi","rgb","int","bw","tga","tiff","tif","vtf","xbm","xcf","xpm","3dv","amf","ai","awg","cgm","cdr","cmx","dxf","e2d","egt","eps","fs","gbr","odg","svg","stl","vrml","x3d","sxd","v2d","vnd","wmf","emf","art","xar","png","webp","jxr","hdp","wdp","cur","ecw","iff","lbm","liff","nrrd","pam","pcx","pgf","sgi","rgb","rgba","bw","int","inta","sid","ras","sun","tga","heic","heif"],R=new Set(S),l=new RegExp(`((.${S.join("|.")})+)$`,"i"),E=["pico","icon","thumb","small","compact","medium","large","grande","original","master"],c=["center","top","right","bottom","left"],h=["progressive"],v=new RegExp(`((?:_(?:x|X)?)(?:(?:\\d{1,4}(?:x|X)\\d{0,4}|(?:x|X)\\d{1,4})|(?:${E.join("|")})))?(_crop_(?:${c.join("|")}))?(@[23]x)?(.(?:${h.join("|")}))?$`),O=(()=>{let d=[];return a=>{let T=a.replace(/\.([^.]+?)$/,"");d=T.split(".");let C=-1;for(let M=0;M0?C:void 0).join("."),T}})(),y=(()=>{const d={};return a=>{const T=d[a];if(typeof T=="string")return T;let C=a;C=C.replace(/\?v=.*/g,"");const F=O(C).match(v);if(F){const{index:B=0}=F,j=C.slice(0,B),V=C.slice(B+F[0].length);C=`${j}${V}`}return d[a]=C,C}})(),x=(()=>{const d={};return a=>{let T=d[a];return typeof T=="string"||(T=O(a),d[a]=T),T}})();function D(d,a){return x(d)===x(a)}function o(d,a){return a.find(T=>D(d,T))||""}function r(d){var a,T;return(T=(a=d.split("/").pop())===null||a===void 0?void 0:a.split("?"))===null||T===void 0?void 0:T[0]}const i=(()=>{const d=new Map([]);return(a,T)=>{var C;if(d.has(a))return d.get(a);const M=y(a),F=M.match(l);if(!a.startsWith("/")&&Array.isArray(F)&&F.length>0){const B=r(M);if(typeof B=="string"){const j=`${T}/${B}`;d.set(a,j)}}return(C=d.get(a))!==null&&C!==void 0?C:a}})();function n(d,a="/cdn"){return`${d}${a}`}function m(){const{store:d}=Object(p.b)(),a=window.location.pathname;return a.match(/^\/(?:[a-z]{2})?$/)?"home":a.match(/\/products\/.+?$/)?"product":a.match(/\/pages\/.+?$/)?"page":a.includes("collection")||a.includes("search")?"collection":d==="venustahome"&&a.includes("campaign")?"home":"_not_supported_"}const g=window.modeMagicPreviewSettings||window.modeMagicSettings||{},U=d=>{const a=M=>{const{visibility:F,display:B,opacity:j}=getComputedStyle(M);return!(document.hidden||F==="hidden"||B==="none"||+j==0)};let T=d,C=a(T);for(;C&&T.parentElement;)T=T.parentElement,C=a(T);return C},W=(d,{areaCheck:a}={areaCheck:!0})=>{if(!U(d))return!1;const{top:T,left:C,bottom:M,right:F}=d.getBoundingClientRect(),B={x:0,y:0},j={x:window.innerWidth||document.documentElement.clientWidth,y:window.innerHeight||document.documentElement.clientHeight},V=($,K)=>{const z=B[$],Y=j[$];return KY?Y:K},G=V("y",M)-V("y",T),_=V("x",F)-V("x",C),H=G*_;return a?H>0:G>0||_>0},Q=d=>{let{logs:a}=d!=null?d:{};a||({logs:a}=d==null?void 0:d.constructor);let T=["",""];return a&&(T=[Object.keys(a).reduce((C,M)=>`${C}${M}: ${a[M]}; `,""),"background-color: rgb(76, 136, 255);color:white;","color: rgb(76, 136, 255)"]),P||L?d:new Proxy(d,{get(C,M,F){const B=Reflect.get(C,M,F);return typeof B=="function"?function(...j){var V,G;const _=`%c[${(V=d==null?void 0:d.name)!==null&&V!==void 0?V:(G=d==null?void 0:d.constructor)===null||G===void 0?void 0:G.name}]%c[${M.toString()}]%c: `;s.a.group(_,...T),j.length>0&&s.a.debug("Called with: ",...j);const H=B.apply(this,j);return s.a.debug("Returning",H),s.a.groupEnd(),H}:B}})}}).call(this,e(15))},function(b,u,e){"use strict";e.d(u,"a",function(){return p}),e.d(u,"b",function(){return f});var t=e(0),s=e(10);const p={SHOPIFY:"shopify",BIGCOMMERCE:"bigcommerce",UNKNOWN:"--unknown--"},f=()=>{var A,w,I;const P={cart:null,platform:p.UNKNOWN,product:"",store:"",currency:{active_currency_code:"",active_currency_id:1},settings:{store_hash:"",secure_host:"",cdn_url:"",secure_base_url:"",channel_id:1},customer:null,dumps:{},urls:{home:""}};if(typeof window!="undefined"){if(typeof window.__store_context__=="undefined"&&(window.__store_context__={}),Object.assign(window.__store_context__,Object.assign(Object.assign({},P),window.__store_context__)),Object(t.g)(window.Shopify)){const L=Object(s.a)(),N=window.Shopify.shop.split(".")[0];Object.assign(window.__store_context__,{platform:p.SHOPIFY,store:N,dumps:{},currency:{active_currency_code:(w=(A=window.Shopify.currency)===null||A===void 0?void 0:A.active)!==null&&w!==void 0?w:"USD",active_currency_id:1},settings:{secure_base_url:`https://${window.Shopify.shop}`,secure_host:window.Shopify.shop,cdn_url:window.Shopify.cdnHost,store_hash:N,channel_id:1},cart:null,urls:{home:(I=window.Shopify.routes)===null||I===void 0?void 0:I.root},product:L.product})}return window.__store_context__}return P}},function(b,u,e){"use strict";e.d(u,"d",function(){return l}),e.d(u,"b",function(){return c}),e.d(u,"c",function(){return h}),e.d(u,"a",function(){return x});const t="__SECRET_INTERNALS_DO_NOT_USE__";var s=e(12),p=e(4),f=e(2),A=e(7),w=e(0),I=e(11),P=e(13),L=e(5),N=function(D,o){var r={};for(var i in D)Object.prototype.hasOwnProperty.call(D,i)&&o.indexOf(i)<0&&(r[i]=D[i]);if(D!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(D);n{f.a.debug("MM:Clearing impressions cache"),o.impressionsCache=new Set,o.viewsCache=new Set,o.stats=v}),o.addOrderCompletionListener()}addOrderCompletionListener(){window.addEventListener("message",o=>{const{data:r}=o,{messageType:i,messageData:{actionType:n}={}}=r,m=Object(w.c)(r,"messageAuth.source",null),g=Object(w.c)(r,"messageData.payload.order",null),{id:U,line_items:W=[],cart_token:Q="",email:d="",customer:a,customer_locale:T=""}=g!=null?g:{},{id:C=-1}=a!=null?a:{};i==="MODEMAGIC_CONVERSION_EVENT"&&n==="ORDER_CREATE"&&!Object(w.e)(m)&&R.has(m)&&!Object(w.h)(U)&&Object(I.b)({email:d,orderId:U,customerId:C,cartToken:Q,customerLocale:T,source:m!=null?m:void 0,lineItems:W})})}flushQueue(){var o,r,i;const n=y.getInstance(),m=n.eventQueue.get(O.FLUSH_QUEUE);if(!Object(w.e)(m)&&!Object(w.h)(m)){const U=new Date().getTime();if(U-m.queued>n.queWaitTime){if(m.counter>=n.maxRetries){n.eventQueue.set(O.ACTIVE_QUEUE,[...(o=n.eventQueue.get(O.ACTIVE_QUEUE))!==null&&o!==void 0?o:[],...m.events]),n.eventQueue.set(O.FLUSH_QUEUE,void 0),n.flushQueue();return}n.eventQueue.set(O.FLUSH_QUEUE,Object.assign(Object.assign({},m),{queued:new Date().getTime(),counter:m.counter+1}))}else{if(n.retryQueTimeout!==-1)return;const W=n.queWaitTime-(U-m.queued)+1e3;n.retryQueTimeout=window.setTimeout(()=>{n.retryQueTimeout=-1,n.flushQueue()},W);return}}else{const U=(r=n.eventQueue.get(O.ACTIVE_QUEUE))!==null&&r!==void 0?r:[];Array.isArray(U)&&U.length>0&&(n.eventQueue.set(O.ACTIVE_QUEUE,[]),n.eventQueue.set(O.FLUSH_QUEUE,{events:U,queued:new Date().getTime(),counter:1}))}const g=(i=n.eventQueue.get(O.FLUSH_QUEUE))===null||i===void 0?void 0:i.events;if(Array.isArray(g)&&g.length>0){const U=JSON.stringify(g);fetch(l,{method:"POST",body:U}).then(()=>{n.eventQueue.set(O.FLUSH_QUEUE,void 0)}).catch(()=>{})}}queueEvent(o){var r;const i=y.getInstance(),n=[...(r=i.eventQueue.get(O.ACTIVE_QUEUE))!==null&&r!==void 0?r:[],o];i.eventQueue.set(O.ACTIVE_QUEUE,n),i.queTimeout>0&&(window.clearTimeout(i.queTimeout),i.queTimeout=-1),n.length>=E?i.flushQueue():i.queTimeout=window.setTimeout(()=>{i.flushQueue()},1e3)}raiseEvent(o){const{store:r}=Object(L.b)(),{appName:i=P.a,entity:n,eventType:m,data:g,element:U}=o,W=g!=null?g:{},{product:Q,storyboard:d,template:a,impressionsData:T,widgets:C,playbookId:M}=W,F=N(W,["product","storyboard","template","impressionsData","widgets","playbookId"]),B=new Date().getTime()/1e3,j=y.getInstance();j.stats[m]+=1,j.log(n,m,g,U),j.queueEvent(Object.assign(Object.assign({app_name:i,store_id:r,product_id:Q,storyboard_id:d,widget_ids:C,template_id:a,category:n,action:m,time:B,playbook_id:M,device_id:Object(A.a)()},F),T))}log(o,r,i,n){f.a.debug(`MM:${o}:${r}`),n&&f.a.debug("src element: ",n),f.a.debug("data: ",JSON.stringify(i)),f.a.debug("stats: ",JSON.stringify(y.getInstance().stats))}click(o){const{entity:r,element:i,data:n,appName:m}=o;y.getInstance().raiseEvent({appName:m,entity:r,eventType:c.CLICK,data:n,element:i})}impression(o){const{entity:r,element:i,data:n,appName:m}=o,g=y.getInstance();g.impressionsCache.has(i)||(g.raiseEvent({appName:m,entity:r,eventType:c.IMPRESSION,data:n,element:i}),g.impressionsCache.add(i))}view(o){const{entity:r,element:i,data:n,appName:m}=o,g=y.getInstance();g.viewsCache.has(i)||(g.raiseEvent({appName:m,entity:r,eventType:c.VIEW,data:n,element:i}),g.viewsCache.add(i))}hide(o){const{entity:r,element:i,data:n,appName:m}=o;y.getInstance().raiseEvent({appName:m,entity:r,eventType:c.HIDE,data:n,element:i})}conversion(o){const{data:r,appName:i}=o;y.getInstance().raiseEvent({appName:i,entity:h.WIDGET,eventType:c.CONVERSION,data:r})}}const x=y.getInstance()},function(b,u,e){"use strict";e.d(u,"a",function(){return p});var t=e(0);const s="mm.userDeviceID",p=()=>{const f=window.localStorage.getItem(s);if(Object(t.e)(f)){const A=JSON.stringify(performance.now())+Math.random().toString(36).substring(2,11);return window.localStorage.setItem(s,A),A}return f}},,,function(b,u,e){"use strict";e.d(u,"a",function(){return t});function t(){const s=document.querySelectorAll("[data-app='mm']");let p={};return s.forEach(f=>{p=Object.assign(Object.assign({},p),f.dataset)}),p}},function(b,u,e){"use strict";e.d(u,"a",function(){return p}),e.d(u,"b",function(){return f});var t=e(6),s=e(0);const p={swift:!0,shopflo:!0,fastrr:!0};function f(A){const{customerLocale:w,customerId:I,orderId:P,lineItems:L,email:N,cartToken:S,source:R}=A,l=L.reduce((E,{properties:c={}})=>{const h=c.__mmWidget,v=Object(s.j)(h,null);return v!==null&&!Array.isArray(v)&&typeof v=="object"&&E.push(v),E},[]);t.a.conversion({appName:"shopify",data:{widgets:l,meta:{source:R,line_items:L,order:P,cartToken:S,src:window.location.href,customer:{id:I,locale:w,email:N}},impressionsData:{apply_type:"manual"}}})}},function(b,u,e){"use strict";e.d(u,"a",function(){return s});var t=e(0);class s{constructor(f=!0){this.sessionKey="",this.cache=new Map,this.persistent=!0,this.persistent=!!f}init(f){this.sessionKey=`${f}-cache`,this.cache=new Map(Object(t.j)(this.persistent?window.localStorage.getItem(this.sessionKey):window.sessionStorage.getItem(this.sessionKey),[]))}get(f){return this.cache.get(f)}set(f,A){if(this.cache.set(f,A),this.persistent){window.localStorage.setItem(this.sessionKey,JSON.stringify(Array.from(this.cache.entries())));return}window.sessionStorage.setItem(this.sessionKey,JSON.stringify(Array.from(this.cache.entries())))}}},function(b,u,e){"use strict";e.d(u,"a",function(){return t});const t="-- empty --"},,function(b,u){var e=b.exports={},t,s;function p(){throw new Error("setTimeout has not been defined")}function f(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?t=setTimeout:t=p}catch(c){t=p}try{typeof clearTimeout=="function"?s=clearTimeout:s=f}catch(c){s=f}})();function A(c){if(t===setTimeout)return setTimeout(c,0);if((t===p||!t)&&setTimeout)return t=setTimeout,setTimeout(c,0);try{return t(c,0)}catch(h){try{return t.call(null,c,0)}catch(v){return t.call(this,c,0)}}}function w(c){if(s===clearTimeout)return clearTimeout(c);if((s===f||!s)&&clearTimeout)return s=clearTimeout,clearTimeout(c);try{return s(c)}catch(h){try{return s.call(null,c)}catch(v){return s.call(this,c)}}}var I=[],P=!1,L,N=-1;function S(){!P||!L||(P=!1,L.length?I=L.concat(I):N=-1,I.length&&R())}function R(){if(!P){var c=A(S);P=!0;for(var h=I.length;h;){for(L=I,I=[];++N1)for(var v=1;v{const[,,w]=A;p.apply(f,A),t.listeners.forEach(I=>typeof w=="string"&&I(w.split("?")[1]||""))}})}static listen(p){t.unlisten(p),t.listeners.push(p)}static unlisten(p){t.listeners=t.listeners.filter(f=>f!==p)}}t.listeners=[]},,,,,,function(b,u,e){"use strict";e.r(u),e.d(u,"addFeatureSettings",function(){return l});var t=e(0),s=e(2),p=e(7),f=e(6),A=e(10),w=e(5),I=e(1),P=e.n(I),L=e(16),N=function(o,r,i,n){function m(g){return g instanceof i?g:new i(function(U){U(g)})}return new(i||(i=Promise))(function(g,U){function W(a){try{d(n.next(a))}catch(T){U(T)}}function Q(a){try{d(n.throw(a))}catch(T){U(T)}}function d(a){a.done?g(a.value):m(a.value).then(W,Q)}d((n=n.apply(o,r||[])).next())})};const S="COD",R=()=>new Promise(o=>{const r=setInterval(()=>{const i=Object(t.c)(window,"Shopflo.order.tags","").split(",").map(n=>n.trim()).filter(n=>n.length>0);if(i.length>0){const n=new Set(i);clearInterval(r),o(n.has(S)?"true":"false")}},100)});function l(o,r,i="modeMagic"){const n=`${i}Settings`;typeof window[n]=="undefined"&&(window[n]={}),typeof r!="undefined"&&(window[n][o]=r)}function E(o){o.forEach(({name:r,src:i,data:n})=>{l(r,n,"modeMagic");const m=document.createElement("script");m.setAttribute("data-mm-script",r),m.setAttribute("type","text/javascript"),m.setAttribute("src",i),m.setAttribute("fetchPriority","high"),document.body.appendChild(m)})}function c(o){try{const i=JSON.parse(o.responseText).data;E(i)}catch(r){s.a.debug(r)}}function h(o,r){Object.entries(r).forEach(([i,n])=>{n&&o.searchParams.set(i,n)})}const v=()=>{const{store:o,product:r}=Object(w.b)(),i=new Date().getTime()/1e3;fetch(f.d,{method:"POST",body:JSON.stringify({device_id:Object(p.a)(),meta:{url:window.location.href},product_id:r!=null?r:"",action:f.b.PAGE_VIEW,time:i,store_id:o,category:"price_drop"})})},O=()=>N(void 0,void 0,void 0,function*(){var o,r;let i=null;try{const n=yield fetch(`${window.location.pathname}.json`).then(m=>m.json());i=(r=(o=n==null?void 0:n.product)===null||o===void 0?void 0:o.id)===null||r===void 0?void 0:r.toString()}catch(n){s.a.debug(n)}return i!=null?i:null}),y=()=>N(void 0,void 0,void 0,function*(){const o=Object(A.a)();if(!o.product&&Object(t.g)(window.Shopify)){const r=yield O();if(typeof r=="string"){o.product=r;const i=document.createElement("div");i.setAttribute("data-app","mm"),i.setAttribute("data-product",r),document.body.appendChild(i)}}return Promise.resolve()});function x(){var o;return N(this,void 0,void 0,function*(){let r=!1;const{store:i,product:n}=Object(w.b)(),m=!Object(t.h)(window.Shopflo),g=typeof((o=window.Shopify)===null||o===void 0?void 0:o.checkout)!="undefined"||m&&new URLSearchParams(window.location.search).get("page")==="thank_you"?"true":"false";let U="false";m&&(U=yield R());const W={shop:i,path:window.location.pathname,domain:window.location.host,product:n,app:I.FeaturesAPIApp.MODEMAGIC,hash:window.location.hash,device_id:Object(p.a)(),thankyou:g,shopflo_cod:U};r||(v(),r=!0,window==null||window.addEventListener("popstate",()=>{r&&v()}));const Q=new URL("https://app.getmodemagic.com/api/features");h(Q,W);const d=new XMLHttpRequest;d.addEventListener("load",c.bind(null,d)),window!=null&&window.MMScriptLoaded||(d.open("GET",Q.toString(),!0),d.send(),window.MMScriptLoaded=!0)})}const D=()=>N(void 0,void 0,void 0,function*(){var o;window!=null&&window.MMScriptLoaded||(window.MMScriptLoaded=(o=window==null?void 0:window.MMScriptLoaded)!==null&&o!==void 0?o:!1,yield y(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",D):yield x())});s.a.debug("[loader] starting initialization"),D(),L.a.init(),L.a.listen(()=>{typeof window!="undefined"&&window.MMScriptLoaded&&typeof window.Shopflo!="undefined"&&new URLSearchParams(window.location.search).get("page")==="thank_you"&&(s.a.debug("[loader] re-initializing as shopflo integration changed query param in thank you page"),window.MMScriptLoaded=!1,D())})}]);})();