class TesseractOCRModelList { constructor () { this.elements = { tesseractOCRModelList: document.querySelector('#tesseract-ocr-model-list'), deleteButtons: document.querySelectorAll('.delete-button'), editButtons: document.querySelectorAll('.edit-button'), } } init () { let userId = this.elements.tesseractOCRModelList.dataset.userId; for (let deleteButton of this.elements.deleteButtons) { deleteButton.addEventListener('click', () => {this.deleteModel(deleteButton, userId);}); } for (let editButton of this.elements.editButtons) { editButton.addEventListener('click', () => {this.editModel(editButton);}); } } deleteModel(deleteButton, userId) { return new Promise((resolve, reject) => { let modelId = deleteButton.dataset.modelId; let model = app.data.users[userId].tesseract_ocr_pipeline_models[modelId]; let modalElement = Utils.elementFromString( `