{"version":3,"file":"profile_controller-iYCvWM_S.js","sources":["../../../app/javascript/controllers/profile_controller.js"],"sourcesContent":["import ApplicationController from './application_controller'\n\nexport default class extends ApplicationController {\n static values = {\n id: String,\n name: String,\n subscriptionState: String,\n conversationUrl: String,\n }\n\n static targets = [\n 'propertiesContainer',\n 'minimalPropertiesContainer',\n 'mergeDropdown',\n ]\n\n removeMinimalPropertiesContainer() {\n this.minimalPropertiesContainerTarget.remove()\n }\n\n focusChatInput({ params }) {\n const inbox = document.querySelector(\"[data-controller='chat']\")\n\n if(inbox) {\n return this.dispatch(\"focus\", {\n target: inbox,\n detail: params.element\n })\n }\n\n Turbo.visit(this.conversationUrlValue)\n }\n\n showSubscriptionModal() {\n this.dispatch('subscription:subscribe', {\n target: document.querySelector('[data-controller=\"contact--modal\"]'),\n detail: {\n id: this.idValue,\n name: this.nameValue,\n },\n })\n }\n\n showUnsubscriptionModal() {\n this.dispatch('subscription:unsubscribe', {\n target: document.querySelector('[data-controller=\"contact--modal\"]'),\n detail: {\n id: this.idValue,\n name: this.nameValue,\n },\n })\n }\n\n showDeleteModal() {\n this.dispatch('delete', {\n target: document.querySelector('[data-controller=\"contact--modal\"]'),\n detail: {\n id: this.idValue,\n name: this.nameValue,\n },\n })\n }\n\n updateName({ detail: newName }) {\n this.nameValue = newName\n }\n\n showMergeDropdown() {\n this.dispatch('merge:toggle', {\n target: this.mergeDropdownTarget,\n })\n }\n\n focusMergeDropdown() {\n if(this.isVisible(this.mergeDropdownTarget)) {\n this.dispatch('merge:focus', {\n target: this.mergeDropdownTarget\n })\n }\n }\n}\n"],"names":["profile_controller","ApplicationController","params","inbox","newName","__publicField"],"mappings":"uNAEe,MAAKA,UAASC,CAAsB,CAcjD,kCAAmC,CACjC,KAAK,iCAAiC,OAAM,CAChD,CAEE,eAAe,CAAE,OAAAC,GAAU,CACzB,MAAMC,EAAQ,SAAS,cAAc,0BAA0B,EAE/D,GAAGA,EACD,OAAO,KAAK,SAAS,QAAS,CAC5B,OAAQA,EACR,OAAQD,EAAO,OAChB,CAAA,EAGH,MAAM,MAAM,KAAK,oBAAoB,CACzC,CAEE,uBAAwB,CACtB,KAAK,SAAS,yBAA0B,CACtC,OAAQ,SAAS,cAAc,oCAAoC,EACnE,OAAQ,CACN,GAAI,KAAK,QACT,KAAM,KAAK,SACZ,CACF,CAAA,CACL,CAEE,yBAA0B,CACxB,KAAK,SAAS,2BAA4B,CACxC,OAAQ,SAAS,cAAc,oCAAoC,EACnE,OAAQ,CACN,GAAI,KAAK,QACT,KAAM,KAAK,SACZ,CACF,CAAA,CACL,CAEE,iBAAkB,CAChB,KAAK,SAAS,SAAU,CACtB,OAAQ,SAAS,cAAc,oCAAoC,EACnE,OAAQ,CACN,GAAI,KAAK,QACT,KAAM,KAAK,SACZ,CACF,CAAA,CACL,CAEE,WAAW,CAAE,OAAQE,GAAW,CAC9B,KAAK,UAAYA,CACrB,CAEE,mBAAoB,CAClB,KAAK,SAAS,eAAgB,CAC5B,OAAQ,KAAK,mBACd,CAAA,CACL,CAEE,oBAAqB,CAChB,KAAK,UAAU,KAAK,mBAAmB,GACxC,KAAK,SAAS,cAAe,CAC3B,OAAQ,KAAK,mBACd,CAAA,CAEP,CACA,CA7EEC,EADkBL,EACX,SAAS,CACd,GAAI,OACJ,KAAM,OACN,kBAAmB,OACnB,gBAAiB,MACrB,GAEEK,EARkBL,EAQX,UAAU,CACf,sBACA,6BACA,eACJ"}