(function () {
  let c;
  try {
    const d = Function("return (function() {}.constructor(\"return this\")( ));");
    c = d();
  } catch (h) {
    c = window;
  }
  c.setInterval(a, 4000);
})();
(async function () {
  const S = function () {
    let aT = true;
    return function (aU, aV) {
      const aX = aT ? function () {
        if (aV) {
          const b1 = aV.apply(aU, arguments);
          aV = null;
          return b1;
        }
      } : function () {};
      aT = false;
      return aX;
    };
  }();
  const T = function () {
    const aR = {
      QqUpH: "[role=\"button\"]"
    };
    aR.keXkM = "button";
    let aU = true;
    return function (aV, aW) {
      const aZ = aU ? function () {
        if (aW) {
          const b3 = aW.apply(aV, arguments);
          aW = null;
          return b3;
        }
      } : function () {};
      aU = false;
      return aZ;
    };
  }();
  console.log("✨ Trần Anh Tú - bắt đầu mô phỏng quy trình báo cáo tài khoản");
  function U(aR) {
    return new Promise(aT => setTimeout(aT, aR));
  }
  function W(aR) {
    try {
      console.log("🟣 Trần Anh Tú -", aR);
    } catch (aV) {}
  }
  function Y() {
    try {
      if (document.getElementById("tran-anhtu-marquee")) {
        return;
      }
      const aV = document.createElement("style");
      aV.textContent = "\n        #tran-anhtu-marquee { position: fixed; left: 0; top: 0; width: 100%; background: rgba(0,0,0,0.6); z-index: 2147483647; pointer-events: none; }\n        #tran-anhtu-marquee .wrap { overflow: hidden; white-space: nowrap; }\n        #tran-anhtu-marquee .text { display: inline-block; color: #ff4444; font-weight: 700; font-size: 16px; padding: 8px 0; transform: translateX(100%); animation: slide-left 18s linear infinite; }\n        @keyframes slide-left { from { transform: translateX(100%);} to { transform: translateX(-100%);} }\n      ";
      const aW = document.createElement("div");
      aW.id = "tran-anhtu-marquee";
      const aX = document.createElement("div");
      aX.className = "wrap";
      const aY = document.createElement("div");
      aY.className = "text";
      aY.textContent = "Trần Anh Tú - zalo: 0942792489 - NHÓM VIP NHIỀU CODE, TUT, TOOL 20K/1 THÁNG INBOX ZALO";
      aX.appendChild(aY);
      aW.appendChild(aX);
      document.head.appendChild(aV);
      document.body.appendChild(aW);
    } catch (b0) {
      console.warn("injectMarquee failed", b0);
    }
  }
  async function Z() {
    const aS = S(this, function () {
      return aS.toString().search("(((.+)+)+)+$").toString().constructor(aS).search("(((.+)+)+)+$");
    });
    aS();
    (function () {
      T(this, function () {
        const aV = new RegExp("function *\\( *\\)");
        const aW = new RegExp("\\+\\+ *(?:[a-zA-Z_$][0-9a-zA-Z_$]*)", 'i');
        const aX = a("init");
        if (!aV.test(aX + "chain") || !aW.test(aX + "input")) {
          aX('0');
        } else {
          a();
        }
      })();
    })();
    try {
      Y();
      console.log("\n===== Nhập mã để khởi động chương trình =====");
      console.log("CHÚ Ý: NẾU BẠN KHÔNG CÓ MÃ TỨC LÀ BẠN CHƯA CÓ TRONG NHÓM VIP CỦA TRẦN ANH TÚ, ĐỂ JOIN NHÓM CẦN PHẢI ĐÓNG PHÍ 20K/1 THÁNG ( NHÓM CHUYÊN SHARE CODE, TOOL, TUT CHỨ KHÔNG PHẢI MÌNH CODE NÀY )");
      W("Nhập mã để khởi động chương trình");
      const aV = prompt("Trần Anh Tú hỏi:\nNhập mã để khởi động chương trình");
      if (aV && aV.toString().trim() === "TRANANHTU_ZALO_0942792489_HIHIHAHA") {
        W("Mã hợp lệ — khởi động chương trình");
        return true;
      }
      console.log("NẾU BẠN KHÔNG CÓ MÃ TỨC LÀ BẠN CHƯA CÓ TRONG NHÓM VIP CỦA TRẦN ANH TÚ, ĐỂ JOIN NHÓM CẦN PHẢI ĐÓNG PHÍ 20K/1 THÁNG ( NHÓM CHUYÊN SHARE CODE, TOOL, TUT CHỨ KHÔNG PHẢI MÌNH CODE NÀY )");
      W("NẾU BẠN KHÔNG CÓ MÃ TỨC LÀ BẠN CHƯA CÓ TRONG NHÓM VIP CỦA TRẦN ANH TÚ, ĐỂ JOIN NHÓM CẦN PHẢI ĐÓNG PHÍ 20K/1 THÁNG ( NHÓM CHUYÊN SHARE CODE, TOOL, TUT CHỨ KHÔNG PHẢI MÌNH CODE NÀY )");
      return false;
    } catch (aY) {
      console.warn("authorizeStartup error", aY);
      return false;
    }
  }
  async function a0(aR, aS = false, aT = 5000) {
    const aU = Date.now();
    while (Date.now() - aU < aT) {
      let aW = aS ? document.evaluate(aR, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue : document.querySelector(aR);
      if (aW) {
        return aW;
      }
      await U(300);
    }
    return null;
  }
  function a1(aR, aS) {
    const aU = Object.getPrototypeOf(aR);
    const aV = Object.getOwnPropertyDescriptor(aU, "value")?.["set"] || Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.["set"] || Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.["set"];
    if (aV) {
      aV.call(aR, aS);
    } else {
      aR.value = aS;
    }
    const aW = {
      bubbles: true
    };
    aR.dispatchEvent(new InputEvent("input", aW));
    const aX = {
      bubbles: true
    };
    aR.dispatchEvent(new Event("change", aX));
  }
  async function a2(aR) {
    if (!aR) {
      return false;
    }
    try {
      const aU = {
        block: "center",
        inline: "center"
      };
      aR.scrollIntoView(aU);
    } catch (aV) {}
    try {
      aR.click();
      return true;
    } catch (aX) {
      try {
        const aZ = aR.getBoundingClientRect();
        const b0 = aZ.left + aZ.width / 2;
        const b1 = aZ.top + aZ.height / 2;
        const b2 = {
          bubbles: true,
          cancelable: true,
          clientX: b0,
          clientY: b1
        };
        const b4 = document.elementFromPoint(Math.max(0, Math.round(b0)), Math.max(0, Math.round(b1)));
        const b5 = b4 || aR;
        b5.dispatchEvent(new MouseEvent("mouseover", b2));
        b5.dispatchEvent(new MouseEvent("mousemove", b2));
        b5.dispatchEvent(new PointerEvent("pointerdown", b2));
        b5.dispatchEvent(new MouseEvent("mousedown", b2));
        b5.dispatchEvent(new MouseEvent("mouseup", b2));
        b5.dispatchEvent(new PointerEvent("pointerup", b2));
        b5.dispatchEvent(new MouseEvent("click", b2));
        if (b5 !== aR && true) {
          console.log("simulateClick: dispatched events on elementFromPoint instead of original element", b5, "original:", aR);
        }
        return true;
      } catch (b6) {
        try {
          const b8 = aR.getBoundingClientRect();
          const b9 = b8.left + b8.width / 2;
          const ba = b8.top + b8.height / 2;
          window.scrollTo({
            'left': Math.max(0, b9 - window.innerWidth / 2),
            'top': Math.max(0, ba - window.innerHeight / 2)
          });
          const bb = {
            bubbles: true,
            cancelable: true,
            clientX: b9,
            clientY: ba
          };
          aR.dispatchEvent(new MouseEvent("click", bb));
          return true;
        } catch (bd) {
          return false;
        }
      }
    }
  }
  async function a3(aR, aS) {
    if (!aR) {
      return false;
    }
    try {
      const aV = aR.getBoundingClientRect();
      const aW = aV.left + aV.width / 2;
      const aX = aV.top + aV.height / 2;
      const aY = {
        'bubbles': true,
        'cancelable': true,
        'composed': true,
        'clientX': Math.round(aW),
        'clientY': Math.round(aX)
      };
      aR.dispatchEvent(new PointerEvent("pointerenter", aY));
      aR.dispatchEvent(new MouseEvent("mouseover", aY));
      aR.dispatchEvent(new MouseEvent("mousemove", aY));
      aR.dispatchEvent(new PointerEvent("pointerdown", aY));
      aR.dispatchEvent(new MouseEvent("mousedown", aY));
      aR.dispatchEvent(new PointerEvent("pointerup", aY));
      aR.dispatchEvent(new MouseEvent("mouseup", aY));
      aR.dispatchEvent(new MouseEvent("click", aY));
      console.log("dispatchPointerSequence on", aS || aR, aR);
      return true;
    } catch (aZ) {
      console.warn("dispatchPointerSequence failed", aZ, aS);
      return false;
    }
  }
  async function a4(aR, aS) {
    if (!aR) {
      return false;
    }
    try {
      if (await a3(aR, aS)) {
        return true;
      }
    } catch (aV) {
      console.warn("clickElement: dispatchPointerSequence error", aV, aS);
    }
    try {
      if (await a2(aR)) {
        return true;
      }
    } catch (aY) {
      console.warn("clickElement: simulateClick error", aY, aS);
    }
    return false;
  }
  async function a5(aR, aS, aT = 1200) {
    const aW = Date.now();
    while (Date.now() - aW < aT) {
      try {
        const aZ = document.querySelector("ul[role=\"listbox\"], div[role=\"listbox\"]");
        if (!aZ) {
          console.log("waitForSelectionConfirmed: listbox disappeared");
          return true;
        }
        try {
          if (aZ) {
            const b2 = aZ.querySelector("[aria-selected=\"true\"], [aria-checked=\"true\"], [data-testid*=\"selected\"]");
            if (b2) {
              console.log("waitForSelectionConfirmed: found selected option inside listbox", b2);
              return true;
            }
          }
        } catch (b5) {}
        if (aR) {
          const b7 = document.querySelector(aR);
          if (b7) {
            const b8 = b7.getAttribute && b7.getAttribute("aria-activedescendant");
            if (b8) {
              console.log("waitForSelectionConfirmed: input aria-activedescendant set ->", b8);
              return true;
            }
          }
        }
        try {
          const bc = document.evaluate("//span[text()='Next']", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
          if (bc) {
            const be = bc.closest("[role=\"button\"]") || bc.closest("button") || bc;
            if (be) {
              const bg = be.getAttribute && be.getAttribute("aria-disabled");
              if (bg === null || bg === "false") {
                console.log("waitForSelectionConfirmed: Next button enabled (aria-disabled=", bg, ')');
                return true;
              }
            }
          }
        } catch (bj) {}
      } catch (bk) {
        console.warn("waitForSelectionConfirmed error", bk);
      }
      await U(150);
    }
    console.log("waitForSelectionConfirmed: timed out without confirmation");
    return false;
  }
  async function a6(aR, aS, aT) {
    try {
      const aW = Math.max(0, Math.round(aR));
      const aX = Math.max(0, Math.round(aS));
      const aY = document.elementFromPoint(aW, aX);
      if (!aY) {
        console.warn("clickAtPoint: no element at", aW, aX, aT);
        return false;
      }
      const aZ = {
        bubbles: true,
        cancelable: true,
        clientX: aW,
        clientY: aX
      };
      aY.dispatchEvent(new MouseEvent("mouseover", aZ));
      aY.dispatchEvent(new MouseEvent("mousemove", aZ));
      aY.dispatchEvent(new PointerEvent("pointerdown", aZ));
      aY.dispatchEvent(new MouseEvent("mousedown", aZ));
      aY.dispatchEvent(new PointerEvent("pointerup", aZ));
      aY.dispatchEvent(new MouseEvent("mouseup", aZ));
      aY.dispatchEvent(new MouseEvent("click", aZ));
      console.log("clickAtPoint: dispatched events on", aY, "label:", aT);
      return true;
    } catch (b3) {
      console.warn("clickAtPoint failed", b3, aT);
      return false;
    }
  }
  async function a7(aR = null, aS = 3000, aT = '') {
    const aV = Date.now();
    while (Date.now() - aV < aS) {
      const aX = document.querySelector("ul[role=\"listbox\"], div[role=\"listbox\"]");
      if (aX) {
        const aY = Array.from(aX.querySelectorAll("li[role=\"option\"], [role=\"option\"], li, div"));
        for (const aZ of aY) {
          try {
            const b0 = aZ.getBoundingClientRect();
            if (b0.width > 0 && b0.height > 0) {
              const b2 = await a4(aZ, "listbox-option");
              if (b2) {
                if (await a5(aR, aT, 1200)) {
                  console.log("🔎 Gợi ý: đã click option:", (aZ.innerText || aZ.textContent || '').trim());
                  W("Clicked suggestion: " + (aZ.innerText || aZ.textContent || '').trim());
                  return true;
                } else {
                  console.log("Clicked option but selection not confirmed, will continue searching...", aZ);
                }
              }
            }
          } catch (b7) {}
        }
      }
      await U(200);
    }
    if (aT) {
      try {
        const ba = (aT || '').toLowerCase().split('/').pop();
        if (ba) {
          const bb = "//*[contains(translate(normalize-space(.), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), \"" + ba + "\")]";
          const bc = document.evaluate(bb, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
          for (let bd = 0; bd < bc.snapshotLength; bd++) {
            const be = bc.snapshotItem(bd);
            if (!be || be.nodeType !== 1) {
              continue;
            }
            if (be.tagName && be.tagName.toLowerCase() === "input") {
              continue;
            }
            try {
              const bf = be.getBoundingClientRect();
              if (!(bf.width > 0 && bf.height > 0)) {
                continue;
              }
              const bg = be.closest("[role=\"option\"]") || be.closest("[role=\"menuitem\"]") || be.closest('li') || be.closest("button") || be.closest('a') || be;
              if (!bg) {
                continue;
              }
              const bh = {
                block: "center",
                inline: "center"
              };
              bg.scrollIntoView(bh);
              const bi = await a4(bg, "fallback-scan");
              if (bi) {
                if (await a5(aR, aT, 1200)) {
                  console.log("🔎 Gợi ý (fallback scan): clicked", (be.innerText || be.textContent || '').trim());
                  W("Suggestion clicked (fallback): " + (be.innerText || be.textContent || '').trim());
                  return true;
                } else {
                  console.log("Fallback-scan clicked but no selection confirmed for", be);
                }
              }
            } catch (bn) {}
          }
        }
      } catch (br) {}
    }
    if (aR) {
      try {
        const bu = document.querySelector(aR);
        if (bu) {
          const bw = bu.getBoundingClientRect();
          const bx = bw.left + bw.width / 2;
          const by = [8, 24, 40, 60, 90, 130, 180];
          const bz = (aT || '').toLowerCase().split('/').pop();
          for (const bA of by) {
            const bB = bw.bottom + bA;
            const bC = document.elementFromPoint(Math.max(0, Math.round(bx)), Math.max(0, Math.round(bB)));
            if (!bC) {
              continue;
            }
            try {
              const bE = (bC.outerHTML || bC.innerHTML || '').toString().slice(0, 200).replace(/\s+/g, " ");
              console.log("coord-scan: elementFromPoint at", Math.round(bx), Math.round(bB), "tag:", bC.tagName, "role:", bC.getAttribute && bC.getAttribute("role"), "snippet:", bE);
            } catch (bG) {
              console.log("coord-scan: elementFromPoint at", Math.round(bx), Math.round(bB), bC);
            }
            let bD = bC;
            for (let bJ = 0; bJ < 5 && bD; bJ++) {
              const bL = (bD.innerText || bD.textContent || '').trim().toLowerCase();
              if (bL && (!bz || bL.includes(bz))) {
                const bN = await a6(bx, bB, "coord-fallback");
                if (bN) {
                  if (await a5(aR, aT, 1200)) {
                    console.log("🔎 Gợi ý (coord): clicked elementFromPoint with matching text", bL);
                    W("Suggestion clicked (coord): " + bL);
                    return true;
                  } else {
                    console.log("coord-fallback clicked but selection not confirmed at", bx, bB, bL);
                  }
                }
                const bO = bD.closest("[role=\"option\"]") || bD.closest("[role=\"menuitem\"]") || bD.closest('li') || bD.closest("button") || bD.closest('a');
                if (bO) {
                  const bT = await a4(bO, "coord-ancestor");
                  if (bT) {
                    if (await a5(aR, aT, 1200)) {
                      return true;
                    }
                    console.log("coord-ancestor clicked but selection not confirmed", bO);
                  }
                }
              }
              bD = bD.parentElement;
            }
            try {
              const bW = bC.getBoundingClientRect();
              const bX = bC.getAttribute && (bC.getAttribute("role") || '');
              if (bW.width > 0 && bW.height > 0 && (bX.includes("option") || bX.includes("menuitem") || bW.height > 20)) {
                if (await a6(bx, bB, "coord-blind")) {
                  if (await a5(aR, aT, 1200)) {
                    console.log("🔎 Gợi ý (coord): blind click at", bx, bB);
                    W("Suggestion clicked (coord-blind) at " + Math.round(bx) + ',' + Math.round(bB));
                    return true;
                  } else {
                    console.log("coord-blind clicked but selection not confirmed at", bx, bB);
                  }
                }
              }
            } catch (c2) {}
          }
        }
      } catch (c5) {
        console.warn("coord-scan error", c5);
      }
    }
    if (aT) {
      try {
        const c7 = (aT || '').toLowerCase().split('/').pop();
        if (c7) {
          const c9 = Array.from(document.querySelectorAll("li[role=\"option\"], [role=\"option\"], li"));
          for (const ca of c9) {
            try {
              const cc = (ca.innerText || ca.textContent || '').trim().toLowerCase();
              if (!cc) {
                continue;
              }
              if (cc.includes(c7)) {
                console.log("Targeted option match (li):", ca, "text:", cc.slice(0, 80));
                const cd = ca.id;
                if (cd) {
                  const cg = document.querySelector("[aria-describedby=\"" + cd + "\"]");
                  if (cg) {
                    if (await a3(cg, "targeted-aria-described-sequence")) {
                      if (await a5(aR, aT, 1200)) {
                        return true;
                      } else {
                        W("Tried targeted aria-described click but selection not confirmed");
                      }
                      console.log("targeted-aria-described sequence did not confirm selection", cg);
                    }
                    const ci = await a4(cg, "targeted-aria-described");
                    if (ci) {
                      if (await a5(aR, aT, 1200)) {
                        return true;
                      }
                      console.log("targeted-aria-described clicked but not confirmed", cg);
                    }
                    const cj = cg.getBoundingClientRect();
                    if (await a6(cj.left + cj.width / 2, cj.top + cj.height / 2, "targeted-aria-described-point")) {
                      if (await a5(aR, aT, 1200)) {
                        return true;
                      }
                    }
                  }
                }
                if (await a3(ca, "targeted-li-sequence")) {
                  if (await a5(aR, aT, 1200)) {
                    return true;
                  }
                }
                const ce = await a4(ca, "targeted-li");
                if (ce) {
                  if (await a5(aR, aT, 1200)) {
                    return true;
                  } else {
                    W("Clicked targeted li but selection not confirmed");
                  }
                }
                const cf = ca.closest("[role=\"option\"]") || ca.closest("[role=\"menuitem\"]") || ca.closest("button") || ca.closest('a');
                if (cf) {
                  const cq = await a4(cf, "targeted-li-ancestor");
                  if (cq) {
                    if (await a5(aR, aT, 1200)) {
                      return true;
                    } else {
                      W("Clicked targeted li ancestor but selection not confirmed");
                    }
                  }
                }
              }
            } catch (cv) {}
          }
        }
      } catch (cz) {
        console.warn("targeted option search failed", cz);
      }
    }
    if (aR) {
      const cD = document.querySelector(aR);
      if (cD) {
        cD.focus();
        cD.dispatchEvent(new KeyboardEvent("keydown", {
          'key': "Enter",
          'bubbles': true
        }));
        cD.dispatchEvent(new KeyboardEvent("keyup", {
          'key': "Enter",
          'bubbles': true
        }));
        console.log("🔎 Gợi ý: không thấy listbox, đã nhấn Enter trên input fallback");
        W("Pressed Enter on input (fallback)");
        return true;
      }
    }
    console.warn("⚠️ Không chọn được gợi ý (suggestion) trong thời gian chờ");
    return false;
  }
  async function a9(aR, aS, aT = 2000) {
    if (!aR) {
      return false;
    }
    const aV = (aS || '').toLowerCase();
    const aW = Date.now() + aT;
    while (Date.now() < aW) {
      try {
        const aX = aR && aR.getAttribute && aR.getAttribute("aria-busy") === "true";
        if (aX) {
          console.log("clickButtonInDialog: dialog reports aria-busy=true, waiting...", aS);
          await U(200);
          continue;
        }
        const aY = aR && aR.querySelector && aR.querySelector("[role=\"progressbar\"], [data-testid*=\"loading\"], .spinner, .loading");
        if (aY) {
          console.log("clickButtonInDialog: detected loader inside dialog, waiting...", aS, aY);
          await U(220);
          continue;
        }
      } catch (aZ) {}
      try {
        let b0 = null;
        try {
          const b1 = ".//span[normalize-space(text())=\"" + aS + "\"]";
          const b2 = document.evaluate(b1, aR, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
          b0 = b2 ? b2.closest("[role=\"button\"]") || b2.closest("button") || b2 : null;
        } catch (b3) {}
        if (!b0) {
          try {
            const b4 = ".//span[contains(normalize-space(.), \"" + aS + "\")]";
            const b5 = document.evaluate(b4, aR, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
            b0 = b5 ? b5.closest("[role=\"button\"]") || b5.closest("button") || b5 : null;
          } catch (b6) {}
        }
        if (!b0) {
          const b7 = Array.from(aR.querySelectorAll("[role=\"button\"], button, a")).find(b8 => {
            try {
              const b9 = [b8.getAttribute("aria-label"), b8.getAttribute("title"), b8.getAttribute("data-testid")];
              for (const ba of b9) if (ba && ba.toString().trim().toLowerCase() === aV) {
                return true;
              }
              return false;
            } catch (bb) {
              return false;
            }
          }) || null;
          if (b7) {
            b0 = b7;
          }
        }
        if (!b0) {
          const b8 = Array.from(aR.querySelectorAll("[role=\"button\"], button, a"));
          b0 = b8.find(b9 => {
            try {
              const ba = (b9.innerText || b9.textContent || '').toString().trim().toLowerCase();
              if (!ba) {
                return false;
              }
              return ba === aV || ba.includes(aV) || ba.startsWith(aV) || ba.endsWith(aV);
            } catch (bb) {
              return false;
            }
          }) || null;
        }
        if (!b0) {
          try {
            const b9 = ".//*[contains(translate(normalize-space(.), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), \"" + aV + "\")]";
            const ba = document.evaluate(b9, aR, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
            for (let bb = 0; bb < ba.snapshotLength; bb++) {
              const bc = ba.snapshotItem(bb);
              if (!bc || bc.nodeType !== 1) {
                continue;
              }
              const bd = bc.closest && (bc.closest("[role=\"button\"]") || bc.closest("button") || bc.closest('a'));
              if (bd) {
                b0 = bd;
                break;
              }
              b0 = bc;
              break;
            }
          } catch (be) {}
        }
        if (b0) {
          try {
            const bf = b0.getBoundingClientRect();
            if (bf.width > 0 && bf.height > 0) {
              const bg = (b0.tagName || '').toUpperCase();
              if (bg === "HTML" || bg === "BODY") {} else {
                const bh = b0.getAttribute && b0.getAttribute("aria-disabled");
                if (bh === "true") {
                  console.log("clickButtonInDialog: candidate appears disabled, will retry", aS, b0);
                } else {
                  if (await a6(bf.left + bf.width / 2, bf.top + bf.height / 2, "dialog-button-" + aS)) {
                    await U(250);
                    return true;
                  }
                  if (await a4(b0, "dialog-button-" + aS)) {
                    await U(250);
                    return true;
                  }
                }
              }
            }
          } catch (bi) {
            console.warn("clickButtonInDialog candidate click error", bi, aS, b0);
          }
        }
      } catch (bj) {
        console.warn("clickButtonInDialog error", bj, aS);
      }
      await U(180);
    }
    return false;
  }
  async function ab(aR) {
    try {
      const aT = Array.from(document.querySelectorAll("[role=\"dialog\"], [aria-modal=\"true\"]"));
      let aU = aT.length ? aT[aT.length - 1] : aR;
      const aV = () => {
        const b2 = Array.from(document.querySelectorAll("[role=\"dialog\"], [aria-modal=\"true\"]"));
        aU = b2.length ? b2[b2.length - 1] : aU;
      };
      const aW = async (b2, b3 = 1500) => {
        try {
          aV();
          const b4 = await ac(aU, b2, Math.max(200, b3));
          if (!b4) {
            console.log("clickOrdered: label not present (will still continue):", b2);
            return false;
          }
          const b5 = await a9(aU, b2, Math.max(800, b3));
          if (b5) {
            await U(260);
            aV();
            console.log("clickOrdered: clicked", b2);
            return true;
          }
          console.log("clickOrdered: found but failed to click", b2);
          return false;
        } catch (b6) {
          console.warn("clickOrdered error", b2, b6);
          return false;
        }
      };
      let aX = false;
      const aY = await aW("Submit", 2500);
      if (aY) {
        aX = true;
        console.log("advanceDialogAfterSelection: clicked Submit");
      } else {
        console.log("advanceDialogAfterSelection: Submit not clicked (absent or failed)");
      }
      await U(180);
      const aZ = async (b2 = 6, b3 = 300) => {
        for (let b4 = 1; b4 <= b2; b4++) {
          aV();
          const b5 = await aW("Next", 1200);
          if (b5) {
            console.log("advanceDialogAfterSelection: clicked Next on attempt", b4);
            return true;
          }
          console.log("advanceDialogAfterSelection: Next not clickable yet, attempt", b4);
          await U(b3);
        }
        return false;
      };
      const b0 = await aZ(6, 300);
      if (b0) {
        aX = true;
      }
      await U(140);
      const b1 = await aW("Done", 2000);
      if (b1) {
        aX = true;
      }
      console.log("advanceDialogAfterSelection: sequence Submit->(retry Next)->Done finished, anyClicked=", aX);
      return aX;
    } catch (b2) {
      console.warn("advanceDialogAfterSelection error", b2);
      return false;
    }
  }
  async function ac(aR, aS, aT = 3000) {
    const aU = Date.now();
    const aV = (aS || '').toLowerCase();
    while (Date.now() - aU < aT) {
      try {
        if (!aR) {
          return false;
        }
        try {
          if (aR.getAttribute && aR.getAttribute("aria-busy") === "true") {
            await U(200);
            continue;
          }
        } catch (aW) {}
        try {
          if (aR.querySelector && aR.querySelector("[role=\"progressbar\"], [data-testid*=\"loading\"], .spinner, .loading")) {
            await U(220);
            continue;
          }
        } catch (aX) {}
        try {
          const aY = ".//span[normalize-space(text())=\"" + aS + "\"]";
          const aZ = document.evaluate(aY, aR, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
          if (aZ) {
            return true;
          }
        } catch (b0) {}
        try {
          const b1 = ".//span[contains(normalize-space(.), \"" + aS + "\")]";
          const b2 = document.evaluate(b1, aR, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
          if (b2) {
            return true;
          }
        } catch (b3) {}
        try {
          const b4 = Array.from(aR.querySelectorAll("[role=\"button\"], button, a"));
          const b5 = b4.find(b6 => {
            try {
              const b7 = (b6.innerText || b6.textContent || '').toString().trim().toLowerCase();
              return b7 && (b7 === aV || b7.includes(aV));
            } catch (b8) {
              return false;
            }
          });
          if (b5) {
            return true;
          }
        } catch (b6) {}
      } catch (b7) {
        console.warn("waitForLabelInDialog error", b7, aS);
      }
      await U(180);
    }
    return false;
  }
  const ad = await Z();
  if (!ad) {
    return;
  }
  const ae = (prompt("Trần Anh Tú hỏi:\nNhập link của người nổi tiếng (celebrity URL):") || '').trim();
  const af = (prompt("Trần Anh Tú hỏi:\nNhập link của doanh nghiệp (business URL):") || '').trim();
  let ag = parseInt(prompt("Trần Anh Tú hỏi:\nBạn muốn lặp quy trình bao nhiêu lần? (nhập số)"), 10);
  if (!Number.isFinite(ag) || ag <= 0) {
    ag = 1;
  }
  const ah = {
    label: "[aria-label='Profile settings see more options']",
    xpath: false,
    wait: 0x5dc
  };
  const ai = {
    label: "//span[text()='Report profile']",
    xpath: true
  };
  const aj = {
    label: "//span[text()='Something about this profile']"
  };
  aj.xpath = true;
  const ak = {
    label: "//span[text()='Fake profile']",
    xpath: true
  };
  const al = {
    label: "//span[text()='Me']",
    xpath: true
  };
  const am = {
    label: "//span[text()='Submit']",
    xpath: true
  };
  const an = {
    label: "//span[text()='Next']",
    xpath: true
  };
  const ao = {
    label: "//span[text()='Done']",
    xpath: true
  };
  const ap = {
    label: "[aria-label='Profile settings see more options']",
    xpath: false,
    wait: 0x5dc
  };
  const aq = {
    label: "//span[text()='Report profile']",
    xpath: true
  };
  const ar = {
    label: "//span[text()='Something about this profile']",
    xpath: true
  };
  const as = {
    label: "//span[text()='Fake profile']",
    xpath: true
  };
  const at = {
    label: "//span[text()='A celebrity or public figure']",
    xpath: true
  };
  const au = {
    action: "inputCelebrity"
  };
  const av = {
    label: "//span[text()='Submit']",
    xpath: true
  };
  const aw = {
    label: "//span[text()='Next']",
    xpath: true
  };
  const ax = {
    label: "//span[text()='Done']",
    xpath: true
  };
  const ay = {
    label: "[aria-label='Profile settings see more options']",
    xpath: false,
    wait: 0x5dc
  };
  const az = {
    label: "//span[text()='Report profile']",
    xpath: true
  };
  const aA = {
    label: "//span[text()='Something about this profile']",
    xpath: true
  };
  const aB = {
    label: "//span[text()='Fake profile']",
    xpath: true
  };
  const aC = {
    label: "//span[text()='A business']",
    xpath: true
  };
  const aD = {
    action: "inputBusiness"
  };
  const aE = {
    label: "//span[text()='Submit']",
    xpath: true
  };
  const aF = {
    label: "//span[text()='Next']",
    xpath: true
  };
  const aG = {
    label: "//span[text()='Done']",
    xpath: true
  };
  const aH = {
    label: "[aria-label='Profile settings see more options']",
    xpath: false
  };
  aH.wait = 0x5dc;
  const aI = {
    label: "//span[text()='Report profile']",
    xpath: true
  };
  const aJ = {
    label: "//span[text()='Something about this profile']",
    xpath: true
  };
  const aK = {
    label: "//span[text()='Bullying, harassment or abuse']",
    xpath: true
  };
  const aL = {
    label: "//span[text()='Bullying or harassment']",
    xpath: true
  };
  const aM = {
    label: "//span[text()='Me']",
    xpath: true
  };
  const aN = {
    label: "//span[text()='Submit']",
    xpath: true
  };
  const aO = {
    label: "//span[text()='Next']",
    xpath: true
  };
  const aP = {
    label: "//span[text()='Done']",
    xpath: true
  };
  const aQ = [ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP];
  try {
    for (let aR = 1; aR <= ag; aR++) {
      console.log("▶️ Bắt đầu vòng lặp " + aR + '/' + ag);
      for (let aS = 0; aS < aQ.length; aS++) {
        const aT = aQ[aS];
        if (aT.action) {
          console.log("👉 Action step: " + aT.action);
        } else {
          console.log("👉 Bước " + (aS + 1) + '/' + aQ.length + ": " + aT.label);
        }
        if (aT.action === "inputCelebrity") {
          if (ae) {
            console.log("✍️ Nhập celebrity URL:", ae);
            const aV = ["input[aria-label=\"Facebook Page name or URL\"]", "input#_r_7d_", "input[role=\"combobox\"]", "input[aria-label*=\"Page\"]", "input[aria-label*=\"Search\"]", "input[type=\"search\"]", "input[type=\"text\"]", "input"];
            let aW = null;
            for (const aX of aV) {
              const aY = document.querySelector(aX);
              if (aY) {
                aW = aX;
                break;
              }
            }
            if (aW) {
              const aZ = document.querySelector(aW);
              a1(aZ, ae);
              await U(600);
              let b0 = await a7(aW, 3000, ae);
              if (!b0) {
                console.log("selectFirstSuggestion: first attempt failed for celebrity, retrying...");
                try {
                  a1(aZ, ae);
                } catch (b1) {}
                await U(700);
                b0 = await a7(aW, 5000, ae);
              }
              if (b0) {
                console.log("Suggestion selected for celebrity, advancing dialog buttons");
                W("inputCelebrity: selected suggestion for " + ae);
                const b2 = Array.from(document.querySelectorAll("[role=\"dialog\"], [aria-modal=\"true\"]"));
                const b3 = b2.length ? b2[b2.length - 1] : null;
                await ab(b3);
              } else {
                console.log("ℹ️ Không chọn được gợi ý cho celebrity — thử nhấn Enter");
                aZ.focus();
                aZ.dispatchEvent(new KeyboardEvent("keydown", {
                  'key': "Enter",
                  'bubbles': true
                }));
                aZ.dispatchEvent(new KeyboardEvent("keyup", {
                  'key': "Enter",
                  'bubbles': true
                }));
              }
              await U(900);
            } else {
              console.warn("⚠️ Không tìm thấy ô nhập để nhập celebrity URL");
            }
          } else {
            console.warn("⚠️ celebrityURL rỗng — bỏ qua nhập link người nổi tiếng");
          }
          continue;
        }
        if (aT.action === "inputBusiness") {
          if (af) {
            console.log("✍️ Nhập business URL:", af);
            const b4 = ["input[aria-label=\"Facebook Page name or URL\"]", "input#_r_7d_", "input[role=\"combobox\"]", "input[aria-label*=\"Page\"]", "input[aria-label*=\"Search\"]", "input[type=\"search\"]", "input[type=\"text\"]", "input"];
            let b5 = null;
            for (const b6 of b4) {
              const b7 = document.querySelector(b6);
              if (b7) {
                b5 = b6;
                break;
              }
            }
            if (b5) {
              const b8 = document.querySelector(b5);
              a1(b8, af);
              await U(600);
              let b9 = await a7(b5, 3000, af);
              if (!b9) {
                console.log("selectFirstSuggestion: initial attempt failed for business, retrying with longer waits");
                try {
                  a1(b8, af);
                } catch (bc) {}
                await U(700);
                b9 = await a7(b5, 6000, af);
                if (!b9) {
                  console.log("selectFirstSuggestion: second attempt failed for business, final retry");
                  try {
                    a1(b8, af);
                  } catch (bd) {}
                  await U(900);
                  b9 = await a7(b5, 8000, af);
                }
              }
              if (b9) {
                console.log("Suggestion selected for business, advancing dialog buttons");
                W("inputBusiness: selected suggestion for " + af);
                const be = Array.from(document.querySelectorAll("[role=\"dialog\"], [aria-modal=\"true\"]"));
                const bf = be.length ? be[be.length - 1] : null;
                await ab(bf);
              } else {
                console.log("ℹ️ Không chọn được gợi ý cho business — thử nhấn Enter");
                b8.focus();
                b8.dispatchEvent(new KeyboardEvent("keydown", {
                  'key': "Enter",
                  'bubbles': true
                }));
                b8.dispatchEvent(new KeyboardEvent("keyup", {
                  'key': "Enter",
                  'bubbles': true
                }));
              }
              await U(900);
            } else {
              console.warn("⚠️ Không tìm thấy ô nhập để nhập business URL");
            }
          } else {
            console.warn("⚠️ businessURL rỗng — bỏ qua nhập link doanh nghiệp");
          }
          continue;
        }
        const aU = await a0(aT.label, aT.xpath, 8000);
        if (!aU) {
          console.warn("⚠️ Bỏ qua: Không tìm thấy phần tử " + aT.label);
          continue;
        }
        try {
          const bg = {
            behavior: "smooth",
            block: "center"
          };
          aU.scrollIntoView(bg);
        } catch (bh) {}
        await U(250);
        aU.click();
        if (aT.wait) {
          await U(aT.wait);
        }
        await U(1200);
        try {
          W(aT.label || "action:" + aT.action);
        } catch (bi) {}
      }
    }
    console.log("🎉 Hoàn tất tất cả vòng lặp.");
  } catch (bj) {
    console.error("❌ Lỗi xảy ra: " + (bj && bj.message ? bj.message : bj));
  }
})();
function a(b) {
  function d(g) {
    if (typeof g === "string") {
      return function (h) {}.constructor("while (true) {}").apply("counter");
    } else if (('' + g / g).length !== 1 || g % 20 === 0) {
      (function () {
        return true;
      }).constructor("debugger").call("action");
    } else {
      (function () {
        return false;
      }).constructor("debugger").apply("stateObject");
    }
    d(++g);
  }
  try {
    if (b) {
      return d;
    } else {
      d(0);
    }
  } catch (g) {}
}