{"version":3,"file":"periodicity_controller-kQQGa65g.js","sources":["../../../app/javascript/controllers/segments/periodicity_controller.js"],"sourcesContent":["import ApplicationController from '../application_controller'\n\nexport default class extends ApplicationController {\n static targets = [\"hidden\", \"allTime\", \"overTheLast\", \"durationInput\"]\n static classes = [\"selected\"]\n\n showPeriodFilters() {\n this.element.querySelectorAll('input, select').forEach(this.enable)\n this.hiddenTargets.forEach((element) => {\n this.show(element)\n })\n\n this.show(this.durationInputTarget)\n this.enable(this.durationInputTarget)\n\n this.toggleSelectedClass()\n\n this.focus(this.durationInputTarget)\n }\n\n hidePeriodFilters() {\n this.element.querySelectorAll('input, select').forEach(this.disable)\n\n this.hiddenTargets.forEach((element) => {\n this.hide(element)\n })\n\n this.hide(this.durationInputTarget)\n this.disable(this.durationInputTarget)\n\n this.toggleSelectedClass()\n\n this.durationInputTarget.value = ''\n }\n\n // private\n\n toggleSelectedClass() {\n if(this.hasSelectedClass) {\n this.allTimeTarget.classList.toggle(this.selectedClasses)\n this.overTheLastTarget.classList.toggle(this.selectedClasses)\n }\n }\n}\n"],"names":["periodicity_controller","ApplicationController","element","__publicField"],"mappings":"uNAEe,MAAKA,UAASC,CAAsB,CAIjD,mBAAoB,CAClB,KAAK,QAAQ,iBAAiB,eAAe,EAAE,QAAQ,KAAK,MAAM,EAClE,KAAK,cAAc,QAASC,GAAY,CACtC,KAAK,KAAKA,CAAO,CAClB,CAAA,EAED,KAAK,KAAK,KAAK,mBAAmB,EAClC,KAAK,OAAO,KAAK,mBAAmB,EAEpC,KAAK,oBAAmB,EAExB,KAAK,MAAM,KAAK,mBAAmB,CACvC,CAEE,mBAAoB,CAClB,KAAK,QAAQ,iBAAiB,eAAe,EAAE,QAAQ,KAAK,OAAO,EAEnE,KAAK,cAAc,QAASA,GAAY,CACtC,KAAK,KAAKA,CAAO,CAClB,CAAA,EAED,KAAK,KAAK,KAAK,mBAAmB,EAClC,KAAK,QAAQ,KAAK,mBAAmB,EAErC,KAAK,oBAAmB,EAExB,KAAK,oBAAoB,MAAQ,EACrC,CAIE,qBAAsB,CACjB,KAAK,mBACN,KAAK,cAAc,UAAU,OAAO,KAAK,eAAe,EACxD,KAAK,kBAAkB,UAAU,OAAO,KAAK,eAAe,EAElE,CACA,CAxCEC,EADkBH,EACX,UAAU,CAAC,SAAU,UAAW,cAAe,eAAe,GACrEG,EAFkBH,EAEX,UAAU,CAAC,UAAU"}