Best JavaScript code snippet using playwright-internal
vue.js
Source:vue.js
...1771 if (_.resolveAsset(options, 'components', tag)) {1772 // custom element component1773 return tag1774 } else {1775 var exp = hasAttrs && checkComponentAttribute(el)1776 /* istanbul ignore if */1777 if (exp) return exp1778 if (true) {1779 if (tag.indexOf('-') > -1 ||1780 /HTMLUnknownElement/.test(Object.prototype.toString.call(el))) {1781 _.warn(1782 'Unknown custom element: <' + tag + '> - did you ' +1783 'register the component correctly?'1784 )1785 }1786 }1787 }1788 } else if (hasAttrs) {1789 return checkComponentAttribute(el)1790 }1791 }1792 /**1793 * Check possible component denoting attributes, e.g.1794 * is, bind-is and v-component.1795 *1796 * @param {Elemnent} el1797 * @return {String|null}1798 */1799 function checkComponentAttribute (el) {1800 var exp1801 /* eslint-disable no-cond-assign */1802 if (exp = _.attr(el, 'component')) {1803 /* eslint-enable no-cond-assign */...
injectedScriptSource.js
Source:injectedScriptSource.js
1var pwExport2;(() => {3 'use strict'4 var e = {5 204: (e, t) => {6 Object.defineProperty(t, '__esModule', { value: !0 }),7 (t.checkComponentAttribute = function (e, t) {8 for (const n of t.jsonPath) null != e && (e = e[n])9 const n =10 'string' != typeof e || t.caseSensetive ? e : e.toUpperCase(),11 r =12 'string' != typeof t.value || t.caseSensetive13 ? t.value14 : t.value.toUpperCase()15 return '<truthy>' === t.op16 ? !!n17 : '=' === t.op18 ? n === r19 : 'string' == typeof n &&20 'string' == typeof r &&21 ('*=' === t.op22 ? n.includes(r)23 : '^=' === t.op24 ? n.startsWith(r)25 : '$=' === t.op26 ? n.endsWith(r)27 : '|=' === t.op28 ? n === r || n.startsWith(r + '-')29 : '~=' === t.op && n.split(' ').includes(r))30 }),31 (t.parseComponentSelector = function (e) {32 let t = 0,33 n = 0 === e.length34 const r = () => e[t] || '',35 o = () => {36 const o = r()37 return ++t, (n = t >= e.length), o38 },39 i = (o) => {40 if (n)41 throw new Error(42 `Unexpected end of selector while parsing selector \`${e}\``43 )44 throw new Error(45 `Error while parsing selector \`${e}\` - unexpected symbol "${r()}" at position ${t}` +46 (o ? ' during ' + o : '')47 )48 }49 function s() {50 for (; !n && /\s/.test(r()); ) o()51 }52 function c() {53 let e = ''54 for (s(); !n && /[-$0-9A-Z_]/i.test(r()); ) e += o()55 return e56 }57 function a(e) {58 let t = o()59 for (t !== e && i('parsing quoted string'); !n && r() !== e; )60 '\\' === r() && o(), (t += o())61 return r() !== e && i('parsing quoted string'), (t += o()), t62 }63 function u() {64 let e = ''65 return (66 s(),67 (e = "'" === r() || '"' === r() ? a(r()).slice(1, -1) : c()),68 e || i('parsing property path'),69 e70 )71 }72 function l() {73 o()74 const t = []75 for (t.push(u()), s(); '.' === r(); ) o(), t.push(u()), s()76 if (']' === r())77 return (78 o(),79 {80 jsonPath: t,81 op: '<truthy>',82 value: null,83 caseSensetive: !184 }85 )86 const c = (function () {87 s()88 let e = ''89 return (90 n || (e += o()),91 n || '=' === e || (e += o()),92 ['=', '*=', '^=', '$=', '|=', '~='].includes(e) ||93 i('parsing operator'),94 e95 )96 })()97 let l,98 h = !099 if ((s(), "'" === r() || '"' === r()))100 (l = a(r()).slice(1, -1)),101 s(),102 'i' === r() || 'I' === r()103 ? ((h = !1), o())104 : ('s' !== r() && 'S' !== r()) || ((h = !0), o())105 else {106 for (l = ''; !n && !/\s/.test(r()) && ']' !== r(); ) l += o()107 'true' === l108 ? (l = !0)109 : 'false' === l110 ? (l = !1)111 : ((l = +l), isNaN(l) && i('parsing attribute value'))112 }113 if (114 (s(),115 ']' !== r() && i('parsing attribute value'),116 o(),117 '=' !== c && 'string' != typeof l)118 )119 throw new Error(120 `Error while parsing selector \`${e}\` - cannot use ${c} in attribute with non-string matching value - ${l}`121 )122 return { jsonPath: t, op: c, value: l, caseSensetive: h }123 }124 const h = { name: '', attributes: [] }125 for (h.name = c(), s(); '[' === r(); ) h.attributes.push(l()), s()126 if ((n || i(void 0), !h.name && !h.attributes.length))127 throw new Error(128 `Error while parsing selector \`${e}\` - selector cannot be empty`129 )130 return h131 })132 },133 317: (e, t, n) => {134 Object.defineProperty(t, '__esModule', { value: !0 }),135 (t.parseCSS = function (e, t) {136 let n137 try {138 ;(n = r.tokenize(e)),139 n[n.length - 1] instanceof r.EOFToken ||140 n.push(new r.EOFToken())141 } catch (t) {142 const n = t.message + ` while parsing selector "${e}"`,143 r = (t.stack || '').indexOf(t.message)144 throw (145 (-1 !== r &&146 (t.stack =147 t.stack.substring(0, r) +148 n +149 t.stack.substring(r + t.message.length)),150 (t.message = n),151 t)152 )153 }154 const o = n.find(155 (e) =>156 e instanceof r.AtKeywordToken ||157 e instanceof r.BadStringToken ||158 e instanceof r.BadURLToken ||159 e instanceof r.ColumnToken ||160 e instanceof r.CDOToken ||161 e instanceof r.CDCToken ||162 e instanceof r.SemicolonToken ||163 e instanceof r.OpenCurlyToken ||164 e instanceof r.CloseCurlyToken ||165 e instanceof r.URLToken ||166 e instanceof r.PercentageToken167 )168 if (o)169 throw new Error(170 `Unsupported token "${o.toSource()}" while parsing selector "${e}"`171 )172 let i = 0173 const s = new Set()174 function c() {175 return new Error(176 `Unexpected token "${n[177 i178 ].toSource()}" while parsing selector "${e}"`179 )180 }181 function a() {182 for (; n[i] instanceof r.WhitespaceToken; ) i++183 }184 function u(e = i) {185 return n[e] instanceof r.IdentToken186 }187 function l(e = i) {188 return n[e] instanceof r.CommaToken189 }190 function h(e = i) {191 return n[e] instanceof r.CloseParenToken192 }193 function p(e = i) {194 return n[e] instanceof r.DelimToken && '*' === n[e].value195 }196 function f(e = i) {197 return n[e] instanceof r.EOFToken198 }199 function d(e = i) {200 return (201 n[e] instanceof r.DelimToken &&202 ['>', '+', '~'].includes(n[e].value)203 )204 }205 function m(e = i) {206 return (207 l(e) ||208 h(e) ||209 f(e) ||210 d(e) ||211 n[e] instanceof r.WhitespaceToken212 )213 }214 function g() {215 const e = [y()]216 for (; a(), l(); ) i++, e.push(y())217 return e218 }219 function y() {220 return (221 a(),222 (function (e = i) {223 return n[e] instanceof r.NumberToken224 })() ||225 (function (e = i) {226 return n[e] instanceof r.StringToken227 })()228 ? n[i++].value229 : (function () {230 const e = { simples: [] }231 for (232 a(),233 d()234 ? e.simples.push({235 selector: {236 functions: [{ name: 'scope', args: [] }]237 },238 combinator: ''239 })240 : e.simples.push({ selector: v(), combinator: '' });241 ;242 ) {243 if ((a(), d()))244 (e.simples[e.simples.length - 1].combinator =245 n[i++].value),246 a()247 else if (m()) break248 e.simples.push({ combinator: '', selector: v() })249 }250 return e251 })()252 )253 }254 function v() {255 let e = ''256 const o = []257 for (; !m(); )258 if (u() || p()) e += n[i++].toSource()259 else if (n[i] instanceof r.HashToken) e += n[i++].toSource()260 else if (n[i] instanceof r.DelimToken && '.' === n[i].value) {261 if ((i++, !u())) throw c()262 e += '.' + n[i++].toSource()263 } else if (n[i] instanceof r.ColonToken)264 if ((i++, u()))265 if (t.has(n[i].value.toLowerCase())) {266 const e = n[i++].value.toLowerCase()267 o.push({ name: e, args: [] }), s.add(e)268 } else e += ':' + n[i++].toSource()269 else {270 if (!(n[i] instanceof r.FunctionToken)) throw c()271 {272 const r = n[i++].value.toLowerCase()273 if (274 (t.has(r)275 ? (o.push({ name: r, args: g() }), s.add(r))276 : (e += `:${r}(${w()})`),277 a(),278 !h())279 )280 throw c()281 i++282 }283 }284 else {285 if (!(n[i] instanceof r.OpenSquareToken)) throw c()286 for (287 e += '[', i++;288 !(n[i] instanceof r.CloseSquareToken || f());289 )290 e += n[i++].toSource()291 if (!(n[i] instanceof r.CloseSquareToken)) throw c()292 ;(e += ']'), i++293 }294 if (!e && !o.length) throw c()295 return { css: e || void 0, functions: o }296 }297 function w() {298 let e = ''299 for (; !h() && !f(); ) e += n[i++].toSource()300 return e301 }302 const b = g()303 if (!f()) throw new Error(`Error while parsing selector "${e}"`)304 if (b.some((e) => 'object' != typeof e || !('simples' in e)))305 throw new Error(`Error while parsing selector "${e}"`)306 return { selector: b, names: Array.from(s) }307 }),308 (t.serializeSelector = function e(t) {309 return t310 .map((t) =>311 'string' == typeof t312 ? `"${t}"`313 : 'number' == typeof t314 ? String(t)315 : t.simples316 .map(({ selector: t, combinator: n }) => {317 let r = t.css || ''318 return (319 (r += t.functions320 .map((t) => `:${t.name}(${e(t.args)})`)321 .join('')),322 n && (r += ' ' + n),323 r324 )325 })326 .join(' ')327 )328 .join(', ')329 })330 var r = (function (e, t) {331 if (e && e.__esModule) return e332 if (null === e || ('object' != typeof e && 'function' != typeof e))333 return { default: e }334 var n = o(t)335 if (n && n.has(e)) return n.get(e)336 var r = {},337 i = Object.defineProperty && Object.getOwnPropertyDescriptor338 for (var s in e)339 if ('default' !== s && Object.prototype.hasOwnProperty.call(e, s)) {340 var c = i ? Object.getOwnPropertyDescriptor(e, s) : null341 c && (c.get || c.set)342 ? Object.defineProperty(r, s, c)343 : (r[s] = e[s])344 }345 return (r.default = e), n && n.set(e, r), r346 })(n(503))347 function o(e) {348 if ('function' != typeof WeakMap) return null349 var t = new WeakMap(),350 n = new WeakMap()351 return (o = function (e) {352 return e ? n : t353 })(e)354 }355 },356 503: (e, t) => {357 var n, r358 ;(n = function (e) {359 var t = function (e, t, n) {360 return e >= t && e <= n361 }362 function n(e) {363 return t(e, 48, 57)364 }365 function r(e) {366 return n(e) || t(e, 65, 70) || t(e, 97, 102)367 }368 function o(e) {369 return (370 (function (e) {371 return t(e, 65, 90)372 })(e) ||373 (function (e) {374 return t(e, 97, 122)375 })(e)376 )377 }378 function i(e) {379 return (380 o(e) ||381 (function (e) {382 return e >= 128383 })(e) ||384 95 == e385 )386 }387 function s(e) {388 return i(e) || n(e) || 45 == e389 }390 function c(e) {391 return t(e, 0, 8) || 11 == e || t(e, 14, 31) || 127 == e392 }393 function a(e) {394 return 10 == e395 }396 function u(e) {397 return a(e) || 9 == e || 32 == e398 }399 var l = function (e) {400 this.message = e401 }402 function h(e) {403 if (e <= 65535) return String.fromCharCode(e)404 e -= Math.pow(2, 16)405 var t = Math.floor(e / Math.pow(2, 10)) + 55296,406 n = (e % Math.pow(2, 10)) + 56320407 return String.fromCharCode(t) + String.fromCharCode(n)408 }409 function p() {410 throw 'Abstract Base Class'411 }412 function f() {413 return this414 }415 function d() {416 return this417 }418 function m() {419 return this420 }421 function g() {422 return this423 }424 function y() {425 return this426 }427 function v() {428 return this429 }430 function w() {431 return this432 }433 function b() {434 return this435 }436 function E() {437 throw 'Abstract Base Class'438 }439 function _() {440 return (this.value = '{'), (this.mirror = '}'), this441 }442 function S() {443 return (this.value = '}'), (this.mirror = '{'), this444 }445 function T() {446 return (this.value = '['), (this.mirror = ']'), this447 }448 function k() {449 return (this.value = ']'), (this.mirror = '['), this450 }451 function N() {452 return (this.value = '('), (this.mirror = ')'), this453 }454 function x() {455 return (this.value = ')'), (this.mirror = '('), this456 }457 function C() {458 return this459 }460 function A() {461 return this462 }463 function O() {464 return this465 }466 function M() {467 return this468 }469 function $() {470 return this471 }472 function R() {473 return this474 }475 function j() {476 return this477 }478 function L(e) {479 return (this.value = h(e)), this480 }481 function P() {482 throw 'Abstract Base Class'483 }484 function q(e) {485 this.value = e486 }487 function D(e) {488 ;(this.value = e), (this.mirror = ')')489 }490 function I(e) {491 this.value = e492 }493 function U(e) {494 ;(this.value = e), (this.type = 'unrestricted')495 }496 function W(e) {497 this.value = e498 }499 function F(e) {500 this.value = e501 }502 function B() {503 ;(this.value = null), (this.type = 'integer'), (this.repr = '')504 }505 function z() {506 ;(this.value = null), (this.repr = '')507 }508 function V() {509 ;(this.value = null),510 (this.type = 'integer'),511 (this.repr = ''),512 (this.unit = '')513 }514 function H(e) {515 for (516 var n = '', r = (e = '' + e).charCodeAt(0), o = 0;517 o < e.length;518 o++519 ) {520 var i = e.charCodeAt(o)521 if (0 == i)522 throw new l('Invalid character: the input contains U+0000.')523 t(i, 1, 31) ||524 127 == i ||525 (0 == o && t(i, 48, 57)) ||526 (1 == o && t(i, 48, 57) && 45 == r)527 ? (n += '\\' + i.toString(16) + ' ')528 : i >= 128 ||529 45 == i ||530 95 == i ||531 t(i, 48, 57) ||532 t(i, 65, 90) ||533 t(i, 97, 122)534 ? (n += e[o])535 : (n += '\\' + e[o])536 }537 return n538 }539 function G(e) {540 e = '' + e541 for (var n = '', r = 0; r < e.length; r++) {542 var o = e.charCodeAt(r)543 if (0 == o)544 throw new l('Invalid character: the input contains U+0000.')545 t(o, 1, 31) || 127 == o546 ? (n += '\\' + o.toString(16) + ' ')547 : (n += 34 == o || 92 == o ? '\\' + e[r] : e[r])548 }549 return n550 }551 ;((l.prototype = new Error()).name = 'InvalidCharacterError'),552 (p.prototype.toJSON = function () {553 return { token: this.tokenType }554 }),555 (p.prototype.toString = function () {556 return this.tokenType557 }),558 (p.prototype.toSource = function () {559 return '' + this560 }),561 (f.prototype = Object.create(p.prototype)),562 (f.prototype.tokenType = 'BADSTRING'),563 (d.prototype = Object.create(p.prototype)),564 (d.prototype.tokenType = 'BADURL'),565 (m.prototype = Object.create(p.prototype)),566 (m.prototype.tokenType = 'WHITESPACE'),567 (m.prototype.toString = function () {568 return 'WS'569 }),570 (m.prototype.toSource = function () {571 return ' '572 }),573 (g.prototype = Object.create(p.prototype)),574 (g.prototype.tokenType = 'CDO'),575 (g.prototype.toSource = function () {576 return '\x3c!--'577 }),578 (y.prototype = Object.create(p.prototype)),579 (y.prototype.tokenType = 'CDC'),580 (y.prototype.toSource = function () {581 return '--\x3e'582 }),583 (v.prototype = Object.create(p.prototype)),584 (v.prototype.tokenType = ':'),585 (w.prototype = Object.create(p.prototype)),586 (w.prototype.tokenType = ';'),587 (b.prototype = Object.create(p.prototype)),588 (b.prototype.tokenType = ','),589 (E.prototype = Object.create(p.prototype)),590 (_.prototype = Object.create(E.prototype)),591 (_.prototype.tokenType = '{'),592 (S.prototype = Object.create(E.prototype)),593 (S.prototype.tokenType = '}'),594 (T.prototype = Object.create(E.prototype)),595 (T.prototype.tokenType = '['),596 (k.prototype = Object.create(E.prototype)),597 (k.prototype.tokenType = ']'),598 (N.prototype = Object.create(E.prototype)),599 (N.prototype.tokenType = '('),600 (x.prototype = Object.create(E.prototype)),601 (x.prototype.tokenType = ')'),602 (C.prototype = Object.create(p.prototype)),603 (C.prototype.tokenType = '~='),604 (A.prototype = Object.create(p.prototype)),605 (A.prototype.tokenType = '|='),606 (O.prototype = Object.create(p.prototype)),607 (O.prototype.tokenType = '^='),608 (M.prototype = Object.create(p.prototype)),609 (M.prototype.tokenType = '$='),610 ($.prototype = Object.create(p.prototype)),611 ($.prototype.tokenType = '*='),612 (R.prototype = Object.create(p.prototype)),613 (R.prototype.tokenType = '||'),614 (j.prototype = Object.create(p.prototype)),615 (j.prototype.tokenType = 'EOF'),616 (j.prototype.toSource = function () {617 return ''618 }),619 (L.prototype = Object.create(p.prototype)),620 (L.prototype.tokenType = 'DELIM'),621 (L.prototype.toString = function () {622 return 'DELIM(' + this.value + ')'623 }),624 (L.prototype.toJSON = function () {625 var e =626 this.constructor.prototype.constructor.prototype.toJSON.call(627 this628 )629 return (e.value = this.value), e630 }),631 (L.prototype.toSource = function () {632 return '\\' == this.value ? '\\\n' : this.value633 }),634 (P.prototype = Object.create(p.prototype)),635 (P.prototype.ASCIIMatch = function (e) {636 return this.value.toLowerCase() == e.toLowerCase()637 }),638 (P.prototype.toJSON = function () {639 var e =640 this.constructor.prototype.constructor.prototype.toJSON.call(641 this642 )643 return (e.value = this.value), e644 }),645 (q.prototype = Object.create(P.prototype)),646 (q.prototype.tokenType = 'IDENT'),647 (q.prototype.toString = function () {648 return 'IDENT(' + this.value + ')'649 }),650 (q.prototype.toSource = function () {651 return H(this.value)652 }),653 (D.prototype = Object.create(P.prototype)),654 (D.prototype.tokenType = 'FUNCTION'),655 (D.prototype.toString = function () {656 return 'FUNCTION(' + this.value + ')'657 }),658 (D.prototype.toSource = function () {659 return H(this.value) + '('660 }),661 (I.prototype = Object.create(P.prototype)),662 (I.prototype.tokenType = 'AT-KEYWORD'),663 (I.prototype.toString = function () {664 return 'AT(' + this.value + ')'665 }),666 (I.prototype.toSource = function () {667 return '@' + H(this.value)668 }),669 (U.prototype = Object.create(P.prototype)),670 (U.prototype.tokenType = 'HASH'),671 (U.prototype.toString = function () {672 return 'HASH(' + this.value + ')'673 }),674 (U.prototype.toJSON = function () {675 var e =676 this.constructor.prototype.constructor.prototype.toJSON.call(677 this678 )679 return (e.value = this.value), (e.type = this.type), e680 }),681 (U.prototype.toSource = function () {682 return 'id' == this.type683 ? '#' + H(this.value)684 : '#' +685 (function (e) {686 for (687 var n = '', r = ((e = '' + e).charCodeAt(0), 0);688 r < e.length;689 r++690 ) {691 var o = e.charCodeAt(r)692 if (0 == o)693 throw new l(694 'Invalid character: the input contains U+0000.'695 )696 o >= 128 ||697 45 == o ||698 95 == o ||699 t(o, 48, 57) ||700 t(o, 65, 90) ||701 t(o, 97, 122)702 ? (n += e[r])703 : (n += '\\' + o.toString(16) + ' ')704 }705 return n706 })(this.value)707 }),708 (W.prototype = Object.create(P.prototype)),709 (W.prototype.tokenType = 'STRING'),710 (W.prototype.toString = function () {711 return '"' + G(this.value) + '"'712 }),713 (F.prototype = Object.create(P.prototype)),714 (F.prototype.tokenType = 'URL'),715 (F.prototype.toString = function () {716 return 'URL(' + this.value + ')'717 }),718 (F.prototype.toSource = function () {719 return 'url("' + G(this.value) + '")'720 }),721 (B.prototype = Object.create(p.prototype)),722 (B.prototype.tokenType = 'NUMBER'),723 (B.prototype.toString = function () {724 return 'integer' == this.type725 ? 'INT(' + this.value + ')'726 : 'NUMBER(' + this.value + ')'727 }),728 (B.prototype.toJSON = function () {729 var e =730 this.constructor.prototype.constructor.prototype.toJSON.call(731 this732 )733 return (734 (e.value = this.value),735 (e.type = this.type),736 (e.repr = this.repr),737 e738 )739 }),740 (B.prototype.toSource = function () {741 return this.repr742 }),743 (z.prototype = Object.create(p.prototype)),744 (z.prototype.tokenType = 'PERCENTAGE'),745 (z.prototype.toString = function () {746 return 'PERCENTAGE(' + this.value + ')'747 }),748 (z.prototype.toJSON = function () {749 var e =750 this.constructor.prototype.constructor.prototype.toJSON.call(751 this752 )753 return (e.value = this.value), (e.repr = this.repr), e754 }),755 (z.prototype.toSource = function () {756 return this.repr + '%'757 }),758 (V.prototype = Object.create(p.prototype)),759 (V.prototype.tokenType = 'DIMENSION'),760 (V.prototype.toString = function () {761 return 'DIM(' + this.value + ',' + this.unit + ')'762 }),763 (V.prototype.toJSON = function () {764 var e =765 this.constructor.prototype.constructor.prototype.toJSON.call(766 this767 )768 return (769 (e.value = this.value),770 (e.type = this.type),771 (e.repr = this.repr),772 (e.unit = this.unit),773 e774 )775 }),776 (V.prototype.toSource = function () {777 var e = this.repr,778 n = H(this.unit)779 return (780 'e' != n[0].toLowerCase() ||781 ('-' != n[1] && !t(n.charCodeAt(1), 48, 57)) ||782 (n = '\\65 ' + n.slice(1, n.length)),783 e + n784 )785 }),786 (e.tokenize = function (e) {787 e = (function (e) {788 for (var n = [], r = 0; r < e.length; r++) {789 var o = e.charCodeAt(r)790 if (791 (13 == o && 10 == e.charCodeAt(r + 1) && ((o = 10), r++),792 (13 != o && 12 != o) || (o = 10),793 0 == o && (o = 65533),794 t(o, 55296, 56319) && t(e.charCodeAt(r + 1), 56320, 57343))795 ) {796 var i = o - 55296,797 s = e.charCodeAt(r + 1) - 56320798 ;(o = Math.pow(2, 16) + i * Math.pow(2, 10) + s), r++799 }800 n.push(o)801 }802 return n803 })(e)804 for (805 var o,806 l = -1,807 p = [],808 E = 0,809 P = 0,810 H = 0,811 G = { line: E, column: P },812 J = function (t) {813 return t >= e.length ? -1 : e[t]814 },815 Q = function (e) {816 if ((void 0 === e && (e = 1), e > 3))817 throw 'Spec Error: no more than three codepoints of lookahead.'818 return J(l + e)819 },820 X = function (e) {821 return (822 void 0 === e && (e = 1),823 a((o = J((l += e))))824 ? ((E += 1), (H = P), (P = 0))825 : (P += e),826 !0827 )828 },829 K = function () {830 return (831 (l -= 1),832 a(o) ? ((E -= 1), (P = H)) : (P -= 1),833 (G.line = E),834 (G.column = P),835 !0836 )837 },838 Z = function (e) {839 return void 0 === e && (e = o), -1 == e840 },841 Y = function () {842 return (843 console.log(844 'Parse error at index ' +845 l +846 ', processing codepoint 0x' +847 o.toString(16) +848 '.'849 ),850 !0851 )852 },853 ee = function () {854 if ((te(), X(), u(o))) {855 for (; u(Q()); ) X()856 return new m()857 }858 if (34 == o) return oe()859 if (35 == o) {860 if (s(Q()) || ce(Q(1), Q(2))) {861 var e = new U()862 return (863 ue(Q(1), Q(2), Q(3)) && (e.type = 'id'),864 (e.value = pe()),865 e866 )867 }868 return new L(o)869 }870 return 36 == o871 ? 61 == Q()872 ? (X(), new M())873 : new L(o)874 : 39 == o875 ? oe()876 : 40 == o877 ? new N()878 : 41 == o879 ? new x()880 : 42 == o881 ? 61 == Q()882 ? (X(), new $())883 : new L(o)884 : 43 == o885 ? he()886 ? (K(), ne())887 : new L(o)888 : 44 == o889 ? new b()890 : 45 == o891 ? he()892 ? (K(), ne())893 : 45 == Q(1) && 62 == Q(2)894 ? (X(2), new y())895 : le()896 ? (K(), re())897 : new L(o)898 : 46 == o899 ? he()900 ? (K(), ne())901 : new L(o)902 : 58 == o903 ? new v()904 : 59 == o905 ? new w()906 : 60 == o907 ? 33 == Q(1) && 45 == Q(2) && 45 == Q(3)908 ? (X(3), new g())909 : new L(o)910 : 64 == o911 ? ue(Q(1), Q(2), Q(3))912 ? new I(pe())913 : new L(o)914 : 91 == o915 ? new T()916 : 92 == o917 ? ae()918 ? (K(), re())919 : (Y(), new L(o))920 : 93 == o921 ? new k()922 : 94 == o923 ? 61 == Q()924 ? (X(), new O())925 : new L(o)926 : 123 == o927 ? new _()928 : 124 == o929 ? 61 == Q()930 ? (X(), new A())931 : 124 == Q()932 ? (X(), new R())933 : new L(o)934 : 125 == o935 ? new S()936 : 126 == o937 ? 61 == Q()938 ? (X(), new C())939 : new L(o)940 : n(o)941 ? (K(), ne())942 : i(o)943 ? (K(), re())944 : Z()945 ? new j()946 : new L(o)947 },948 te = function () {949 for (; 47 == Q(1) && 42 == Q(2); )950 for (X(2); ; ) {951 if ((X(), 42 == o && 47 == Q())) {952 X()953 break954 }955 if (Z()) return void Y()956 }957 },958 ne = function () {959 var e,960 t = fe()961 return ue(Q(1), Q(2), Q(3))962 ? (((e = new V()).value = t.value),963 (e.repr = t.repr),964 (e.type = t.type),965 (e.unit = pe()),966 e)967 : 37 == Q()968 ? (X(),969 ((e = new z()).value = t.value),970 (e.repr = t.repr),971 e)972 : (((e = new B()).value = t.value),973 (e.repr = t.repr),974 (e.type = t.type),975 e)976 },977 re = function () {978 var e = pe()979 if ('url' == e.toLowerCase() && 40 == Q()) {980 for (X(); u(Q(1)) && u(Q(2)); ) X()981 return 34 == Q() || 39 == Q()982 ? new D(e)983 : !u(Q()) || (34 != Q(2) && 39 != Q(2))984 ? ie()985 : new D(e)986 }987 return 40 == Q() ? (X(), new D(e)) : new q(e)988 },989 oe = function (e) {990 void 0 === e && (e = o)991 for (var t = ''; X(); ) {992 if (o == e || Z()) return new W(t)993 if (a(o)) return Y(), K(), new f()994 92 == o995 ? Z(Q()) || (a(Q()) ? X() : (t += h(se())))996 : (t += h(o))997 }998 },999 ie = function () {1000 for (var e = new F(''); u(Q()); ) X()1001 if (Z(Q())) return e1002 for (; X(); ) {1003 if (41 == o || Z()) return e1004 if (u(o)) {1005 for (; u(Q()); ) X()1006 return 41 == Q() || Z(Q()) ? (X(), e) : (me(), new d())1007 }1008 if (34 == o || 39 == o || 40 == o || c(o))1009 return Y(), me(), new d()1010 if (92 == o) {1011 if (!ae()) return Y(), me(), new d()1012 e.value += h(se())1013 } else e.value += h(o)1014 }1015 },1016 se = function () {1017 if ((X(), r(o))) {1018 for (var e = [o], t = 0; t < 5 && r(Q()); t++)1019 X(), e.push(o)1020 u(Q()) && X()1021 var n = parseInt(1022 e1023 .map(function (e) {1024 return String.fromCharCode(e)1025 })1026 .join(''),1027 161028 )1029 return n > 1114111 && (n = 65533), n1030 }1031 return Z() ? 65533 : o1032 },1033 ce = function (e, t) {1034 return 92 == e && !a(t)1035 },1036 ae = function () {1037 return ce(o, Q())1038 },1039 ue = function (e, t, n) {1040 return 45 == e1041 ? i(t) || 45 == t || ce(t, n)1042 : !!i(e) || (92 == e && ce(e, t))1043 },1044 le = function () {1045 return ue(o, Q(1), Q(2))1046 },1047 he = function () {1048 return (1049 (e = o),1050 (t = Q(1)),1051 (r = Q(2)),1052 43 == e || 45 == e1053 ? !!n(t) || !(46 != t || !n(r))1054 : 46 == e1055 ? !!n(t)1056 : !!n(e)1057 )1058 var e, t, r1059 },1060 pe = function () {1061 for (var e = ''; X(); )1062 if (s(o)) e += h(o)1063 else {1064 if (!ae()) return K(), e1065 e += h(se())1066 }1067 },1068 fe = function () {1069 var e = [],1070 t = 'integer'1071 for (1072 (43 != Q() && 45 != Q()) || (X(), (e += h(o)));1073 n(Q());1074 )1075 X(), (e += h(o))1076 if (46 == Q(1) && n(Q(2)))1077 for (1078 X(), e += h(o), X(), e += h(o), t = 'number';1079 n(Q());1080 )1081 X(), (e += h(o))1082 var r = Q(1),1083 i = Q(2),1084 s = Q(3)1085 if ((69 != r && 101 != r) || !n(i)) {1086 if ((69 == r || 101 == r) && (43 == i || 45 == i) && n(s))1087 for (1088 X(),1089 e += h(o),1090 X(),1091 e += h(o),1092 X(),1093 e += h(o),1094 t = 'number';1095 n(Q());1096 )1097 X(), (e += h(o))1098 } else1099 for (1100 X(), e += h(o), X(), e += h(o), t = 'number';1101 n(Q());1102 )1103 X(), (e += h(o))1104 return { type: t, value: de(e), repr: e }1105 },1106 de = function (e) {1107 return +e1108 },1109 me = function () {1110 for (; X(); ) {1111 if (41 == o || Z()) return1112 ae() && se()1113 }1114 },1115 ge = 0;1116 !Z(Q());1117 )1118 if ((p.push(ee()), ++ge > 2 * e.length))1119 return "I'm infinite-looping!"1120 return p1121 }),1122 (e.IdentToken = q),1123 (e.FunctionToken = D),1124 (e.AtKeywordToken = I),1125 (e.HashToken = U),1126 (e.StringToken = W),1127 (e.BadStringToken = f),1128 (e.URLToken = F),1129 (e.BadURLToken = d),1130 (e.DelimToken = L),1131 (e.NumberToken = B),1132 (e.PercentageToken = z),1133 (e.DimensionToken = V),1134 (e.IncludeMatchToken = C),1135 (e.DashMatchToken = A),1136 (e.PrefixMatchToken = O),1137 (e.SuffixMatchToken = M),1138 (e.SubstringMatchToken = $),1139 (e.ColumnToken = R),1140 (e.WhitespaceToken = m),1141 (e.CDOToken = g),1142 (e.CDCToken = y),1143 (e.ColonToken = v),1144 (e.SemicolonToken = w),1145 (e.CommaToken = b),1146 (e.OpenParenToken = N),1147 (e.CloseParenToken = x),1148 (e.OpenSquareToken = T),1149 (e.CloseSquareToken = k),1150 (e.OpenCurlyToken = _),1151 (e.CloseCurlyToken = S),1152 (e.EOFToken = j),1153 (e.CSSParserToken = p),1154 (e.GroupingToken = E)1155 }),1156 void 0 === (r = n.apply(t, [t])) || (e.exports = r)1157 },1158 461: (e, t, n) => {1159 Object.defineProperty(t, '__esModule', { value: !0 }),1160 (t.parseSelector = function (e) {1161 const t = (function (e) {1162 let t,1163 n = 0,1164 r = 01165 const o = { parts: [] },1166 i = () => {1167 const t = e.substring(r, n).trim(),1168 i = t.indexOf('=')1169 let s, c1170 ;-1 !== i &&1171 t1172 .substring(0, i)1173 .trim()1174 .match(/^[a-zA-Z_0-9-+:*]+$/)1175 ? ((s = t.substring(0, i).trim()),1176 (c = t.substring(i + 1)))1177 : (t.length > 1 &&1178 '"' === t[0] &&1179 '"' === t[t.length - 1]) ||1180 (t.length > 1 &&1181 "'" === t[0] &&1182 "'" === t[t.length - 1])1183 ? ((s = 'text'), (c = t))1184 : /^\(*\/\//.test(t) || t.startsWith('..')1185 ? ((s = 'xpath'), (c = t))1186 : ((s = 'css'), (c = t))1187 let a = !11188 if (1189 ('*' === s[0] && ((a = !0), (s = s.substring(1))),1190 o.parts.push({ name: s, body: c }),1191 a)1192 ) {1193 if (void 0 !== o.capture)1194 throw new Error(1195 'Only one of the selectors can capture using * modifier'1196 )1197 o.capture = o.parts.length - 11198 }1199 }1200 if (!e.includes('>>')) return (n = e.length), i(), o1201 for (; n < e.length; ) {1202 const o = e[n]1203 '\\' === o && n + 1 < e.length1204 ? (n += 2)1205 : o === t1206 ? ((t = void 0), n++)1207 : t || ('"' !== o && "'" !== o && '`' !== o)1208 ? t || '>' !== o || '>' !== e[n + 1]1209 ? n++1210 : (i(), (n += 2), (r = n))1211 : ((t = o), n++)1212 }1213 return i(), o1214 })(e),1215 n = t.parts.map((e) =>1216 'css' === e.name || 'css:light' === e.name1217 ? ('css:light' === e.name &&1218 (e.body = ':light(' + e.body + ')'),1219 { name: 'css', body: (0, r.parseCSS)(e.body, o).selector })1220 : e1221 )1222 return { selector: e, capture: t.capture, parts: n }1223 }),1224 (t.customCSSNames = void 0)1225 var r = n(317)1226 const o = new Set([1227 'not',1228 'is',1229 'where',1230 'has',1231 'scope',1232 'light',1233 'visible',1234 'text',1235 'text-matches',1236 'text-is',1237 'has-text',1238 'above',1239 'below',1240 'right-of',1241 'left-of',1242 'near',1243 'nth-match'1244 ])1245 t.customCSSNames = o1246 },1247 836: (e, t, n) => {1248 Object.defineProperty(t, '__esModule', { value: !0 }),1249 (t.ReactEngine = void 0)1250 var r = n(204)1251 function o(e) {1252 if ('function' == typeof e.type)1253 return e.type.displayName || e.type.name || 'Anonymous'1254 if ('string' == typeof e.type) return e.type1255 if (e._currentElement) {1256 const t = e._currentElement.type1257 if ('string' == typeof t) return t1258 if ('function' == typeof t)1259 return t.displayName || t.name || 'Anonymous'1260 }1261 return ''1262 }1263 function i(e) {1264 if (e.child) {1265 const t = []1266 for (let n = e.child; n; n = n.sibling) t.push(n)1267 return t1268 }1269 if (!e._currentElement) return []1270 const t = (e) => {1271 var t1272 const n =1273 null === (t = e._currentElement) || void 0 === t ? void 0 : t.type1274 return 'function' == typeof n || 'string' == typeof n1275 }1276 if (e._renderedComponent) {1277 const n = e._renderedComponent1278 return t(n) ? [n] : []1279 }1280 return e._renderedChildren1281 ? [...Object.values(e._renderedChildren)].filter(t)1282 : []1283 }1284 function s(e) {1285 var t1286 const n =1287 e.memoizedProps ||1288 (null === (t = e._currentElement) || void 0 === t1289 ? void 01290 : t.props)1291 if (!n || 'string' == typeof n) return n1292 const r = { ...n }1293 return delete r.children, r1294 }1295 function c(e) {1296 var t1297 const n = {1298 name: o(e),1299 children: i(e).map(c),1300 rootElements: [],1301 props: s(e)1302 },1303 r =1304 e.stateNode ||1305 e._hostNode ||1306 (null === (t = e._renderedComponent) || void 0 === t1307 ? void 01308 : t._hostNode)1309 if (r instanceof Element) n.rootElements.push(r)1310 else1311 for (const e of n.children) n.rootElements.push(...e.rootElements)1312 return n1313 }1314 function a(e, t, n = []) {1315 t(e) && n.push(e)1316 for (const r of e.children) a(r, t, n)1317 return n1318 }1319 const u = {1320 queryAll(e, t) {1321 const { name: n, attributes: o } = (0, r.parseComponentSelector)(t),1322 i = (function () {1323 const e = [],1324 t = document.createTreeWalker(1325 document,1326 NodeFilter.SHOW_ELEMENT1327 )1328 for (; t.nextNode(); ) {1329 const n = t.currentNode1330 n.hasOwnProperty('_reactRootContainer') &&1331 e.push(n._reactRootContainer._internalRoot.current)1332 }1333 for (const t of document.querySelectorAll('[data-reactroot]'))1334 for (const n of Object.keys(t))1335 (n.startsWith('__reactInternalInstance') ||1336 n.startsWith('__reactFiber')) &&1337 e.push(t[n])1338 return e1339 })()1340 .map((e) => c(e))1341 .map((t) =>1342 a(t, (t) => {1343 if (n && t.name !== n) return !11344 if (t.rootElements.some((t) => !e.contains(t))) return !11345 for (const e of o)1346 if (!(0, r.checkComponentAttribute)(t.props, e)) return !11347 return !01348 })1349 )1350 .flat(),1351 s = new Set()1352 for (const e of i) for (const t of e.rootElements) s.add(t)1353 return [...s]1354 }1355 }1356 t.ReactEngine = u1357 },1358 848: (e, t, n) => {1359 Object.defineProperty(t, '__esModule', { value: !0 }),1360 (t.createLaxTextMatcher = d),1361 (t.createStrictTextMatcher = m),1362 (t.createRegexTextMatcher = g),1363 (t.elementText = v),1364 (t.elementMatchesText = w),1365 (t.parentElementOrShadowHost = x),1366 (t.isVisible = O),1367 (t.SelectorEvaluatorImpl = void 0)1368 var r = n(461)1369 t.SelectorEvaluatorImpl = class {1370 constructor(e) {1371 ;(this._engines = new Map()),1372 (this._cacheQueryCSS = new Map()),1373 (this._cacheMatches = new Map()),1374 (this._cacheQuery = new Map()),1375 (this._cacheMatchesSimple = new Map()),1376 (this._cacheMatchesParents = new Map()),1377 (this._cacheCallMatches = new Map()),1378 (this._cacheCallQuery = new Map()),1379 (this._cacheQuerySimple = new Map()),1380 (this._cacheText = new Map()),1381 (this._scoreMap = void 0),1382 (this._retainCacheCounter = 0)1383 for (const [t, n] of e) this._engines.set(t, n)1384 this._engines.set('not', c),1385 this._engines.set('is', o),1386 this._engines.set('where', o),1387 this._engines.set('has', i),1388 this._engines.set('scope', s),1389 this._engines.set('light', a),1390 this._engines.set('visible', u),1391 this._engines.set('text', l),1392 this._engines.set('text-is', h),1393 this._engines.set('text-matches', p),1394 this._engines.set('has-text', f),1395 this._engines.set('right-of', k('right-of', b)),1396 this._engines.set('left-of', k('left-of', E)),1397 this._engines.set('above', k('above', _)),1398 this._engines.set('below', k('below', S)),1399 this._engines.set('near', k('near', T)),1400 this._engines.set('nth-match', N)1401 const t = [...this._engines.keys()]1402 t.sort()1403 const n = [...r.customCSSNames]1404 if ((n.sort(), t.join('|') !== n.join('|')))1405 throw new Error(1406 `Please keep customCSSNames in sync with evaluator engines: ${t.join(1407 '|'1408 )} vs ${n.join('|')}`1409 )1410 }1411 begin() {1412 ++this._retainCacheCounter1413 }1414 end() {1415 --this._retainCacheCounter,1416 this._retainCacheCounter ||1417 (this._cacheQueryCSS.clear(),1418 this._cacheMatches.clear(),1419 this._cacheQuery.clear(),1420 this._cacheMatchesSimple.clear(),1421 this._cacheMatchesParents.clear(),1422 this._cacheCallMatches.clear(),1423 this._cacheCallQuery.clear(),1424 this._cacheQuerySimple.clear(),1425 this._cacheText.clear())1426 }1427 _cached(e, t, n, r) {1428 e.has(t) || e.set(t, [])1429 const o = e.get(t),1430 i = o.find((e) => n.every((t, n) => e.rest[n] === t))1431 if (i) return i.result1432 const s = r()1433 return o.push({ rest: n, result: s }), s1434 }1435 _checkSelector(e) {1436 if (1437 'object' != typeof e ||1438 !e ||1439 !(Array.isArray(e) || ('simples' in e && e.simples.length))1440 )1441 throw new Error(`Malformed selector "${e}"`)1442 return e1443 }1444 matches(e, t, n) {1445 const r = this._checkSelector(t)1446 this.begin()1447 try {1448 return this._cached(1449 this._cacheMatches,1450 e,1451 [r, n.scope, n.pierceShadow],1452 () =>1453 Array.isArray(r)1454 ? this._matchesEngine(o, e, r, n)1455 : !!this._matchesSimple(1456 e,1457 r.simples[r.simples.length - 1].selector,1458 n1459 ) && this._matchesParents(e, r, r.simples.length - 2, n)1460 )1461 } finally {1462 this.end()1463 }1464 }1465 query(e, t) {1466 const n = this._checkSelector(t)1467 this.begin()1468 try {1469 return this._cached(1470 this._cacheQuery,1471 n,1472 [e.scope, e.pierceShadow],1473 () => {1474 if (Array.isArray(n)) return this._queryEngine(o, e, n)1475 const t = this._scoreMap1476 this._scoreMap = new Map()1477 let r = this._querySimple(1478 e,1479 n.simples[n.simples.length - 1].selector1480 )1481 return (1482 (r = r.filter((t) =>1483 this._matchesParents(t, n, n.simples.length - 2, e)1484 )),1485 this._scoreMap.size &&1486 r.sort((e, t) => {1487 const n = this._scoreMap.get(e),1488 r = this._scoreMap.get(t)1489 return n === r1490 ? 01491 : void 0 === n1492 ? 11493 : void 0 === r1494 ? -11495 : n - r1496 }),1497 (this._scoreMap = t),1498 r1499 )1500 }1501 )1502 } finally {1503 this.end()1504 }1505 }1506 _markScore(e, t) {1507 this._scoreMap && this._scoreMap.set(e, t)1508 }1509 _matchesSimple(e, t, n) {1510 return this._cached(1511 this._cacheMatchesSimple,1512 e,1513 [t, n.scope, n.pierceShadow],1514 () => {1515 if (1516 !t.functions.some(1517 (e) => 'scope' === e.name || 'is' === e.name1518 ) &&1519 e === n.scope1520 )1521 return !11522 if (t.css && !this._matchesCSS(e, t.css)) return !11523 for (const r of t.functions)1524 if (1525 !this._matchesEngine(this._getEngine(r.name), e, r.args, n)1526 )1527 return !11528 return !01529 }1530 )1531 }1532 _querySimple(e, t) {1533 return t.functions.length1534 ? this._cached(1535 this._cacheQuerySimple,1536 t,1537 [e.scope, e.pierceShadow],1538 () => {1539 let n = t.css1540 const r = t.functions1541 let o1542 '*' === n && r.length && (n = void 0)1543 let i = -11544 void 0 !== n1545 ? (o = this._queryCSS(e, n))1546 : ((i = r.findIndex(1547 (e) => void 0 !== this._getEngine(e.name).query1548 )),1549 -1 === i && (i = 0),1550 (o = this._queryEngine(1551 this._getEngine(r[i].name),1552 e,1553 r[i].args1554 )))1555 for (let t = 0; t < r.length; t++) {1556 if (t === i) continue1557 const n = this._getEngine(r[t].name)1558 void 0 !== n.matches &&1559 (o = o.filter((o) =>1560 this._matchesEngine(n, o, r[t].args, e)1561 ))1562 }1563 for (let t = 0; t < r.length; t++) {1564 if (t === i) continue1565 const n = this._getEngine(r[t].name)1566 void 0 === n.matches &&1567 (o = o.filter((o) =>1568 this._matchesEngine(n, o, r[t].args, e)1569 ))1570 }1571 return o1572 }1573 )1574 : this._queryCSS(e, t.css || '*')1575 }1576 _matchesParents(e, t, n, r) {1577 return (1578 n < 0 ||1579 this._cached(1580 this._cacheMatchesParents,1581 e,1582 [t, n, r.scope, r.pierceShadow],1583 () => {1584 const { selector: o, combinator: i } = t.simples[n]1585 if ('>' === i) {1586 const i = C(e, r)1587 return (1588 !(!i || !this._matchesSimple(i, o, r)) &&1589 this._matchesParents(i, t, n - 1, r)1590 )1591 }1592 if ('+' === i) {1593 const i = A(e, r)1594 return (1595 !(!i || !this._matchesSimple(i, o, r)) &&1596 this._matchesParents(i, t, n - 1, r)1597 )1598 }1599 if ('' === i) {1600 let i = C(e, r)1601 for (; i; ) {1602 if (this._matchesSimple(i, o, r)) {1603 if (this._matchesParents(i, t, n - 1, r)) return !01604 if ('' === t.simples[n - 1].combinator) break1605 }1606 i = C(i, r)1607 }1608 return !11609 }1610 if ('~' === i) {1611 let i = A(e, r)1612 for (; i; ) {1613 if (this._matchesSimple(i, o, r)) {1614 if (this._matchesParents(i, t, n - 1, r)) return !01615 if ('~' === t.simples[n - 1].combinator) break1616 }1617 i = A(i, r)1618 }1619 return !11620 }1621 if ('>=' === i) {1622 let i = e1623 for (; i; ) {1624 if (this._matchesSimple(i, o, r)) {1625 if (this._matchesParents(i, t, n - 1, r)) return !01626 if ('' === t.simples[n - 1].combinator) break1627 }1628 i = C(i, r)1629 }1630 return !11631 }1632 throw new Error(`Unsupported combinator "${i}"`)1633 }1634 )1635 )1636 }1637 _matchesEngine(e, t, n, r) {1638 if (e.matches) return this._callMatches(e, t, n, r)1639 if (e.query) return this._callQuery(e, n, r).includes(t)1640 throw new Error(1641 'Selector engine should implement "matches" or "query"'1642 )1643 }1644 _queryEngine(e, t, n) {1645 if (e.query) return this._callQuery(e, n, t)1646 if (e.matches)1647 return this._queryCSS(t, '*').filter((r) =>1648 this._callMatches(e, r, n, t)1649 )1650 throw new Error(1651 'Selector engine should implement "matches" or "query"'1652 )1653 }1654 _callMatches(e, t, n, r) {1655 return this._cached(1656 this._cacheCallMatches,1657 t,1658 [e, r.scope, r.pierceShadow, ...n],1659 () => e.matches(t, n, r, this)1660 )1661 }1662 _callQuery(e, t, n) {1663 return this._cached(1664 this._cacheCallQuery,1665 e,1666 [n.scope, n.pierceShadow, ...t],1667 () => e.query(n, t, this)1668 )1669 }1670 _matchesCSS(e, t) {1671 return e.matches(t)1672 }1673 _queryCSS(e, t) {1674 return this._cached(1675 this._cacheQueryCSS,1676 t,1677 [e.scope, e.pierceShadow],1678 () => {1679 let n = []1680 return (1681 (function r(o) {1682 if (1683 ((n = n.concat([...o.querySelectorAll(t)])),1684 e.pierceShadow)1685 ) {1686 o.shadowRoot && r(o.shadowRoot)1687 for (const e of o.querySelectorAll('*'))1688 e.shadowRoot && r(e.shadowRoot)1689 }1690 })(e.scope),1691 n1692 )1693 }1694 )1695 }1696 _getEngine(e) {1697 const t = this._engines.get(e)1698 if (!t) throw new Error(`Unknown selector engine "${e}"`)1699 return t1700 }1701 }1702 const o = {1703 matches(e, t, n, r) {1704 if (0 === t.length)1705 throw new Error('"is" engine expects non-empty selector list')1706 return t.some((t) => r.matches(e, t, n))1707 },1708 query(e, t, n) {1709 if (0 === t.length)1710 throw new Error('"is" engine expects non-empty selector list')1711 let r = []1712 for (const o of t) r = r.concat(n.query(e, o))1713 return 1 === t.length1714 ? r1715 : (function (e) {1716 const t = new Map(),1717 n = [],1718 r = []1719 function o(e) {1720 let r = t.get(e)1721 if (r) return r1722 const i = x(e)1723 return (1724 i ? o(i).children.push(e) : n.push(e),1725 (r = { children: [], taken: !1 }),1726 t.set(e, r),1727 r1728 )1729 }1730 return (1731 e.forEach((e) => (o(e).taken = !0)),1732 n.forEach(function e(n) {1733 const o = t.get(n)1734 if ((o.taken && r.push(n), o.children.length > 1)) {1735 const e = new Set(o.children)1736 o.children = []1737 let t = n.firstElementChild1738 for (; t && o.children.length < e.size; )1739 e.has(t) && o.children.push(t),1740 (t = t.nextElementSibling)1741 for (1742 t = n.shadowRoot1743 ? n.shadowRoot.firstElementChild1744 : null;1745 t && o.children.length < e.size;1746 )1747 e.has(t) && o.children.push(t),1748 (t = t.nextElementSibling)1749 }1750 o.children.forEach(e)1751 }),1752 r1753 )1754 })(r)1755 }1756 },1757 i = {1758 matches(e, t, n, r) {1759 if (0 === t.length)1760 throw new Error('"has" engine expects non-empty selector list')1761 return r.query({ ...n, scope: e }, t).length > 01762 }1763 },1764 s = {1765 matches(e, t, n, r) {1766 if (0 !== t.length)1767 throw new Error('"scope" engine expects no arguments')1768 return 9 === n.scope.nodeType1769 ? e === n.scope.documentElement1770 : e === n.scope1771 },1772 query(e, t, n) {1773 if (0 !== t.length)1774 throw new Error('"scope" engine expects no arguments')1775 if (9 === e.scope.nodeType) {1776 const t = e.scope.documentElement1777 return t ? [t] : []1778 }1779 return 1 === e.scope.nodeType ? [e.scope] : []1780 }1781 },1782 c = {1783 matches(e, t, n, r) {1784 if (0 === t.length)1785 throw new Error('"not" engine expects non-empty selector list')1786 return !r.matches(e, t, n)1787 }1788 },1789 a = {1790 query: (e, t, n) => n.query({ ...e, pierceShadow: !1 }, t),1791 matches: (e, t, n, r) => r.matches(e, t, { ...n, pierceShadow: !1 })1792 },1793 u = {1794 matches(e, t, n, r) {1795 if (t.length)1796 throw new Error('"visible" engine expects no arguments')1797 return O(e)1798 }1799 },1800 l = {1801 matches(e, t, n, r) {1802 if (1 !== t.length || 'string' != typeof t[0])1803 throw new Error('"text" engine expects a single string')1804 return 'self' === w(r, e, d(t[0]))1805 }1806 },1807 h = {1808 matches(e, t, n, r) {1809 if (1 !== t.length || 'string' != typeof t[0])1810 throw new Error('"text-is" engine expects a single string')1811 return 'none' !== w(r, e, m(t[0]))1812 }1813 },1814 p = {1815 matches(e, t, n, r) {1816 if (1817 0 === t.length ||1818 'string' != typeof t[0] ||1819 t.length > 2 ||1820 (2 === t.length && 'string' != typeof t[1])1821 )1822 throw new Error(1823 '"text-matches" engine expects a regexp body and optional regexp flags'1824 )1825 return 'self' === w(r, e, g(t[0], 2 === t.length ? t[1] : void 0))1826 }1827 },1828 f = {1829 matches(e, t, n, r) {1830 if (1 !== t.length || 'string' != typeof t[0])1831 throw new Error('"has-text" engine expects a single string')1832 return !y(e) && d(t[0])(v(r, e))1833 }1834 }1835 function d(e) {1836 return (1837 (e = e.trim().replace(/\s+/g, ' ').toLowerCase()),1838 (t) => t.full.trim().replace(/\s+/g, ' ').toLowerCase().includes(e)1839 )1840 }1841 function m(e) {1842 return (1843 (e = e.trim().replace(/\s+/g, ' ')),1844 (t) =>1845 (!e && !t.immediate.length) ||1846 t.immediate.some((t) => t.trim().replace(/\s+/g, ' ') === e)1847 )1848 }1849 function g(e, t) {1850 const n = new RegExp(e, t)1851 return (e) => n.test(e.full)1852 }1853 function y(e) {1854 return (1855 'SCRIPT' === e.nodeName ||1856 'STYLE' === e.nodeName ||1857 (document.head && document.head.contains(e))1858 )1859 }1860 function v(e, t) {1861 let n = e._cacheText.get(t)1862 if (void 0 === n) {1863 if (((n = { full: '', immediate: [] }), !y(t))) {1864 let r = ''1865 if (1866 t instanceof HTMLInputElement &&1867 ('submit' === t.type || 'button' === t.type)1868 )1869 n = { full: t.value, immediate: [t.value] }1870 else {1871 for (let o = t.firstChild; o; o = o.nextSibling)1872 o.nodeType === Node.TEXT_NODE1873 ? ((n.full += o.nodeValue || ''), (r += o.nodeValue || ''))1874 : (r && n.immediate.push(r),1875 (r = ''),1876 o.nodeType === Node.ELEMENT_NODE &&1877 (n.full += v(e, o).full))1878 r && n.immediate.push(r),1879 t.shadowRoot && (n.full += v(e, t.shadowRoot).full)1880 }1881 }1882 e._cacheText.set(t, n)1883 }1884 return n1885 }1886 function w(e, t, n) {1887 if (y(t)) return 'none'1888 if (!n(v(e, t))) return 'none'1889 for (let r = t.firstChild; r; r = r.nextSibling)1890 if (r.nodeType === Node.ELEMENT_NODE && n(v(e, r)))1891 return 'selfAndChildren'1892 return t.shadowRoot && n(v(e, t.shadowRoot))1893 ? 'selfAndChildren'1894 : 'self'1895 }1896 function b(e, t, n) {1897 const r = e.left - t.right1898 if (!(r < 0 || (void 0 !== n && r > n)))1899 return (1900 r + Math.max(t.bottom - e.bottom, 0) + Math.max(e.top - t.top, 0)1901 )1902 }1903 function E(e, t, n) {1904 const r = t.left - e.right1905 if (!(r < 0 || (void 0 !== n && r > n)))1906 return (1907 r + Math.max(t.bottom - e.bottom, 0) + Math.max(e.top - t.top, 0)1908 )1909 }1910 function _(e, t, n) {1911 const r = t.top - e.bottom1912 if (!(r < 0 || (void 0 !== n && r > n)))1913 return (1914 r + Math.max(e.left - t.left, 0) + Math.max(t.right - e.right, 0)1915 )1916 }1917 function S(e, t, n) {1918 const r = e.top - t.bottom1919 if (!(r < 0 || (void 0 !== n && r > n)))1920 return (1921 r + Math.max(e.left - t.left, 0) + Math.max(t.right - e.right, 0)1922 )1923 }1924 function T(e, t, n) {1925 const r = void 0 === n ? 50 : n1926 let o = 01927 return (1928 e.left - t.right >= 0 && (o += e.left - t.right),1929 t.left - e.right >= 0 && (o += t.left - e.right),1930 t.top - e.bottom >= 0 && (o += t.top - e.bottom),1931 e.top - t.bottom >= 0 && (o += e.top - t.bottom),1932 o > r ? void 0 : o1933 )1934 }1935 function k(e, t) {1936 return {1937 matches(n, r, o, i) {1938 const s =1939 r.length && 'number' == typeof r[r.length - 1]1940 ? r[r.length - 1]1941 : void 0,1942 c = void 0 === s ? r : r.slice(0, r.length - 1)1943 if (r.length < 1 + (void 0 === s ? 0 : 1))1944 throw new Error(1945 `"${e}" engine expects a selector list and optional maximum distance in pixels`1946 )1947 const a = n.getBoundingClientRect()1948 let u1949 for (const e of i.query(o, c)) {1950 if (e === n) continue1951 const r = t(a, e.getBoundingClientRect(), s)1952 void 0 !== r && (void 0 === u || r < u) && (u = r)1953 }1954 return void 0 !== u && (i._markScore(n, u), !0)1955 }1956 }1957 }1958 const N = {1959 query(e, t, n) {1960 let r = t[t.length - 1]1961 if (t.length < 2)1962 throw new Error(1963 '"nth-match" engine expects non-empty selector list and an index argument'1964 )1965 if ('number' != typeof r || r < 1)1966 throw new Error(1967 '"nth-match" engine expects a one-based index as the last argument'1968 )1969 const i = o.query(e, t.slice(0, t.length - 1), n)1970 return r--, r < i.length ? [i[r]] : []1971 }1972 }1973 function x(e) {1974 return e.parentElement1975 ? e.parentElement1976 : e.parentNode &&1977 e.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&1978 e.parentNode.host1979 ? e.parentNode.host1980 : void 01981 }1982 function C(e, t) {1983 if (e !== t.scope)1984 return t.pierceShadow ? x(e) : e.parentElement || void 01985 }1986 function A(e, t) {1987 if (e !== t.scope) return e.previousElementSibling || void 01988 }1989 function O(e) {1990 if (!e.ownerDocument || !e.ownerDocument.defaultView) return !01991 const t = e.ownerDocument.defaultView.getComputedStyle(e)1992 if (!t || 'hidden' === t.visibility) return !11993 const n = e.getBoundingClientRect()1994 return n.width > 0 && n.height > 01995 }1996 },1997 854: (e, t, n) => {1998 Object.defineProperty(t, '__esModule', { value: !0 }),1999 (t.querySelector = function (e, t, n) {2000 try {2001 const r = e.parseSelector(t)2002 return { selector: t, elements: e.querySelectorAll(r, n) }2003 } catch (e) {2004 return { selector: t, elements: [] }2005 }2006 }),2007 (t.generateSelector = function (e, t) {2008 e._evaluator.begin()2009 try {2010 const n = (function (e, t) {2011 if (t.ownerDocument.documentElement === t)2012 return [{ engine: 'css', selector: 'html', score: 1 }]2013 const n = (u, h) => {2014 const d = h ? o : i2015 let m = d.get(u)2016 return (2017 void 0 === m &&2018 ((m = ((o, i) => {2019 const u = o === t2020 let h = i2021 ? (function (e, t, n) {2022 if ('SELECT' === t.nodeName) return []2023 const o = (0, r.elementText)(e._evaluator, t)2024 .full.trim()2025 .replace(/\s+/g, ' ')2026 .substring(0, 80)2027 if (!o) return []2028 const i = []2029 let s = o2030 if (2031 ((o.includes('"') ||2032 o.includes('>>') ||2033 '/' === o[0]) &&2034 (s = `/.*${(function (e) {2035 return e.replace(2036 /[.*+?^>${}()|[\]\\]/g,2037 '\\$&'2038 )2039 })(o)}.*/`),2040 i.push({2041 engine: 'text',2042 selector: s,2043 score: 102044 }),2045 n && s === o)2046 ) {2047 let e = t.nodeName.toLocaleLowerCase()2048 t.hasAttribute('role') &&2049 (e += `[role=${l(2050 t.getAttribute('role')2051 )}]`),2052 i.push({2053 engine: 'css',2054 selector: `${e}:has-text("${o}")`,2055 score: 302056 })2057 }2058 return i2059 })(e, o, o === t).map((e) => [e])2060 : []2061 o !== t && (h = s(h))2062 const d = (function (e, t) {2063 const n = []2064 for (const e of [2065 'data-testid',2066 'data-test-id',2067 'data-test'2068 ])2069 t.hasAttribute(e) &&2070 n.push({2071 engine: 'css',2072 selector: `[${e}=${l(t.getAttribute(e))}]`,2073 score: 12074 })2075 if ('INPUT' === t.nodeName) {2076 const e = t2077 e.placeholder &&2078 n.push({2079 engine: 'css',2080 selector: `[placeholder=${l(e.placeholder)}]`,2081 score: 102082 })2083 }2084 t.hasAttribute('aria-label') &&2085 n.push({2086 engine: 'css',2087 selector: `[aria-label=${l(2088 t.getAttribute('aria-label')2089 )}]`,2090 score: 102091 }),2092 t.getAttribute('alt') &&2093 ['APPLET', 'AREA', 'IMG', 'INPUT'].includes(2094 t.nodeName2095 ) &&2096 n.push({2097 engine: 'css',2098 selector: `${t.nodeName.toLowerCase()}[alt=${l(2099 t.getAttribute('alt')2100 )}]`,2101 score: 102102 }),2103 t.hasAttribute('role') &&2104 n.push({2105 engine: 'css',2106 selector: `${t.nodeName.toLocaleLowerCase()}[role=${l(2107 t.getAttribute('role')2108 )}]`,2109 score: 502110 }),2111 t.getAttribute('name') &&2112 [2113 'BUTTON',2114 'FORM',2115 'FIELDSET',2116 'IFRAME',2117 'INPUT',2118 'KEYGEN',2119 'OBJECT',2120 'OUTPUT',2121 'SELECT',2122 'TEXTAREA',2123 'MAP',2124 'META',2125 'PARAM'2126 ].includes(t.nodeName) &&2127 n.push({2128 engine: 'css',2129 selector: `${t.nodeName.toLowerCase()}[name=${l(2130 t.getAttribute('name')2131 )}]`,2132 score: 502133 }),2134 ['INPUT', 'TEXTAREA'].includes(t.nodeName) &&2135 'hidden' !== t.getAttribute('type') &&2136 t.getAttribute('type') &&2137 n.push({2138 engine: 'css',2139 selector: `${t.nodeName.toLowerCase()}[type=${l(2140 t.getAttribute('type')2141 )}]`,2142 score: 502143 }),2144 ['INPUT', 'TEXTAREA', 'SELECT'].includes(2145 t.nodeName2146 ) &&2147 n.push({2148 engine: 'css',2149 selector: t.nodeName.toLowerCase(),2150 score: 502151 })2152 const r = t.getAttribute('id')2153 return (2154 r &&2155 !(function (e) {2156 let t,2157 n = 02158 for (let r = 0; r < e.length; ++r) {2159 const o = e[r]2160 let i2161 '-' !== o &&2162 '_' !== o &&2163 ((i =2164 o >= 'a' && o <= 'z'2165 ? 'lower'2166 : o >= 'A' && o <= 'Z'2167 ? 'upper'2168 : o >= '0' && o <= '9'2169 ? 'digit'2170 : 'other'),2171 'lower' !== i || 'upper' !== t2172 ? (t && t !== i && ++n, (t = i))2173 : (t = i))2174 }2175 return n >= e.length / 42176 })(r) &&2177 n.push({2178 engine: 'css',2179 selector: a(r),2180 score: 1002181 }),2182 n.push({2183 engine: 'css',2184 selector: t.nodeName.toLocaleLowerCase(),2185 score: 2002186 }),2187 n2188 )2189 })(0, o).map((e) => [e])2190 let m = f(e, t.ownerDocument, o, [...h, ...d], u)2191 h = s(h)2192 const g = (t) => {2193 const r = i && !t.length,2194 s = [...t, ...d].filter((e) => !m || p(e) < p(m))2195 let a = s[0]2196 if (a)2197 for (let t = c(o); t; t = c(t)) {2198 const i = n(t, r)2199 if (!i) continue2200 if (m && p([...i, ...a]) >= p(m)) continue2201 if (((a = f(e, t, o, s, u)), !a)) return2202 const c = [...i, ...a]2203 ;(!m || p(c) < p(m)) && (m = c)2204 }2205 }2206 return g(h), o === t && h.length && g([]), m2207 })(u, h)),2208 d.set(u, m)),2209 m2210 )2211 }2212 return n(t, !0)2213 })(2214 e,2215 (t =2216 t.closest(2217 'button,select,input,[role=button],[role=checkbox],[role=radio]'2218 ) || t)2219 ),2220 d = h(n || [u(e, t)]),2221 m = e.parseSelector(d)2222 return {2223 selector: d,2224 elements: e.querySelectorAll(m, t.ownerDocument)2225 }2226 } finally {2227 o.clear(), i.clear(), e._evaluator.end()2228 }2229 })2230 var r = n(848)2231 const o = new Map(),2232 i = new Map()2233 function s(e) {2234 return e.filter((e) => '/' !== e[0].selector[0])2235 }2236 function c(e) {2237 return e.parentElement2238 ? e.parentElement2239 : e.parentNode &&2240 e.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&2241 e.parentNode.host2242 ? e.parentNode.host2243 : null2244 }2245 function a(e) {2246 return /^[a-zA-Z][a-zA-Z0-9\-\_]+$/.test(e) ? '#' + e : `[id="${e}"]`2247 }2248 function u(e, t) {2249 const n = 1e7,2250 r = t.ownerDocument,2251 o = []2252 function i(n) {2253 const r = o.slice()2254 n && r.unshift(n)2255 const i = r.join(' '),2256 s = e.parseSelector(i)2257 return e.querySelector(s, t.ownerDocument, !1) === t ? i : void 02258 }2259 for (let e = t; e && e !== r; e = c(e)) {2260 const t = e.nodeName.toLowerCase()2261 let r = ''2262 if (e.id) {2263 const t = a(e.id),2264 o = i(t)2265 if (o) return { engine: 'css', selector: o, score: n }2266 r = t2267 }2268 const s = e.parentNode,2269 c = [...e.classList]2270 for (let e = 0; e < c.length; ++e) {2271 const t = '.' + c.slice(0, e + 1).join('.'),2272 o = i(t)2273 if (o) return { engine: 'css', selector: o, score: n }2274 !r && s && 1 === s.querySelectorAll(t).length && (r = t)2275 }2276 if (s) {2277 const o = [...s.children],2278 c =2279 0 ===2280 o.filter((e) => e.nodeName.toLowerCase() === t).indexOf(e)2281 ? t2282 : `${t}:nth-child(${1 + o.indexOf(e)})`,2283 a = i(c)2284 if (a) return { engine: 'css', selector: a, score: n }2285 r || (r = c)2286 } else r || (r = t)2287 o.unshift(r)2288 }2289 return { engine: 'css', selector: i(), score: n }2290 }2291 function l(e) {2292 return `"${e.replace(/"/g, '\\"').replace(/\n/g, '\\n')}"`2293 }2294 function h(e) {2295 const t = []2296 let n = ''2297 for (const { engine: r, selector: o } of e)2298 t.length &&2299 ('css' !== n || 'css' !== r || o.startsWith(':nth-match(')) &&2300 t.push('>>'),2301 (n = r),2302 'css' === r ? t.push(o) : t.push(`${r}=${o}`)2303 return t.join(' ')2304 }2305 function p(e) {2306 let t = 02307 for (let n = 0; n < e.length; n++) t += e[n].score * (e.length - n)2308 return t2309 }2310 function f(e, t, n, r, o) {2311 const i = r.map((e) => ({ tokens: e, score: p(e) }))2312 i.sort((e, t) => e.score - t.score)2313 let s = null2314 for (const { tokens: r } of i) {2315 const i = e.parseSelector(h(r)),2316 c = e.querySelectorAll(i, t),2317 a = c.indexOf(n)2318 if (0 === a) return r2319 if (!o || s || -1 === a || c.length > 5) continue2320 const u = r.map((e) =>2321 'text' !== e.engine2322 ? e2323 : e.selector.startsWith('/') && e.selector.endsWith('/')2324 ? {2325 engine: 'css',2326 selector: `:text-matches("${e.selector.substring(2327 1,2328 e.selector.length - 12329 )}")`,2330 score: e.score2331 }2332 : {2333 engine: 'css',2334 selector: `:text("${e.selector}")`,2335 score: e.score2336 }2337 )2338 s = [2339 {2340 engine: 'css',2341 selector: `:nth-match(${h(u)}, ${a + 1})`,2342 score: p(u) + 1e32343 }2344 ]2345 }2346 return s2347 }2348 },2349 12: (e, t, n) => {2350 Object.defineProperty(t, '__esModule', { value: !0 }),2351 (t.VueEngine = void 0)2352 var r = n(204)2353 function o(e, t) {2354 const n = e.replace(/^[a-zA-Z]:/, '').replace(/\\/g, '/')2355 let r = n.substring(n.lastIndexOf('/') + 1)2356 return (2357 t && r.endsWith(t) && (r = r.substring(0, r.length - t.length)), r2358 )2359 }2360 function i(e, t) {2361 return t ? t.toUpperCase() : ''2362 }2363 const s = /(?:^|[-_/])(\w)/g,2364 c = (e) => e && e.replace(s, i)2365 function a(e, t, n = []) {2366 t(e) && n.push(e)2367 for (const r of e.children) a(r, t, n)2368 return n2369 }2370 const u = {2371 queryAll(e, t) {2372 const { name: n, attributes: i } = (0, r.parseComponentSelector)(t),2373 s = (function () {2374 const e = []2375 for (const t of document.querySelectorAll('[data-v-app]'))2376 t._vnode &&2377 t._vnode.component &&2378 e.push({ root: t._vnode.component, version: 3 })2379 const t = document.createTreeWalker(2380 document,2381 NodeFilter.SHOW_ELEMENT2382 ),2383 n = new Set()2384 for (; t.nextNode(); ) {2385 const e = t.currentNode2386 e && e.__vue__ && n.add(e.__vue__.$root)2387 }2388 for (const t of n) e.push({ version: 2, root: t })2389 return e2390 })()2391 .map((e) =>2392 3 === e.version2393 ? (function (e) {2394 function t(e, t) {2395 return (e.type.__playwright_guessedName = t), t2396 }2397 function n(e) {2398 const n = (function (e) {2399 const t =2400 e.name ||2401 e._componentTag ||2402 e.__playwright_guessedName2403 if (t) return t2404 const n = e.__file2405 return n ? c(o(n, '.vue')) : void 02406 })(e.type || {})2407 if (n) return n2408 if (e.root === e) return 'Root'2409 for (const n in null === (r = e.parent) ||2410 void 0 === r ||2411 null === (i = r.type) ||2412 void 0 === i2413 ? void 02414 : i.components) {2415 var r, i, s2416 if (2417 (null === (s = e.parent) || void 0 === s2418 ? void 02419 : s.type.components[n]) === e.type2420 )2421 return t(e, n)2422 }2423 for (const n in null === (a = e.appContext) ||2424 void 0 === a2425 ? void 02426 : a.components) {2427 var a2428 if (e.appContext.components[n] === e.type)2429 return t(e, n)2430 }2431 return 'Anonymous Component'2432 }2433 function r(e) {2434 const t = []2435 return (2436 e.component && t.push(e.component),2437 e.suspense && t.push(...r(e.suspense.activeBranch)),2438 Array.isArray(e.children) &&2439 e.children.forEach((e) => {2440 e.component2441 ? t.push(e.component)2442 : t.push(...r(e))2443 }),2444 t.filter((e) => {2445 var t2446 return !(2447 (function (e) {2448 return e._isBeingDestroyed || e.isUnmounted2449 })(e) ||2450 (null !== (t = e.type.devtools) &&2451 void 0 !== t &&2452 t.hide)2453 )2454 })2455 )2456 }2457 function i(e) {2458 return (function (e) {2459 return (2460 'Symbol(Fragment)' === e.subTree.type.toString()2461 )2462 })(e)2463 ? (function (e) {2464 if (!e.children) return []2465 const t = []2466 for (2467 let n = 0, r = e.children.length;2468 n < r;2469 n++2470 ) {2471 const r = e.children[n]2472 r.component2473 ? t.push(...i(r.component))2474 : r.el && t.push(r.el)2475 }2476 return t2477 })(e.subTree)2478 : [e.subTree.el]2479 }2480 return (function e(t) {2481 return {2482 name: n(t),2483 children: r(t.subTree).map(e),2484 rootElements: i(t),2485 props: t.props2486 }2487 })(e)2488 })(e.root)2489 : (function (e) {2490 function t(e) {2491 return (2492 (function (e) {2493 const t =2494 e.displayName || e.name || e._componentTag2495 if (t) return t2496 const n = e.__file2497 return n ? c(o(n, '.vue')) : void 02498 })(e.$options || e.fnOptions || {}) ||2499 (e.$root === e ? 'Root' : 'Anonymous Component')2500 )2501 }2502 function n(e) {2503 return e.$children2504 ? e.$children2505 : Array.isArray(e.subTree.children)2506 ? e.subTree.children2507 .filter((e) => !!e.component)2508 .map((e) => e.component)2509 : []2510 }2511 return (function e(r) {2512 return {2513 name: t(r),2514 children: n(r).map(e),2515 rootElements: [r.$el],2516 props: r._props2517 }2518 })(e)2519 })(e.root)2520 )2521 .map((t) =>2522 a(t, (t) => {2523 if (n && t.name !== n) return !12524 if (t.rootElements.some((t) => !e.contains(t))) return !12525 for (const e of i)2526 if (!(0, r.checkComponentAttribute)(t.props, e)) return !12527 return !02528 })2529 )2530 .flat(),2531 u = new Set()2532 for (const e of s) for (const t of e.rootElements) u.add(t)2533 return [...u]2534 }2535 }2536 t.VueEngine = u2537 },2538 530: (e, t) => {2539 Object.defineProperty(t, '__esModule', { value: !0 }),2540 (t.XPathEngine = void 0)2541 const n = {2542 queryAll(e, t) {2543 t.startsWith('/') && (t = '.' + t)2544 const n = [],2545 r = e instanceof Document ? e : e.ownerDocument2546 if (!r) return n2547 const o = r.evaluate(2548 t,2549 e,2550 null,2551 XPathResult.ORDERED_NODE_ITERATOR_TYPE2552 )2553 for (let e = o.iterateNext(); e; e = o.iterateNext())2554 e.nodeType === Node.ELEMENT_NODE && n.push(e)2555 return n2556 }2557 }2558 t.XPathEngine = n2559 }2560 },2561 t = {}2562 function n(r) {2563 var o = t[r]2564 if (void 0 !== o) return o.exports2565 var i = (t[r] = { exports: {} })2566 return e[r](i, i.exports, n), i.exports2567 }2568 n.g = (function () {2569 if ('object' == typeof globalThis) return globalThis2570 try {2571 return this || new Function('return this')()2572 } catch (e) {2573 if ('object' == typeof window) return window2574 }2575 })()2576 var r = {}2577 ;(() => {2578 var e = r2579 e.default = void 02580 var t = n(530),2581 o = n(836),2582 i = n(12),2583 s = n(461),2584 c = n(848),2585 a = n(854)2586 const u = new Set([2587 'AREA',2588 'BASE',2589 'BR',2590 'COL',2591 'COMMAND',2592 'EMBED',2593 'HR',2594 'IMG',2595 'INPUT',2596 'KEYGEN',2597 'LINK',2598 'MENUITEM',2599 'META',2600 'PARAM',2601 'SOURCE',2602 'TRACK',2603 'WBR'2604 ]),2605 l = new Set(['checked', 'selected', 'disabled', 'readonly', 'multiple'])2606 function h(e) {2607 return e.replace(/\n/g, 'âµ').replace(/\t/g, 'â')2608 }2609 const p = new Map([2610 ['auxclick', 'mouse'],2611 ['click', 'mouse'],2612 ['dblclick', 'mouse'],2613 ['mousedown', 'mouse'],2614 ['mouseeenter', 'mouse'],2615 ['mouseleave', 'mouse'],2616 ['mousemove', 'mouse'],2617 ['mouseout', 'mouse'],2618 ['mouseover', 'mouse'],2619 ['mouseup', 'mouse'],2620 ['mouseleave', 'mouse'],2621 ['mousewheel', 'mouse'],2622 ['keydown', 'keyboard'],2623 ['keyup', 'keyboard'],2624 ['keypress', 'keyboard'],2625 ['textInput', 'keyboard'],2626 ['touchstart', 'touch'],2627 ['touchmove', 'touch'],2628 ['touchend', 'touch'],2629 ['touchcancel', 'touch'],2630 ['pointerover', 'pointer'],2631 ['pointerout', 'pointer'],2632 ['pointerenter', 'pointer'],2633 ['pointerleave', 'pointer'],2634 ['pointerdown', 'pointer'],2635 ['pointerup', 'pointer'],2636 ['pointermove', 'pointer'],2637 ['pointercancel', 'pointer'],2638 ['gotpointercapture', 'pointer'],2639 ['lostpointercapture', 'pointer'],2640 ['focus', 'focus'],2641 ['blur', 'focus'],2642 ['drag', 'drag'],2643 ['dragstart', 'drag'],2644 ['dragend', 'drag'],2645 ['dragover', 'drag'],2646 ['dragenter', 'drag'],2647 ['dragleave', 'drag'],2648 ['dragexit', 'drag'],2649 ['drop', 'drag']2650 ])2651 function f(e) {2652 if (!e.includes('\\')) return e2653 const t = []2654 let n = 02655 for (; n < e.length; )2656 '\\' === e[n] && n + 1 < e.length && n++, t.push(e[n++])2657 return t.join('')2658 }2659 class d {2660 constructor(e) {2661 ;(this._string = void 0),2662 (this._substring = void 0),2663 (this._regex = void 0),2664 (this._normalizeWhiteSpace = void 0),2665 (this._normalizeWhiteSpace = e.normalizeWhiteSpace),2666 (this._string = e.matchSubstring2667 ? void 02668 : this.normalizeWhiteSpace(e.string)),2669 (this._substring = e.matchSubstring2670 ? this.normalizeWhiteSpace(e.string)2671 : void 0),2672 (this._regex = e.regexSource2673 ? new RegExp(e.regexSource, e.regexFlags)2674 : void 0)2675 }2676 matches(e) {2677 return (2678 this._normalizeWhiteSpace &&2679 !this._regex &&2680 (e = this.normalizeWhiteSpace(e)),2681 void 0 !== this._string2682 ? e === this._string2683 : void 0 !== this._substring2684 ? e.includes(this._substring)2685 : !!this._regex && !!this._regex.test(e)2686 )2687 }2688 normalizeWhiteSpace(e) {2689 return e && this._normalizeWhiteSpace2690 ? e.trim().replace(/\s+/g, ' ')2691 : e2692 }2693 }2694 function m(e, t) {2695 if (e === t) return !02696 if (e && t && 'object' == typeof e && 'object' == typeof t) {2697 if (e.constructor !== t.constructor) return !12698 if (Array.isArray(e)) {2699 if (e.length !== t.length) return !12700 for (let n = 0; n < e.length; ++n) if (!m(e[n], t[n])) return !12701 return !02702 }2703 if (e instanceof RegExp)2704 return e.source === t.source && e.flags === t.flags2705 if (e.valueOf !== Object.prototype.valueOf)2706 return e.valueOf() === t.valueOf()2707 if (e.toString !== Object.prototype.toString)2708 return e.toString() === t.toString()2709 const n = Object.keys(e)2710 if (n.length !== Object.keys(t).length) return !12711 for (let e = 0; e < n.length; ++e)2712 if (!t.hasOwnProperty(n[e])) return !12713 for (const r of n) if (!m(e[r], t[r])) return !12714 return !02715 }2716 return (2717 'number' == typeof e && 'number' == typeof t && isNaN(e) && isNaN(t)2718 )2719 }2720 var g = class {2721 constructor(e, n, r) {2722 ;(this._engines = void 0),2723 (this._evaluator = void 0),2724 (this._stableRafCount = void 0),2725 (this._browserName = void 0),2726 (this.onGlobalListenersRemoved = new Set()),2727 (this._evaluator = new c.SelectorEvaluatorImpl(new Map())),2728 (this._engines = new Map()),2729 this._engines.set('xpath', t.XPathEngine),2730 this._engines.set('xpath:light', t.XPathEngine),2731 this._engines.set('_react', o.ReactEngine),2732 this._engines.set('_vue', i.VueEngine),2733 this._engines.set('text', this._createTextEngine(!0)),2734 this._engines.set('text:light', this._createTextEngine(!1)),2735 this._engines.set('id', this._createAttributeEngine('id', !0)),2736 this._engines.set('id:light', this._createAttributeEngine('id', !1)),2737 this._engines.set(2738 'data-testid',2739 this._createAttributeEngine('data-testid', !0)2740 ),2741 this._engines.set(2742 'data-testid:light',2743 this._createAttributeEngine('data-testid', !1)2744 ),2745 this._engines.set(2746 'data-test-id',2747 this._createAttributeEngine('data-test-id', !0)2748 ),2749 this._engines.set(2750 'data-test-id:light',2751 this._createAttributeEngine('data-test-id', !1)2752 ),2753 this._engines.set(2754 'data-test',2755 this._createAttributeEngine('data-test', !0)2756 ),2757 this._engines.set(2758 'data-test:light',2759 this._createAttributeEngine('data-test', !1)2760 ),2761 this._engines.set('css', this._createCSSEngine()),2762 this._engines.set('nth', { queryAll: () => [] }),2763 this._engines.set('visible', { queryAll: () => [] })2764 for (const { name: e, engine: t } of r) this._engines.set(e, t)2765 ;(this._stableRafCount = e),2766 (this._browserName = n),2767 this._setupGlobalListenersRemovalDetection()2768 }2769 eval(e) {2770 return n.g.eval(e)2771 }2772 parseSelector(e) {2773 const t = (0, s.parseSelector)(e)2774 for (const n of t.parts)2775 if (!this._engines.has(n.name))2776 throw this.createStacklessError(2777 `Unknown engine "${n.name}" while parsing selector ${e}`2778 )2779 return t2780 }2781 querySelector(e, t, n) {2782 if (!t.querySelector)2783 throw this.createStacklessError('Node is not queryable.')2784 this._evaluator.begin()2785 try {2786 var r, o2787 const i = this._querySelectorRecursively(2788 [{ element: t, capture: void 0 }],2789 e,2790 0,2791 new Map()2792 )2793 if (n && i.length > 1)2794 throw this.strictModeViolationError(2795 e,2796 i.map((e) => e.element)2797 )2798 return (2799 (null === (r = i[0]) || void 0 === r ? void 0 : r.capture) ||2800 (null === (o = i[0]) || void 0 === o ? void 0 : o.element)2801 )2802 } finally {2803 this._evaluator.end()2804 }2805 }2806 _querySelectorRecursively(e, t, n, r) {2807 if (n === t.parts.length) return e2808 const o = t.parts[n]2809 if ('nth' === o.name) {2810 let i = []2811 if ('0' === o.body) i = e.slice(0, 1)2812 else if ('-1' === o.body) e.length && (i = e.slice(e.length - 1))2813 else {2814 if ('number' == typeof t.capture)2815 throw this.createStacklessError(2816 "Can't query n-th element in a request with the capture."2817 )2818 const n = +o.body,2819 r = new Set()2820 for (const t of e) r.add(t.element), n + 1 === r.size && (i = [t])2821 }2822 return this._querySelectorRecursively(i, t, n + 1, r)2823 }2824 if ('visible' === o.name) {2825 const i = Boolean(o.body),2826 s = e.filter((e) => i === (0, c.isVisible)(e.element))2827 return this._querySelectorRecursively(s, t, n + 1, r)2828 }2829 const i = []2830 for (const o of e) {2831 const e = n - 1 === t.capture ? o.element : o.capture2832 let s = r.get(o.element)2833 s || ((s = []), r.set(o.element, s))2834 let c = s[n]2835 c || ((c = this._queryEngineAll(t.parts[n], o.element)), (s[n] = c))2836 for (const t of c) {2837 if (!('nodeName' in t))2838 throw this.createStacklessError(2839 `Expected a Node but got ${Object.prototype.toString.call(t)}`2840 )2841 i.push({ element: t, capture: e })2842 }2843 }2844 return this._querySelectorRecursively(i, t, n + 1, r)2845 }2846 querySelectorAll(e, t) {2847 if (!t.querySelectorAll)2848 throw this.createStacklessError('Node is not queryable.')2849 this._evaluator.begin()2850 try {2851 const n = this._querySelectorRecursively(2852 [{ element: t, capture: void 0 }],2853 e,2854 0,2855 new Map()2856 ),2857 r = new Set()2858 for (const e of n) r.add(e.capture || e.element)2859 return [...r]2860 } finally {2861 this._evaluator.end()2862 }2863 }2864 _queryEngineAll(e, t) {2865 return this._engines.get(e.name).queryAll(t, e.body)2866 }2867 _createAttributeEngine(e, t) {2868 return {2869 queryAll: (n, r) =>2870 this._evaluator.query(2871 { scope: n, pierceShadow: t },2872 ((t) => [2873 {2874 simples: [2875 {2876 selector: {2877 css: `[${e}=${JSON.stringify(t)}]`,2878 functions: []2879 },2880 combinator: ''2881 }2882 ]2883 }2884 ])(r)2885 )2886 }2887 }2888 _createCSSEngine() {2889 const e = this._evaluator2890 return {2891 queryAll: (t, n) => e.query({ scope: t, pierceShadow: !0 }, n)2892 }2893 }2894 _createTextEngine(e) {2895 const t = (t, n) => {2896 const { matcher: r, kind: o } = (function (e) {2897 if ('/' === e[0] && e.lastIndexOf('/') > 0) {2898 const t = e.lastIndexOf('/')2899 return {2900 matcher: (0, c.createRegexTextMatcher)(2901 e.substring(1, t),2902 e.substring(t + 1)2903 ),2904 kind: 'regex'2905 }2906 }2907 let t = !12908 return (2909 e.length > 1 &&2910 '"' === e[0] &&2911 '"' === e[e.length - 1] &&2912 ((e = f(e.substring(1, e.length - 1))), (t = !0)),2913 e.length > 1 &&2914 "'" === e[0] &&2915 "'" === e[e.length - 1] &&2916 ((e = f(e.substring(1, e.length - 1))), (t = !0)),2917 {2918 matcher: t2919 ? (0, c.createStrictTextMatcher)(e)2920 : (0, c.createLaxTextMatcher)(e),2921 kind: t ? 'strict' : 'lax'2922 }2923 )2924 })(n),2925 i = []2926 let s = null2927 const a = (e) => {2928 if ('lax' === o && s && s.contains(e)) return !12929 const t = (0, c.elementMatchesText)(this._evaluator, e, r)2930 'none' === t && (s = e),2931 ('self' === t || ('selfAndChildren' === t && 'strict' === o)) &&2932 i.push(e)2933 }2934 t.nodeType === Node.ELEMENT_NODE && a(t)2935 const u = this._evaluator._queryCSS(2936 { scope: t, pierceShadow: e },2937 '*'2938 )2939 for (const e of u) a(e)2940 return i2941 }2942 return { queryAll: (e, n) => t(e, n) }2943 }2944 extend(e, t) {2945 return new (n.g.eval(2946 `\n (() => {\n ${e}\n return pwExport;\n })()`2947 ))(this, t)2948 }2949 isVisible(e) {2950 return (0, c.isVisible)(e)2951 }2952 pollRaf(e) {2953 return this.poll(e, (e) => requestAnimationFrame(e))2954 }2955 pollInterval(e, t) {2956 return this.poll(t, (t) => setTimeout(t, e))2957 }2958 pollLogScale(e) {2959 const t = [100, 250, 500]2960 let n = 02961 return this.poll(e, (e) => setTimeout(e, t[n++] || 1e3))2962 }2963 poll(e, t) {2964 return this._runAbortableTask((n) => {2965 let r, o2966 const i = new Promise((e, t) => {2967 ;(r = e), (o = t)2968 }),2969 s = () => {2970 if (!n.aborted)2971 try {2972 const o = e(n)2973 o !== n.continuePolling ? r(o) : t(s)2974 } catch (e) {2975 n.log(' ' + e.message), o(e)2976 }2977 }2978 return s(), i2979 })2980 }2981 _runAbortableTask(e) {2982 let t,2983 n = [],2984 r = !12985 const o = () => {2986 t && (t(n), (n = []), (t = void 0))2987 }2988 let i,2989 s = ''2990 const c = {2991 injectedScript: this,2992 aborted: !1,2993 continuePolling: Symbol('continuePolling'),2994 log: (e) => {2995 ;(s = e), n.push({ message: e }), o()2996 },2997 logRepeating: (e) => {2998 e !== s && c.log(e)2999 },3000 setIntermediateResult: (e) => {3001 i !== e && ((i = e), n.push({ intermediateResult: e }), o())3002 }3003 }3004 return {3005 takeNextLogs: () =>3006 new Promise((e) => {3007 ;(t = e), (n.length || r) && o()3008 }),3009 run: () => {3010 const t = e(c)3011 return (3012 t.finally(() => {3013 ;(r = !0), o()3014 }),3015 t3016 )3017 },3018 cancel: () => {3019 c.aborted = !03020 },3021 takeLastLogs: () => n3022 }3023 }3024 getElementBorderWidth(e) {3025 if (3026 e.nodeType !== Node.ELEMENT_NODE ||3027 !e.ownerDocument ||3028 !e.ownerDocument.defaultView3029 )3030 return { left: 0, top: 0 }3031 const t = e.ownerDocument.defaultView.getComputedStyle(e)3032 return {3033 left: parseInt(t.borderLeftWidth || '', 10),3034 top: parseInt(t.borderTopWidth || '', 10)3035 }3036 }3037 retarget(e, t) {3038 let n = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement3039 return n3040 ? (n.matches('input, textarea, select') ||3041 (n =3042 n.closest(3043 'button, [role=button], [role=checkbox], [role=radio]'3044 ) || n),3045 'follow-label' === t &&3046 (n.matches(3047 'input, textarea, button, select, [role=button], [role=checkbox], [role=radio]'3048 ) ||3049 n.isContentEditable ||3050 (n = n.closest('label') || n),3051 'LABEL' === n.nodeName && (n = n.control || n)),3052 n)3053 : null3054 }3055 waitForElementStatesAndPerformAction(e, t, n, r) {3056 let o,3057 i = 0,3058 s = 0,3059 c = 03060 return this.pollRaf((a) => {3061 if (n) return a.log(' forcing action'), r(e, a)3062 for (const n of t) {3063 if ('stable' !== n) {3064 const t = this.elementState(e, n)3065 if ('boolean' != typeof t) return t3066 if (!t)3067 return (3068 a.logRepeating(` element is not ${n} - waiting...`),3069 a.continuePolling3070 )3071 continue3072 }3073 const t = this.retarget(e, 'no-follow-label')3074 if (!t) return 'error:notconnected'3075 if (1 == ++i) return a.continuePolling3076 const r = performance.now()3077 if (this._stableRafCount > 1 && r - c < 15) return a.continuePolling3078 c = r3079 const u = t.getBoundingClientRect(),3080 l = { x: u.top, y: u.left, width: u.width, height: u.height }3081 o &&3082 l.x === o.x &&3083 l.y === o.y &&3084 l.width === o.width &&3085 l.height === o.height3086 ? ++s3087 : (s = 0)3088 const h = s >= this._stableRafCount,3089 p = h || !o3090 if (3091 ((o = l),3092 p || a.logRepeating(' element is not stable - waiting...'),3093 !h)3094 )3095 return a.continuePolling3096 }3097 return r(e, a)3098 })3099 }3100 elementState(e, t) {3101 const n = this.retarget(3102 e,3103 ['stable', 'visible', 'hidden'].includes(t)3104 ? 'no-follow-label'3105 : 'follow-label'3106 )3107 if (!n || !n.isConnected) return 'hidden' === t || 'error:notconnected'3108 if ('visible' === t) return this.isVisible(n)3109 if ('hidden' === t) return !this.isVisible(n)3110 const r =3111 ['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'].includes(n.nodeName) &&3112 n.hasAttribute('disabled')3113 if ('disabled' === t) return r3114 if ('enabled' === t) return !r3115 const o = !(3116 ['INPUT', 'TEXTAREA', 'SELECT'].includes(n.nodeName) &&3117 n.hasAttribute('readonly')3118 )3119 if ('editable' === t) return !r && o3120 if ('checked' === t) {3121 if (['checkbox', 'radio'].includes(n.getAttribute('role') || ''))3122 return 'true' === n.getAttribute('aria-checked')3123 if ('INPUT' !== n.nodeName)3124 throw this.createStacklessError('Not a checkbox or radio button')3125 if (!['radio', 'checkbox'].includes(n.type.toLowerCase()))3126 throw this.createStacklessError('Not a checkbox or radio button')3127 return n.checked3128 }3129 throw this.createStacklessError(`Unexpected element state "${t}"`)3130 }3131 selectOptions(e, t, n) {3132 const r = this.retarget(t, 'follow-label')3133 if (!r) return 'error:notconnected'3134 if ('select' !== r.nodeName.toLowerCase())3135 throw this.createStacklessError('Element is not a <select> element')3136 const o = r,3137 i = [...o.options],3138 s = []3139 let c = e.slice()3140 for (let e = 0; e < i.length; e++) {3141 const t = i[e],3142 n = (n) => {3143 if (n instanceof Node) return t === n3144 let r = !03145 return (3146 void 0 !== n.value && (r = r && n.value === t.value),3147 void 0 !== n.label && (r = r && n.label === t.label),3148 void 0 !== n.index && (r = r && n.index === e),3149 r3150 )3151 }3152 if (c.some(n)) {3153 if ((s.push(t), !o.multiple)) {3154 c = []3155 break3156 }3157 c = c.filter((e) => !n(e))3158 }3159 }3160 return c.length3161 ? (n.logRepeating(' did not find some options - waiting... '),3162 n.continuePolling)3163 : ((o.value = void 0),3164 s.forEach((e) => (e.selected = !0)),3165 n.log(' selected specified option(s)'),3166 o.dispatchEvent(new Event('input', { bubbles: !0 })),3167 o.dispatchEvent(new Event('change', { bubbles: !0 })),3168 s.map((e) => e.value))3169 }3170 fill(e, t, n) {3171 const r = this.retarget(t, 'follow-label')3172 if (!r) return 'error:notconnected'3173 if ('input' === r.nodeName.toLowerCase()) {3174 const t = r,3175 o = t.type.toLowerCase(),3176 i = new Set([3177 'date',3178 'time',3179 'datetime',3180 'datetime-local',3181 'month',3182 'week'3183 ])3184 if (3185 !new Set([3186 '',3187 'email',3188 'number',3189 'password',3190 'search',3191 'tel',3192 'text',3193 'url'3194 ]).has(o) &&3195 !i.has(o)3196 )3197 throw (3198 (n.log(` input of type "${o}" cannot be filled`),3199 this.createStacklessError(3200 `Input of type "${o}" cannot be filled`3201 ))3202 )3203 if ('number' === o && ((e = e.trim()), isNaN(Number(e))))3204 throw this.createStacklessError(3205 'Cannot type text into input[type=number]'3206 )3207 if (i.has(o)) {3208 if (((e = e.trim()), t.focus(), (t.value = e), t.value !== e))3209 throw this.createStacklessError('Malformed value')3210 return (3211 r.dispatchEvent(new Event('input', { bubbles: !0 })),3212 r.dispatchEvent(new Event('change', { bubbles: !0 })),3213 'done'3214 )3215 }3216 } else if ('textarea' === r.nodeName.toLowerCase());3217 else if (!r.isContentEditable)3218 throw this.createStacklessError(3219 'Element is not an <input>, <textarea> or [contenteditable] element'3220 )3221 return this.selectText(r), 'needsinput'3222 }3223 selectText(e) {3224 const t = this.retarget(e, 'follow-label')3225 if (!t) return 'error:notconnected'3226 if ('input' === t.nodeName.toLowerCase()) {3227 const e = t3228 return e.select(), e.focus(), 'done'3229 }3230 if ('textarea' === t.nodeName.toLowerCase()) {3231 const e = t3232 return (3233 (e.selectionStart = 0),3234 (e.selectionEnd = e.value.length),3235 e.focus(),3236 'done'3237 )3238 }3239 const n = t.ownerDocument.createRange()3240 n.selectNodeContents(t)3241 const r = t.ownerDocument.defaultView.getSelection()3242 return r && (r.removeAllRanges(), r.addRange(n)), t.focus(), 'done'3243 }3244 focusNode(e, t) {3245 if (!e.isConnected) return 'error:notconnected'3246 if (e.nodeType !== Node.ELEMENT_NODE)3247 throw this.createStacklessError('Node is not an element')3248 const n =3249 e.getRootNode().activeElement === e &&3250 e.ownerDocument &&3251 e.ownerDocument.hasFocus()3252 if ((e.focus(), t && !n && 'input' === e.nodeName.toLowerCase()))3253 try {3254 e.setSelectionRange(0, 0)3255 } catch (e) {}3256 return 'done'3257 }3258 setInputFiles(e, t) {3259 if (e.nodeType !== Node.ELEMENT_NODE)3260 return 'Node is not of type HTMLElement'3261 const n = e3262 if ('INPUT' !== n.nodeName) return 'Not an <input> element'3263 const r = n3264 if ('file' !== (r.getAttribute('type') || '').toLowerCase())3265 return 'Not an input[type=file] element'3266 const o = t.map((e) => {3267 const t = Uint8Array.from(atob(e.buffer), (e) => e.charCodeAt(0))3268 return new File([t], e.name, { type: e.mimeType })3269 }),3270 i = new DataTransfer()3271 for (const e of o) i.items.add(e)3272 ;(r.files = i.files),3273 r.dispatchEvent(new Event('input', { bubbles: !0 })),3274 r.dispatchEvent(new Event('change', { bubbles: !0 }))3275 }3276 checkHitTargetAt(e, t) {3277 let n = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement3278 if (!n || !n.isConnected) return 'error:notconnected'3279 n = n.closest('button, [role=button]') || n3280 let r = this.deepElementFromPoint(document, t.x, t.y)3281 const o = []3282 for (; r && r !== n; )3283 o.push(r), (r = (0, c.parentElementOrShadowHost)(r))3284 if (r === n) return 'done'3285 const i = this.previewNode(o[0])3286 let s3287 for (; n; ) {3288 const e = o.indexOf(n)3289 if (-1 !== e) {3290 e > 1 && (s = this.previewNode(o[e - 1]))3291 break3292 }3293 n = (0, c.parentElementOrShadowHost)(n)3294 }3295 return s3296 ? { hitTargetDescription: `${i} from ${s} subtree` }3297 : { hitTargetDescription: i }3298 }3299 dispatchEvent(e, t, n) {3300 let r3301 switch (3302 ((n = { bubbles: !0, cancelable: !0, composed: !0, ...n }), p.get(t))3303 ) {3304 case 'mouse':3305 r = new MouseEvent(t, n)3306 break3307 case 'keyboard':3308 r = new KeyboardEvent(t, n)3309 break3310 case 'touch':3311 r = new TouchEvent(t, n)3312 break3313 case 'pointer':3314 r = new PointerEvent(t, n)3315 break3316 case 'focus':3317 r = new FocusEvent(t, n)3318 break3319 case 'drag':3320 r = new DragEvent(t, n)3321 break3322 default:3323 r = new Event(t, n)3324 }3325 e.dispatchEvent(r)3326 }3327 deepElementFromPoint(e, t, n) {3328 let r,3329 o = e3330 for (; o; ) {3331 const e = o.elementsFromPoint(t, n)[0]3332 if (!e || r === e) break3333 ;(r = e), (o = r.shadowRoot)3334 }3335 return r3336 }3337 previewNode(e) {3338 if (e.nodeType === Node.TEXT_NODE)3339 return h(`#text=${e.nodeValue || ''}`)3340 if (e.nodeType !== Node.ELEMENT_NODE)3341 return h(`<${e.nodeName.toLowerCase()} />`)3342 const t = e,3343 n = []3344 for (let e = 0; e < t.attributes.length; e++) {3345 const { name: r, value: o } = t.attributes[e]3346 'style' === r ||3347 r.startsWith('__playwright') ||3348 (!o && l.has(r) ? n.push(` ${r}`) : n.push(` ${r}="${o}"`))3349 }3350 n.sort((e, t) => e.length - t.length)3351 let r = n.join('')3352 if (3353 (r.length > 50 && (r = r.substring(0, 49) + 'â¦'), u.has(t.nodeName))3354 )3355 return h(`<${t.nodeName.toLowerCase()}${r}/>`)3356 const o = t.childNodes3357 let i = !13358 if (o.length <= 5) {3359 i = !03360 for (let e = 0; e < o.length; e++)3361 i = i && o[e].nodeType === Node.TEXT_NODE3362 }3363 let s = i ? t.textContent || '' : o.length ? 'â¦' : ''3364 return (3365 s.length > 50 && (s = s.substring(0, 49) + 'â¦'),3366 h(3367 `<${t.nodeName.toLowerCase()}${r}>${s}</${t.nodeName.toLowerCase()}>`3368 )3369 )3370 }3371 strictModeViolationError(e, t) {3372 const n = t3373 .slice(0, 10)3374 .map((e) => ({3375 preview: this.previewNode(e),3376 selector: (0, a.generateSelector)(this, e).selector3377 })),3378 r = n.map(3379 (e, t) =>3380 `\n ${t + 1}) ${e.preview} aka playwright.$("${e.selector}")`3381 )3382 return (3383 n.length < t.length && r.push('\n ...'),3384 this.createStacklessError(3385 `strict mode violation: "${e.selector}" resolved to ${3386 t.length3387 } elements:${r.join('')}\n`3388 )3389 )3390 }3391 createStacklessError(e) {3392 if ('firefox' === this._browserName) {3393 const t = new Error('Error: ' + e)3394 return (t.stack = ''), t3395 }3396 const t = new Error(e)3397 return delete t.stack, t3398 }3399 _setupGlobalListenersRemovalDetection() {3400 const e = '__playwright_global_listeners_check__'3401 let t = !13402 const n = () => (t = !0)3403 window.addEventListener(e, n),3404 new MutationObserver((r) => {3405 if (3406 r.some((e) =>3407 Array.from(e.addedNodes).includes(document.documentElement)3408 ) &&3409 ((t = !1), window.dispatchEvent(new CustomEvent(e)), !t)3410 ) {3411 window.addEventListener(e, n)3412 for (const e of this.onGlobalListenersRemoved) e()3413 }3414 }).observe(document, { childList: !0 })3415 }3416 expectSingleElement(e, t, n) {3417 const r = e.injectedScript,3418 o = n.expression3419 {3420 let n3421 if ('to.be.checked' === o)3422 n = e.injectedScript.elementState(t, 'checked')3423 else if ('to.be.disabled' === o)3424 n = e.injectedScript.elementState(t, 'disabled')3425 else if ('to.be.editable' === o)3426 n = e.injectedScript.elementState(t, 'editable')3427 else if ('to.be.empty' === o) {3428 var i3429 n =3430 'INPUT' === t.nodeName || 'TEXTAREA' === t.nodeName3431 ? !t.value3432 : !(null !== (i = t.textContent) && void 0 !== i && i.trim())3433 } else3434 'to.be.enabled' === o3435 ? (n = e.injectedScript.elementState(t, 'enabled'))3436 : 'to.be.focused' === o3437 ? (n = document.activeElement === t)3438 : 'to.be.hidden' === o3439 ? (n = e.injectedScript.elementState(t, 'hidden'))3440 : 'to.be.visible' === o &&3441 (n = e.injectedScript.elementState(t, 'visible'))3442 if (void 0 !== n) {3443 if ('error:notcheckbox' === n)3444 throw r.createStacklessError('Element is not a checkbox')3445 if ('error:notconnected' === n)3446 throw r.createStacklessError('Element is not connected')3447 return { received: n, matches: n }3448 }3449 }3450 if ('to.have.property' === o) {3451 const e = t[n.expressionArg]3452 return { received: e, matches: m(e, n.expectedValue) }3453 }3454 {3455 let e3456 if ('to.have.attribute' === o)3457 e = t.getAttribute(n.expressionArg) || ''3458 else if ('to.have.class' === o) e = t.className3459 else if ('to.have.css' === o)3460 e = window.getComputedStyle(t)[n.expressionArg]3461 else if ('to.have.id' === o) e = t.id3462 else if ('to.have.text' === o)3463 e = n.useInnerText ? t.innerText : t.textContent || ''3464 else if ('to.have.title' === o) e = document.title3465 else if ('to.have.url' === o) e = document.location.href3466 else if ('to.have.value' === o) {3467 if (3468 'INPUT' !== t.nodeName &&3469 'TEXTAREA' !== t.nodeName &&3470 'SELECT' !== t.nodeName3471 )3472 throw this.createStacklessError('Not an input element')3473 e = t.value3474 }3475 if (void 0 !== e && n.expectedText)3476 return { received: e, matches: new d(n.expectedText[0]).matches(e) }3477 }3478 throw this.createStacklessError('Unknown expect matcher: ' + o)3479 }3480 expectArray(e, t) {3481 const n = t.expression3482 if ('to.have.count' === n) {3483 const n = e.length3484 return { received: n, matches: n === t.expectedNumber }3485 }3486 let r3487 if (3488 ('to.have.text.array' === n || 'to.contain.text.array' === n3489 ? (r = e.map((e) =>3490 t.useInnerText ? e.innerText : e.textContent || ''3491 ))3492 : 'to.have.class.array' === n && (r = e.map((e) => e.className)),3493 r && t.expectedText)3494 ) {3495 const e = 'to.contain.text.array' !== n3496 if (r.length !== t.expectedText.length && e)3497 return { received: r, matches: !1 }3498 let o = 03499 const i = t.expectedText.map((e) => new d(e))3500 let s = !03501 for (const e of i) {3502 for (; o < r.length && !e.matches(r[o]); ) o++3503 if (o >= r.length) {3504 s = !13505 break3506 }3507 }3508 return { received: r, matches: s }3509 }3510 throw this.createStacklessError('Unknown expect matcher: ' + n)3511 }3512 }3513 e.default = g3514 })(),3515 (pwExport = r.default)...
componentUtils.js
Source:componentUtils.js
...18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.19 * See the License for the specific language governing permissions and20 * limitations under the License.21 */22function checkComponentAttribute(obj, attr) {23 for (const token of attr.jsonPath) {24 if (obj !== undefined && obj !== null) obj = obj[token];25 }26 const objValue = typeof obj === 'string' && !attr.caseSensetive ? obj.toUpperCase() : obj;27 const attrValue = typeof attr.value === 'string' && !attr.caseSensetive ? attr.value.toUpperCase() : attr.value;28 if (attr.op === '<truthy>') return !!objValue;29 if (attr.op === '=') return objValue === attrValue;30 if (typeof objValue !== 'string' || typeof attrValue !== 'string') return false;31 if (attr.op === '*=') return objValue.includes(attrValue);32 if (attr.op === '^=') return objValue.startsWith(attrValue);33 if (attr.op === '$=') return objValue.endsWith(attrValue);34 if (attr.op === '|=') return objValue === attrValue || objValue.startsWith(attrValue + '-');35 if (attr.op === '~=') return objValue.split(' ').includes(attrValue);36 return false;...
Using AI Code Generation
1const {chromium} = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 const attributeValue = await page.checkComponentAttribute('text=Get started', 'aria-label');7 console.log(attributeValue);8 await browser.close();9})();10const {chromium} = require('playwright');11(async () => {12 const browser = await chromium.launch();13 const context = await browser.newContext();14 const page = await context.newPage();15 const propertyValue = await page.checkComponentProperty('text=Get started', 'disabled');16 console.log(propertyValue);17 await browser.close();18})();19const {chromium} = require('playwright');20(async () => {21 const browser = await chromium.launch();22 const context = await browser.newContext();23 const page = await context.newPage();24 const stateValue = await page.checkComponentState('text=Get started', 'hovered');25 console.log(stateValue);26 await browser.close();27})();
Using AI Code Generation
1const { checkComponentAttribute } = require('playwright');2const { chromium } = require('playwright-chromium');3(async () => {4 const browser = await chromium.launch();5 const context = await browser.newContext();6 const page = await context.newPage();7 const check = await checkComponentAttribute(page, 'text=Get Started', 'button');8 console.log(check);9})();
Using AI Code Generation
1const {checkComponentAttribute} = require('playwright');2const {chromium} = require('playwright');3(async () => {4 const browser = await chromium.launch();5 const context = await browser.newContext();6 const page = await context.newPage();7 await page.click('[aria-label="Google apps"]');8 await page.click('text=Drive');9 await page.click('[aria-label="Google apps"]');10 await page.click('text=Calendar');11 await page.click('[aria-label="Google apps"]');12 await page.click('text=YouTube');13 await page.click('[aria-label="Google apps"]');14 await page.click('text=Gmail');15 await page.click('[aria-label="Google apps"]');16 await page.click('text=Contacts');17 await page.click('[aria-label="Google apps"]');18 await page.click('text=Translate');19 await page.click('[aria-label="Google apps"]');20 await page.click('text=Photos');21 await page.click('[aria-label="Google apps"]');22 await page.click('text=Keep');23 await page.click('[aria-label="Google apps"]');24 await page.click('text=Tasks');25 await page.click('[aria-label="Google apps"]');26 await page.click('text=News');27 await page.click('[aria-label="Google apps"]');28 await page.click('text=Shopping');29 await page.click('[aria
Using AI Code Generation
1const {checkComponentAttribute} = require('playwright');2const {chromium} = require('playwright');3(async () => {4 const browser = await chromium.launch({headless: false});5 const context = await browser.newContext();6 const page = await context.newPage();7 const searchInput = await page.$('input[type="text"]');8 const hasAriaLabel = await checkComponentAttribute(searchInput, 'aria-label');9 console.log(hasAriaLabel);10 await browser.close();11})();12const {checkComponentProperty} = require('playwright');13const {chromium} = require('playwright');14(async () => {15 const browser = await chromium.launch({headless: false});16 const context = await browser.newContext();17 const page = await context.newPage();18 const searchInput = await page.$('input[type="text"]');19 const hasAriaLabel = await checkComponentProperty(searchInput, 'aria-label');20 console.log(hasAriaLabel);21 await browser.close();22})();23const {checkComponentState} = require('playwright');24const {chromium} = require('playwright');25(async () => {26 const browser = await chromium.launch({headless: false});27 const context = await browser.newContext();28 const page = await context.newPage();29 const searchInput = await page.$('input[type="text"]');30 const hasAriaLabel = await checkComponentState(searchInput, 'aria-label');31 console.log(hasAriaLabel);32 await browser.close();33})();
Using AI Code Generation
1const { checkComponentAttribute } = require('@playwright/test');2const { test, expect } = require('@playwright/test');3test('test', async ({ page }) => {4 const result = await checkComponentAttribute(page, 'text=Get Started', 'href', '/docs/intro');5 expect(result).toBe(true);6});
Using AI Code Generation
1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 const checkComponentAttribute = page._delegate.checkComponentAttribute;7 console.log(result);8 await browser.close();9})();
Using AI Code Generation
1const { checkComponentAttribute } = require('@playwright/test/lib/server/traceViewer/ui/traceModel');2const { chromium } = require('playwright');3(async () => {4 const browser = await chromium.launch();5 const context = await browser.newContext();6 const page = await context.newPage();7 await checkComponentAttribute(page, 'input[name="q"]');8 await browser.close();9})();
LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.
Get 100 minutes of automation test minutes FREE!!