{"version":3,"sources":["webpack:///./src/pages/merchant-list/MerchantList.vue?6f9d","webpack:///./src/pages/merchant-list/MerchantList.vue","webpack:///./src/pages/merchant-list/MerchantList.vue?3ff8","webpack:///./src/pages/merchant-list/MerchantList.vue?6ea3"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","tableColumns","tableData","enabled","perPage","mode","perPageDropdownEnabled","scopedSlots","_u","key","fn","props","column","field","row","isProcessing","on","val","onChangeToggle","model","value","callback","$$v","$set","expression","_v","_s","formattedRow","slot","onSearch","searchQuery","staticRenderFns","merchantModule","namespace","MerchantList","Vue","constructor","label","sortable","tdClass","keyword","searchTimer","clearTimeout","setTimeout","async","getMerchantList","merchant","isActive","callbackStatus","setMerchantStatus","merchantId","id","status","catch","finally","__decorate","Action","Component","components","DataTable","SvgIcon","Input","ToggleSwitch","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,aAAa,CAACE,YAAY,kCAAkCC,MAAM,CAAC,kBAAiB,EAAK,KAAM,EAAK,QAAUP,EAAIQ,aAAa,KAAOR,EAAIS,UAAU,qBAAqB,CACxQC,SAAS,EACTC,QAAS,GACTC,KAAM,UACNC,wBAAwB,GACxB,kBAAkB,wCAAwC,MAAQ,iBAAiBC,YAAYd,EAAIe,GAAG,CAAC,CAACC,IAAI,YAAYC,GAAG,SAASC,GAAO,MAAO,CAAyB,aAAvBA,EAAMC,OAAOC,MAAsBhB,EAAG,MAAM,CAACA,EAAG,gBAAgB,CAACG,MAAM,CAAC,QAAUW,EAAMG,IAAIC,aAAa,oBAAmB,EAAK,cAAc,oBAAoBC,GAAG,CAAC,OAAS,SAAUC,GAAO,OAAOxB,EAAIyB,eAAeD,EAAKN,EAAMG,OAASK,MAAM,CAACC,MAAOT,EAAMG,IAAY,SAAEO,SAAS,SAAUC,GAAM7B,EAAI8B,KAAKZ,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AKQ,gBAAkBR,KAAKmD,gBAAgB,MA/E9CU,gBADCvB,EAAewB,OAAO,oBAAkB,sCAQGD,gBAA3CvB,EAAewB,OAAO,sBAAoB,wCATxBtB,EAAY,gBARhCuB,eAAU,CACTC,WAAY,CACVC,qBACAC,qBACAC,iBACAC,mCAGiB5B,WC/D6yB,I,YCO9zB6B,EAAY,eACd,EACAvE,EACAuC,GACA,EACA,KACA,KACA,MAIa,aAAAgC,E","file":"js/chunk-2d0e26c5.3c837f65.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('data-table',{staticClass:\"bg-mono-white rounded shadow-md\",attrs:{\"header-actions\":true,\"new\":true,\"columns\":_vm.tableColumns,\"rows\":_vm.tableData,\"pagination-options\":{\n enabled: true,\n perPage: 10,\n mode: 'records',\n perPageDropdownEnabled: false,\n },\"row-style-class\":\"cursor-pointer hover:bg-blue-light-30\",\"title\":\"Merchant List\"},scopedSlots:_vm._u([{key:\"table-row\",fn:function(props){return [(props.column.field === 'isActive')?_c('div',[_c('toggle-switch',{attrs:{\"loading\":props.row.isProcessing,\"use-confirmation\":true,\"toggle-type\":\"Merchant Account\"},on:{\"change\":function (val) { return _vm.onChangeToggle(val, props.row); }},model:{value:(props.row.isActive),callback:function ($$v) {_vm.$set(props.row, \"isActive\", $$v)},expression:\"props.row.isActive\"}})],1):_c('span',[_vm._v(\" \"+_vm._s(props.formattedRow[props.column.field])+\" \")])]}}])},[_c('template',{slot:\"header-actions\"},[_c('Input',{staticClass:\"w-80\",attrs:{\"placeholder\":\"Search Merchant Name or Email\"},on:{\"input\":_vm.onSearch},model:{value:(_vm.searchQuery),callback:function ($$v) {_vm.searchQuery=$$v},expression:\"searchQuery\"}})],1)],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Vue, Component } from \"vue-property-decorator\";\nimport { namespace } from \"vuex-class\";\nimport {\n Table as DataTable,\n Input,\n SvgIcon,\n ToggleSwitch,\n} from \"@brankas/web-ui\";\nimport { MerchantListItem, TableColumn } from \"@/types\";\nimport * as ServiceProto from \"@/proto/pay/admin/all_pb\";\n\nconst merchantModule = namespace(\"merchant\");\n\n@Component({\n components: {\n DataTable,\n SvgIcon,\n Input,\n ToggleSwitch,\n },\n})\nexport default class MerchantList extends Vue {\n @merchantModule.Action(\"getMerchantList\")\n getMerchantList!: (data: {\n keyword?: string;\n page?: number;\n sort?: ServiceProto.OrderMap[keyof ServiceProto.OrderMap];\n limit?: number;\n }) => MerchantListItem[];\n\n @merchantModule.Action(\"setMerchantStatus\") setMerchantStatus!: (data: {\n merchantId: string;\n status: boolean;\n }) => Promise;\n\n tableColumns: TableColumn[] = [\n {\n label: \"ORGANIZATION NAME\",\n field: \"name\",\n sortable: true,\n tdClass: \"font-sans font-medium\",\n },\n {\n label: \"EMAIL\",\n field: \"email\",\n sortable: false,\n tdClass: \"font-sans font-medium\",\n },\n {\n label: \"SUBSCRIPTION\",\n field: \"subscription\",\n sortable: false,\n tdClass: \"font-sans font-medium\",\n },\n {\n label: \"COUNTRY\",\n field: \"country\",\n sortable: false,\n tdClass: \"font-sans font-medium\",\n },\n {\n label: \"STATUS\",\n field: \"isActive\",\n sortable: false,\n tdClass: \"font-sans font-medium\",\n },\n ];\n\n tableData: MerchantListItem[] = [];\n searchQuery = \"\";\n searchTimer!: ReturnType;\n\n async onSearch(keyword: any) {\n if (this.searchTimer) {\n clearTimeout(this.searchTimer);\n }\n this.searchTimer = setTimeout(async () => {\n this.tableData = await this.getMerchantList({\n keyword,\n });\n }, 300);\n }\n\n onChangeToggle(value: boolean, merchant: any) {\n merchant.isActive = value;\n merchant.isProcessing = true;\n\n const callbackStatus = this.setMerchantStatus({\n merchantId: merchant.id,\n status: value,\n });\n\n callbackStatus\n .catch(() => {\n merchant.isActive = !value;\n })\n .finally(() => {\n merchant.isProcessing = false;\n });\n }\n\n async mounted() {\n this.tableData = await this.getMerchantList({});\n }\n}\n","import mod from \"-!../../../../../cache-deps/virtual-store/cache-loader@4.1.0_webpack@4.46.0/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../cache-deps/virtual-store/thread-loader@2.1.3_webpack@4.46.0/node_modules/thread-loader/dist/cjs.js!../../../../../cache-deps/virtual-store/babel-loader@8.3.0_233723f55376fb7a01a2470553e60506/node_modules/babel-loader/lib/index.js!../../../../../cache-deps/virtual-store/ts-loader@6.2.2_typescript@4.4.4/node_modules/ts-loader/index.js??ref--14-3!../../../../../cache-deps/virtual-store/cache-loader@4.1.0_webpack@4.46.0/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../cache-deps/virtual-store/vue-loader@15.9.8_679359cdb69c218f2f8f476b2ba08796/node_modules/vue-loader/lib/index.js??vue-loader-options!./MerchantList.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../../cache-deps/virtual-store/cache-loader@4.1.0_webpack@4.46.0/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../cache-deps/virtual-store/thread-loader@2.1.3_webpack@4.46.0/node_modules/thread-loader/dist/cjs.js!../../../../../cache-deps/virtual-store/babel-loader@8.3.0_233723f55376fb7a01a2470553e60506/node_modules/babel-loader/lib/index.js!../../../../../cache-deps/virtual-store/ts-loader@6.2.2_typescript@4.4.4/node_modules/ts-loader/index.js??ref--14-3!../../../../../cache-deps/virtual-store/cache-loader@4.1.0_webpack@4.46.0/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../cache-deps/virtual-store/vue-loader@15.9.8_679359cdb69c218f2f8f476b2ba08796/node_modules/vue-loader/lib/index.js??vue-loader-options!./MerchantList.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./MerchantList.vue?vue&type=template&id=1b1dc910&\"\nimport script from \"./MerchantList.vue?vue&type=script&lang=ts&\"\nexport * from \"./MerchantList.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../cache-deps/virtual-store/vue-loader@15.9.8_679359cdb69c218f2f8f476b2ba08796/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}