selenium-webdriver 4.35.0 → 4.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +111 -0
  3. data/Gemfile +1 -4
  4. data/LICENSE +1 -1
  5. data/NOTICE +1 -1
  6. data/README.md +43 -23
  7. data/bin/linux/selenium-manager +0 -0
  8. data/bin/macos/selenium-manager +0 -0
  9. data/bin/selenium-manager-THIRD-PARTY-NOTICES.txt +5971 -0
  10. data/bin/selenium-manager.cdx.json +11629 -0
  11. data/bin/windows/selenium-manager.exe +0 -0
  12. data/lib/selenium/server.rb +30 -5
  13. data/lib/selenium/webdriver/atoms/findElements.js +272 -54
  14. data/lib/selenium/webdriver/atoms/getAttribute.js +152 -6
  15. data/lib/selenium/webdriver/atoms/isDisplayed.js +385 -28
  16. data/lib/selenium/webdriver/bidi/browser.rb +71 -0
  17. data/lib/selenium/webdriver/bidi/browsing_context.rb +3 -2
  18. data/lib/selenium/webdriver/bidi/{log/filter_by.rb → error.rb} +20 -16
  19. data/lib/selenium/webdriver/bidi/log_handler.rb +5 -0
  20. data/lib/selenium/webdriver/bidi/network/cookies.rb +13 -9
  21. data/lib/selenium/webdriver/bidi/network/credentials.rb +4 -0
  22. data/lib/selenium/webdriver/bidi/network/headers.rb +4 -0
  23. data/lib/selenium/webdriver/bidi/network/intercepted_auth.rb +4 -0
  24. data/lib/selenium/webdriver/bidi/network/intercepted_item.rb +4 -0
  25. data/lib/selenium/webdriver/bidi/network/intercepted_request.rb +20 -4
  26. data/lib/selenium/webdriver/bidi/network/intercepted_response.rb +24 -6
  27. data/lib/selenium/webdriver/bidi/network/url_pattern.rb +4 -0
  28. data/lib/selenium/webdriver/bidi/network.rb +18 -9
  29. data/lib/selenium/webdriver/bidi/protocol/bluetooth.rb +495 -0
  30. data/lib/selenium/webdriver/bidi/protocol/browser.rb +250 -0
  31. data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +798 -0
  32. data/lib/selenium/webdriver/bidi/{log/base_log_entry.rb → protocol/domain.rb} +22 -11
  33. data/lib/selenium/webdriver/bidi/protocol/emulation.rb +448 -0
  34. data/lib/selenium/webdriver/bidi/protocol/error_code.rb +66 -0
  35. data/lib/selenium/webdriver/bidi/protocol/input.rb +354 -0
  36. data/lib/selenium/webdriver/bidi/protocol/log.rb +115 -0
  37. data/lib/selenium/webdriver/bidi/protocol/network.rb +720 -0
  38. data/lib/selenium/webdriver/bidi/protocol/permissions.rb +75 -0
  39. data/lib/selenium/webdriver/bidi/protocol/script.rb +1052 -0
  40. data/lib/selenium/webdriver/bidi/protocol/session.rb +286 -0
  41. data/lib/selenium/webdriver/bidi/protocol/speculation.rb +58 -0
  42. data/lib/selenium/webdriver/bidi/protocol/storage.rb +183 -0
  43. data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +88 -0
  44. data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +132 -0
  45. data/lib/selenium/webdriver/bidi/protocol.rb +42 -0
  46. data/lib/selenium/webdriver/bidi/serialization/record.rb +402 -0
  47. data/lib/selenium/webdriver/bidi/serialization/union.rb +156 -0
  48. data/lib/selenium/webdriver/bidi/serialization.rb +90 -0
  49. data/lib/selenium/webdriver/bidi/session.rb +4 -0
  50. data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +1420 -0
  51. data/lib/selenium/webdriver/bidi/support/check_generated.rb +63 -0
  52. data/lib/selenium/webdriver/bidi/transport.rb +57 -0
  53. data/lib/selenium/webdriver/bidi.rb +4 -1
  54. data/lib/selenium/webdriver/chrome/driver.rb +4 -3
  55. data/lib/selenium/webdriver/chrome/service.rb +13 -0
  56. data/lib/selenium/webdriver/chromium/driver.rb +0 -1
  57. data/lib/selenium/webdriver/chromium/options.rb +23 -1
  58. data/lib/selenium/webdriver/chromium/profile.rb +6 -0
  59. data/lib/selenium/webdriver/common/child_process.rb +2 -1
  60. data/lib/selenium/webdriver/common/client_config.rb +97 -0
  61. data/lib/selenium/webdriver/common/driver.rb +13 -7
  62. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +0 -7
  63. data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +0 -7
  64. data/lib/selenium/webdriver/common/driver_extensions/{has_bidi.rb → has_session_events.rb} +19 -7
  65. data/lib/selenium/webdriver/common/driver_finder.rb +35 -25
  66. data/lib/selenium/webdriver/common/error.rb +10 -3
  67. data/lib/selenium/webdriver/common/local_driver.rb +29 -12
  68. data/lib/selenium/webdriver/common/logger.rb +28 -0
  69. data/lib/selenium/webdriver/common/manager.rb +2 -0
  70. data/lib/selenium/webdriver/common/options.rb +41 -2
  71. data/lib/selenium/webdriver/common/platform.rb +1 -3
  72. data/lib/selenium/webdriver/common/proxy.rb +1 -9
  73. data/lib/selenium/webdriver/common/selenium_manager.rb +2 -1
  74. data/lib/selenium/webdriver/common/service.rb +4 -8
  75. data/lib/selenium/webdriver/common/service_manager.rb +36 -4
  76. data/lib/selenium/webdriver/common/socket_poller.rb +1 -1
  77. data/lib/selenium/webdriver/common/takes_screenshot.rb +1 -1
  78. data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +1 -1
  79. data/lib/selenium/webdriver/common/wait.rb +4 -1
  80. data/lib/selenium/webdriver/common/websocket_connection.rb +73 -37
  81. data/lib/selenium/webdriver/common.rb +2 -1
  82. data/lib/selenium/webdriver/devtools/response.rb +3 -3
  83. data/lib/selenium/webdriver/devtools.rb +1 -1
  84. data/lib/selenium/webdriver/edge/driver.rb +4 -3
  85. data/lib/selenium/webdriver/edge/service.rb +14 -0
  86. data/lib/selenium/webdriver/firefox/driver.rb +4 -6
  87. data/lib/selenium/webdriver/firefox/options.rb +19 -0
  88. data/lib/selenium/webdriver/firefox/profile.rb +13 -6
  89. data/lib/selenium/webdriver/firefox/service.rb +31 -2
  90. data/lib/selenium/webdriver/ie/driver.rb +4 -3
  91. data/lib/selenium/webdriver/ie/service.rb +10 -0
  92. data/lib/selenium/webdriver/remote/bidi_bridge.rb +44 -10
  93. data/lib/selenium/webdriver/remote/bridge.rb +20 -14
  94. data/lib/selenium/webdriver/remote/driver.rb +15 -4
  95. data/lib/selenium/webdriver/remote/features.rb +26 -1
  96. data/lib/selenium/webdriver/remote/http/common.rb +57 -12
  97. data/lib/selenium/webdriver/remote/http/curb.rb +6 -8
  98. data/lib/selenium/webdriver/remote/http/default.rb +56 -39
  99. data/lib/selenium/webdriver/safari/driver.rb +4 -3
  100. data/lib/selenium/webdriver/safari/options.rb +23 -4
  101. data/lib/selenium/webdriver/safari.rb +1 -6
  102. data/lib/selenium/webdriver/support/block_event_listener.rb +5 -1
  103. data/lib/selenium/webdriver/support/color.rb +14 -14
  104. data/lib/selenium/webdriver/support/event_firing_bridge.rb +5 -1
  105. data/lib/selenium/webdriver/support/guards/guard.rb +30 -14
  106. data/lib/selenium/webdriver/support/guards.rb +11 -4
  107. data/lib/selenium/webdriver/version.rb +1 -1
  108. data/lib/selenium/webdriver.rb +7 -2
  109. data/selenium-webdriver.gemspec +1 -1
  110. metadata +33 -11
  111. data/lib/selenium/webdriver/bidi/log/console_log_entry.rb +0 -35
  112. data/lib/selenium/webdriver/bidi/log/generic_log_entry.rb +0 -33
  113. data/lib/selenium/webdriver/bidi/log/javascript_log_entry.rb +0 -33
  114. data/lib/selenium/webdriver/bidi/log_inspector.rb +0 -147
