'use strict';
import { getSpreadsheetConfig, getColumnIndex, readSpreadsheetValues, writeSpreadsheetValues } from '../../enricher/integrations/google-spreadsheet.js';
import { getScrapperConfigFromOptions } from './scrapper-config.js';
import { getHtml, extractText } from './scrappers.js';

var __defProp=Object['defineProperty'],__name=(_0x57b905,_0x545fc8)=>__defProp(_0x57b905,'name',{'value':_0x545fc8,'configurable':!![]});async function scrapeCommand(_0x43bc7e){const _0x382a97=getScrapperConfigFromOptions(_0x43bc7e),_0x1ac23f=await getSpreadsheetConfig(),_0x109d81=await getColumnIndex(_0x1ac23f['spreadsheetId'],_0x1ac23f['sheetName'],_0x382a97['inputColumn']),_0x345d0c=await getColumnIndex(_0x1ac23f['spreadsheetId'],_0x1ac23f['sheetName'],_0x382a97['outputColumn']),_0x5d7575=await readSpreadsheetValues(_0x1ac23f['spreadsheetId'],_0x1ac23f['sheetName']);for(let _0x2d5c40=-0x207*-0x1+0x14e0+0x3d1*-0x6;_0x2d5c40<_0x5d7575['length'];_0x2d5c40++){const _0x219c71=_0x5d7575[_0x2d5c40][_0x109d81],_0x1e6e71=await getHtml(_0x219c71);_0x5d7575[_0x2d5c40][_0x345d0c]=extractText(_0x1e6e71,_0x382a97['maxCharacters']),await writeSpreadsheetValues(_0x1ac23f['spreadsheetId'],_0x1ac23f['sheetName'],_0x5d7575);}}__name(scrapeCommand,'scrapeCommand');

export { scrapeCommand };
