{"version":3,"file":"email_controller-BpkqWv6q.js","sources":["../../../app/javascript/controllers/property/email_controller.js"],"sourcesContent":["import PropertyController from \"../contact/property_controller\"\n\nexport default class extends PropertyController {\n static targets = [\"menu\", \"clearButton\"]\n\n connect() {\n super.connect()\n\n if(this.errorValue) {\n this.focus()\n }\n }\n\n saveChanges(e) {\n if(this.withinBoundaries(e)) return\n\n if(this.inputTarget.value === this.currentValue) {\n return this.blur()\n }\n\n if(this.errorValue) {\n return this.restore()\n }\n\n if(this.inputTarget.value.trim().length === 0) {\n if(this.hasClearButtonTarget) {\n this.clearButtonTarget.click()\n } else {\n this.blur()\n }\n } else {\n this.formTarget.requestSubmit()\n }\n }\n\n submit() {\n if(this.inputTarget.value.trim() === this.currentValue) {\n return this.blur()\n }\n\n if(this.inputTarget.value.trim().length === 0 && this.persistedValue) {\n return this.clearButtonTarget.click()\n }\n\n this.formTarget.requestSubmit()\n }\n}\n"],"names":["email_controller","PropertyController","e","__publicField"],"mappings":"0NAEe,MAAKA,UAASC,CAAmB,CAG9C,SAAU,CACR,MAAM,QAAO,EAEV,KAAK,YACN,KAAK,MAAK,CAEhB,CAEE,YAAYC,EAAG,CACb,GAAG,MAAK,iBAAiBA,CAAC,EAE1B,IAAG,KAAK,YAAY,QAAU,KAAK,aACjC,OAAO,KAAK,KAAI,EAGlB,GAAG,KAAK,WACN,OAAO,KAAK,QAAO,EAGlB,KAAK,YAAY,MAAM,KAAM,EAAC,SAAW,EACvC,KAAK,qBACN,KAAK,kBAAkB,MAAK,EAE5B,KAAK,KAAI,EAGX,KAAK,WAAW,cAAa,EAEnC,CAEE,QAAS,CACP,GAAG,KAAK,YAAY,MAAM,KAAM,IAAK,KAAK,aACxC,OAAO,KAAK,KAAI,EAGlB,GAAG,KAAK,YAAY,MAAM,KAAM,EAAC,SAAW,GAAK,KAAK,eACpD,OAAO,KAAK,kBAAkB,MAAK,EAGrC,KAAK,WAAW,cAAa,CACjC,CACA,CA3CEC,EADkBH,EACX,UAAU,CAAC,OAAQ,aAAa"}