{"version":3,"file":"listing_image_controller-cQ3vhQWP.js","sources":["../../../app/javascript/controllers/dynamic_bundles/listing_image_controller.js"],"sourcesContent":["import { Controller } from \"@hotwired/stimulus\";\n\nexport default class extends Controller {\n  static targets = [\"image\"];\n\n  static values = {\n    listingId: Number,\n    currentListing: Number,\n    listingIndex: Number\n  };\n\n  connect() {\n    if (this.currentListingValue === this.listingIdValue) {\n      this.addBorderToCurrentIndex();\n      this.addCurrentListingIndexToMainImage();\n    }\n  }\n\n  addBorderToCurrentIndex() {\n    this.imageTarget.classList.add(\"border-ink\");\n    this.imageTarget.classList.remove(\"border-transparent\");\n  }\n\n  addCurrentListingIndexToMainImage() {\n    const mainImage = document.getElementById(\"dynamic-bundle-main-image\");\n    mainImage.setAttribute(\n      \"data-current-listing-index\",\n      this.listingIndexValue\n    );\n  }\n}\n"],"names":["listing_image_controller","Controller","__publicField"],"mappings":"qTAEe,MAAKA,UAASC,CAAW,CAStC,SAAU,CACJ,KAAK,sBAAwB,KAAK,iBACpC,KAAK,wBAAyB,EAC9B,KAAK,kCAAmC,EAE9C,CAEE,yBAA0B,CACxB,KAAK,YAAY,UAAU,IAAI,YAAY,EAC3C,KAAK,YAAY,UAAU,OAAO,oBAAoB,CAC1D,CAEE,mCAAoC,CAChB,SAAS,eAAe,2BAA2B,EAC3D,aACR,6BACA,KAAK,iBACN,CACL,CACA,CA3BEC,EADkBF,EACX,UAAU,CAAC,OAAO,GAEzBE,EAHkBF,EAGX,SAAS,CACd,UAAW,OACX,eAAgB,OAChB,aAAc,MACf"}