@@ -1,28 +1,385 @@
1
- function(){return (function(){var g=this||self;
2
- function aa(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==
3
- b&&"undefined"==typeof a.call)return"object";return b}function ca(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};var da=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},ea=Array.prototype.some?function(a,b){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,e="string"===typeof a?a.split(""):a,d=0;d<c;d++)if(d in e&&b.call(void 0,e[d],d,a))return!0;return!1},fa=Array.prototype.every?function(a,
4
- b){return Array.prototype.every.call(a,b,void 0)}:function(a,b){for(var c=a.length,e="string"===typeof a?a.split(""):a,d=0;d<c;d++)if(d in e&&!b.call(void 0,e[d],d,a))return!1;return!0};var ha={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
5
- darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
6
- ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",
7
- lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
8
- moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",
9
- seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var ia="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),ja=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,ka=/^#(?:[0-9a-f]{3}){1,2}$/i,la=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,ma=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function m(a,b){this.code=a;this.a=p[a]||r;this.message=b||"";a=this.a.replace(/((?:^|\s+)[a-z])/g,function(c){return c.toUpperCase().replace(/^[\s\xa0]+/g,"")});b=a.length-5;if(0>b||a.indexOf("Error",b)!=b)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}ca(m,Error);var r="unknown error",p={15:"element not selectable",11:"element not visible"};p[31]=r;p[30]=r;p[24]="invalid cookie domain";p[29]="invalid element coordinates";p[12]="invalid element state";
10
- p[32]="invalid selector";p[51]="invalid selector";p[52]="invalid selector";p[17]="javascript error";p[405]="unsupported operation";p[34]="move target out of bounds";p[27]="no such alert";p[7]="no such element";p[8]="no such frame";p[23]="no such window";p[28]="script timeout";p[33]="session not created";p[10]="stale element reference";p[21]="timeout";p[25]="unable to set cookie";p[26]="unexpected alert open";p[13]=r;p[9]="unknown command";var u=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]};
11
- function na(a,b){var c=0;a=u(String(a)).split(".");b=u(String(b)).split(".");for(var e=Math.max(a.length,b.length),d=0;0==c&&d<e;d++){var f=a[d]||"",h=b[d]||"";do{f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""];if(0==f[0].length&&0==h[0].length)break;c=v(0==f[1].length?0:parseInt(f[1],10),0==h[1].length?0:parseInt(h[1],10))||v(0==f[2].length,0==h[2].length)||v(f[2],h[2]);f=f[3];h=h[3]}while(0==c)}return c}function v(a,b){return a<b?-1:a>b?1:0};var w;a:{var oa=g.navigator;if(oa){var sa=oa.userAgent;if(sa){w=sa;break a}}w=""}function x(a){return-1!=w.indexOf(a)};function y(){return x("Firefox")||x("FxiOS")}function A(){return(x("Chrome")||x("CriOS"))&&!x("Edge")};function ta(a){return String(a).replace(/\-([a-z])/g,function(b,c){return c.toUpperCase()})};function B(){return x("iPhone")&&!x("iPod")&&!x("iPad")};function ua(a,b){var c=va;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var wa=x("Opera"),C=x("Trident")||x("MSIE"),xa=x("Edge"),ya=x("Gecko")&&!(-1!=w.toLowerCase().indexOf("webkit")&&!x("Edge"))&&!(x("Trident")||x("MSIE"))&&!x("Edge"),za=-1!=w.toLowerCase().indexOf("webkit")&&!x("Edge");function Aa(){var a=g.document;return a?a.documentMode:void 0}var E;
12
- a:{var F="",G=function(){var a=w;if(ya)return/rv:([^\);]+)(\)|;)/.exec(a);if(xa)return/Edge\/([\d\.]+)/.exec(a);if(C)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(za)return/WebKit\/(\S+)/.exec(a);if(wa)return/(?:Version)[ \/]?(\S+)/.exec(a)}();G&&(F=G?G[1]:"");if(C){var H=Aa();if(null!=H&&H>parseFloat(F)){E=String(H);break a}}E=F}var va={};function Ba(a){return ua(a,function(){return 0<=na(E,a)})}var I;I=g.document&&C?Aa():void 0;var Ca=y(),Da=B()||x("iPod"),Ea=x("iPad"),Fa=x("Android")&&!(A()||y()||x("Opera")||x("Silk")),Ga=A(),Ha=x("Safari")&&!(A()||x("Coast")||x("Opera")||x("Edge")||x("Edg/")||x("OPR")||y()||x("Silk")||x("Android"))&&!(B()||x("iPad")||x("iPod"));function J(a){return(a=a.exec(w))?a[1]:""}(function(){if(Ca)return J(/Firefox\/([0-9.]+)/);if(C||xa||wa)return E;if(Ga)return B()||x("iPad")||x("iPod")?J(/CriOS\/([0-9.]+)/):J(/Chrome\/([0-9.]+)/);if(Ha&&!(B()||x("iPad")||x("iPod")))return J(/Version\/([0-9.]+)/);if(Da||Ea){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(w);if(a)return a[1]+"."+a[2]}else if(Fa)return(a=J(/Android\s+([0-9.]+)/))?a:J(/Version\/([0-9.]+)/);return""})();var K;if(K=C)K=!(9<=Number(I));var Ia=K;function L(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}L.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};L.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};L.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function M(a,b){this.width=a;this.height=b}M.prototype.aspectRatio=function(){return this.width/this.height};M.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};M.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};M.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function N(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function Ja(a,b){a&&(a=a.parentNode);for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function Ka(a){this.a=a||g.document||document};function P(a,b){b&&"string"!==typeof b&&(b=b.toString());return a instanceof HTMLFormElement?!!a&&1==a.nodeType&&(!b||"FORM"==b):!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)};function Q(a,b,c,e){this.f=a;this.a=b;this.b=c;this.c=e}Q.prototype.ceil=function(){this.f=Math.ceil(this.f);this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.c=Math.ceil(this.c);return this};Q.prototype.floor=function(){this.f=Math.floor(this.f);this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.c=Math.floor(this.c);return this};Q.prototype.round=function(){this.f=Math.round(this.f);this.a=Math.round(this.a);this.b=Math.round(this.b);this.c=Math.round(this.c);return this};function R(a,b,c,e){this.a=a;this.b=b;this.width=c;this.height=e}R.prototype.ceil=function(){this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};R.prototype.floor=function(){this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};
13
- R.prototype.round=function(){this.a=Math.round(this.a);this.b=Math.round(this.b);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};var La="function"===typeof ShadowRoot;function S(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return P(a)?a:null}
14
- function T(a,b){b=ta(b);if("float"==b||"cssFloat"==b||"styleFloat"==b)b=Ia?"styleFloat":"cssFloat";a:{var c=b;var e=N(a);if(e.defaultView&&e.defaultView.getComputedStyle&&(e=e.defaultView.getComputedStyle(a,null))){c=e[c]||e.getPropertyValue(c)||"";break a}c=""}a=c||Ma(a,b);if(null===a)a=null;else if(0<=da(ia,b)){b:{var d=a.match(la);if(d&&(b=Number(d[1]),c=Number(d[2]),e=Number(d[3]),d=Number(d[4]),0<=b&&255>=b&&0<=c&&255>=c&&0<=e&&255>=e&&0<=d&&1>=d)){b=[b,c,e,d];break b}b=null}if(!b)b:{if(e=a.match(ma))if(b=
15
- Number(e[1]),c=Number(e[2]),e=Number(e[3]),0<=b&&255>=b&&0<=c&&255>=c&&0<=e&&255>=e){b=[b,c,e,1];break b}b=null}if(!b)b:{b=a.toLowerCase();c=ha[b.toLowerCase()];if(!c&&(c="#"==b.charAt(0)?b:"#"+b,4==c.length&&(c=c.replace(ja,"#$1$1$2$2$3$3")),!ka.test(c))){b=null;break b}b=[parseInt(c.substr(1,2),16),parseInt(c.substr(3,2),16),parseInt(c.substr(5,2),16),1]}a=b?"rgba("+b.join(", ")+")":a}return a}
16
- function Ma(a,b){var c=a.currentStyle||a.style,e=c[b];void 0===e&&"function"==aa(c.getPropertyValue)&&(e=c.getPropertyValue(b));return"inherit"!=e?void 0!==e?e:null:(a=S(a))?Ma(a,b):null}
17
- function U(a,b,c){function e(h){var n=V(h);return 0<n.height&&0<n.width?!0:P(h,"PATH")&&(0<n.height||0<n.width)?(h=T(h,"stroke-width"),!!h&&0<parseInt(h,10)):"hidden"!=T(h,"overflow")&&ea(h.childNodes,function(D){return 3==D.nodeType||P(D)&&e(D)})}function d(h){return Na(h)==W&&fa(h.childNodes,function(n){return!P(n)||d(n)||!e(n)})}if(!P(a))throw Error("Argument to isShown must be of type Element");if(P(a,"BODY"))return!0;if(P(a,"OPTION")||P(a,"OPTGROUP"))return a=Ja(a,function(h){return P(h,"SELECT")}),
18
- !!a&&U(a,!0,c);var f=Oa(a);if(f)return!!f.image&&0<f.rect.width&&0<f.rect.height&&U(f.image,b,c);if(P(a,"INPUT")&&"hidden"==a.type.toLowerCase()||P(a,"NOSCRIPT"))return!1;f=T(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=Pa(a))&&e(a)?!d(a):!1}var W="hidden";
19
- function Na(a){function b(k){function l(ba){if(ba==h)return!0;var pa=T(ba,"display");return 0==pa.lastIndexOf("inline",0)||"contents"==pa||"absolute"==qa&&"static"==T(ba,"position")?!1:!0}var qa=T(k,"position");if("fixed"==qa)return ra=!0,k==h?null:h;for(k=S(k);k&&!l(k);)k=S(k);return k}function c(k){var l=k;if("visible"==D)if(k==h&&n)l=n;else if(k==n)return{x:"visible",y:"visible"};l={x:T(l,"overflow-x"),y:T(l,"overflow-y")};k==h&&(l.x="visible"==l.x?"auto":l.x,l.y="visible"==l.y?"auto":l.y);return l}
20
- function e(k){if(k==h){var l=(new Ka(f)).a;k=l.scrollingElement?l.scrollingElement:za||"CSS1Compat"!=l.compatMode?l.body||l.documentElement:l.documentElement;l=l.parentWindow||l.defaultView;k=C&&Ba("10")&&l.pageYOffset!=k.scrollTop?new L(k.scrollLeft,k.scrollTop):new L(l.pageXOffset||k.scrollLeft,l.pageYOffset||k.scrollTop)}else k=new L(k.scrollLeft,k.scrollTop);return k}var d=Qa(a),f=N(a),h=f.documentElement,n=f.body,D=T(h,"overflow"),ra;for(a=b(a);a;a=b(a)){var q=c(a);if("visible"!=q.x||"visible"!=
21
- q.y){var t=V(a);if(0==t.width||0==t.height)return W;var z=d.a<t.a,O=d.b<t.b;if(z&&"hidden"==q.x||O&&"hidden"==q.y)return W;if(z&&"visible"!=q.x||O&&"visible"!=q.y){z=e(a);O=d.b<t.b-z.y;if(d.a<t.a-z.x&&"visible"!=q.x||O&&"visible"!=q.x)return W;d=Na(a);return d==W?W:"scroll"}z=d.c>=t.a+t.width;t=d.f>=t.b+t.height;if(z&&"hidden"==q.x||t&&"hidden"==q.y)return W;if(z&&"visible"!=q.x||t&&"visible"!=q.y){if(ra&&(q=e(a),d.c>=h.scrollWidth-q.x||d.a>=h.scrollHeight-q.y))return W;d=Na(a);return d==W?W:"scroll"}}}return"none"}
22
- function V(a){var b=Oa(a);if(b)return b.rect;if(P(a,"HTML"))return a=N(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new M(a.clientWidth,a.clientHeight),new R(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(e){return new R(0,0,0,0)}b=new R(c.left,c.top,c.right-c.left,c.bottom-c.top);C&&a.ownerDocument.body&&(a=N(a),b.a-=a.documentElement.clientLeft+a.body.clientLeft,b.b-=a.documentElement.clientTop+a.body.clientTop);
23
- return b}
24
- function Oa(a){var b=P(a,"MAP");if(!b&&!P(a,"AREA"))return null;var c=b?a:P(a.parentNode,"MAP")?a.parentNode:null,e=null,d=null;if(c&&c.name){e='*[usemap="#'+c.name+'"]';c=N(c);var f;if(f="function"!=aa(c.querySelector)&&C&&(C?0<=na(I,8):Ba(8))){f=c.querySelector;var h=typeof f;f=!("object"==h&&null!=f||"function"==h)}if(f)throw Error("CSS selection is not supported");if(!e)throw new m(32,"No selector specified");e=u(e);try{var n=c.querySelector(e)}catch(D){throw new m(32,"An invalid or illegal selector was specified");}if(e=
25
- n&&1==n.nodeType?n:null)d=V(e),b||"default"==a.shape.toLowerCase()||(a=Ra(a),b=Math.min(Math.max(a.a,0),d.width),n=Math.min(Math.max(a.b,0),d.height),d=new R(b+d.a,n+d.b,Math.min(a.width,d.width-b),Math.min(a.height,d.height-n)))}return{image:e,rect:d||new R(0,0,0,0)}}
26
- function Ra(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){b=a[0];var c=a[1];return new R(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new R(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){b=a[0];c=a[1];for(var e=b,d=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),e=Math.max(e,a[f]),c=Math.min(c,a[f+1]),d=Math.max(d,a[f+1]);return new R(b,c,e-b,d-c)}return new R(0,0,0,0)}function Qa(a){a=V(a);return new Q(a.b,a.a+a.width,a.b+a.height,a.a)}
27
- function Pa(a){if(Ia){if("relative"==T(a,"position"))return 1;a=T(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return Sa(a)}function Sa(a){var b=1,c=T(a,"opacity");c&&(b=Number(c));(a=S(a))&&(b*=Sa(a));return b};function Ta(a,b){function c(e){if(P(e)&&("none"==T(e,"display")||"hidden"==T(e,"content-visibility")))return!1;var d;if((d=e.parentNode)&&d.shadowRoot&&void 0!==e.assignedSlot)d=e.assignedSlot?e.assignedSlot.parentNode:null;else if(e.getDestinationInsertionPoints){var f=e.getDestinationInsertionPoints();0<f.length&&(d=f[f.length-1])}if(La&&d instanceof ShadowRoot){if(d.host.shadowRoot&&d.host.shadowRoot!==d)return!1;d=d.host}return!d||9!=d.nodeType&&11!=d.nodeType?d&&P(d,"DETAILS")&&!d.open&&!P(e,
28
- "SUMMARY")?!1:!!d&&c(d):!0}return U(a,!!b,c)}var X=["se_exportedFunctionSymbol"],Y=g;X[0]in Y||"undefined"==typeof Y.execScript||Y.execScript("var "+X[0]);for(var Z;X.length&&(Z=X.shift());)X.length||void 0===Ta?Y[Z]&&Y[Z]!==Object.prototype[Z]?Y=Y[Z]:Y=Y[Z]={}:Y[Z]=Ta;; return this.se_exportedFunctionSymbol.apply(null,arguments);}).apply(window, arguments);}
1
+ (function isShownElement(elem, optIgnoreOpacity) {
2
+ var tagNameDescriptor = Object.getOwnPropertyDescriptor(Element.prototype, 'tagName');
3
+ var computedStyleCache = new Map();
4
+ var clientRectCache = new Map();
5
+ var displayedCache = new Map();
6
+ function toUpperCaseTag(tagName) {
7
+ return tagName ? tagName.toUpperCase() : undefined;
8
+ }
9
+ function isElement(node, tagName) {
10
+ if (!node || node.nodeType !== 1) {
11
+ return false;
12
+ }
13
+ var asElement = node;
14
+ var rawTagName = tagNameDescriptor && typeof tagNameDescriptor.get === 'function'
15
+ ? tagNameDescriptor.get.call(asElement)
16
+ : asElement.tagName;
17
+ var upperTagName = typeof rawTagName === 'string' ? rawTagName.toUpperCase() : '';
18
+ var normalizedTagName = toUpperCaseTag(tagName);
19
+ if (upperTagName === 'FORM') {
20
+ return !normalizedTagName || normalizedTagName === 'FORM';
21
+ }
22
+ return !!upperTagName && (!normalizedTagName || upperTagName === normalizedTagName);
23
+ }
24
+ function getParentElement(node) {
25
+ var current = node.parentNode;
26
+ while (current &&
27
+ current.nodeType !== Node.ELEMENT_NODE &&
28
+ current.nodeType !== Node.DOCUMENT_NODE &&
29
+ current.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) {
30
+ current = current.parentNode;
31
+ }
32
+ return current && current.nodeType === 1 ? current : null;
33
+ }
34
+ function getEffectiveStyle(elem, propertyName) {
35
+ var computed = computedStyleCache.get(elem);
36
+ if (computed === undefined) {
37
+ var win = elem.ownerDocument.defaultView;
38
+ computed = win ? (win.getComputedStyle(elem) || null) : null;
39
+ computedStyleCache.set(elem, computed);
40
+ }
41
+ if (!computed) {
42
+ return null;
43
+ }
44
+ var value = computed.getPropertyValue(propertyName);
45
+ return value || null;
46
+ }
47
+ function getOpacity(elem) {
48
+ var opacityStyle = getEffectiveStyle(elem, 'opacity');
49
+ var opacity = opacityStyle ? Number(opacityStyle) : 1;
50
+ var parent = getParentElement(elem);
51
+ return parent ? opacity * getOpacity(parent) : opacity;
52
+ }
53
+ function getParentNodeInComposedDom(node) {
54
+ var parent = node.parentNode;
55
+ var slottable = node;
56
+ var parentWithShadow = parent;
57
+ if (parentWithShadow && parentWithShadow.shadowRoot && slottable.assignedSlot !== undefined) {
58
+ return slottable.assignedSlot ? slottable.assignedSlot.parentNode : null;
59
+ }
60
+ return parent;
61
+ }
62
+ function createRect(left, top, width, height) {
63
+ return {
64
+ left: left,
65
+ top: top,
66
+ right: left + width,
67
+ bottom: top + height,
68
+ width: width,
69
+ height: height,
70
+ };
71
+ }
72
+ function getClientRect(elem) {
73
+ var cachedRect = clientRectCache.get(elem);
74
+ if (cachedRect) {
75
+ return cachedRect;
76
+ }
77
+ var rect;
78
+ var imageMap = maybeFindImageMap(elem);
79
+ if (imageMap) {
80
+ rect = imageMap.rect;
81
+ }
82
+ else {
83
+ var elemTagName = typeof elem.tagName === 'string' ? elem.tagName : '';
84
+ if (elemTagName.toUpperCase() === 'HTML') {
85
+ var doc = elem.ownerDocument;
86
+ var sizeElem = doc.compatMode === 'CSS1Compat' ? doc.documentElement : (doc.body || doc.documentElement);
87
+ rect = createRect(0, 0, sizeElem.clientWidth, sizeElem.clientHeight);
88
+ }
89
+ else {
90
+ try {
91
+ var nativeRect = elem.getBoundingClientRect();
92
+ rect = {
93
+ left: nativeRect.left,
94
+ top: nativeRect.top,
95
+ right: nativeRect.right,
96
+ bottom: nativeRect.bottom,
97
+ width: nativeRect.right - nativeRect.left,
98
+ height: nativeRect.bottom - nativeRect.top,
99
+ };
100
+ }
101
+ catch (_error) {
102
+ rect = createRect(0, 0, 0, 0);
103
+ }
104
+ }
105
+ }
106
+ clientRectCache.set(elem, rect);
107
+ return rect;
108
+ }
109
+ function getAreaRelativeRect(area) {
110
+ var shape = area.shape.toLowerCase();
111
+ var coords = area.coords.split(',').map(function (value) {
112
+ return Number(value.trim());
113
+ });
114
+ if (shape === 'rect' && coords.length === 4) {
115
+ return createRect(coords[0], coords[1], coords[2] - coords[0], coords[3] - coords[1]);
116
+ }
117
+ if (shape === 'circle' && coords.length === 3) {
118
+ return createRect(coords[0] - coords[2], coords[1] - coords[2], coords[2] * 2, coords[2] * 2);
119
+ }
120
+ if (shape === 'poly' && coords.length > 2) {
121
+ var minX = coords[0];
122
+ var minY = coords[1];
123
+ var maxX = minX;
124
+ var maxY = minY;
125
+ for (var index = 2; index + 1 < coords.length; index += 2) {
126
+ minX = Math.min(minX, coords[index]);
127
+ maxX = Math.max(maxX, coords[index]);
128
+ minY = Math.min(minY, coords[index + 1]);
129
+ maxY = Math.max(maxY, coords[index + 1]);
130
+ }
131
+ return createRect(minX, minY, maxX - minX, maxY - minY);
132
+ }
133
+ return createRect(0, 0, 0, 0);
134
+ }
135
+ function findImageUsingMap(mapName, doc) {
136
+ return doc.querySelector('[usemap="#' + mapName.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"]');
137
+ }
138
+ function maybeFindImageMap(elem) {
139
+ var isMap = isElement(elem, 'MAP');
140
+ if (!isMap && !isElement(elem, 'AREA')) {
141
+ return null;
142
+ }
143
+ var map = isMap ? elem : isElement(elem.parentNode, 'MAP') ? elem.parentNode : null;
144
+ var image = null;
145
+ var rect = createRect(0, 0, 0, 0);
146
+ if (isElement(map, 'MAP') && map.name) {
147
+ image = findImageUsingMap(map.name, map.ownerDocument);
148
+ if (image) {
149
+ rect = getClientRect(image);
150
+ if (!isMap && isElement(elem, 'AREA') && elem.shape.toLowerCase() !== 'default') {
151
+ var relativeRect = getAreaRelativeRect(elem);
152
+ var relativeX = Math.min(Math.max(relativeRect.left, 0), rect.width);
153
+ var relativeY = Math.min(Math.max(relativeRect.top, 0), rect.height);
154
+ var width = Math.min(relativeRect.width, rect.width - relativeX);
155
+ var height = Math.min(relativeRect.height, rect.height - relativeY);
156
+ rect = createRect(relativeX + rect.left, relativeY + rect.top, width, height);
157
+ }
158
+ }
159
+ }
160
+ return { image: image, rect: rect };
161
+ }
162
+ function getClientRegion(elem) {
163
+ return getClientRect(elem);
164
+ }
165
+ function getOverflowState(elem) {
166
+ var region = getClientRegion(elem);
167
+ var ownerDoc = elem.ownerDocument;
168
+ var htmlElem = ownerDoc.documentElement;
169
+ var bodyElem = ownerDoc.body;
170
+ var htmlOverflowStyle = getEffectiveStyle(htmlElem, 'overflow') || 'visible';
171
+ var treatAsFixedPosition = false;
172
+ function canBeOverflowed(container, position) {
173
+ if (container === htmlElem) {
174
+ return true;
175
+ }
176
+ var display = getEffectiveStyle(container, 'display') || '';
177
+ if (display.indexOf('inline') === 0 || display === 'contents') {
178
+ return false;
179
+ }
180
+ if (position === 'absolute' && getEffectiveStyle(container, 'position') === 'static') {
181
+ return false;
182
+ }
183
+ return true;
184
+ }
185
+ function getOverflowParent(current) {
186
+ var position = getEffectiveStyle(current, 'position');
187
+ if (position === 'fixed') {
188
+ treatAsFixedPosition = true;
189
+ return current === htmlElem ? null : htmlElem;
190
+ }
191
+ var parent = getParentElement(current);
192
+ while (parent && !canBeOverflowed(parent, position)) {
193
+ parent = getParentElement(parent);
194
+ }
195
+ return parent;
196
+ }
197
+ function getOverflowStyles(current) {
198
+ var overflowElem = current;
199
+ if (htmlOverflowStyle === 'visible') {
200
+ if (current === htmlElem && bodyElem) {
201
+ overflowElem = bodyElem;
202
+ }
203
+ else if (current === bodyElem) {
204
+ return { x: 'visible', y: 'visible' };
205
+ }
206
+ }
207
+ var overflow = {
208
+ x: getEffectiveStyle(overflowElem, 'overflow-x') || 'visible',
209
+ y: getEffectiveStyle(overflowElem, 'overflow-y') || 'visible',
210
+ };
211
+ if (current === htmlElem) {
212
+ overflow.x = overflow.x === 'visible' ? 'auto' : overflow.x;
213
+ overflow.y = overflow.y === 'visible' ? 'auto' : overflow.y;
214
+ }
215
+ return overflow;
216
+ }
217
+ function getScroll(current) {
218
+ if (current === htmlElem) {
219
+ return {
220
+ x: ownerDoc.defaultView ? ownerDoc.defaultView.pageXOffset : 0,
221
+ y: ownerDoc.defaultView ? ownerDoc.defaultView.pageYOffset : 0,
222
+ };
223
+ }
224
+ return { x: current.scrollLeft, y: current.scrollTop };
225
+ }
226
+ for (var container = getOverflowParent(elem); container; container = getOverflowParent(container)) {
227
+ var containerOverflow = getOverflowStyles(container);
228
+ if (containerOverflow.x === 'visible' && containerOverflow.y === 'visible') {
229
+ continue;
230
+ }
231
+ var containerRect = getClientRect(container);
232
+ if (containerRect.width === 0 || containerRect.height === 0) {
233
+ return 'hidden';
234
+ }
235
+ var underflowsX = region.right < containerRect.left;
236
+ var underflowsY = region.bottom < containerRect.top;
237
+ if ((underflowsX && containerOverflow.x === 'hidden') || (underflowsY && containerOverflow.y === 'hidden')) {
238
+ return 'hidden';
239
+ }
240
+ if ((underflowsX && containerOverflow.x !== 'visible') || (underflowsY && containerOverflow.y !== 'visible')) {
241
+ var containerScroll = getScroll(container);
242
+ var unscrollableX = region.right < containerRect.left - containerScroll.x;
243
+ var unscrollableY = region.bottom < containerRect.top - containerScroll.y;
244
+ if ((unscrollableX && containerOverflow.x !== 'visible') || (unscrollableY && containerOverflow.y !== 'visible')) {
245
+ return 'hidden';
246
+ }
247
+ var containerUnderflowState = getOverflowState(container);
248
+ return containerUnderflowState === 'hidden' ? 'hidden' : 'scroll';
249
+ }
250
+ var overflowsX = region.left >= containerRect.left + containerRect.width;
251
+ var overflowsY = region.top >= containerRect.top + containerRect.height;
252
+ if ((overflowsX && containerOverflow.x === 'hidden') || (overflowsY && containerOverflow.y === 'hidden')) {
253
+ return 'hidden';
254
+ }
255
+ if ((overflowsX && containerOverflow.x !== 'visible') || (overflowsY && containerOverflow.y !== 'visible')) {
256
+ if (treatAsFixedPosition) {
257
+ var docScroll = getScroll(container);
258
+ if (region.left >= htmlElem.scrollWidth - docScroll.x || region.right >= htmlElem.scrollHeight - docScroll.y) {
259
+ return 'hidden';
260
+ }
261
+ }
262
+ var containerOverflowState = getOverflowState(container);
263
+ return containerOverflowState === 'hidden' ? 'hidden' : 'scroll';
264
+ }
265
+ }
266
+ return 'none';
267
+ }
268
+ function isShownInternal(elem, ignoreOpacity, displayedFn) {
269
+ if (!isElement(elem)) {
270
+ throw new Error('Argument to isShown must be of type Element');
271
+ }
272
+ if (isElement(elem, 'BODY')) {
273
+ return true;
274
+ }
275
+ if (isElement(elem, 'OPTION') || isElement(elem, 'OPTGROUP')) {
276
+ var select = elem.closest('select');
277
+ return !!select && isShownInternal(select, true, displayedFn);
278
+ }
279
+ var imageMap = maybeFindImageMap(elem);
280
+ if (imageMap) {
281
+ return !!imageMap.image && imageMap.rect.width > 0 && imageMap.rect.height > 0 &&
282
+ isShownInternal(imageMap.image, ignoreOpacity, displayedFn);
283
+ }
284
+ if (isElement(elem, 'INPUT') && elem.type.toLowerCase() === 'hidden') {
285
+ return false;
286
+ }
287
+ if (isElement(elem, 'NOSCRIPT')) {
288
+ return false;
289
+ }
290
+ var visibility = getEffectiveStyle(elem, 'visibility');
291
+ if (visibility === 'collapse' || visibility === 'hidden') {
292
+ return false;
293
+ }
294
+ if (!displayedFn(elem)) {
295
+ return false;
296
+ }
297
+ if (!ignoreOpacity && getOpacity(elem) === 0) {
298
+ return false;
299
+ }
300
+ function positiveSize(element) {
301
+ var rect = getClientRect(element);
302
+ if (rect.height > 0 && rect.width > 0) {
303
+ return true;
304
+ }
305
+ if (isElement(element, 'PATH') && (rect.height > 0 || rect.width > 0)) {
306
+ var strokeWidth = getEffectiveStyle(element, 'stroke-width');
307
+ return !!strokeWidth && parseInt(strokeWidth, 10) > 0;
308
+ }
309
+ var elementVisibility = getEffectiveStyle(element, 'visibility');
310
+ if (elementVisibility === 'collapse' || elementVisibility === 'hidden') {
311
+ return false;
312
+ }
313
+ if (!displayedFn(element)) {
314
+ return false;
315
+ }
316
+ if (getEffectiveStyle(element, 'overflow') === 'hidden') {
317
+ return false;
318
+ }
319
+ for (var index = 0; index < element.childNodes.length; index += 1) {
320
+ var child = element.childNodes[index];
321
+ if (child.nodeType === Node.TEXT_NODE) {
322
+ var text = child.nodeValue || '';
323
+ if (/^[\s]*$/.test(text) && /[\n\r\t]/.test(text)) {
324
+ continue;
325
+ }
326
+ return true;
327
+ }
328
+ if (isElement(child) && positiveSize(child)) {
329
+ return true;
330
+ }
331
+ }
332
+ return false;
333
+ }
334
+ if (!positiveSize(elem)) {
335
+ return false;
336
+ }
337
+ function hiddenByOverflow(element) {
338
+ if (getOverflowState(element) !== 'hidden') {
339
+ return false;
340
+ }
341
+ for (var index = 0; index < element.childNodes.length; index += 1) {
342
+ var child = element.childNodes[index];
343
+ if (isElement(child) && !hiddenByOverflow(child) && positiveSize(child)) {
344
+ return false;
345
+ }
346
+ }
347
+ return true;
348
+ }
349
+ return !hiddenByOverflow(elem);
350
+ }
351
+ function displayed(node) {
352
+ var cached = displayedCache.get(node);
353
+ if (cached !== undefined) {
354
+ return cached;
355
+ }
356
+ if (isElement(node)) {
357
+ var display = getEffectiveStyle(node, 'display');
358
+ var contentVisibility = getEffectiveStyle(node, 'content-visibility');
359
+ if (display === 'none' || contentVisibility === 'hidden') {
360
+ displayedCache.set(node, false);
361
+ return false;
362
+ }
363
+ }
364
+ var parent = getParentNodeInComposedDom(node);
365
+ if (typeof ShadowRoot === 'function' && parent instanceof ShadowRoot) {
366
+ if (parent.host.shadowRoot && parent.host.shadowRoot !== parent) {
367
+ displayedCache.set(node, false);
368
+ return false;
369
+ }
370
+ parent = parent.host;
371
+ }
372
+ if (parent && (parent.nodeType === Node.DOCUMENT_NODE || parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE)) {
373
+ displayedCache.set(node, true);
374
+ return true;
375
+ }
376
+ if (isElement(parent, 'DETAILS') && !parent.open && !isElement(node, 'SUMMARY')) {
377
+ displayedCache.set(node, false);
378
+ return false;
379
+ }
380
+ var result = !!parent && displayed(parent);
381
+ displayedCache.set(node, result);
382
+ return result;
383
+ }
384
+ return isShownInternal(elem, !!optIgnoreOpacity, displayed);
385
+ })
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed to the Software Freedom Conservancy (SFC) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The SFC licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ module Selenium
21
+ module WebDriver
22
+ class BiDi
23
+ #
24
+ # BiDi Implementation of the Browser Module
25
+ # Continue to use functionality from existing `driver.manager.window` method
26
+ #
27
+ # @api private
28
+ #
29
+
30
+ class Browser
31
+ Window = Struct.new(:handle, :active, :height, :width, :x, :y, :state) do
32
+ def active?
33
+ active
34
+ end
35
+ end
36
+ def initialize(bidi)
37
+ @bidi = bidi
38
+ end
39
+
40
+ def create_user_context
41
+ @bidi.send_cmd('browser.createUserContext')
42
+ end
43
+
44
+ def user_contexts
45
+ @bidi.send_cmd('browser.getUserContexts')
46
+ end
47
+
48
+ def remove_user_context(user_context)
49
+ @bidi.send_cmd('browser.removeUserContext', userContext: user_context)
50
+ end
51
+
52
+ def windows
53
+ response = @bidi.send_cmd('browser.getClientWindows')
54
+
55
+ response['clientWindows'].map do |win_data|
56
+ attributes = {
57
+ handle: win_data['clientWindow'],
58
+ active: win_data['active'],
59
+ height: win_data['height'],
60
+ width: win_data['width'],
61
+ x: win_data['x'],
62
+ y: win_data['y'],
63
+ state: win_data['state']
64
+ }
65
+ Window.new(**attributes)
66
+ end
67
+ end
68
+ end # Browser
69
+ end # BiDi
70
+ end # WebDriver
71
+ end # Selenium
@@ -20,7 +20,8 @@
20
20
  module Selenium
21
21
  module WebDriver
22
22
  class BiDi
23
- # Implements the browsingContext Module of the WebDriver-BiDi specification
23
+ # Implements the BrowsingContext Module of the WebDriver-BiDi specification
24
+ # Continue to use functionality from existing `driver.navigate` method
24
25
  #
25
26
  # @api private
26
27
  #
@@ -109,7 +110,7 @@ module Selenium
109
110
  context_id ||= @bridge.window_handle
110
111
  @bidi.send_cmd('browsingContext.activate', context: context_id)
111
112
  end
112
- end
113
+ end # BrowsingContext
113
114
  end # BiDi
114
115
  end # WebDriver
115
116
  end # Selenium
@@ -17,24 +17,28 @@
17
17
  # specific language governing permissions and limitations
18
18
  # under the License.
19
19
 
20
+ require 'selenium/webdriver/common/error'
21
+ require 'selenium/webdriver/bidi/protocol/error_code'
22
+
20
23
  module Selenium
21
24
  module WebDriver
22
- class BiDi
23
- class FilterBy
24
- attr_accessor :level
25
+ module Error
26
+ # Register each BiDi-only code as a WebDriverError subclass; shared codes keep their classic class.
27
+ BiDi::Protocol::ErrorCode::CLASS_NAMES.each_value do |name|
28
+ const_set(name, Class.new(WebDriverError)) unless const_defined?(name, false)
29
+ end
30
+ end
25
31
 
26
- def initialize(level)
27
- @level = level
28
- end
29
-
30
- def self.log_level(level = nil)
31
- unless %w[debug error info warning].include?(level)
32
- raise Error::WebDriverError,
33
- "Valid log levels are 'debug', 'error', 'info' and 'warning'. Received: #{level}"
32
+ class BiDi
33
+ module Protocol
34
+ module ErrorCode
35
+ # The exception class for a wire error code, or WebDriverError for an unknown one.
36
+ def self.for(code)
37
+ name = code && CLASS_NAMES[code]
38
+ name ? Error.const_get(name) : Error::WebDriverError
34
39
  end
35
- FilterBy.new(level)
36
40
  end
37
- end # FilterBy
38
- end # BiDi
39
- end # WebDriver
40
- end # Selenium
41
+ end
42
+ end
43
+ end
44
+ end
@@ -20,6 +20,11 @@
20
20
  module Selenium
21
21
  module WebDriver
22
22
  class BiDi
23
+ # Implements the Log of the WebDriver-BiDi specification
24
+ # This functionality should be accessed through `driver.script` method
25
+ #
26
+ # @api private
27
+ #
23
28
  class LogHandler
24
29
  ConsoleLogEntry = BiDi::Struct.new(:level, :text, :timestamp, :stack_trace, :type, :source, :method, :args)
25
30
  JavaScriptLogEntry = BiDi::Struct.new(:level, :text, :timestamp, :stack_trace, :type, :source)
@@ -20,17 +20,21 @@
20
20
  module Selenium
21
21
  module WebDriver
22
22
  class BiDi
23
- class Cookies < Hash
24
- def initialize(cookies = {})
25
- super()
26
- merge!(cookies)
27
- end
23
+ #
24
+ # @api private
25
+ #
28
26
 
27
+ class Cookies < Hash
29
28
  def as_json
30
- self[:name] = self[:name].to_s
31
- self[:value] = {type: 'string', value: self[:value].to_s}
32
-
33
- [compact]
29
+ map do |name, val|
30
+ {
31
+ name: name.to_s,
32
+ value: {
33
+ type: 'string',
34
+ value: val.to_s
35
+ }
36
+ }
37
+ end
34
38
  end
35
39
  end
36
40
  end # BiDi
@@ -20,6 +20,10 @@
20
20
  module Selenium
21
21
  module WebDriver
22
22
  class BiDi
23
+ #
24
+ # @api private
25
+ #
26
+
23
27
  class Credentials
24
28
  attr_accessor :username, :password
25
29
 
@@ -20,6 +20,10 @@
20
20
  module Selenium
21
21
  module WebDriver
22
22
  class BiDi
23
+ #
24
+ # @api private
25
+ #
26
+
23
27
  class Headers < Hash
24
28
  def as_json
25
29
  map do |name, val|