class SegmentClient{constructor(){this.cartToken=this.getCookie("cart"),this.email=JSON.parse(window.localStorage.getItem("ajs_user_traits"))?.email||void 0,this.ometriaProfileId=this.getOmetriaProfileId(),this.CONSTANTS={BRAND:"Rothys",CURRENCY:"USD",SENT_FROM:"website",EVENTS:{SPLIT_CAROUSEL_CLICKED:"50/50 Carousel Clicked",ACCORDION_OPENED:"Accordion Opened",ACCOUNT_CREATED:"Account Created",ACCOUNT_CREATION_STARTED:"Account Creation Started",ACCOUNT_DETAILS_UPDATED:"Account Details Updated",ACCOUNT_ICON_CLICKED:"Account Icon Clicked",ACCOUNT_MENU_ITEM_CLICKED:"Account Menu Item Clicked",ADD_ADDRESS:"Add Address",BANNER_BLOCK_CLICKED:"Banner Block Clicked",BANNER_BLOCK_SCROLLED:"Banner Block Scrolled",BIS_SUBMISSION:"BIS Submission",BREADCRUMB_CLICKED:"Breadcrumb Clicked",CART_ADDON_CLICKED:"Cart Addon Clicked",CART_ADDON_CTA_CLICKED:"Cart Addon CTA Clicked",CART_CHECKOUT_BUTTON_CLICKED:"Cart Checkout Button Clicked",CART_ICON_CLICKED:"Cart Icon Clicked",CART_INSOLE_UPSELL_ADDED:"Cart Insole Upsell Added",CART_ITEM_QUANTITY_INCREASED:"Cart Item Quantity Increased",CART_ITEM_QUANTITY_DECREASED:"Cart Item Quantity Decreased",CART_VIEWED:"Cart Viewed",CATEGORIES_BLOCK_CLICKED:"Categories Block Clicked",CHANGE_DEFAULT_ADDRESS:"Change Default Address",CHAT_CLICKED:"Chat Clicked",COLLECTION_FEATURED_FILTER_CLICKED:"Collection Featured Filter Clicked",COLLECTION_LOAD_MORE:"Collection Load More Clicked",CONTACT_FORM_SUBMISSION:"Contact Form Submission",COUNTRY_SWITCHED:"Country Switched",COUNTRY_SWITCHER_OPENED:"Country Switcher Opened",COUPON_DENIED:"Coupon Denied",COUPON_REMOVED:"Coupon Removed",CROSS_SELL_BLOCK_CLICKED:"Cross Sell Block Clicked",DELETE_ADDRESS:"Delete Address",DISCOUNT_ELIGIBILITY_CLICKED:"Discount Eligibility Button Clicked",DISCOUNT_VERIFICATION_STARTED:"Discount Verification Started",EDIT_ADDRESS:"Edit Address",EMAIL_SUBMITTED:"Email Submitted",EMPC_SCROLLED:"Editorial Multi-Product Carousel Scrolled",EMPC_PRODUCT_CLICKED:"Editorial Multi-Product Carousel Product Clicked",EMPC_LINK_CLICKED:"Editorial Multi-Product Carousel Link Clicked",EPC_SCROLLED:"Editorial Product Carousel Scrolled",EPC_PRODUCT_CLICKED:"Editorial Product Carousel Product Clicked",EPC_LINK_CLICKED:"Editorial Product Carousel Link Clicked",EXPERIMENT_VIEWED:"Experiment Viewed",EXPRESS_CHECKOUT_INITIATED:"Express Checkout Initiated",FAQ_ANSWER_VIEWED:"FAQ Answer Viewed",FAQ_SEARCHED:"FAQ Searched",FEATURED_BLOCK_CLICKED:"Featured Collections Block Clicked",FILTER_ADDED:"Filter Added",FILTER_REMOVED:"Filter Removed",FILTERS_CLEARED:"Filters Cleared",FILTERS_VIEWED:"Filters Viewed",FLEXIBLE_BLOCK_CLICKED:"Flexible Block Clicked",FOOTER_MENU_SECTION_EXPANDED:"Footer Menu Section Expanded",FOOTER_MENU_ITEM_CLICKED:"Footer Menu Item Clicked",SMS_SUBMITTED:"SMS Submitted",FORGOT_PASSWORD:"Forgot Password",GIFT_CARD_LOOKUP:"Gift Card Lookup",GIFT_NOTE_ADDED:"Gift Note Added",HEADER_LOGO_CLICKED:"Header Logo Clicked",HORIZONTAL_SLIDER_CLICKED:"Horizontal Slider Clicked",HORIZONTAL_SLIDER_SCROLLED:"Horizontal Slider Scrolled",HOT_SPOT_EXPANDED:"Hot Spot Expanded",HOT_SPOT_LINK_CLICKED:"Hot Spot Link Clicked",HYPE_BANNER_CLICKED:"Hype Banner Clicked",IN_GRID_CONTENT_CLICKED:"In Grid Content Clicked",INTERACTIVE_ACCORDION_CLICKED:"Interactive Accordion Clicked",JOIN_WAITLIST_CLICKED:"Join Waitlist Clicked",LOGIN_LINK_CLICKED:"Login Link Clicked",LOGIN:"Login",LOGOUT:"Logout",MAIN_MENU_CLOSED:"Main Menu Closed",MAIN_MENU_ITEM_CLICKED:"Main Menu Item Clicked",MAIN_MENU_OPENED:"Main Menu Opened",MAIN_MENU_SECTION_EXPANDED:"Main Menu Section Expanded",MISSION_BANNER_CLICKED:"Mission Banner Clicked",NOTIFICATION_BAR_CLICKED:"Notification Bar Clicked",NOTIFICATION_BAR_SCROLLED:"Notification Bar Scrolled",ORDER_CLICKED:"Order Clicked",ORDER_REORDER_CLICKED:"Order Reorder Clicked",ORDER_RETURN_CLICKED:"Order Return Clicked",ORDER_REVIEW_CLICKED:"Order Write Review Clicked",ORDER_TRACK_CLICKED:"Order Track Clicked",PAGE_VIEWED:"Loaded a Page",PDP_CONTENT_CTA_CLICKED:"PDP Content CTA Clicked",PDP_GENDER_LINK_CLICKED:"PDP Dual Gender Link Clicked",PDP_SPECIAL_MESSAGE_CLICKED:"PDP Special Message Clicked",PDP_PRODUCT_TOGGLE_CLICKED:"PDP Product Toggle Clicked",PRODUCT_ADDED:"Product Added",PRODUCT_ADDONS_SCROLLED:"Product Addons Scrolled",PRODUCT_ADDONS_CLICKED:"Product Addon Clicked",PRODUCT_ADDONS_CTA_CLICKED:"Product Addon CTA Clicked",PRODUCT_CARD_GALLERY_SCROLLED:"Product Card Gallery Scrolled",PRODUCT_CARD_GALLERY_SLIDE_CLICKED:"Product Card Gallery Slide Clicked",PRODUCT_CARD_SLIDE_CLICKED:"Product Card Slide Clicked",PRODUCT_CARD_SLIDE_VIEWED:"Product Card Slide Viewed",PRODUCT_CAROUSEL_CLICKED:"Product Carousel Clicked",PRODUCT_CAROUSEL_CTA_CLICKED:"Product Carousel CTA Clicked",PRODUCT_CAROUSEL_SCROLLED:"Product Carousel Scrolled",PRODUCT_CLICKED:"Product Clicked",PRODUCT_CTA_CLICKED:"Product CTA Clicked",PRODUCT_IMAGE_CLICKED:"Product Image Clicked",PRODUCT_IMAGE_SCROLLED:"Product Image Scrolled",PRODUCT_IMAGE_VIEWED:"Product Image Viewed",PRODUCT_IMAGE_THUMBNAIL_CLICKED:"Product Image Thumbnail Clicked",PRODUCT_LIST_FILTERED:"Product List Filtered",PRODUCT_LIST_VIEWED:"Product List Viewed",PRODUCT_REMOVED:"Product Removed",PRODUCT_VIEWED:"Product Viewed",PRODUCTS_SEARCHED:"Products Searched",QUICK_LINK_CLICKED:"Quick Link Clicked",QUICK_SHOP_DETAILS_CLICKED:"Quick Shop Full Details Clicked",QUICK_SHOP_VARIANT_CLICKED:"Quick Shop Variant Clicked",QUICK_VIEW_OPENED:"Quick View Opened",QUICK_VIEW_FULL_DETAILS_CLICKED:"Quick View Full Details Clicked",REVIEWS_FILTERED:"Reviews Filtered",REVIEW_DOWNVOTED:"Review Downvoted",REVIEW_DOWNVOTE_REMOVED:"Review Downvote Removed",REVIEW_IMAGE_CLICKED:"Review Image Clicked",REVIEW_STARS_CLICKED:"Review Stars Clicked",REVIEW_SUBMITTED:"Review Submitted",REVIEW_UPVOTED:"Review Upvoted",REVIEW_UPVOTE_REMOVED:"Review Upvote Removed",REVIEWS_PAGINATION_CLICKED:"Reviews Pagination Clicked",SEARCHANDISING_BANNER_CLICKED:"Searchandizing Banner Clicked",SEARCH_ICON_CLICKED:"Search Icon Clicked",SEARCH_SUGGESTED_TERM_CLICKED:"Search Suggested Term Clicked",SEARCH_VIEW_RESULTS_CLICKED:"Search View Results Clicked",SIZE_CHART_CLICKED:"Size Chart Clicked",SIZE_SYSTEM_SELECTED:"Size System Selected",SLP_IMAGE_SELECTOR_INTERACTION:"SLP Image Selector Interaction",SORT_ADDED:"Sort Added",SORTS_VIEWED:"Sorts Viewed",SPLIT_BANNER_CLICKED:"Split Banner Clicked",START_SESSION:"Start Session",STORE_AVAILABILITY_STORE_CLICKED:"Store Name Clicked",STORE_AVAILABILITY_CHECK_ADDITIONAL:"Check Additional Stores Clicked",STORE_AVAILABILITY_VIEW_ALL:"View All Stores Clicked",STORE_CLICKED:"Store Clicked",STORE_ACCORDION_OPENED:"Store Accordion Opened",STORE_CONTENT_BLCOK_CLICKED:"Store Content Block Clicked",STORE_DIRECTIONS_CLICKED:"Store Directions Clicked",STORES_FILTER_CLICKED:"Stores Location Type Clicked",STORES_GEOLOCATED:"Use Current Location Clicked",STORES_REGION_CLICKED:"Stores Region Clicked",STORES_SEARCHED:"Stores Searched",SWATCH_CLICKED:"Swatch Clicked",SWATCH_HOVERED:"Swatch Hovered",TRANSPARENT_CAROUSEL_CLICKED:"Transparent Carousel Clicked",TRIPTYCH_CLICKED:"Triptych Clicked",TRIPTYCH_SCROLLED:"Triptych Scrolled",UGC_POST_CLICKED:"UGC Post Clicked",UGC_POST_PRODUCT_ADDED:"UGC Product Added to Cart",UGC_POST_PRODUCT_CLICKED:"UGC Product Clicked",VARIANT_CLICKED:"Variant Clicked",VIDEO_CC_TOGGLED:"Video CC Toggled",VIDEO_COMPLETED:"Video Completed",VIDEO_MUTE_TOGGLED:"Video Mute Toggled",VIDEO_PAUSED:"Video Paused",VIDEO_PLAYED:"Video Played",VIDEO_PROGRESS:"Video Progress Updated",VIEW_ALL_COLORS_CLICKED:"View All Colors Clicked",WISHLIST_EMPTY_LINK_CLICKED:"Empty Wishlist Link Clicked",WISHLIST_PRODUCT_ADDED:"Product Added to Wishlist",WISHLIST_PRODUCT_ATC:"Wishlist Product Added to Cart",WISHLIST_PRODUCT_REMOVED:"Product Removed from Wishlist",WISHLIST_SHARED:"Wishlist Shared"}}}identify({email,id=!1,traits={},merge=!0}){if(merge&&(this.accessCommonProperties(),this.country&&(traits.countryCode=this.country),this.presentmentCurrency&&(traits.currencyCode=this.presentmentCurrency),this.language&&(traits.languageCode=this.language),this.locale&&(traits.locale=this.locale),window.navigator.userAgent&&(traits.userAgent=window.navigator.userAgent)),traits.ometriaProfileId=this.ometriaProfileId||this.getOmetriaProfileId()||void 0,email||this.email){if(traits.email=email||this.email,traits.emailDomain=email.split("@")[1],window.md5){const userId=md5(email);if(analytics.identify(userId,traits,this.consentProperties),id){const previousId=id;userId!==previousId&&analytics.alias(userId,previousId)}}}else id?analytics.identify(id,traits,this.consentProperties):analytics.identify(traits,this.consentProperties);return Promise.resolve(!0)}track(name,data,merge=!0){const eventProperties=data||{};eventProperties.email=this.email,eventProperties.sent_from=this.CONSTANTS.SENT_FROM,eventProperties.page_url=window.location.href.includes("?")?window.location.href.split("?")[0]:window.location.href,eventProperties.page_path=window.location.pathname.includes("?")?window.location.pathname.split("?")[0]:window.location.pathname,eventProperties.referrer=document.referrer,eventProperties.ometria_profile_id=this.ometriaProfileId||this.getOmetriaProfileId()||void 0;const attentiveParams="utm_medium=sms&utm_source=attentive&utm_campaign=category-abandonment-message";return eventProperties.attentive_full_url=window.location.search?`${window.location.href}&${attentiveParams}`:`${window.location.href}?${attentiveParams}`,merge===!0&&(this.accessCommonProperties(),this.country&&(eventProperties.country=this.country),this.CONSTANTS.CURRENCY&&(eventProperties.currency=this.CONSTANTS.CURRENCY),this.presentmentCurrency&&(eventProperties.presentment_currency=this.presentmentCurrency),this.language&&(eventProperties.language=this.language),this.locale&&(eventProperties.locale=this.locale)),typeof analytics.track=="function"?(analytics.track(name,eventProperties,this.consentProperties),this.dataLayerPush(name,eventProperties),window.igEvents=window.igEvents||[],window.igEvents.push({event:name,properties:eventProperties}),Promise.resolve(!0)):Promise.reject(new Error("analytics.track function was not found"))}page(name,data){typeof analytics.page=="function"&&(analytics.page(name,data,this.consentProperties),this.dataLayerPush(this.CONSTANTS.EVENTS.PAGE_VIEWED,data))}protect(cb){try{cb()}catch(error){console.warn("Error with Segment call"),console.log(error)}}dataLayerPush(name,data){const dataForGTM=structuredClone(data)||{};dataForGTM.event=name,dataForGTM.sent_from="website",window.dataLayer=window.dataLayer||[],window.dataLayer.push(dataForGTM)}getCookie(cookieName){const name=`${cookieName}=`,decodedCookieValues=decodeURIComponent(document.cookie).split(";");for(let i=0;iparam.startsWith("uuid="));omidParam?.includes("omid:")&&(ometriaProfileId=omidParam.split("omid:")[1])}}catch(error){console.warn("Could not parse Ometria cookie"),console.log(error)}if(!ometriaProfileId)try{const ometriaIdentity=window.ometria?.getIdentity();ometriaIdentity?.includes("omid:")?ometriaProfileId=ometriaIdentity.split("omid:")[1]:ometriaIdentity?.includes("@")&&(this.email=ometriaIdentity)}catch(error){console.warn("Error accessing Ometria identity"),console.log(error)}return ometriaProfileId}async accessCommonProperties(){if(window.Shopify)this.setCommonProperties();else{for(;!Object.prototype.hasOwnProperty.call(window,"Shopify");)await new Promise(resolve=>setTimeout(resolve,500));this.setCommonProperties()}}setCommonProperties(){this.country=window.Shopify?.country?.toLowerCase(),this.language=window.Shopify?.locale?.toLowerCase()||window.Shopify?.Checkout?.locale?.toLowerCase()||void 0,this.locale=window.Shopify?.routes?.root==="/"?"en-us":window.Shopify.routes.root.replaceAll("/","").toLowerCase(),this.presentmentCurrency=window.Shopify?.currency?.active;const preferences=window.Shopify?.customerPrivacy?.currentVisitorConsent();preferences&&(this.consentProperties={consent:{categoryPreferences:{Advertising:preferences.marketing,Analytics:preferences.analytics,Functional:preferences.preferences,DataSharing:preferences.sale_of_data}}})}}export const Segment=new SegmentClient;const registerGlobal=window.DNARegisterGlobal;registerGlobal&®isterGlobal(Segment,"Segment","vendor"); //# sourceMappingURL=/cdn/shop/t/1163/assets/lib-analytics.js.map?v=180093069692107250961760566305