{
  "version": 3,
  "sources": ["/cdn/shop/t/6/assets/events.js?v=164878410936539277451790720035"],
  "sourcesContent": ["/**\n * @namespace ThemeEvents\n * @description A collection of theme-specific events that can be used to trigger and listen for changes anywhere in the theme.\n * @example\n * document.dispatchEvent(new QuantitySelectorUpdateEvent(quantity, cartLine));\n * document.addEventListener(ThemeEvents.quantitySelectorUpdate, (e) => { console.log(e.detail.quantity) });\n */\nexport class ThemeEvents {\n  /** @static @constant {string} Event triggered when a media (video, 3d model) is loaded */\n  static mediaStartedPlaying = 'media:started-playing';\n  // Event triggered when quantity-selector value is changed\n  static quantitySelectorUpdate = 'quantity-selector:update';\n  /** @static @constant {string} Event triggered when a predictive search is expanded */\n  static megaMenuHover = 'megaMenu:hover';\n  /** @static @constant {string} Event triggered when a zoom dialog media is selected */\n  static zoomMediaSelected = 'zoom-media:selected';\n  /** @static @constant {string} Event triggered when a cart section re-renders after a back/forward cache restore */\n  static cartSectionRestored = 'cart-section:restored';\n}\n\n/**\n * Event class for quantity-selector updates\n * @extends {Event}\n */\nexport class QuantitySelectorUpdateEvent extends Event {\n  /**\n   * Creates a new QuantitySelectorUpdateEvent\n   * @param {number} quantity - Quantity value\n   * @param {number} [cartLine] - The id of the updated cart line\n   */\n  constructor(quantity, cartLine) {\n    super(ThemeEvents.quantitySelectorUpdate, { bubbles: true });\n    this.detail = {\n      quantity,\n      cartLine,\n    };\n  }\n}\n\n/**\n * Event class for media playback starts\n * @extends {Event}\n */\nexport class MediaStartedPlayingEvent extends Event {\n  /**\n   * Creates a new MediaStartedPlayingEvent\n   * @param {HTMLElement} resource - The element containing the video that emitted the event\n   */\n  constructor(resource) {\n    super(ThemeEvents.mediaStartedPlaying, { bubbles: true });\n    this.detail = {\n      resource,\n    };\n  }\n}\n\n/**\n * @typedef {Object} SlideshowSelectEventData\n * @property {number} index\n * @property {string | null} id\n * @property {Element} slide\n * @property {number} previousIndex\n * @property {boolean} userInitiated\n * @property {'select' | 'scroll' | 'drag'} trigger\n */\n\nexport class SlideshowSelectEvent extends Event {\n  /**  @param {SlideshowSelectEventData} data */\n  constructor(data) {\n    super(SlideshowSelectEvent.eventName, { bubbles: true });\n    this.detail = data;\n  }\n\n  /** @type {SlideshowSelectEventData} */\n  detail;\n\n  static eventName = 'slideshow:select';\n}\n\n/**\n * Event class for zoom dialog media selection\n * @extends {Event}\n */\nexport class ZoomMediaSelectedEvent extends Event {\n  /**\n   * Creates a new ZoomMediaSelectedEvent\n   * @param {number} index - The index of the selected media\n   */\n  constructor(index) {\n    super(ThemeEvents.zoomMediaSelected, { bubbles: true });\n    this.detail = {\n      index,\n    };\n  }\n}\n\n/**\n * Event class for mega menu hover being hovered over\n * @extends {Event}\n */\nexport class MegaMenuHoverEvent extends Event {\n  constructor() {\n    super(ThemeEvents.megaMenuHover, { bubbles: true });\n  }\n}\n\n/**\n * Event class for a cart section re-rendering after a back/forward cache restore.\n *\n * It has to bubble: `cart-drawer-component` listens for it on itself and the dispatcher is\n * the `cart-items-component` nested inside it.\n *\n * @extends {Event}\n */\nexport class CartSectionRestoredEvent extends Event {\n  constructor() {\n    super(ThemeEvents.cartSectionRestored, { bubbles: true });\n  }\n}\n"],
  "mappings": "AAOO,aAAM,WAAY,CAEvB,OAAO,oBAAsB,wBAE7B,OAAO,uBAAyB,2BAEhC,OAAO,cAAgB,iBAEvB,OAAO,kBAAoB,sBAE3B,OAAO,oBAAsB,uBAC/B,CAMO,aAAM,oCAAoC,KAAM,CAMrD,YAAY,SAAU,SAAU,CAC9B,MAAM,YAAY,uBAAwB,CAAE,QAAS,EAAK,CAAC,EAC3D,KAAK,OAAS,CACZ,SACA,QACF,CACF,CACF,CAMO,aAAM,iCAAiC,KAAM,CAKlD,YAAY,SAAU,CACpB,MAAM,YAAY,oBAAqB,CAAE,QAAS,EAAK,CAAC,EACxD,KAAK,OAAS,CACZ,QACF,CACF,CACF,CAYO,aAAM,6BAA6B,KAAM,CAE9C,YAAY,KAAM,CAChB,MAAM,qBAAqB,UAAW,CAAE,QAAS,EAAK,CAAC,EACvD,KAAK,OAAS,IAChB,CAGA,OAEA,OAAO,UAAY,kBACrB,CAMO,aAAM,+BAA+B,KAAM,CAKhD,YAAY,MAAO,CACjB,MAAM,YAAY,kBAAmB,CAAE,QAAS,EAAK,CAAC,EACtD,KAAK,OAAS,CACZ,KACF,CACF,CACF,CAMO,aAAM,2BAA2B,KAAM,CAC5C,aAAc,CACZ,MAAM,YAAY,cAAe,CAAE,QAAS,EAAK,CAAC,CACpD,CACF,CAUO,aAAM,iCAAiC,KAAM,CAClD,aAAc,CACZ,MAAM,YAAY,oBAAqB,CAAE,QAAS,EAAK,CAAC,CAC1D,CACF",
  "names": []
}
