{"version":3,"file":"todo_all_set_controller-cWWHOr8K.js","sources":["../../app/assets/javascript/controllers/verification_documents/todo_all_set_controller.js"],"sourcesContent":["import { Controller } from \"@hotwired/stimulus\";\n\nexport default class extends Controller {\n static values = { statuses: Object }\n\n static targets = [\"done\", \"notDone\"];\n\n connect() {\n this.update();\n }\n\n statusUpdated(event) {\n if (this.statusesValue[event.detail.todoId] != event.detail.done) {\n this.statusesValue = {\n ...this.statusesValue,\n [event.detail.todoId]: event.detail.done,\n };\n\n this.update();\n }\n }\n\n update() {\n const incomplete = Object.values(this.statusesValue).some(done => !done);\n\n for (const el of this.notDoneTargets) {\n el.style.display = incomplete ? \"\" : \"none\";\n }\n\n for (const el of this.doneTargets) {\n el.style.display = incomplete ? \"none\" : \"\";\n }\n }\n}\n"],"names":["todo_all_set_controller","Controller","event","incomplete","done","el","__publicField"],"mappings":"kSAEe,MAAKA,UAASC,CAAW,CAKtC,SAAU,CACR,KAAK,OAAQ,CACjB,CAEE,cAAcC,EAAO,CACf,KAAK,cAAcA,EAAM,OAAO,MAAM,GAAKA,EAAM,OAAO,OAC1D,KAAK,cAAgB,CACnB,GAAG,KAAK,cACR,CAACA,EAAM,OAAO,MAAM,EAAGA,EAAM,OAAO,IACrC,EAED,KAAK,OAAQ,EAEnB,CAEE,QAAS,CACP,MAAMC,EAAa,OAAO,OAAO,KAAK,aAAa,EAAE,KAAKC,GAAQ,CAACA,CAAI,EAEvE,UAAWC,KAAM,KAAK,eACpBA,EAAG,MAAM,QAAUF,EAAa,GAAK,OAGvC,UAAWE,KAAM,KAAK,YACpBA,EAAG,MAAM,QAAUF,EAAa,OAAS,EAE/C,CACA,CA9BEG,EADkBN,EACX,SAAS,CAAE,SAAU,MAAM,GAElCM,EAHkBN,EAGX,UAAU,CAAC,OAAQ,SAAS"}