{"version":3,"sources":["webpack:///./src/components/UploadReqs.vue?9e7b","webpack:///./src/components/common/TwainImageViewer.vue?69cf","webpack:///src/components/common/TwainImageViewer.vue","webpack:///./src/components/common/TwainImageViewer.vue?3806","webpack:///./src/components/common/TwainImageViewer.vue","webpack:///src/components/UploadReqs.vue","webpack:///./src/components/UploadReqs.vue?249a","webpack:///./src/components/UploadReqs.vue","webpack:///./src/components/common/TwainImageViewer.vue?a43a","webpack:///./src/components/UploadReqs.vue?bed0"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","_v","ref","attrs","on","onSelectFile","fileNames","_l","file","key","_s","_e","imageTypes","model","value","callback","$$v","reqImageTypeId","expression","handleUpload","uploadedImages","totalImages","sourceList","selectedSource","resolutions","selectedResolution","booleanOptions","useScannerFeeder","useDuplex","startScan","scannedReqImages","scannedReqCounts","cases","images","dataSource","columns","toolbar","initGrid","scopedSlots","_u","fn","data","caseId","permissions","name","params","caseNumber","errorMessage","directives","rawName","modifiers","getLocalImageUrl","$event","viewImages","deleteCaseImages","isViewerOpen","staticRenderFns","hasMultipleImages","imageIdx","handlePrevious","imageCount","handleNext","components","IconButton","viewer","mounted","methods","getImageData","imagePath","fetch","imageFetch","imageBlob","start","DWObject","component","Container","SelectInput","DxGridWithSearch","TwainImageViewer","Modal","metaInfo","title","titleTemplate","id","displayName","isLoading","imageIndex","imagesInBuffer","created","TWAINDriver","subscriptions","filter","startWith","loaded","total","map","distinctUntilChanged","width","progress","uploadStatus$","imageReceived$","watch","nv","deep","handler","computed","mapState","enableTWAINDriver","localImageUrls","savedDuplexScanning","mapGetters","caption","type","cellTemplate","dataField","sortIndex","dataType","items","widget","options","icon","onClick","visible","showViewer","window","caseNumbers","CasesApi","casesData","input","files","Array","successfulCaseNumbers","timer","imageData","fileCaseData","URL","formData","JSON","tagIds","specimenId","keywords","printOnReport","comment","imageTypeId","ImagesApi","response","logItem","createLogItem","AuditLogApi","resetCounter","parseFileName","fileName","handleDeleteSelected","selectedCases","confirm","imageIds","caseData","newCases","handleErrors","startTwain","Dynamsoft","findInList","convertToBlob","resolve","reject","saveFile","handleScannedImages","imageUrls","imageUrl","getReqImageType","reqImageType","payload","getSources","tryCount","sources"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,YAAY,CAACA,EAAG,MAAM,CAACE,YAAY,iBAAiB,CAACF,EAAG,KAAK,CAACJ,EAAIO,GAAG,sBAAsBH,EAAG,QAAQ,CAACI,IAAI,YAAYF,YAAY,MAAMG,MAAM,CAAC,OAAS,kBAAkB,KAAO,OAAO,GAAK,MAAM,SAAW,IAAIC,GAAG,CAAC,MAAQV,EAAIW,gBAAiBX,EAAIY,UAAgB,OAAER,EAAG,MAAM,CAACE,YAAY,wBAAwBN,EAAIa,GAAIb,EAAa,WAAE,SAASc,GAAM,OAAOV,EAAG,MAAM,CAACW,IAAID,GAAM,CAACd,EAAIO,GAAGP,EAAIgB,GAAGF,SAAW,GAAGd,EAAIiB,KAAKb,EAAG,cAAc,CAACE,YAAY,eAAeG,MAAM,CAAC,MAAQ,aAAa,MAAQT,EAAIkB,YAAYC,MAAM,CAACC,MAAOpB,EAAkB,eAAEqB,SAAS,SAAUC,GAAMtB,EAAIuB,eAAeD,GAAKE,WAAW,oBAAoBpB,EAAG,MAAM,CAACA,EAAG,SAAS,CAACE,YAAY,kBAAkBI,GAAG,CAAC,MAAQV,EAAIyB,eAAe,CAACzB,EAAIO,GAAG,oBAAqBP,EAAe,YAAEI,EAAG,MAAM,CAACJ,EAAIO,GAAG,YAAYP,EAAIgB,GAAGhB,EAAI0B,gBAAgB,OAAO1B,EAAIgB,GAAGhB,EAAI2B,aAAa,aAAa3B,EAAIiB,KAAMjB,EAAI4B,WAAiB,OAAExB,EAAG,MAAM,CAACE,YAAY,QAAQ,CAACF,EAAG,KAAK,CAACJ,EAAIO,GAAG,oBAAoBH,E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AuF,+BACAa,EAAA,EAFA,UAGA,sBAHA,gCAIA,qDAJA,OAKAA,IALA,sBAOAC,EAAArG,mBACA,yCAAAW,cAAAD,SACA,0CACA8E,EAAAxF,4CACA,IACA,yCAZA,+CAgBAtB,iBA/OA,YA+OA,iBACA,MACA,qEACA,oCACA,kBAGA,YC/hBoV,ICQhV,G,UAAY,eACd,EACA1D,EACA+D,GACA,EACA,KACA,WACA,OAIa,e,6CCnBf,W,2DCAA,W","file":"js/chunk-0a48eaba.6548a6d2.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('container',[_c('div',{staticClass:\"body p-3 mx-3\"},[_c('h1',[_vm._v(\"Upload Req Forms\")]),_c('input',{ref:\"fileInput\",staticClass:\"m-2\",attrs:{\"accept\":\"application/pdf\",\"type\":\"file\",\"id\":\"img\",\"multiple\":\"\"},on:{\"input\":_vm.onSelectFile}}),(_vm.fileNames.length)?_c('div',{staticClass:\"file-names mx-2 mb-2\"},_vm._l((_vm.fileNames),function(file){return _c('div',{key:file},[_vm._v(_vm._s(file))])}),0):_vm._e(),_c('SelectInput',{staticClass:\"select-input\",attrs:{\"label\":\"Image Type\",\"items\":_vm.imageTypes},model:{value:(_vm.reqImageTypeId),callback:function ($$v) {_vm.reqImageTypeId=$$v},expression:\"reqImageTypeId\"}}),_c('div',[_c('button',{staticClass:\"btn btn-primary\",on:{\"click\":_vm.handleUpload}},[_vm._v(\"Upload Files\")])]),(_vm.totalImages)?_c('div',[_vm._v(\"Uploaded \"+_vm._s(_vm.uploadedImages)+\" of \"+_vm._s(_vm.totalImages)+\" images\")]):_vm._e(),(_vm.sourceList.length)?_c('div',{staticClass:\"mt-3\"},[_c('h1',[_vm._v(\"Scan Req Forms\")]),_c('SelectInput',{staticClass:\"select-input\",attrs:{\"label\":\"Twain Device\",\"items\":_vm.sourceList,\"displayExpr\":\"displayName\",\"valueExpr\":\"id\",\"name\":\"twainDevice\"},model:{value:(_vm.selectedSource),callback:function ($$v) {_vm.selectedSource=$$v},expression:\"selectedSource\"}}),_c('SelectInput',{staticClass:\"select-input\",attrs:{\"label\":\"Image Resolution\",\"items\":_vm.resolutions,\"displayExpr\":\"displayName\",\"valueExpr\":\"id\",\"name\":\"resolution\"},model:{value:(_vm.selectedResolution),callback:function ($$v) {_vm.selectedResolution=$$v},expression:\"selectedResolution\"}}),_c('SelectInput',{staticClass:\"select-input\",attrs:{\"label\":\"Image Type\",\"items\":_vm.imageTypes},model:{value:(_vm.reqImageTypeId),callback:function ($$v) {_vm.reqImageTypeId=$$v},expression:\"reqImageTypeId\"}}),_c('SelectInput',{staticClass:\"select-input\",attrs:{\"label\":\"Use Feeder\",\"items\":_vm.booleanOptions},model:{value:(_vm.useScannerFeeder),callback:function ($$v) {_vm.useScannerFeeder=$$v},expression:\"useScannerFeeder\"}}),(_vm.useScannerFeeder)?_c('SelectInput',{staticClass:\"select-input\",attrs:{\"label\":\"Double Sided\",\"items\":_vm.booleanOptions},model:{value:(_vm.useDuplex),callback:function ($$v) {_vm.useDuplex=$$v},expression:\"useDuplex\"}}):_vm._e(),_c('div',{staticClass:\"d-flex justify-content-between\"},[(_vm.sourceList.length)?_c('button',{staticClass:\"btn btn-success ml-2\",on:{\"click\":_vm.startScan}},[_vm._v(\" Start Scan \")]):_vm._e()]),(_vm.scannedReqImages.length)?_c('div',[_c('h3',{staticClass:\"text-center\"},[_vm._v(\" \"+_vm._s(_vm.scannedReqCounts.cases)+\" Cases, \"+_vm._s(_vm.scannedReqCounts.images)+\" Images \")]),_c('DxGridWithSearch',{attrs:{\"dataSource\":_vm.dataSource,\"columns\":_vm.columns,\"toolbar\":_vm.toolbar},on:{\"initialized\":_vm.initGrid},scopedSlots:_vm._u([{key:\"caseNumber\",fn:function(ref){\nvar data = ref.data.data;\nreturn [(!data.caseId)?_c('div',[_c('span',{staticClass:\"text-danger\"},[_vm._v(_vm._s(data.errorMessage || \"Unable to read case number.\"))])]):_c('div',[(_vm.permissions.CaseView)?_c('router-link',{attrs:{\"to\":{\n                  name: 'CaseView',\n                  params: {\n                    caseId: data.caseId\n                  }\n                }}},[_vm._v(\" \"+_vm._s(data.caseNumber)+\" \")]):_c('div',[_vm._v(_vm._s(data.caseNumber))])],1)]}},{key:\"actions\",fn:function(ref){\n                var data = ref.data.data;\nreturn [_c('div',{staticClass:\"d-flex align-items-center justify-content-center\"},[_c('icon-button',{directives:[{name:\"tooltip\",rawName:\"v-tooltip.right.start\",value:('View images'),expression:\"'View images'\",modifiers:{\"right\":true,\"start\":true}}],staticClass:\"ml-1 p-0 text-secondary pointer\",attrs:{\"disabled\":!data.caseId && !_vm.getLocalImageUrl(data),\"icon\":\"eye\"},on:{\"click\":function($event){return _vm.viewImages(data)}}}),(_vm.permissions.CaseImageCreateEdit)?_c('icon-button',{directives:[{name:\"tooltip\",rawName:\"v-tooltip.right.start\",value:('Delete images.'),expression:\"'Delete images.'\",modifiers:{\"right\":true,\"start\":true}}],staticClass:\"mx-1 p-0 text-danger pointer\",attrs:{\"icon\":\"trash-alt\"},on:{\"click\":function($event){return _vm.deleteCaseImages(data)}}}):_vm._e()],1)]}}],null,false,1417613530)})],1):_vm._e()],1):_vm._e()],1),_c('modal',{attrs:{\"status\":_vm.isViewerOpen},on:{\"close\":function($event){_vm.isViewerOpen = false}}},[_c('TwainImageViewer')],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"wrapper\"},[_c('div',{ref:\"imagePreview\",staticClass:\"viewer\"}),_c('div',{staticClass:\"d-flex justify-content-center mt-4\"},[(_vm.hasMultipleImages && _vm.imageIdx > 0)?_c('icon-button',{staticClass:\"btn-outline-primary mr-2\",attrs:{\"icon\":\"arrow-left\"},on:{\"click\":_vm.handlePrevious}}):_vm._e(),(_vm.hasMultipleImages && _vm.imageIdx < _vm.imageCount - 1)?_c('icon-button',{staticClass:\"btn-outline-primary ml-2\",attrs:{\"icon\":\"arrow-right\"},on:{\"click\":_vm.handleNext}}):_vm._e()],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <div class=\"wrapper\">\n    <div class=\"viewer\" ref=\"imagePreview\"></div>\n    <div class=\"d-flex justify-content-center mt-4\">\n      <icon-button\n        @click=\"handlePrevious\"\n        v-if=\"hasMultipleImages && imageIdx > 0\"\n        class=\"btn-outline-primary mr-2\"\n        icon=\"arrow-left\"\n      >\n      </icon-button>\n\n      <icon-button\n        @click=\"handleNext\"\n        v-if=\"hasMultipleImages && imageIdx < imageCount - 1\"\n        class=\"btn-outline-primary ml-2\"\n        icon=\"arrow-right\"\n      >\n      </icon-button>\n    </div>\n  </div>\n</template>\n\n<script>\nimport Dynamsoft from \"dwt\";\nimport { WEB_TWAIN_ID } from \"@/modules/constants\";\nimport IconButton from \"@/components/common/IconButton.vue\";\n\nexport default {\n  name: \"TwainImageViewer\",\n  components: { IconButton },\n  data() {\n    return {\n      viewer: null,\n      hasMultipleImages: false,\n      imageIdx: 0,\n      imageCount: 0\n    };\n  },\n\n  mounted() {\n    this.start();\n  },\n  methods: {\n    handlePrevious() {\n      const DWObject = Dynamsoft.DWT.GetWebTwain(WEB_TWAIN_ID);\n      this.imageIdx = DWObject.Viewer.previous();\n    },\n    handleNext() {\n      const DWObject = Dynamsoft.DWT.GetWebTwain(WEB_TWAIN_ID);\n      this.imageIdx = DWObject.Viewer.next();\n    },\n    async getImageData(imagePath) {\n      const imageFetch = await fetch(imagePath);\n      const imageBlob = await imageFetch.blob();\n\n      return imageBlob;\n    },\n    start() {\n      const DWObject = Dynamsoft.DWT.GetWebTwain(WEB_TWAIN_ID);\n      if (DWObject) {\n        const element = this.$refs.imagePreview;\n        DWObject.Viewer.bind(element);\n        DWObject.Viewer.width = 800;\n        DWObject.Viewer.height = 800;\n        DWObject.Viewer.singlePageMode = true;\n        DWObject.Viewer.show();\n        this.hasMultipleImages = DWObject.HowManyImagesInBuffer > 1;\n        this.imageCount = DWObject.HowManyImagesInBuffer;\n        this.viewer = DWObject.Viewer;\n      }\n    }\n  }\n};\n</script>\n\n<style lang=\"scss\" scoped>\n.viewer {\n}\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TwainImageViewer.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TwainImageViewer.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./TwainImageViewer.vue?vue&type=template&id=2598bdc4&scoped=true&\"\nimport script from \"./TwainImageViewer.vue?vue&type=script&lang=js&\"\nexport * from \"./TwainImageViewer.vue?vue&type=script&lang=js&\"\nimport style0 from \"./TwainImageViewer.vue?vue&type=style&index=0&id=2598bdc4&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"2598bdc4\",\n  null\n  \n)\n\nexport default component.exports","<template>\n  <container>\n    <div class=\"body p-3 mx-3\">\n      <h1>Upload Req Forms</h1>\n      <input\n        class=\"m-2\"\n        accept=\"application/pdf\"\n        type=\"file\"\n        id=\"img\"\n        ref=\"fileInput\"\n        multiple\n        @input=\"onSelectFile\"\n      />\n      <div v-if=\"fileNames.length\" class=\"file-names mx-2 mb-2\">\n        <div v-for=\"file of fileNames\" v-bind:key=\"file\">{{ file }}</div>\n      </div>\n      <SelectInput\n        class=\"select-input\"\n        label=\"Image Type\"\n        v-model=\"reqImageTypeId\"\n        :items=\"imageTypes\"\n      />\n      <div>\n        <button class=\"btn btn-primary\" @click=\"handleUpload\">Upload Files</button>\n      </div>\n      <div v-if=\"totalImages\">Uploaded {{ uploadedImages }} of {{ totalImages }} images</div>\n      <div v-if=\"sourceList.length\" class=\"mt-3\">\n        <h1>Scan Req Forms</h1>\n        <SelectInput\n          label=\"Twain Device\"\n          class=\"select-input\"\n          :items=\"sourceList\"\n          displayExpr=\"displayName\"\n          valueExpr=\"id\"\n          name=\"twainDevice\"\n          v-model=\"selectedSource\"\n        />\n        <SelectInput\n          label=\"Image Resolution\"\n          class=\"select-input\"\n          :items=\"resolutions\"\n          displayExpr=\"displayName\"\n          valueExpr=\"id\"\n          name=\"resolution\"\n          v-model=\"selectedResolution\"\n        />\n        <SelectInput\n          class=\"select-input\"\n          label=\"Image Type\"\n          v-model=\"reqImageTypeId\"\n          :items=\"imageTypes\"\n        />\n        <SelectInput\n          class=\"select-input\"\n          label=\"Use Feeder\"\n          :items=\"booleanOptions\"\n          v-model=\"useScannerFeeder\"\n        />\n        <SelectInput\n          class=\"select-input\"\n          label=\"Double Sided\"\n          :items=\"booleanOptions\"\n          v-if=\"useScannerFeeder\"\n          v-model=\"useDuplex\"\n        />\n        <div class=\"d-flex justify-content-between\">\n          <button v-if=\"sourceList.length\" class=\"btn btn-success ml-2\" @click=\"startScan\">\n            Start Scan\n          </button>\n          <!-- <button v-if=\"imagesInBuffer\" class=\"btn btn-primary ml-2\" @click=\"handleScannedImages\">\n            Submit\n          </button>\n\n          <button v-if=\"imagesInBuffer\" @click=\"showViewer\" type=\"button\" class=\"btn btn-secondary\">\n            Open Viewer ({{ imagesInBuffer }})\n          </button> -->\n        </div>\n        <div v-if=\"scannedReqImages.length\">\n          <h3 class=\"text-center\">\n            {{ scannedReqCounts.cases }} Cases, {{ scannedReqCounts.images }} Images\n          </h3>\n          <DxGridWithSearch\n            :dataSource=\"dataSource\"\n            :columns=\"columns\"\n            :toolbar=\"toolbar\"\n            @initialized=\"initGrid\"\n          >\n            <template v-slot:caseNumber=\"{ data: { data } }\">\n              <div v-if=\"!data.caseId\">\n                <span class=\"text-danger\">{{\n                  data.errorMessage || \"Unable to read case number.\"\n                }}</span>\n              </div>\n              <div v-else>\n                <router-link\n                  v-if=\"permissions.CaseView\"\n                  :to=\"{\n                    name: 'CaseView',\n                    params: {\n                      caseId: data.caseId\n                    }\n                  }\"\n                >\n                  {{ data.caseNumber }}\n                </router-link>\n                <div v-else>{{ data.caseNumber }}</div>\n              </div>\n            </template>\n            <template v-slot:actions=\"{ data: { data } }\">\n              <div class=\"d-flex align-items-center justify-content-center\">\n                <icon-button\n                  v-tooltip.right.start=\"'View images'\"\n                  :disabled=\"!data.caseId && !getLocalImageUrl(data)\"\n                  @click=\"viewImages(data)\"\n                  class=\"ml-1 p-0 text-secondary pointer\"\n                  icon=\"eye\"\n                />\n                <icon-button\n                  v-if=\"permissions.CaseImageCreateEdit\"\n                  v-tooltip.right.start=\"'Delete images.'\"\n                  @click=\"deleteCaseImages(data)\"\n                  class=\"mx-1 p-0 text-danger pointer\"\n                  icon=\"trash-alt\"\n                />\n              </div>\n            </template>\n          </DxGridWithSearch>\n        </div>\n      </div>\n    </div>\n    <modal :status=\"isViewerOpen\" @close=\"isViewerOpen = false\">\n      <TwainImageViewer></TwainImageViewer>\n    </modal>\n  </container>\n</template>\n\n<script>\nimport { AuditLogApi, CasesApi, ImagesApi } from \"@/services\";\nimport Container from \"./common/Container.vue\";\nimport { createLogItem } from \"@/modules/helpers\";\nimport { AuditLogItems } from \"@/modules/enums\";\nimport SelectInput from \"./common/SelectInput.vue\";\nimport TWAINDriver from \"@/modules/TWAINDriver\";\nimport {\n  SCANNED_ALL_IMAGE,\n  // SCANNED_IMAGE,\n  UPLOAD_PROGRESS,\n  fromBusEvent\n} from \"@/modules/eventBus\";\nimport { startWith, map, distinctUntilChanged, filter } from \"rxjs/operators\";\nimport Dynamsoft from \"dwt\";\nimport { WEB_TWAIN_ID } from \"@/modules/constants\";\nimport ArrayStore from \"devextreme/data/array_store\";\nimport { mapState, mapGetters } from \"vuex\";\nimport { handleErrors } from \"@/modules/handleErrors\";\nimport DxGridWithSearch from \"@/components/common/DxGridWithSearch.vue\";\nimport IconButton from \"@/components/common/IconButton.vue\";\nimport TwainImageViewer from \"./common/TwainImageViewer.vue\";\nimport Modal from \"@/components/common/Modal\";\n\nexport default {\n  components: { Container, SelectInput, DxGridWithSearch, IconButton, TwainImageViewer, Modal },\n  metaInfo: {\n    title: \"Upload Req Images\",\n    titleTemplate: \"IntelliPath - %s\"\n  },\n  data() {\n    return {\n      fileNames: [],\n      totalImages: 0,\n      isViewerOpen: false,\n      uploadedImages: 0,\n      sourceList: [],\n      selectedSource: null,\n      resolutions: [\n        { id: 0, displayName: \"Use Device\" },\n        { id: 1980, displayName: \"1080 HD\" },\n        { id: 720, displayName: \"720 HD\" },\n        { id: 480, displayName: \"480 SD\" }\n      ],\n      selectedResolution: 0,\n      isLoading: false,\n      DWObject: null,\n      imageIndex: null,\n      imageTypes: [],\n      reqImageTypeId: null,\n      imagesInBuffer: 0,\n      booleanOptions: [\n        { id: 1, displayName: \"Yes\" },\n        { id: 0, displayName: \"No\" }\n      ],\n      useScannerFeeder: 1,\n      useDuplex: 0\n    };\n  },\n\n  created() {\n    if (!TWAINDriver.isLoaded && this.enableTWAINDriver) {\n      TWAINDriver.load();\n    }\n  },\n  mounted() {\n    this.getReqImageType();\n    if (this.enableTWAINDriver) {\n      this.startTwain();\n      this.$store.commit(\"applicationSettings/setUseScannerFeeder\", true);\n      this.useDuplex = this.savedDuplexScanning ? 1 : 0;\n    }\n  },\n  subscriptions() {\n    const uploadStatus$ = fromBusEvent(UPLOAD_PROGRESS).pipe(\n      filter(() => this.isLoading),\n      startWith({ loaded: 0, total: 100 }),\n      map(progressEvent => Math.round((progressEvent.loaded * 100) / progressEvent.total)),\n      distinctUntilChanged(),\n      map(progress => ({\n        width: `${progress}%`,\n        progress: progress\n      }))\n    );\n    const imageReceived$ = fromBusEvent(SCANNED_ALL_IMAGE).pipe(\n      map(data => {\n        const DWObject = Dynamsoft.DWT.GetWebTwain(WEB_TWAIN_ID);\n        const { imageId } = data;\n        this.imageIndex = DWObject.ImageIDToIndex(imageId);\n        this.imagesInBuffer = DWObject.HowManyImagesInBuffer;\n      })\n    );\n    return {\n      uploadStatus$,\n      imageReceived$\n    };\n  },\n  watch: {\n    selectedSource(nv) {\n      this.$store.commit(\"applicationSettings/setSelectedTWAINDevice\", nv);\n    },\n    selectedResolution(nv) {\n      this.$store.commit(\"applicationSettings/setSelectedResolution\", nv);\n    },\n    sourceList: {\n      deep: true,\n      handler(nv) {\n        if (nv?.length) {\n          this.selectedSource = this.$store.state.applicationSettings.selectedTWAINDevice;\n        }\n      }\n    },\n    useScannerFeeder(nv) {\n      this.$store.commit(\"applicationSettings/setUseScannerFeeder\", nv);\n    },\n    useDuplex(nv) {\n      this.$store.commit(\"applicationSettings/setScannerDuplex\", nv);\n    }\n  },\n  computed: {\n    ...mapState({\n      scannedReqImages: state => state.sessionDetails.scannedReqImages,\n      scannedReqCounts: state => state.sessionDetails.scannedReqCounts,\n      enableTWAINDriver: state => state.applicationSettings.enableTWAINDriver,\n      localImageUrls: state => state.sessionDetails.localImageUrls,\n      savedDuplexScanning: state => state.applicationSettings.useDuplexScanning\n    }),\n    ...mapGetters([\"permissions\"]),\n    dataSource() {\n      return new ArrayStore({\n        data: this.scannedReqImages\n      });\n    },\n    columns() {\n      return [\n        { caption: \"Actions\", type: \"buttons\", cellTemplate: \"actions\" },\n        { dataField: \"caseNumber\", sortIndex: 0, cellTemplate: \"caseNumber\" },\n        { dataField: \"imageCount\" },\n        {\n          dataField: \"dateUploaded\",\n          caption: \"Scanned On\",\n          dataType: \"datetime\"\n        }\n      ];\n    },\n    toolbar() {\n      return {\n        items: [\n          {\n            widget: \"dxButton\",\n            options: {\n              icon: \"fa fa-trash-alt\",\n              onClick: () => this.handleDeleteSelected(),\n              type: \"danger\"\n            },\n            visible: this.permissions.CaseImageCreateEdit\n          }\n        ]\n      };\n    }\n  },\n  methods: {\n    showViewer() {\n      this.isViewerOpen = true;\n    },\n    onSelectFile() {\n      const input = this.$refs.fileInput;\n      const files = Array.from(input.files);\n      this.fileNames = files.map(e => e.name);\n    },\n    async handleUpload() {\n      if (!this.fileNames.length) {\n        window.alert(\"Please select files to upload.\");\n        return;\n      }\n      this.resetCounter();\n      const caseNumbers = this.fileNames.map(e => this.parseFileName(e));\n      const casesData = await CasesApi.getCaseIdsByCaseNumber(caseNumbers);\n      const input = this.$refs.fileInput;\n      const files = Array.from(input.files);\n      this.totalImages = files?.length;\n      let successfulCaseNumbers = [];\n      const timer = ms => new Promise(res => setTimeout(res, ms));\n      for (const imageData of files) {\n        const caseNumber = imageData.name.replace(\".pdf\", \"\");\n        const fileCaseData = casesData.find(e => e.searchValue === this.parseFileName(caseNumber));\n        if (fileCaseData?.caseId) {\n          const imagePath = URL.createObjectURL(imageData);\n          const formData = new FormData();\n          const file = await fetch(imagePath).then(r => r.blob());\n          formData.append(`file`, file);\n          formData.append(\n            \"jsonPayload\",\n            JSON.stringify({\n              tagIds: [],\n              specimenId: null,\n              keywords: \"\",\n              printOnReport: false,\n              comment: \"\",\n              imageTypeId: this.reqImageTypeId,\n              caseId: fileCaseData.caseId\n            })\n          );\n          const response = await ImagesApi.addImage(formData);\n          if (response) {\n            this.uploadedImages++;\n            successfulCaseNumbers.push(fileCaseData.caseNumber);\n            await timer(500);\n          } else {\n            this.totalImages--;\n          }\n        } else {\n          this.totalImages--;\n        }\n      }\n      if (this.uploadedImages) {\n        window.notify(`Successfully uploaded ${this.uploadedImages} req forms.`);\n        const logItem = createLogItem({}, AuditLogItems.ChangeAccession);\n        logItem.comments = `Uploaded req images to the following cases:\\n${successfulCaseNumbers.join(\n          \"\\n\"\n        )}`;\n        AuditLogApi.insertLogMessage(logItem);\n        this.resetCounter();\n      }\n    },\n    resetCounter() {\n      this.totalImages = 0;\n      this.uploadedImages = 0;\n    },\n    parseFileName(fileName) {\n      // This will probably eventually be replaced by a lab setting\n      return fileName.replace(\".pdf\", \"\").replace(/_.+$/, \"\").replace(\"-\", \"\");\n    },\n    initGrid({ component }) {\n      this.grid = component;\n    },\n    async handleDeleteSelected() {\n      const selectedCases = this.grid.getSelectedRowsData();\n      if (!selectedCases?.length) {\n        window.notify(\"Please select images to delete.\", \"warning\");\n        return null;\n      }\n      const confirm = await window.confirm(\n        `Are you sure you want to delete images for ${selectedCases.length} cases?`\n      );\n      if (!confirm) {\n        return;\n      }\n      let imageIds = [];\n      for (const caseData of selectedCases) {\n        imageIds = [...imageIds, ...caseData.imageIds];\n      }\n      try {\n        this.isLoading = true;\n        await ImagesApi.deleteImages(imageIds);\n        window.notify(\"Images deleted.\");\n        const newCases = this.scannedReqImages.filter(\n          e => !selectedCases.map(f => f.caseId).includes(e.caseId)\n        );\n        this.$store.commit(\"sessionDetails/setScannedReqImages\", newCases);\n      } catch (error) {\n        handleErrors(error);\n      } finally {\n        this.isLoading = false;\n      }\n    },\n    async deleteCaseImages(data) {\n      if (!data?.caseId) {\n        this.$store.commit(\n          \"sessionDetails/setScannedReqImages\",\n          this.scannedReqImages.filter(e => e.fileName !== data.fileName)\n        );\n        return;\n      }\n      const confirm = await window.confirm(\n        `Are you sure you want to delete ${data.imageIds.length} images for case ${data.caseNumber}?`\n      );\n      if (!confirm) {\n        return;\n      }\n      try {\n        this.isLoading = true;\n        await ImagesApi.deleteImages(data.imageIds);\n        window.notify(`Deleted images for case ${data.caseNumber}.`);\n        this.$store.commit(\n          \"sessionDetails/setScannedReqImages\",\n          this.scannedReqImages.filter(e => e.caseId !== data.caseId)\n        );\n      } catch (error) {\n        handleErrors(error);\n      } finally {\n        this.isLoading = false;\n      }\n    },\n    async startTwain() {\n      const DWObject = Dynamsoft.DWT.GetWebTwain(WEB_TWAIN_ID);\n      if (DWObject) {\n        await this.getSources();\n      }\n      if (Number.isInteger(this.selectedTWAINDevice)) {\n        const findInList = this.sourceList.find(e => e.id === this.selectedTWAINDevice);\n        if (findInList) {\n          this.selectedSource = this.selectedTWAINDevice;\n        }\n      }\n    },\n    async startScan() {\n      try {\n        this.isLoading = true;\n        const DWObject = Dynamsoft.DWT.GetWebTwain(WEB_TWAIN_ID);\n        DWObject.RemoveAllImages();\n        await TWAINDriver.acquireImage(this.selectedSource);\n        this.handleScannedImages();\n      } catch (error) {\n        handleErrors(error);\n      } finally {\n        this.isLoading = false;\n      }\n    },\n    async getImageData(imagePath) {\n      const imageFetch = await fetch(imagePath);\n      const imageBlob = await imageFetch.blob();\n\n      return imageBlob;\n    },\n    convertToBlob(imageIndex) {\n      return new Promise((resolve, reject) => {\n        const DWObject = Dynamsoft.DWT.GetWebTwain(WEB_TWAIN_ID);\n        DWObject.ConvertToBlob(\n          [imageIndex],\n          Dynamsoft.DWT.EnumDWT_ImageType.IT_PNG,\n          resolve,\n          reject\n        );\n      });\n    },\n    saveFile(imageIndex) {\n      return new Promise((resolve, reject) => {\n        const DWObject = Dynamsoft.DWT.GetWebTwain(WEB_TWAIN_ID);\n        DWObject.SaveAsPNG(\"scannedImage.png\", imageIndex, resolve, reject);\n      });\n    },\n    async handleScannedImages() {\n      try {\n        this.isLoading = true;\n        const DWObject = Dynamsoft.DWT.GetWebTwain(WEB_TWAIN_ID);\n        const imageCount = DWObject.HowManyImagesInBuffer;\n        if (!imageCount) {\n          window.alert(\"No images found to scan.\");\n          return;\n        }\n        const formData = new FormData();\n        formData.append(\"imageTypeId\", this.reqImageTypeId);\n        let imageUrls = [];\n        for (let imageIndex = 0; imageIndex < imageCount; imageIndex++) {\n          const imageUrl = DWObject.GetImageURL(imageIndex, this.selectedResolution);\n          const file = await this.getImageData(imageUrl);\n          const fileName = `scan${imageIndex + 1}.png`;\n          formData.append(`file`, file, fileName);\n          imageUrls.push({ fileName, imageUrl });\n        }\n        await this.$store.dispatch(\"sessionDetails/addReqImageScans\", { formData, imageUrls });\n      } catch (error) {\n        handleErrors(error);\n      } finally {\n        this.isLoading = false;\n      }\n    },\n    async getReqImageType() {\n      this.imageTypes = await ImagesApi.getImageTypes();\n      const reqImageType = this.imageTypes.find(e => e.displayName.toLowerCase().includes(\"req\"));\n      this.reqImageTypeId = reqImageType?.id || null;\n    },\n    viewImages(data) {\n      let payload = data?.imageIds;\n      if (!data?.caseId) {\n        payload = this.getLocalImageUrl(data);\n      }\n      if (payload) {\n        this.$store.dispatch(\"sessionDetails/useImageFrame\", payload);\n      } else {\n        window.alert(\"Unable to load image.\");\n      }\n    },\n    async getSources() {\n      const DWObject = Dynamsoft.DWT.GetWebTwain(WEB_TWAIN_ID);\n      let tryCount = 0;\n      while (!DWObject.SourceCount && tryCount < 3) {\n        await new Promise(resolve => setTimeout(resolve, 1000));\n        tryCount++;\n      }\n      const sources = DWObject.GetSourceNames();\n      this.sourceList = sources.map((e, idx) => ({ displayName: e, id: idx }));\n      if (Number.isInteger(this.selectedTWAINDevice)) {\n        const findInList = DWObject.GetSourceNameItems(this.selectedTWAINDevice);\n        if (findInList) {\n          this.selectedSource = this.selectedTWAINDevice;\n        }\n      }\n    },\n    getLocalImageUrl({ fileName }) {\n      if (fileName) {\n        const urlData = this.localImageUrls.find(e => e.fileName === fileName);\n        if (urlData?.imageUrl) {\n          return urlData.imageUrl;\n        }\n      }\n      return \"\";\n    }\n  }\n};\n</script>\n\n<style lang=\"scss\" scoped>\n.file-names {\n  width: 10rem;\n  max-height: 50vh;\n  overflow: scroll;\n}\n.select-input {\n  max-width: 25rem;\n}\n</style>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UploadReqs.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UploadReqs.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./UploadReqs.vue?vue&type=template&id=383148cb&scoped=true&\"\nimport script from \"./UploadReqs.vue?vue&type=script&lang=js&\"\nexport * from \"./UploadReqs.vue?vue&type=script&lang=js&\"\nimport style0 from \"./UploadReqs.vue?vue&type=style&index=0&id=383148cb&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"383148cb\",\n  null\n  \n)\n\nexport default component.exports","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TwainImageViewer.vue?vue&type=style&index=0&id=2598bdc4&lang=scss&scoped=true&\"","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UploadReqs.vue?vue&type=style&index=0&id=383148cb&lang=scss&scoped=true&\""],"sourceRoot":""}