"script":"(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'SEARCH'};const rows0=Array.from(document.querySelectorAll('table tbody tr')).filter(r=>r.offsetParent!==null);R.initialRowCount=rows0.length;if(rows0.length===0){R.warn='테이블에 데이터 없음 - 검색 테스트 불가';R.ok=true;return JSON.stringify(R);}const cells=rows0[0].querySelectorAll('td');let keyword='';for(let i=1;i<cells.length&&i<5;i++){ const t=cells[i]?.innerText?.trim(); if(t&&t.length>=2&&t.length<=20&&!/^\\d+$/.test(t)&&!/^\\d{4}[-/]/.test(t)){keyword=t;break;}}if(!keyword&&cells[0]){keyword=cells[0]?.innerText?.trim().substring(0,10);}R.keyword=keyword;if(!keyword||keyword.length<2){R.warn='검색 가능한 키워드 추출 실패';R.ok=true;return JSON.stringify(R);}const searchInput=document.querySelector('input[placeholder*=\"검색\"]')||document.querySelector('input[type=\"search\"]')||document.querySelector('input[role=\"searchbox\"]');R.hasSearchInput=!!searchInput;if(!searchInput){R.warn='검색 입력란 없음';R.ok=true;return JSON.stringify(R);}R.placeholder=searchInput.placeholder||'';searchInput.focus();await w(200);const nativeSetter=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value')?.set;if(nativeSetter)nativeSetter.call(searchInput,keyword);else searchInput.value=keyword;searchInput.dispatchEvent(new Event('input',{bubbles:true}));searchInput.dispatchEvent(new Event('change',{bubbles:true}));searchInput.dispatchEvent(new KeyboardEvent('keydown',{key:'Enter',code:'Enter',keyCode:13,bubbles:true}));searchInput.dispatchEvent(new KeyboardEvent('keyup',{key:'Enter',code:'Enter',keyCode:13,bubbles:true}));await w(2000);const rows1=Array.from(document.querySelectorAll('table tbody tr')).filter(r=>r.offsetParent!==null);R.afterSearchRowCount=rows1.length;const matchingRows=rows1.filter(r=>r.innerText?.includes(keyword));R.matchingRowCount=matchingRows.length;R.allMatch=rows1.length>0&&matchingRows.length===rows1.length;R.filtered=R.afterSearchRowCount<=R.initialRowCount;if(R.afterSearchRowCount===R.initialRowCount&&R.initialRowCount>1){ R.filterWorked=R.allMatch; if(!R.allMatch)R.info='검색 후 행 수 동일 - 모든 행이 키워드 포함 또는 검색 미동작';}else if(R.afterSearchRowCount<R.initialRowCount){ R.filterWorked=true; R.info='검색 필터링 동작 확인 ('+R.initialRowCount+'→'+R.afterSearchRowCount+'행)';}else if(R.afterSearchRowCount===0){ R.filterWorked=false; R.warn='⚠️ 검색 후 결과 0건 - 기존 데이터의 키워드인데 결과 없음';}R.ok=R.filterWorked!==false;return JSON.stringify(R);})()",
"script":"(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'SEARCH'};const rows0=Array.from(document.querySelectorAll('table tbody tr')).filter(r=>r.offsetParent!==null);R.initialRowCount=rows0.length;if(rows0.length===0){R.warn='테이블에 데이터 없음 - 검색 테스트 불가';R.ok=true;return JSON.stringify(R);}const cells=rows0[0].querySelectorAll('td');let keyword='';for(let i=1;i<cells.length&&i<5;i++){ const t=cells[i]?.innerText?.trim(); if(t&&t.length>=2&&t.length<=20&&!/^\\d+$/.test(t)&&!/^\\d{4}[-/]/.test(t)){keyword=t;break;}}if(!keyword&&cells[0]){keyword=cells[0]?.innerText?.trim().substring(0,10);}R.keyword=keyword;if(!keyword||keyword.length<2){R.warn='검색 가능한 키워드 추출 실패';R.ok=true;return JSON.stringify(R);}const searchInput=document.querySelector('input[placeholder*=\"검색\"]')||document.querySelector('input[type=\"search\"]')||document.querySelector('input[role=\"searchbox\"]');R.hasSearchInput=!!searchInput;if(!searchInput){R.warn='검색 입력란 없음';R.ok=true;return JSON.stringify(R);}R.placeholder=searchInput.placeholder||'';searchInput.focus();await w(200);const nativeSetter=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value')?.set;if(nativeSetter)nativeSetter.call(searchInput,keyword);else searchInput.value=keyword;searchInput.dispatchEvent(new Event('input',{bubbles:true}));searchInput.dispatchEvent(new Event('change',{bubbles:true}));searchInput.dispatchEvent(new KeyboardEvent('keydown',{key:'Enter',code:'Enter',keyCode:13,bubbles:true}));searchInput.dispatchEvent(new KeyboardEvent('keyup',{key:'Enter',code:'Enter',keyCode:13,bubbles:true}));await w(2000);const rows1=Array.from(document.querySelectorAll('table tbody tr')).filter(r=>r.offsetParent!==null);R.afterSearchRowCount=rows1.length;const matchingRows=rows1.filter(r=>r.innerText?.includes(keyword));R.matchingRowCount=matchingRows.length;R.allMatch=rows1.length>0&&matchingRows.length===rows1.length;R.filtered=R.afterSearchRowCount<=R.initialRowCount;if(R.afterSearchRowCount===R.initialRowCount&&R.initialRowCount>1){ R.filterWorked=R.allMatch; if(!R.allMatch)R.info='검색 후 행 수 동일 - 모든 행이 키워드 포함 또는 검색 미동작';}else if(R.afterSearchRowCount<R.initialRowCount){ R.filterWorked=true; R.info='검색 필터링 동작 확인 ('+R.initialRowCount+'→'+R.afterSearchRowCount+'행)';}else if(R.afterSearchRowCount===0){ R.filterWorked=false; R.warn='⚠️ 검색 후 결과 0건 - 기존 데이터의 키워드인데 결과 없음';}R.ok=R.filterWorked!==false;return JSON.stringify(R);})()",