{
  "version": 3,
  "sources": ["/cdn/shop/t/1/assets/product-form.js?v=37993400097492174081768528522"],
  "sourcesContent": ["import { Component } from '@theme/component';\nimport { fetchConfig, preloadImage, onAnimationEnd, yieldToMainThread } from '@theme/utilities';\nimport { ThemeEvents, CartAddEvent, CartErrorEvent, CartUpdateEvent, VariantUpdateEvent } from '@theme/events';\nimport { cartPerformance } from '@theme/performance';\nimport { morph } from '@theme/morph';\n\n// Error message display duration - gives users time to read the message\nconst ERROR_MESSAGE_DISPLAY_DURATION = 10000;\n\n// Button re-enable delay after error - prevents rapid repeat attempts\nconst ERROR_BUTTON_REENABLE_DELAY = 1000;\n\n// Success message display duration for screen readers\nconst SUCCESS_MESSAGE_DISPLAY_DURATION = 5000;\n\n/**\n * @typedef {HTMLElement & {\n *   source: Element,\n *   destination: Element,\n *   useSourceSize: string | boolean\n * }} FlyToCart\n */\n\n/**\n * A custom element that manages an add to cart button.\n *\n * @typedef {object} AddToCartRefs\n * @property {HTMLButtonElement} addToCartButton - The add to cart button.\n * @extends Component<AddToCartRefs>\n */\nexport class AddToCartComponent extends Component {\n  requiredRefs = ['addToCartButton'];\n\n  /** @type {number[] | undefined} */\n  #resetTimeouts = /** @type {number[]} */ ([]);\n\n  connectedCallback() {\n    super.connectedCallback();\n\n    this.addEventListener('pointerenter', this.#preloadImage);\n  }\n\n  disconnectedCallback() {\n    super.disconnectedCallback();\n\n    if (this.#resetTimeouts) {\n      this.#resetTimeouts.forEach(/** @param {number} timeoutId */ (timeoutId) => clearTimeout(timeoutId));\n    }\n    this.removeEventListener('pointerenter', this.#preloadImage);\n  }\n\n  /**\n   * Disables the add to cart button.\n   */\n  disable() {\n    this.refs.addToCartButton.disabled = true;\n  }\n\n  /**\n   * Enables the add to cart button.\n   */\n  enable() {\n    this.refs.addToCartButton.disabled = false;\n  }\n\n  /**\n   * Handles the click event for the add to cart button.\n   * @param {MouseEvent & {target: HTMLElement}} event - The click event.\n   */\n  handleClick(event) {\n    const form = this.closest('form');\n    if (!form?.checkValidity()) return;\n\n    // Check if adding would exceed max before animating\n    const productForm = /** @type {ProductFormComponent | null} */ (this.closest('product-form-component'));\n    const quantitySelector = productForm?.refs.quantitySelector;\n    if (quantitySelector?.canAddToCart) {\n      const validation = quantitySelector.canAddToCart();\n      // Don't animate if it would exceed max\n      if (!validation.canAdd) {\n        return;\n      }\n    }\n    if (this.refs.addToCartButton.dataset.puppet !== 'true') {\n      const animationEnabled = this.dataset.addToCartAnimation === 'true';\n      if (animationEnabled && !event.target.closest('.quick-add-modal')) {\n        this.#animateFlyToCart();\n      }\n      this.animateAddToCart();\n    }\n  }\n\n  #preloadImage = () => {\n    const image = this.dataset.productVariantMedia;\n\n    if (!image) return;\n\n    preloadImage(image);\n  };\n\n  /**\n   * Animates the fly to cart animation.\n   */\n  #animateFlyToCart() {\n    const { addToCartButton } = this.refs;\n    const cartIcon = document.querySelector('.header-actions__cart-icon');\n\n    const image = this.dataset.productVariantMedia;\n\n    if (!cartIcon || !addToCartButton || !image) return;\n\n    const flyToCartElement = /** @type {FlyToCart} */ (document.createElement('fly-to-cart'));\n\n    let flyToCartClass = addToCartButton.classList.contains('quick-add__button')\n      ? 'fly-to-cart--quick'\n      : 'fly-to-cart--main';\n\n    flyToCartElement.classList.add(flyToCartClass);\n    flyToCartElement.style.setProperty('background-image', `url(${image})`);\n    flyToCartElement.style.setProperty('--start-opacity', '0');\n    flyToCartElement.source = addToCartButton;\n    flyToCartElement.destination = cartIcon;\n\n    document.body.appendChild(flyToCartElement);\n  }\n\n  /**\n   * Animates the add to cart button.\n   */\n  animateAddToCart = async function () {\n    const { addToCartButton } = this.refs;\n\n    // Initialize the array if it doesn't exist\n    if (!this.#resetTimeouts) {\n      this.#resetTimeouts = [];\n    }\n\n    // Clear all existing timeouts\n    this.#resetTimeouts.forEach(/** @param {number} timeoutId */ (timeoutId) => clearTimeout(timeoutId));\n    this.#resetTimeouts = [];\n\n    if (addToCartButton.dataset.added !== 'true') {\n      addToCartButton.dataset.added = 'true';\n    }\n\n    // The onAnimationEnd can trigger a style recalculation so we yield to the main thread first.\n    await yieldToMainThread();\n    await onAnimationEnd(addToCartButton);\n\n    // Create new timeout and store it in the array\n    const timeoutId = setTimeout(() => {\n      addToCartButton.removeAttribute('data-added');\n\n      // Remove this timeout from the array\n      const index = this.#resetTimeouts.indexOf(timeoutId);\n      if (index > -1) {\n        this.#resetTimeouts.splice(index, 1);\n      }\n    }, 800);\n\n    this.#resetTimeouts.push(timeoutId);\n  };\n}\n\nif (!customElements.get('add-to-cart-component')) {\n  customElements.define('add-to-cart-component', AddToCartComponent);\n}\n\n/**\n * A custom element that manages a product form.\n *\n * @typedef {{items: Array<{quantity: number, variant_id: number}>}} Cart\n *\n * @typedef {object} ProductFormRefs\n * @property {HTMLInputElement} variantId - The form input for submitting the variant ID.\n * @property {AddToCartComponent | undefined} addToCartButtonContainer - The add to cart button container element.\n * @property {HTMLElement | undefined} addToCartTextError - The add to cart text error.\n * @property {HTMLElement | undefined} acceleratedCheckoutButtonContainer - The accelerated checkout button container element.\n * @property {HTMLElement} liveRegion - The live region.\n * @property {HTMLElement | undefined} quantityLabelCartCount - The quantity label cart count element.\n * @property {HTMLElement | undefined} quantityRules - The quantity rules element.\n * @property {HTMLElement | undefined} productFormButtons - The product form buttons container.\n * @property {HTMLElement | undefined} volumePricing - The volume pricing component.\n * @property {any | undefined} quantitySelector - The quantity selector component.\n * @property {HTMLElement | undefined} quantitySelectorWrapper - The quantity selector wrapper element.\n * @property {HTMLElement | undefined} quantityLabel - The quantity label element.\n * @property {HTMLElement | undefined} pricePerItem - The price per item component.\n *\n * @extends Component<ProductFormRefs>\n */\nclass ProductFormComponent extends Component {\n  requiredRefs = ['variantId', 'liveRegion'];\n  #abortController = new AbortController();\n\n  /** @type {number | undefined} */\n  #timeout;\n\n  connectedCallback() {\n    super.connectedCallback();\n\n    const { signal } = this.#abortController;\n    const target = this.closest('.shopify-section, dialog, product-card');\n    target?.addEventListener(ThemeEvents.variantUpdate, this.#onVariantUpdate, { signal });\n    target?.addEventListener(ThemeEvents.variantSelected, this.#onVariantSelected, { signal });\n\n    // Listen for cart updates to sync data-cart-quantity\n    document.addEventListener(ThemeEvents.cartUpdate, this.#onCartUpdate, { signal });\n  }\n\n  disconnectedCallback() {\n    super.disconnectedCallback();\n\n    this.#abortController.abort();\n  }\n\n  /**\n   * Updates quantity selector with cart data for current variant\n   * @param {Cart} cart - The cart object with items array\n   * @returns {number} The cart quantity for the current variant\n   */\n  #updateCartQuantityFromData(cart) {\n    const variantIdInput = /** @type {HTMLInputElement | null} */ (this.querySelector('input[name=\"id\"]'));\n    if (!variantIdInput?.value || !cart?.items) return 0;\n\n    const cartItem = cart.items.find((item) => item.variant_id.toString() === variantIdInput.value.toString());\n    const cartQty = cartItem ? cartItem.quantity : 0;\n\n    // Use public API to update quantity selector\n    const quantitySelector = /** @type {any | undefined} */ (this.querySelector('quantity-selector-component'));\n    if (quantitySelector?.setCartQuantity) {\n      quantitySelector.setCartQuantity(cartQty);\n    }\n\n    // Update quantity label if it exists\n    this.#updateQuantityLabel(cartQty);\n\n    return cartQty;\n  }\n\n  /**\n   * Fetches cart and updates quantity selector for current variant\n   * @returns {Promise<number>} The cart quantity for the current variant\n   */\n  async #fetchAndUpdateCartQuantity() {\n    const variantIdInput = /** @type {HTMLInputElement | null} */ (this.querySelector('input[name=\"id\"]'));\n    if (!variantIdInput?.value) return 0;\n\n    try {\n      const response = await fetch('/cart.js');\n      const cart = await response.json();\n\n      return this.#updateCartQuantityFromData(cart);\n    } catch (error) {\n      console.error('Failed to fetch cart quantity:', error);\n      return 0;\n    }\n  }\n\n  /**\n   * Updates data-cart-quantity when cart is updated from elsewhere\n   * @param {CartUpdateEvent|CartAddEvent} event\n   */\n  #onCartUpdate = async (event) => {\n    // Skip if this event came from this component\n    if (event.detail?.sourceId === this.id || event.detail?.data?.source === 'product-form-component') return;\n\n    const cart = /** @type {Cart} */ (event.detail?.resource);\n    if (cart?.items) {\n      this.#updateCartQuantityFromData(cart);\n    } else {\n      await this.#fetchAndUpdateCartQuantity();\n    }\n  };\n\n  /**\n   * Handles the submit event for the product form.\n   *\n   * @param {Event} event - The submit event.\n   */\n  handleSubmit(event) {\n    const { addToCartTextError } = this.refs;\n    // Stop default behaviour from the browser\n    event.preventDefault();\n\n    if (this.#timeout) clearTimeout(this.#timeout);\n\n    // Query for ALL add-to-cart components\n    const allAddToCartContainers = /** @type {NodeListOf<AddToCartComponent>} */ (\n      this.querySelectorAll('add-to-cart-component')\n    );\n\n    // Check if ANY add to cart button is disabled and do an early return if it is\n    const anyButtonDisabled = Array.from(allAddToCartContainers).some(\n      (container) => container.refs.addToCartButton?.disabled\n    );\n    if (anyButtonDisabled) return;\n\n    // Send the add to cart information to the cart\n    const form = this.querySelector('form');\n\n    if (!form) throw new Error('Product form element missing');\n\n    if (this.refs.quantitySelector?.canAddToCart) {\n      const validation = this.refs.quantitySelector.canAddToCart();\n\n      if (!validation.canAdd) {\n        // Disable ALL add-to-cart buttons\n        for (const container of allAddToCartContainers) {\n          container.disable();\n        }\n\n        const errorTemplate = this.dataset.quantityErrorMax || '';\n        const errorMessage = errorTemplate.replace('{{ maximum }}', validation.maxQuantity?.toString() || '');\n        if (addToCartTextError) {\n          addToCartTextError.classList.remove('hidden');\n\n          const textNode = addToCartTextError.childNodes[2];\n          if (textNode) {\n            textNode.textContent = errorMessage;\n          } else {\n            const newTextNode = document.createTextNode(errorMessage);\n            addToCartTextError.appendChild(newTextNode);\n          }\n\n          this.#setLiveRegionText(errorMessage);\n\n          if (this.#timeout) clearTimeout(this.#timeout);\n          this.#timeout = setTimeout(() => {\n            if (!addToCartTextError) return;\n            addToCartTextError.classList.add('hidden');\n            this.#clearLiveRegionText();\n          }, ERROR_MESSAGE_DISPLAY_DURATION);\n        }\n\n        setTimeout(() => {\n          // Re-enable ALL add-to-cart buttons\n          for (const container of allAddToCartContainers) {\n            container.enable();\n          }\n        }, ERROR_BUTTON_REENABLE_DELAY);\n\n        return;\n      }\n    }\n\n    const formData = new FormData(form);\n\n    const cartItemsComponents = document.querySelectorAll('cart-items-component');\n    let cartItemComponentsSectionIds = [];\n    cartItemsComponents.forEach((item) => {\n      if (item instanceof HTMLElement && item.dataset.sectionId) {\n        cartItemComponentsSectionIds.push(item.dataset.sectionId);\n      }\n      formData.append('sections', cartItemComponentsSectionIds.join(','));\n    });\n\n    const fetchCfg = fetchConfig('javascript', { body: formData });\n\n    fetch(Theme.routes.cart_add_url, {\n      ...fetchCfg,\n      headers: {\n        ...fetchCfg.headers,\n        Accept: 'text/html',\n      },\n    })\n      .then((response) => response.json())\n      .then(async (response) => {\n        if (response.status) {\n          this.dispatchEvent(\n            new CartErrorEvent(form.getAttribute('id') || '', response.message, response.description, response.errors)\n          );\n\n          if (!addToCartTextError) return;\n          addToCartTextError.classList.remove('hidden');\n\n          // Reuse the text node if the user is spam-clicking\n          const textNode = addToCartTextError.childNodes[2];\n          if (textNode) {\n            textNode.textContent = response.message;\n          } else {\n            const newTextNode = document.createTextNode(response.message);\n            addToCartTextError.appendChild(newTextNode);\n          }\n\n          // Create or get existing error live region for screen readers\n          this.#setLiveRegionText(response.message);\n\n          this.#timeout = setTimeout(() => {\n            if (!addToCartTextError) return;\n            addToCartTextError.classList.add('hidden');\n\n            // Clear the announcement\n            this.#clearLiveRegionText();\n          }, ERROR_MESSAGE_DISPLAY_DURATION);\n\n          // When we add more than the maximum amount of items to the cart, we need to dispatch a cart update event\n          // because our back-end still adds the max allowed amount to the cart.\n          this.dispatchEvent(\n            new CartAddEvent({}, this.id, {\n              didError: true,\n              source: 'product-form-component',\n              itemCount: Number(formData.get('quantity')) || Number(this.dataset.quantityDefault),\n              productId: this.dataset.productId,\n            })\n          );\n\n          return;\n        } else {\n          const id = formData.get('id');\n\n          if (addToCartTextError) {\n            addToCartTextError.classList.add('hidden');\n            addToCartTextError.removeAttribute('aria-live');\n          }\n\n          if (!id) throw new Error('Form ID is required');\n\n          // Add aria-live region to inform screen readers that the item was added\n          // Get the added text from any add-to-cart button\n          const anyAddToCartButton = allAddToCartContainers[0]?.refs.addToCartButton;\n          if (anyAddToCartButton) {\n            const addedTextElement = anyAddToCartButton.querySelector('.add-to-cart-text--added');\n            const addedText = addedTextElement?.textContent?.trim() || Theme.translations.added;\n\n            this.#setLiveRegionText(addedText);\n\n            setTimeout(() => {\n              this.#clearLiveRegionText();\n            }, SUCCESS_MESSAGE_DISPLAY_DURATION);\n          }\n\n          // Fetch the updated cart to get the actual total quantity for this variant\n          await this.#fetchAndUpdateCartQuantity();\n\n          this.dispatchEvent(\n            new CartAddEvent({}, id.toString(), {\n              source: 'product-form-component',\n              itemCount: Number(formData.get('quantity')) || Number(this.dataset.quantityDefault),\n              productId: this.dataset.productId,\n              sections: response.sections,\n            })\n          );\n        }\n      })\n      .catch((error) => {\n        console.error(error);\n      })\n      .finally(() => {\n        cartPerformance.measureFromEvent('add:user-action', event);\n      });\n  }\n\n  /**\n   * Updates the quantity label with the current cart quantity\n   * @param {number} cartQty - The quantity in cart\n   */\n  #updateQuantityLabel(cartQty) {\n    const quantityLabel = this.refs.quantityLabelCartCount;\n    if (quantityLabel) {\n      const inCartText = quantityLabel.textContent?.match(/\\((\\d+)\\s+(.+)\\)/);\n      if (inCartText && inCartText[2]) {\n        quantityLabel.textContent = `(${cartQty} ${inCartText[2]})`;\n      }\n\n      // Show/hide based on quantity\n      quantityLabel.classList.toggle('hidden', cartQty === 0);\n    }\n  }\n\n  /**\n   * @param {*} text\n   */\n  #setLiveRegionText(text) {\n    const liveRegion = this.refs.liveRegion;\n    liveRegion.textContent = text;\n  }\n\n  #clearLiveRegionText() {\n    const liveRegion = this.refs.liveRegion;\n    liveRegion.textContent = '';\n  }\n\n  /**\n   * Morphs or removes/adds an element based on current and new element states\n   * @param {Element | null | undefined} currentElement - The current element in the DOM\n   * @param {Element | null | undefined} newElement - The new element from the server response\n   * @param {Element | null} [insertReferenceElement] - Element to insert before if adding new element\n   */\n  #morphOrUpdateElement(currentElement, newElement, insertReferenceElement = null) {\n    if (currentElement && newElement) {\n      morph(currentElement, newElement);\n    } else if (currentElement && !newElement) {\n      currentElement.remove();\n    } else if (!currentElement && newElement && insertReferenceElement) {\n      insertReferenceElement.insertAdjacentElement('beforebegin', /** @type {Element} */ (newElement.cloneNode(true)));\n    }\n  }\n\n  /**\n   * @param {VariantUpdateEvent} event\n   */\n  #onVariantUpdate = async (event) => {\n    if (event.detail.data.newProduct) {\n      this.dataset.productId = event.detail.data.newProduct.id;\n    } else if (event.detail.data.productId !== this.dataset.productId) {\n      return;\n    }\n\n    const { variantId } = this.refs;\n\n    // Update the variant ID\n    variantId.value = event.detail.resource?.id ?? '';\n    const { addToCartButtonContainer: currentAddToCartButtonContainer, acceleratedCheckoutButtonContainer } = this.refs;\n    const currentAddToCartButton = currentAddToCartButtonContainer?.refs.addToCartButton;\n\n    // Update state and text for add-to-cart button\n    if (!currentAddToCartButtonContainer || (!currentAddToCartButton && !acceleratedCheckoutButtonContainer)) return;\n\n    // Update the button state\n    if (event.detail.resource == null || event.detail.resource.available == false) {\n      currentAddToCartButtonContainer.disable();\n    } else {\n      currentAddToCartButtonContainer.enable();\n    }\n\n    const newAddToCartButton = event.detail.data.html.querySelector('product-form-component [ref=\"addToCartButton\"]');\n    if (newAddToCartButton && currentAddToCartButton) {\n      morph(currentAddToCartButton, newAddToCartButton);\n    }\n\n    if (acceleratedCheckoutButtonContainer) {\n      if (event.detail.resource == null || event.detail.resource.available == false) {\n        acceleratedCheckoutButtonContainer?.setAttribute('hidden', 'true');\n      } else {\n        acceleratedCheckoutButtonContainer?.removeAttribute('hidden');\n      }\n    }\n\n    // Set the data attribute for the product variant media if it exists\n    if (event.detail.resource) {\n      const productVariantMedia = event.detail.resource.featured_media?.preview_image?.src;\n      if (productVariantMedia) {\n        this.refs.addToCartButtonContainer?.setAttribute(\n          'data-product-variant-media',\n          productVariantMedia + '&width=100'\n        );\n      }\n    }\n\n    // Check if quantity rules, price-per-item, or add-to-cart are appearing/disappearing (causes layout shift)\n    const {\n      quantityRules,\n      pricePerItem,\n      quantitySelector,\n      productFormButtons,\n      quantityLabel,\n      quantitySelectorWrapper,\n    } = this.refs;\n\n    // Update quantity selector's min/max/step attributes and cart quantity for the new variant\n    const newQuantityInput = /** @type {HTMLInputElement | null} */ (\n      event.detail.data.html.querySelector('quantity-selector-component input[ref=\"quantityInput\"]')\n    );\n\n    if (quantitySelector?.updateConstraints && newQuantityInput) {\n      quantitySelector.updateConstraints(newQuantityInput.min, newQuantityInput.max || null, newQuantityInput.step);\n    }\n\n    const newQuantityRules = event.detail.data.html.querySelector('.quantity-rules');\n    const isQuantityRulesChanging = !!quantityRules !== !!newQuantityRules;\n\n    const newPricePerItem = event.detail.data.html.querySelector('price-per-item');\n    const isPricePerItemChanging = !!pricePerItem !== !!newPricePerItem;\n\n    if ((isQuantityRulesChanging || isPricePerItemChanging) && quantitySelector) {\n      // Store quantity value before morphing entire container\n      const currentQuantityValue = quantitySelector.getValue?.();\n\n      const newProductFormButtons = event.detail.data.html.querySelector('.product-form-buttons');\n\n      if (productFormButtons && newProductFormButtons) {\n        morph(productFormButtons, newProductFormButtons);\n\n        // Get the NEW quantity selector after morphing and update its constraints\n        const newQuantityInputElement = /** @type {HTMLInputElement | null} */ (\n          event.detail.data.html.querySelector('quantity-selector-component input[ref=\"quantityInput\"]')\n        );\n\n        if (this.refs.quantitySelector?.updateConstraints && newQuantityInputElement && currentQuantityValue) {\n          // Temporarily set the old value so updateConstraints can snap it properly\n          this.refs.quantitySelector.setValue(currentQuantityValue);\n          // updateConstraints will snap to valid increment if needed\n          this.refs.quantitySelector.updateConstraints(\n            newQuantityInputElement.min,\n            newQuantityInputElement.max || null,\n            newQuantityInputElement.step\n          );\n        }\n      }\n    } else {\n      // Update elements individually when layout isn't changing\n      /** @type {Array<[string, HTMLElement | undefined, HTMLElement | undefined]>} */\n      const morphTargets = [\n        ['.quantity-label', quantityLabel, quantitySelector],\n        ['.quantity-rules', quantityRules, this.refs.productFormButtons],\n        ['price-per-item', pricePerItem, quantitySelectorWrapper],\n      ];\n\n      for (const [selector, currentElement, fallback] of morphTargets) {\n        this.#morphOrUpdateElement(currentElement, event.detail.data.html.querySelector(selector), fallback);\n      }\n    }\n\n    // Morph volume pricing if it exists\n    const currentVolumePricing = this.refs.volumePricing;\n    const newVolumePricing = event.detail.data.html.querySelector('volume-pricing');\n    this.#morphOrUpdateElement(currentVolumePricing, newVolumePricing, this.refs.productFormButtons);\n\n    const hasB2BFeatures =\n      quantityRules || newQuantityRules || pricePerItem || newPricePerItem || currentVolumePricing || newVolumePricing;\n\n    if (!hasB2BFeatures) return;\n\n    // Fetch and update cart quantity for the new variant\n    await this.#fetchAndUpdateCartQuantity();\n  };\n\n  /**\n   * Disable the add to cart button while the UI is updating before #onVariantUpdate is called.\n   * Accelerated checkout button is also disabled via its own event listener not exposed to the theme.\n   */\n  #onVariantSelected = () => {\n    this.refs.addToCartButtonContainer?.disable();\n  };\n}\n\nif (!customElements.get('product-form-component')) {\n  customElements.define('product-form-component', ProductFormComponent);\n}\n"],
  "mappings": "AAAA,OAAS,cAAiB,mBAC1B,OAAS,YAAa,aAAc,eAAgB,sBAAyB,mBAC7E,OAAS,YAAa,aAAc,mBAA2D,gBAC/F,OAAS,oBAAuB,qBAChC,OAAS,UAAa,eAGtB,MAAM,+BAAiC,IAGjC,4BAA8B,IAG9B,iCAAmC,IAiBlC,aAAM,2BAA2B,SAAU,CAChD,aAAe,CAAC,iBAAiB,EAGjC,eAA0C,CAAC,EAE3C,mBAAoB,CAClB,MAAM,kBAAkB,EAExB,KAAK,iBAAiB,eAAgB,KAAK,aAAa,CAC1D,CAEA,sBAAuB,CACrB,MAAM,qBAAqB,EAEvB,KAAK,gBACP,KAAK,eAAe,QAA0C,WAAc,aAAa,SAAS,CAAC,EAErG,KAAK,oBAAoB,eAAgB,KAAK,aAAa,CAC7D,CAKA,SAAU,CACR,KAAK,KAAK,gBAAgB,SAAW,EACvC,CAKA,QAAS,CACP,KAAK,KAAK,gBA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