paintbalbot

Untitled

Mar 23rd, 2017
547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 59.27 KB | None | 0 0
  1. document.elementForOPID = q;
  2. function t(a, b, c, d) {
  3. var e;
  4. u ? (e = document.createEvent('KeyboardEvent'),
  5. e.initKeyEvent(b, !0, !1, null, !1, !1, !1, !1, c, d)) : (e = a.ownerDocument.createEvent('Events'),
  6. e.initEvent(b, !0, !1),
  7. e.charCode = d,
  8. e.keyCode = c,
  9. e.which = c,
  10. e.srcElement = a,
  11. e.target = a);
  12. return e
  13. }
  14. function aa(a) {
  15. var b = a.value;
  16. w(a, !1);
  17. a.dispatchEvent(t(a, 'keydown', 0, 0));
  18. a.dispatchEvent(t(a, 'keypress', 0, 0));
  19. a.dispatchEvent(t(a, 'keyup', 0, 0));
  20. if ('' === a.value || a.dataset['com.agilebits.onepassword.initialValue'] && a.value === a.dataset['com.agilebits.onepassword.initialValue'])
  21. a.value = b
  22. }
  23. function ba(a) {
  24. var b = a.value
  25. , c = a.ownerDocument.createEvent('HTMLEvents')
  26. , d = a.ownerDocument.createEvent('HTMLEvents');
  27. a.dispatchEvent(t(a, 'keydown', 0, 0));
  28. a.dispatchEvent(t(a, 'keypress', 0, 0));
  29. a.dispatchEvent(t(a, 'keyup', 0, 0));
  30. d.initEvent('input', !0, !0);
  31. a.dispatchEvent(d);
  32. c.initEvent('change', !0, !0);
  33. a.dispatchEvent(c);
  34. a.blur();
  35. if ('' === a.value || a.dataset['com.agilebits.onepassword.initialValue'] && a.value === a.dataset['com.agilebits.onepassword.initialValue'])
  36. a.value = b
  37. }
  38. function y(a, b, c) {
  39. var d = null;
  40. a && a.attributes && (d = (d = a.attributes[b]) ? d.value : null);
  41. return (a = d) && c.test(a)
  42. }
  43. function ca() {
  44. var a = RegExp('((\\b|_|-)pin(\\b|_|-)|password|passwort|kennwort|passe|contraseña|senha|密码|adgangskode|hasło|wachtwoord)', 'i');
  45. return Array.prototype.slice.call(z(document, "input[type='text']")).filter(function(b) {
  46. return b.value && a.test(b.value)
  47. }, this)
  48. }
  49. function da() {
  50. ca().forEach(function(a) {
  51. aa(a);
  52. a.click && a.click();
  53. ba(a)
  54. })
  55. }
  56. var B = [/^\W*log\W*[oi]n\W*$/i, /log\W*[oi]n (?:securely|now)/i, /^\W*sign\W*[oi]n\W*$/i, 'continue', 'submit', 'weiter', 'accès', 'вход', 'connexion', 'entrar', 'anmelden', 'accedi', 'valider', '登录', 'लॉग इन करें'];
  57. window.LOGIN_TITLES = B;
  58. var ea = ['change password', 'save changes'];
  59. window.CHANGE_PASSWORD_TITLES = ea;
  60. var C = ['already have an account', 'sign in with'];
  61. window.LOGIN_RED_HERRING_TITLES = C;
  62. var D = 'register;sign up;signup;join;create my account;регистрация;inscription;regístrate;cadastre-se;registrieren;registrazione;注册;साइन अप करें'.split(';');
  63. window.REGISTER_TITLES = D;
  64. var fa = 'search find поиск найти искать recherche suchen buscar suche ricerca procurar 検索'.split(' ');
  65. window.SEARCH_TITLES = fa;
  66. var E = 'forgot geändert vergessen hilfe changeemail español'.split(' ');
  67. window.FORGOT_PASSWORD_TITLES = E;
  68. var F = ['remember me', 'rememberme', 'keep me signed in'];
  69. window.REMEMBER_ME_TITLES = F;
  70. var ga = ['back', 'назад'];
  71. window.BACK_TITLES = ga;
  72. function I(a, b, c) {
  73. var d;
  74. if (!a || '' == a)
  75. return !1;
  76. d = a.replace(/^\s+/m, '').replace(/\s+$/m, '').replace(/\s\s+/, ' ').toLowerCase().trim();
  77. b = b.some(function(b) {
  78. return 'function' === typeof b.test ? b.test(a) || b.test(d) : 0 <= d.indexOf(b)
  79. });
  80. var e = !1;
  81. c && (e = c.some(function(b) {
  82. return 'function' === typeof b.test ? b.test(a) || b.test(d) : 0 <= d.indexOf(b)
  83. }));
  84. return b && !e
  85. }
  86. function ha(a) {
  87. var b, c, d;
  88. if (!a || '' == a)
  89. return !1;
  90. b = 'submit';
  91. 0 === b.constructor.toString().indexOf('function String()') && (b = [],
  92. b.push('submit'));
  93. a = a.replace(/^\s+/m, '').replace(/\s+$/m, '').replace(/\s\s+/, ' ').toLowerCase().trim();
  94. c = 0;
  95. for (d = b.length; c < d; c++)
  96. if (0 <= a.indexOf(b[c].toLowerCase()))
  97. return !0;
  98. return !1
  99. }
  100. function J(a) {
  101. return a.textContent || a.innerText
  102. }
  103. function ia(a) {
  104. var b = null;
  105. a && (b = a.toLowerCase().replace(/\s/mg, '').replace(/[~`!@$%^&*()\-_+=:;'"\[\]|\\,<.>\/?]/mg, ''),
  106. b = 0 < b.length ? b : null);
  107. return b
  108. }
  109. function K(a) {
  110. var b = null;
  111. a && (b = a.replace(/^\s+|\s+$|\r?\n.*$/mg, '').replace(/\s{2,}/, ' '),
  112. b = 0 < b.length ? b : null);
  113. return b
  114. }
  115. function ja(a, b) {
  116. var c;
  117. c = '';
  118. 3 === b.nodeType ? c = b.nodeValue : 1 === b.nodeType && (c = J(b));
  119. (c = K(c)) && a.push(c)
  120. }
  121. function L(a) {
  122. return a && void 0 !== a ? ka(a, 'select option input form textarea button table iframe body head script'.split(' ')) : !0
  123. }
  124. function ma(a, b, c) {
  125. var d;
  126. for (c || (c = 0); a && a.previousSibling; ) {
  127. a = a.previousSibling;
  128. if (L(a))
  129. return;
  130. ja(b, a)
  131. }
  132. if (a && 0 === b.length) {
  133. for (d = null; !d; ) {
  134. a = a.parentElement || a.parentNode;
  135. if (!a)
  136. return;
  137. for (d = a.previousSibling; d && !L(d) && d.lastChild; )
  138. d = d.lastChild
  139. }
  140. L(d) || (ja(b, d),
  141. 0 === b.length && ma(d, b, c + 1))
  142. }
  143. }
  144. function ka(a, b) {
  145. var c;
  146. if (!a)
  147. return !1;
  148. c = a ? (a.tagName || '').toLowerCase() : '';
  149. return b.constructor == Array ? 0 <= b.indexOf(c) : c === b
  150. }
  151. function M(a) {
  152. for (var b = a, c = (a = a.ownerDocument) ? a.defaultView : {}, d; b && b !== a; ) {
  153. d = c.getComputedStyle && b instanceof Element ? c.getComputedStyle(b, null) : b.style;
  154. if (!d)
  155. return !0;
  156. if ('none' === d.display || 'hidden' == d.visibility)
  157. return !1;
  158. b = b.parentNode
  159. }
  160. return b === a
  161. }
  162. function na(a) {
  163. var b = a.ownerDocument.documentElement, c = a.getBoundingClientRect(), d = b.scrollWidth, e = b.scrollHeight, g = c.left - b.clientLeft, b = c.top - b.clientTop, f;
  164. if (!M(a) || !a.offsetParent || 10 > a.clientWidth || 10 > a.clientHeight)
  165. return !1;
  166. var l = a.getClientRects();
  167. if (0 === l.length)
  168. return !1;
  169. for (var k = 0; k < l.length; k++)
  170. if (f = l[k],
  171. f.left > d || 0 > f.right)
  172. return !1;
  173. if (0 > g || g > d || 0 > b || b > e)
  174. return !1;
  175. for (c = a.ownerDocument.elementFromPoint(g + (c.right > window.innerWidth ? (window.innerWidth - g) / 2 : c.width / 2), b + (c.bottom > window.innerHeight ? (window.innerHeight - b) / 2 : c.height / 2)); c && c !== a && c !== document; ) {
  176. if (c.tagName && 'string' === typeof c.tagName && 'label' === c.tagName.toLowerCase() && a.labels && 0 < a.labels.length)
  177. return 0 <= Array.prototype.slice.call(a.labels).indexOf(c);
  178. c = c.parentNode
  179. }
  180. return c === a
  181. }
  182. function oa(a) {
  183. return pa && M(a) ? -1 !== 'email text password number tel url'.split(' ').indexOf(a.type || '') : !1
  184. }
  185. function qa(a) {
  186. var b;
  187. if (!a)
  188. return !1;
  189. a: {
  190. var c;
  191. if (a && !(2 < a.length))
  192. for (c = 0; c < a.length; c++)
  193. if (b = a.elements[c],
  194. b.type && 'search' == b.type.toLowerCase()) {
  195. b = !0;
  196. break a
  197. }
  198. b = !1
  199. }
  200. if (b)
  201. return !0;
  202. b = /(login|signin|log_in)/i;
  203. if (y(a, 'name', b) || y(a, 'id', b) || y(a, 'action', b))
  204. return !1;
  205. b = /(search|[\/?&]find)/i;
  206. return y(a, 'name', b) || y(a, 'id', b) ? !0 : y(a, 'action', b)
  207. }
  208. function N(a) {
  209. var b, c, d;
  210. if (!a)
  211. return '';
  212. b = '';
  213. c = 0;
  214. for (d = a.length; c < d; c++)
  215. b += String.fromCharCode(150 ^ a[c]);
  216. return b
  217. }
  218. function O(a) {
  219. return a ? a.getAttribute('id') + '/' + a.getAttribute('name') + '/' + a.getAttribute('action') : '<null>'
  220. }
  221. function ra(a) {
  222. if (!a || 'form' === a.tagName.toLowerCase())
  223. return a;
  224. if (void 0 !== a.form)
  225. return a.form;
  226. for (var b, c = a.ownerDocument.forms, d = 0; d < c.length; d++)
  227. if (b = Array.prototype.slice.call(c[d].getElementsByTagName(a.tagName)),
  228. -1 !== b.indexOf(a))
  229. return c[d];
  230. return null
  231. }
  232. function sa(a) {
  233. return Array.prototype.slice.call(z(a, 'input, select, button'))
  234. }
  235. function q(a) {
  236. var b;
  237. if (void 0 === a || null === a)
  238. return null;
  239. try {
  240. var c = sa(document)
  241. , d = c.filter(function(b) {
  242. return b.opid == a
  243. });
  244. if (0 < d.length)
  245. b = d[0],
  246. 1 < d.length && console.warn('More than one element found with opid ' + a);
  247. else {
  248. var e = parseInt(a.split('__')[1], 10);
  249. isNaN(e) || (b = c[e])
  250. }
  251. } catch (g) {
  252. console.error('An unexpected error occurred: ' + g)
  253. } finally {
  254. return b
  255. }
  256. }
  257. ;var va = new function() {
  258. function a(a) {
  259. if (!a || 0 >= a.length)
  260. return !1;
  261. for (var b = 0, c = 0; c < a.length; c++)
  262. '' != a[c].value && b++;
  263. return 0 < b
  264. }
  265. function b(a) {
  266. if (!a)
  267. return null;
  268. var b = a ? (a.tagName || '').toLowerCase() : ''
  269. , c = {};
  270. c.name = a.name;
  271. c.value = a.value;
  272. c.id = a.id;
  273. c.visible = M(a);
  274. 'select' === b ? c.type = 'S' : 'input' === b ? (b = a.type.toLowerCase(),
  275. 'text' === b ? c.type = 'T' : 'tel' === b ? c.type = 'TEL' : 'email' === b ? c.type = 'E' : 'url' === b ? c.type = 'U' : 'number' === b ? c.type = 'N' : 'range' === b ? c.type = 'RNG' : 'password' === b ? c.type = 'P' : 'checkbox' === b ? (c.type = 'C',
  276. c.value = a.checked ? '✓' : '') : 'radio' === b ? (c.type = 'R',
  277. c.value = a.checked ? '1' : '0') : 'submit' === b ? c.type = 'I' : 'button' === b && (c.type = 'B')) : 'textarea' === b && (c.type = 'A');
  278. return c
  279. }
  280. function c(a) {
  281. if (!a)
  282. return 0;
  283. for (var b = 0, c = 0; c < a.length; c++) {
  284. var d = a.elements[c];
  285. if (ka(d, 'input')) {
  286. var e = d.type.toLowerCase()
  287. , g = /(text|password|email|url|number|range)/i;
  288. e && e.match(g) && '' != d.value && b++
  289. } else
  290. ka(d, 'textarea') && '' != d.value && b++
  291. }
  292. return b
  293. }
  294. function d(c, d, e) {
  295. var f = {
  296. shouldSave: !1,
  297. fields: null
  298. }
  299. , l = !1
  300. , s = [];
  301. e && c && 0 < c.length && (f.form = c[0].form);
  302. for (var H = [], v = [], n = 0; n < c.length; n++) {
  303. var h = b(c[n]);
  304. h.type && s.push(h);
  305. 'T' != h.type && 'E' != h.type || H.push(h);
  306. 'P' === h.type && 0 < h.value.length && v.push(h)
  307. }
  308. if (e && !d)
  309. for (n = 0,
  310. c = k.length; n < c; n++)
  311. h = b(k[n]),
  312. h.type && '' !== h.value && 0 == s.filter(function(a) {
  313. return a.type !== h.type || a.value !== h.value || a.name !== h.name || a.id !== h.id ? !1 : !0
  314. }).length && s.push(h);
  315. if (0 < H.length) {
  316. var X = null
  317. , r = null
  318. , la = null
  319. , h = null
  320. , za = /user[_-]?name/i
  321. , n = 0;
  322. for (c = H.length; n < c; n++)
  323. h = H[n],
  324. h.name && 'username' === h.name ? X = h : h.name.match(za) || h.id.match(za) ? X = h : h.type && 'E' == h.type && '' != h.value ? r = h : !h.type || 'T' != h.type && 'U' != h.type || '' == h.value || (la = h);
  325. X ? X.designation = 'username' : r ? r.designation = 'username' : la && (la.designation = 'username')
  326. }
  327. 0 < v.length && (v.sort(function(a, b) {
  328. return a.value.length - b.value.length
  329. }),
  330. v[0].designation = 'password',
  331. l = !0);
  332. !d && 0 < s.length ? f.shouldSave = !0 : e ? l && (f.shouldSave = !0) : l && g(null) && a(s) && (f.shouldSave = !0);
  333. f.fields = s;
  334. return f
  335. }
  336. function e(a, b) {
  337. k = [];
  338. for (var c = document.getElementsByTagName('input'), e = 0, f = c.length; e < f; e++)
  339. c[e].form || k.push(c[e]);
  340. e = a ? a.elements : k;
  341. f = d(e, b, a ? !0 : !1);
  342. if (f.shouldSave) {
  343. for (var g = f.form, l = {}, v = [], n = [], c = {}, h = e.length - 1; 0 <= h; h--)
  344. e[h].form && -1 === v.indexOf(e[h].form) && v.push(e[h].form),
  345. e[h].ownerDocument && -1 === n.indexOf(e[h].ownerDocument) && n.push(e[h].ownerDocument);
  346. 1 === v.length && 1 === n.length && v[0].ownerDocument === n[0] ? (c.location = v[0].ownerDocument.URL,
  347. c.title = v[0].ownerDocument.domain) : 1 === n.length ? (c.location = n[0].URL,
  348. c.title = n[0].domain) : (c.location = window.location.href,
  349. c.title = window.document.title);
  350. l.type_name = 'webforms.WebForm';
  351. l.secureContents = {
  352. fields: f.fields
  353. };
  354. g && 'string' === typeof g.getAttribute('action') && '' !== g.getAttribute('action') && (l.secureContents.htmlAction = ta(g.getAttribute('action')));
  355. g && 'string' === typeof g.getAttribute('id') && '' !== g.getAttribute('id') && (l.secureContents.htmlID = g.getAttribute('id'));
  356. g && 'string' === typeof g.getAttribute('name') && '' !== g.getAttribute('name') && (l.secureContents.htmlName = g.getAttribute('name'));
  357. g && 'string' === typeof g.getAttribute('method') && '' !== g.getAttribute('method') && (l.secureContents.htmlMethod = g.getAttribute('method'));
  358. l.overview = {};
  359. e = new ua(l);
  360. e.setTitle(c.title);
  361. e.a.overview.location = c.location;
  362. c = e
  363. } else
  364. c = null;
  365. return c
  366. }
  367. function g(a) {
  368. a = Array.prototype.slice.call(a ? a.elements : k);
  369. for (var b, c, d = 0; d < a.length; d++)
  370. if (c = a[d].value || '',
  371. b = a[d].getAttribute('value') || '',
  372. c != b)
  373. return !0;
  374. return !1
  375. }
  376. function f(a) {
  377. for (var c = {}, d = 0; d < a.length; d++) {
  378. var e = b(a[d]);
  379. e.type && '' !== e.value && (c[e ? e.id + '/' + e.name + '/' + e.type : '<null>'] = e.value)
  380. }
  381. return c
  382. }
  383. var l = {}
  384. , k = null;
  385. return {
  386. k: function() {
  387. var a;
  388. a = null;
  389. var b = document.forms;
  390. if (!b || 1 > b.length)
  391. a = null;
  392. else {
  393. for (var d = [], f = 0, k = b.length; f < k; f++) {
  394. var l = b[f];
  395. g(l) && (d[d.length] = l)
  396. }
  397. b = d;
  398. for (d = 0; d < b.length; d++)
  399. (f = b[d]) && M(f) && (null == a || c(f) > c(a)) && (a = f)
  400. }
  401. return e(a, !1)
  402. },
  403. m: e,
  404. g: function() {
  405. var a = document.getElementsByTagName('input');
  406. k = [];
  407. for (var b = [], c = 0, d = a.length; c < d; c++) {
  408. var e = a[c].form;
  409. e ? l[O(e)] ? -1 === b.indexOf(O(e)) && b.push(O(e)) : l[O(e)] = f(e.elements) : k.push(a[c])
  410. }
  411. 0 < k.length && (l[O(null)] = f(k))
  412. }
  413. }
  414. }
  415. ;
  416. var wa = new function() {
  417. function a(a, b) {
  418. if (!a || 0 == a.length)
  419. return !1;
  420. a = a.toLowerCase();
  421. var c, f = b.length;
  422. for (c = 0; c < f; c++)
  423. if (-1 !== a.indexOf(b[c]))
  424. return !0;
  425. return !1
  426. }
  427. function b() {
  428. var a = document.forms, b, c;
  429. if (!a || 1 > a.length) {
  430. a: {
  431. b = document.getElementsByTagName('input');
  432. c = 0;
  433. for (a = b.length; c < a; c++) {
  434. var f = b[c];
  435. if ('text' === f.type || 'email' === f.type || 'password' === f.type) {
  436. b = !0;
  437. break a
  438. }
  439. }
  440. b = !1
  441. }
  442. return b
  443. }
  444. b = 0;
  445. for (c = a.length; b < c; b++) {
  446. var f = a[b], l;
  447. if (l = f && M(f))
  448. if (l = !qa(f))
  449. if (l = 0 < f.elements.length)
  450. a: {
  451. if (f && !(1 > f.elements)) {
  452. l = 0;
  453. for (var k = f.elements.length; l < k; l++) {
  454. var p = f.elements[l];
  455. if ('text' === p.type || 'email' === p.type || 'password' === p.type) {
  456. l = !0;
  457. break a
  458. }
  459. }
  460. }
  461. l = !1
  462. }
  463. if (l)
  464. return !0
  465. }
  466. a = document.getElementsByTagName('input');
  467. b = 0;
  468. for (c = a.length; b < c; b++)
  469. if (f = a[b],
  470. !f.form && ('password' === f.type || 'text' === f.type && M(f)))
  471. return !0;
  472. return !1
  473. }
  474. var c = ['change password', 'new password'];
  475. return {
  476. h: function() {
  477. var d = b(), e = d && (a(document.title, c) || a(J(document.body), c) ? !0 : !1), g;
  478. g = 0;
  479. for (var f = document.getElementsByTagName('input'), l = 0, k = f.length; l < k; l++) {
  480. var p = f[l], m;
  481. m = p && p.type ? 'password' == p.type.toLowerCase() : void 0;
  482. !m || p.form && !M(p.form) || 0 < p.value.length || g++
  483. }
  484. f = 50;
  485. l = z(document, 'input[type=password]');
  486. k = 0;
  487. for (p = l.length; k < p; k++)
  488. m = l[k],
  489. M(m) && m.getAttribute('maxlength') && (f = Math.min(m.getAttribute('maxlength'), f));
  490. f = Math.max(f, 8);
  491. return {
  492. hasLoginForm: d,
  493. hasChangePasswordForm: e,
  494. hasCreditCardForm: !1,
  495. hasIdentityForm: !1,
  496. emptyPasswordFieldCount: g,
  497. passGenMaxLength: f,
  498. title: document.title || ''
  499. }
  500. }
  501. }
  502. }
  503. ;
  504. function ua(a) {
  505. this.a = a;
  506. this.b = null
  507. }
  508. ua.prototype = {
  509. toJSON: function() {
  510. return this.a
  511. },
  512. toString: function() {
  513. var a = 'Regular login';
  514. P(this) && (a = 'Change password');
  515. var b;
  516. P(this) ? b = !1 : (xa(this, 'htmlAction') || '').match(/(signup|register)/i) || (xa(this, 'htmlID') || '').match(/(signup|register)/i) ? b = !0 : (b = ya(this, ['P']),
  517. b = 2 != b.length ? !1 : b[0].value === b[1].value);
  518. b && (a = 'Registration form');
  519. return '[OPLogin ' + (this.n() || 'NO_UUID') + ' (' + a + ')] <' + this.location() + '>'
  520. },
  521. n: function() {
  522. return this.a.uuid
  523. },
  524. i: function() {
  525. return (this.a.secureContents || {}).fields
  526. },
  527. title: function() {
  528. return this.a.overview.title
  529. },
  530. setTitle: function(a) {
  531. this.a.overview.title = a
  532. },
  533. location: function() {
  534. if (this.a && this.a.overview)
  535. return this.a.overview.location
  536. }
  537. };
  538. function P(a) {
  539. var b = ya(a, ['P'])
  540. , b = b.filter(function(a) {
  541. return a.visible && '' !== a.value
  542. });
  543. if (2 > b.length)
  544. return !1;
  545. if (3 === b.length) {
  546. var c = b[0].value
  547. , d = b[1].value
  548. , e = b[2].value;
  549. if (c === d && c === e)
  550. return !1;
  551. var g = [];
  552. 0 < c.length && -1 === g.indexOf(c) && g.push(c);
  553. 0 < d.length && -1 === g.indexOf(d) && g.push(d);
  554. 0 < e.length && -1 === g.indexOf(e) && g.push(e);
  555. if (2 == g.length)
  556. return !0
  557. }
  558. if (2 === b.length)
  559. if (0 < ya(a, ['T', 'U', 'E']).length) {
  560. if (a.b)
  561. for (a = [a.b.textContent, a.b.value, a.b.innerText, a.b.hasAttribute('title') ? a.b.title : '', a.b.hasAttribute('alt') ? a.b.alt : ''],
  562. c = 0; c < a.length; c++)
  563. if (I(a[c], ea))
  564. return b[0].value === b[1].value
  565. } else
  566. return b[0].value === b[1].value;
  567. return !1
  568. }
  569. function ya(a, b) {
  570. var c = a.i();
  571. if (!c)
  572. return [];
  573. for (var d = [], e = 0; e < c.length; ++e) {
  574. var g = c[e].type;
  575. g && 0 <= b.indexOf(g) && d.push(c[e])
  576. }
  577. return d
  578. }
  579. function xa(a, b) {
  580. var c = (a.a.secureContents || {}).htmlForm;
  581. return c ? c[b] || '' : null
  582. }
  583. ;function Aa(a) {
  584. this.c = {};
  585. this.name = a;
  586. if ('object' != typeof chrome || !chrome.runtime)
  587. if ('object' == typeof safari && null != safari.extension) {
  588. var b = this;
  589. safari.self.addEventListener('message', function(a) {
  590. 'performCallback' === a.name && Ba(b, a.message.uuid, a.message.result)
  591. }, !1)
  592. } else
  593. 'object' === typeof self && 'object' === typeof self.port && (b = this,
  594. self.port.on('callback', function(a) {
  595. Ba(b, a.uuid, a.result)
  596. }))
  597. }
  598. Aa.prototype = {};
  599. function Ba(a, b, c) {
  600. var d = a.c[b];
  601. d && (delete a.c[b],
  602. d(c))
  603. }
  604. function Q(a, b, c) {
  605. var d = Ca
  606. , e = Da.e()
  607. , e = 'uuid-' + d.name + '-' + e
  608. , g = {
  609. uuid: e,
  610. command: a,
  611. params: b
  612. };
  613. 'object' == typeof chrome && chrome.runtime ? chrome.runtime.sendMessage(g, function(a) {
  614. c && c(a)
  615. }) : 'object' == typeof safari && null != safari.extension ? 'object' == typeof safari.extension && 'object' == typeof safari.extension.globalPage && 'object' == typeof safari.extension.globalPage.contentWindow ? safari.extension.globalPage.contentWindow.performCommand(null, a, b, function(a) {
  616. c && c(a)
  617. }) : (c && (d.c[e] = c),
  618. safari.self.tab.dispatchMessage('perform', g)) : 'object' === typeof self && 'object' === typeof self.port && (c && (d.c[e] = c),
  619. self.port && self.port.emit('perform', g))
  620. }
  621. ;function Ea(a, b) {
  622. Fa ? 'object' === typeof safari.application && 'object' === typeof safari.extension ? safari.extension.globalPage.contentWindow.handleMessageEvent(safari.application.activeBrowserWindow.activeTab, a, b, null) : safari.self.tab.dispatchMessage(a, b) : Ga ? chrome.runtime.sendMessage({
  623. name: a,
  624. message: b
  625. }) : u && self.port.emit('message', {
  626. name: a,
  627. message: b
  628. })
  629. }
  630. function ta(a) {
  631. return (a = new URL(a,window.location.href)) ? a.href : null
  632. }
  633. function Ha() {
  634. var a = document
  635. , b = null;
  636. try {
  637. b = a.querySelector(':focus')
  638. } catch (c) {}
  639. return b
  640. }
  641. function z(a, b) {
  642. var c = [];
  643. try {
  644. c = a.querySelectorAll(b)
  645. } catch (d) {}
  646. return c
  647. }
  648. function w(a, b) {
  649. if (!a)
  650. return !1;
  651. var c;
  652. b && (c = a.value);
  653. 'function' === typeof a.click && a.click();
  654. 'function' === typeof a.focus && a.focus();
  655. b && a.value !== c && (a.value = c);
  656. return 'function' === typeof a.click || 'function' === typeof a.focus
  657. }
  658. var Da = new function() {
  659. return {
  660. e: function() {
  661. function a() {
  662. return (65536 * (1 + Math.random()) | 0).toString(16).substring(1).toUpperCase()
  663. }
  664. return [a(), a(), a(), a(), a(), a(), a(), a()].join('')
  665. }
  666. }
  667. }
  668. ;
  669. var Fa = 'object' === typeof safari && safari.extension
  670. , Ga = 'object' === typeof chrome && chrome.runtime
  671. , u = 'object' === typeof self && 'object' === typeof self.port
  672. , Ca = new Aa('protected')
  673. , R = Da.e()
  674. , Ia = null
  675. , Ja = 0;
  676. function Ka(a, b) {
  677. switch (a) {
  678. case 'getPageDetails':
  679. La(b.token);
  680. break;
  681. case 'manualSave':
  682. Ma(b.token);
  683. break;
  684. case 'executeFillScript':
  685. if (R === b.documentUUID || 'all' === b.documentUUID) {
  686. var c;
  687. Ia = b.itemType;
  688. b.nakedDomains && (c = Array.isArray(b.nakedDomains) ? b.nakedDomains : 'string' === typeof b.nakedDomains ? [b.nakedDomains] : [JSON.stringify(b.nakedDomains)]);
  689. 'fillLogin' === Ia || Array.isArray(c) && 0 < c.length ? Q('canFillLoginOnHostname', {
  690. nakedDomains: c,
  691. hostname: window.location.hostname
  692. }, function(a) {
  693. !0 === a.allowed && S(b)
  694. }) : S(b)
  695. }
  696. break;
  697. case 'legacy_executeFillScript':
  698. R !== b.documentUUID && 'all' !== b.documentUUID || S(b);
  699. break;
  700. case 'collectFields':
  701. Na(b);
  702. break;
  703. case 'presentFields':
  704. Oa();
  705. break;
  706. case 'welcomeCommand':
  707. Pa(b);
  708. break;
  709. case 'authCommand':
  710. Qa(b);
  711. break;
  712. case 'checkForGoAndFill':
  713. T = !1,
  714. Ja = 0,
  715. U()
  716. }
  717. }
  718. function Pa(a) {
  719. var b = document.getElementById('xpc');
  720. if (b) {
  721. var c = document.createElement('li');
  722. '' === c.textContent ? c.textContent = JSON.stringify(a) : c.innerText = JSON.stringify(a);
  723. b.appendChild(c)
  724. }
  725. }
  726. function Qa(a) {
  727. var b = CustomEvent;
  728. a = {
  729. name: a.name,
  730. params: a.params
  731. };
  732. a = u ? cloneInto(a, window.document) : a;
  733. b = new b('ExtensionAuthCommand',{
  734. bubbles: !1,
  735. cancelable: !1,
  736. detail: a
  737. });
  738. document.dispatchEvent(b)
  739. }
  740. 'https://agilebits.com/browsers/auth.html' === window.location.href && document.addEventListener('ExtensionAuthResponse', function(a) {
  741. a = a.detail;
  742. Q(a.name, a.params)
  743. });
  744. 'https://agilebits.com/browsers/welcome.html' === window.location.href && document.addEventListener('click', function(a) {
  745. if ('authReconnect' === a.target.id)
  746. return Q('reauthorize', {}),
  747. !1
  748. });
  749. function Ma(a) {
  750. var b, c;
  751. if (b = va.k())
  752. c = V(window.document, R),
  753. Q('manualSaveResults', {
  754. login: b.a,
  755. collectedDocument: c,
  756. token: a,
  757. documentUUID: R,
  758. tabId: void 0
  759. }, null)
  760. }
  761. function Na(a) {
  762. var b = a.fillContextIdentifier;
  763. da();
  764. a = V(window.document, R);
  765. var c = new URL(window.location.href);
  766. c && c.hostname || 'about:accounts' === window.location.href ? Q('collectFieldsResult', {
  767. documentUUID: R,
  768. url: window.location.href,
  769. fields: a,
  770. fillContextIdentifier: b
  771. }, null) : console.warn('Failed to create URL object for string <' + window.location.href + '>')
  772. }
  773. function Ra(a, b, c) {
  774. function d(a) {
  775. return a && !a.dataset.p && M(a) ? 0 <= ['text', 'email', 'number', 'tel', 'url'].indexOf(a.type.toLowerCase()) : !1
  776. }
  777. if (c && 'object' === typeof c && 0 !== c.length) {
  778. var e, g = a['helper-capable-of-press-enter-key'];
  779. elementsToFocus = [];
  780. if (a && a.focusSelector) {
  781. elementsToFocus = Array.prototype.slice.call(z(document, a.focusSelector));
  782. var f = [];
  783. for (e = 0; e < elementsToFocus.length; e++)
  784. c.indexOf(elementsToFocus[e]) && f.push(elementsToFocus[e]);
  785. 0 < f.length && (elementsToFocus = f)
  786. }
  787. if (0 < elementsToFocus.length)
  788. for (e = 0; e < elementsToFocus.length; e++)
  789. w(elementsToFocus[e], !0);
  790. else
  791. elementsToFocus = c;
  792. c = elementsToFocus[elementsToFocus.length - 1];
  793. for (e = elementsToFocus.length - 1; 0 <= e; e--)
  794. if (null !== elementsToFocus[e] && na(elementsToFocus[e])) {
  795. if ('password' === elementsToFocus[e].type.toLowerCase()) {
  796. c = elementsToFocus[e];
  797. break
  798. }
  799. !d(c) && d(elementsToFocus[e]) && (c = elementsToFocus[e])
  800. }
  801. if (null !== c && (document.activeElement !== c && w(c, !0),
  802. a && a.submit))
  803. if ((a = z(document, a.clickSelector)) && 0 < a.length)
  804. for (e = 0,
  805. b = a.length; e < b; e++)
  806. a[e].click();
  807. else
  808. 'password' === c.type.toLowerCase() && Sa(c, g, b)
  809. } else
  810. console.warn('Autosubmit was called without a valid collection of filled fields. Ignoring.')
  811. }
  812. function La(a) {
  813. var b = wa.h();
  814. Q('getPageDetailsResponse', {
  815. pageDetails: b,
  816. token: a
  817. }, null)
  818. }
  819. var Ta = null
  820. , T = !1;
  821. function U() {
  822. T || (10 < Ja ? T = !0 : (Ja++,
  823. 0 == document.querySelectorAll('input[type=text],input[type=password]').length ? Ta = setTimeout(U, 300) : (T = !0,
  824. Q('checkForGoAndFill', {
  825. url: window.location.href,
  826. documentUUID: R
  827. }))))
  828. }
  829. function Ua() {
  830. var a;
  831. void 0 === a && (a = window.location.hostname);
  832. return Va(a) || /^(?:[^.]+\.)*(?:agilebits).com$/i.test(a)
  833. }
  834. function Va(a) {
  835. void 0 === a && (a = window.location.hostname);
  836. return /^(?:[^.]+\.)*(?:1password|b5dev|b5staging|b5test|b5local).com$/i.test(a)
  837. }
  838. function Wa() {
  839. document.addEventListener('B5SignInSucceeded', function(a) {
  840. Q('B5SignInSucceeded', a.detail)
  841. })
  842. }
  843. function Xa(a) {
  844. document.addEventListener('B5WebReady', function(b) {
  845. a && b && b.detail && b.detail.capabilities && b.detail.capabilities.CustomAutosave && (Ya(),
  846. Wa())
  847. })
  848. }
  849. if ('object' == typeof safari && void 0 !== safari.self)
  850. safari.self.addEventListener('message', function(a) {
  851. Ka(a.name, a.message)
  852. }, !1);
  853. else if ('object' == typeof chrome && chrome.runtime)
  854. chrome.runtime.onMessage.addListener(function(a) {
  855. Ka(a.name, a.message)
  856. });
  857. else if ('object' === typeof self && 'object' === typeof self.port)
  858. self.port.on('message', function(a) {
  859. Ka(a.name, a.message)
  860. });
  861. 0 === window.location.protocol.indexOf('http') && (setTimeout(function() {
  862. va.g();
  863. Za(!0);
  864. Ua() && document.body && 'object' === typeof document.body.dataset && (document.body.dataset.onepasswordExtensionVersion = 4060390);
  865. Va() && Q('canAddB5Account', {}, function(a) {
  866. var b = {
  867. capabilities: {},
  868. version: 4060390
  869. };
  870. a = !!a.capable;
  871. Xa(a);
  872. b.capabilities.CustomAutosave = a;
  873. document.dispatchEvent(new CustomEvent('B5OPXReady',{
  874. bubbles: !1,
  875. cancelable: !1,
  876. detail: b
  877. }))
  878. })
  879. }, 200),
  880. window.addEventListener('pageshow', function() {
  881. Ta = setTimeout(U, 200)
  882. }, !1),
  883. setTimeout(function() {
  884. T || (clearTimeout(Ta),
  885. U())
  886. }, 2E3));
  887. var $a = !0
  888. , pa = !0
  889. , ab = !0;
  890. document.com_agilebits_onepassword_fill = S;
  891. function bb(a) {
  892. var b = null;
  893. return a ? 0 === a.indexOf('https://') && 'http:' === document.location.protocol && (b = document.querySelectorAll('input[type=password]'),
  894. 0 < b.length && (confirmResult = confirm('1Password warning: This is an unsecured HTTP page, and any information you submit can potentially be seen and changed by others. This Login was originally saved on a secure (HTTPS) page.\n\nDo you still wish to fill this login?'),
  895. 0 == confirmResult)) ? !0 : !1 : !1
  896. }
  897. function S(a) {
  898. var b, c = [], d = a.properties, e = 1, g = [];
  899. d && d.delay_between_operations && (e = d.delay_between_operations);
  900. if (!bb(a.savedURL)) {
  901. var f = function(a, b) {
  902. var d = a[0];
  903. if (void 0 === d)
  904. b();
  905. else {
  906. if ('delay' === d.operation || 'delay' === d[0])
  907. e = d.parameters ? d.parameters[0] : d[1];
  908. else {
  909. if (d = cb(d))
  910. for (var m = 0; m < d.length; m++)
  911. -1 === g.indexOf(d[m]) && g.push(d[m]);
  912. c = c.concat(g.map(function(a) {
  913. return a && a.hasOwnProperty('opid') ? a.opid : null
  914. }))
  915. }
  916. setTimeout(function() {
  917. f(a.slice(1), b)
  918. }, e)
  919. }
  920. };
  921. $a = ab = !0;
  922. if (b = a.options)
  923. b.hasOwnProperty('animate') && (pa = b.animate),
  924. b.hasOwnProperty('markFilling') && ($a = b.markFilling);
  925. if ((b = a.metadata) && b.hasOwnProperty('action'))
  926. switch (b.action) {
  927. case 'fillPassword':
  928. $a = !1;
  929. break;
  930. case 'fillLogin':
  931. ab = !1
  932. }
  933. a.hasOwnProperty('script') && (b = a.script,
  934. f(b, function() {
  935. a.hasOwnProperty('autosubmit') && 'function' == typeof Ra && (!a.itemType || 'fillLogin' === a.itemType) && 0 < g.length && setTimeout(function() {
  936. Ra(a.autosubmit, d.allow_clicky_autosubmit, g)
  937. }, 250);
  938. 'object' == typeof Ca && Q('fillItemResults', {
  939. documentUUID: R,
  940. fillContextIdentifier: a.fillContextIdentifier,
  941. usedOpids: c
  942. }, function() {
  943. Ia = null
  944. })
  945. }))
  946. }
  947. }
  948. var kb = {
  949. fill_by_opid: db,
  950. fill_by_query: eb,
  951. click_on_opid: fb,
  952. click_on_query: gb,
  953. touch_all_fields: hb,
  954. simple_set_value_by_query: ib,
  955. focus_by_opid: jb,
  956. delay: null
  957. };
  958. function cb(a) {
  959. var b;
  960. if (a.hasOwnProperty('operation') && a.hasOwnProperty('parameters'))
  961. b = a.operation,
  962. a = a.parameters;
  963. else if ('[object Array]' === Object.prototype.toString.call(a))
  964. b = a[0],
  965. a = a.splice(1);
  966. else
  967. return null;
  968. return kb.hasOwnProperty(b) ? kb[b].apply(this, a) : null
  969. }
  970. function db(a, b) {
  971. var c;
  972. return (c = q(a)) ? (lb(c, b),
  973. [c]) : null
  974. }
  975. function eb(a, b) {
  976. var c;
  977. c = z(document, a);
  978. return Array.prototype.map.call(Array.prototype.slice.call(c), function(a) {
  979. lb(a, b);
  980. return a
  981. }, this)
  982. }
  983. function ib(a, b) {
  984. var c, d = [];
  985. c = z(document, a);
  986. Array.prototype.forEach.call(Array.prototype.slice.call(c), function(a) {
  987. a.disabled || a.f || a.readOnly || void 0 === a.value || (a.value = b,
  988. d.push(a))
  989. });
  990. return d
  991. }
  992. function jb(a) {
  993. (a = q(a)) && w(a, !0);
  994. return null
  995. }
  996. function fb(a) {
  997. return (a = q(a)) ? w(a, !1) ? [a] : null : null
  998. }
  999. function gb(a) {
  1000. a = z(document, a);
  1001. return Array.prototype.map.call(Array.prototype.slice.call(a), function(a) {
  1002. w(a, !0);
  1003. return [a]
  1004. }, this)
  1005. }
  1006. function hb() {
  1007. da()
  1008. }
  1009. ;function Za(a) {
  1010. window.document.addEventListener('submit', mb, a);
  1011. window.document.addEventListener('keydown', nb, a);
  1012. window.document.addEventListener('click', ob, a)
  1013. }
  1014. function Ya() {
  1015. window.document.removeEventListener('submit', mb, !0);
  1016. window.document.removeEventListener('keydown', nb, !0);
  1017. window.document.removeEventListener('click', ob, !0)
  1018. }
  1019. function mb(a) {
  1020. (a = a ? a.target : this) || (a = ra(a));
  1021. W(a, null);
  1022. return !1
  1023. }
  1024. var Y = B.concat(D).concat(ea);
  1025. function ob(a) {
  1026. var b = a ? a.target : this;
  1027. if (!1 !== a.j) {
  1028. var c = function(a) {
  1029. for (var b = a.ownerDocument.querySelectorAll('[role=button]'), c, f = 0; f < b.length; f++)
  1030. if (c = Array.prototype.slice.call(b[f].getElementsByTagName(a.tagName)),
  1031. -1 !== c.indexOf(a))
  1032. return b[f];
  1033. return null
  1034. };
  1035. if (a = function(a) {
  1036. if (-1 !== ['button', 'input'].indexOf(a.tagName.toLowerCase())) {
  1037. if ('button' === a.tagName.toLowerCase() && !a.hasAttribute('type') || 'button' === a.type.toLowerCase())
  1038. if (I(a.textContent, Y, C) || I(a.value, Y, C) || a.hasAttribute('aria-label') && I(a.getAttribute('aria-label'), Y, C))
  1039. return a;
  1040. if (-1 !== ['submit', 'image'].indexOf(a.type.toLowerCase()))
  1041. return a
  1042. } else {
  1043. var b;
  1044. a && void 0 !== a.getAttribute ? (b = a.getAttribute('data-action'),
  1045. b = ha(b)) : b = !1;
  1046. b || (b = J(a) || a.value,
  1047. b = 'div' === a.tagName.toLowerCase() && a.classList.contains('button') && (b && I(b, Y, C) || a.hasAttribute('aria-label') && I(a.getAttribute('aria-label'), Y, C)) ? !0 : !1);
  1048. if (b)
  1049. return a
  1050. }
  1051. a: {
  1052. b = 3;
  1053. for (var c = null; a && a !== document && 0 <= b; )
  1054. if (c = J(a) || a.value || c,
  1055. -1 !== ['a', 'button'].indexOf(a.tagName.toLowerCase())) {
  1056. if (a.hasAttribute('type') && 'submit' === a.type.toLowerCase() || c && I(c, Y, C) || a.hasAttribute('aria-label') && I(a.getAttribute('aria-label'), Y, C))
  1057. break a;
  1058. break
  1059. } else
  1060. a = a.parentNode,
  1061. b--;
  1062. a = null
  1063. }
  1064. return a
  1065. }(b))
  1066. c = ra(b),
  1067. W(c, a);
  1068. else if (b = c(b))
  1069. if (0 <= (b.getAttribute('title') && Y.indexOf(b.getAttribute('title').toLowerCase())) || b.getAttribute('alt') && 0 <= Y.indexOf(b.getAttribute('alt').toLowerCase()))
  1070. (c = ra(b)) ? W(c, b) : W(null, b)
  1071. }
  1072. }
  1073. function nb(a) {
  1074. 13 !== a.keyCode || 'text' !== a.target.type && 'password' !== a.target.type && 'email' !== a.target.type || (a.target.form ? W(a.target.form, null) : W(null, null))
  1075. }
  1076. function W(a, b) {
  1077. if (-1 === window.location.href.indexOf('chrome-extension://') && -1 === window.location.href.indexOf('safari-extension://')) {
  1078. for (var c = document.getElementsByTagName('meta'), d = 0; d < c.length; d++)
  1079. if ('com.agilebits.onepassword.autosave' === c[d].name && 'no' === c[d].content)
  1080. return;
  1081. if (!b || !b.hasAttribute('aria-controls'))
  1082. if (c = document.querySelectorAll('input[type="password"]'),
  1083. 0 !== c.length) {
  1084. var e = va.m(a, !0);
  1085. e && (e.b = b);
  1086. if (null !== e && !P(e)) {
  1087. if (a && a.opfilled)
  1088. return;
  1089. if (!a) {
  1090. for (var g = null, f = !1, d = 0; d < c.length; d++)
  1091. g = c[d],
  1092. /^\d{3,4}$/.test(g.value) || g.value == g.getAttribute('value') || (f = !0);
  1093. if (!f)
  1094. return
  1095. }
  1096. }
  1097. if (e) {
  1098. var l = P(e) ? 'change-password' : 'auto-save'
  1099. , k = e.a
  1100. , p = V(window.document, R);
  1101. Ya();
  1102. setTimeout(function() {
  1103. Q('autosave', {
  1104. login: k,
  1105. collectedDocument: p,
  1106. context: l,
  1107. location: window.location.href
  1108. })
  1109. }, 50);
  1110. setTimeout(Za, 1E3, !0)
  1111. }
  1112. }
  1113. }
  1114. }
  1115. ;function pb() {}
  1116. function qb() {
  1117. var a = document.createEvent(N([194, 243, 238, 226, 211, 224, 243, 248, 226]));
  1118. a[N([255, 248, 255, 226, 194, 243, 238, 226, 211, 224, 243, 248, 226])](N([226, 243, 238, 226, 223, 248, 230, 227, 226]), !0, !1, null, N([156]), 9, 'en-US');
  1119. return a
  1120. }
  1121. function rb(a) {
  1122. if (!a)
  1123. return !1;
  1124. var b = a.getAttribute('action');
  1125. if (!b || '' == b)
  1126. return !1;
  1127. if (!a.onsubmit) {
  1128. if (a.onkeypress || a.onkeydown)
  1129. return !1;
  1130. for (b = 0; b < a.elements.length; ++b) {
  1131. var c = a.elements[b];
  1132. if (c.type && 'password' === c.type.toLowerCase() && (c.onkeypress || c.onkeydown))
  1133. return !1
  1134. }
  1135. }
  1136. b = document.createEvent('UIEvent');
  1137. b.initEvent('submit', !0, !0, window, 1);
  1138. a.dispatchEvent(b);
  1139. a.submit();
  1140. return !0
  1141. }
  1142. function sb(a, b) {
  1143. if (!rb(b)) {
  1144. var c = 0, d = null, e, g;
  1145. if (b)
  1146. for (e = 0; e < b.elements.length; ++e) {
  1147. var f = b.elements[e];
  1148. g = (f.type || '').toLowerCase();
  1149. if ('button' == Z(f) || 'submit' == g || 'button' == g)
  1150. if (g = (f.type || '').toLowerCase(),
  1151. g = 'submit' === g || 'button' === g || 'button' === Z(f) ? 0 <= B.indexOf((f.value || '').toLowerCase()) : void 0,
  1152. g) {
  1153. c = 1;
  1154. d = f;
  1155. break
  1156. } else {
  1157. if (g = !(0 > ['submit', 'button'].indexOf((f.type || '').toLowerCase()) ? 0 : 0 <= D.indexOf(f.value.toLowerCase()) || f.alt && 0 <= D.indexOf(f.alt.toLowerCase())) && !(0 > ['submit', 'button'].indexOf((f.type || '').toLowerCase()) ? 0 : 0 <= fa.indexOf(f.value.toLowerCase()) || f.alt && 0 <= fa.indexOf(f.alt.toLowerCase()))) {
  1158. g = f;
  1159. if (0 > ['submit', 'button'].indexOf((g.type || '').toLowerCase()))
  1160. g = !1;
  1161. else {
  1162. var l = (ia(g.value) || '').toLowerCase();
  1163. 0 <= ga.indexOf(l) ? g = !0 : (g = (ia(g.alt) || '').toLowerCase(),
  1164. g = 0 <= ga.indexOf(g) ? !0 : !1)
  1165. }
  1166. g = !g
  1167. }
  1168. g && (c += 1,
  1169. d = f)
  1170. }
  1171. }
  1172. if (0 === c && b)
  1173. for (l = document.getElementsByTagName('input'),
  1174. e = 0,
  1175. g = l.length; e < g; ++e)
  1176. if (f = l[e],
  1177. 'image' == f.type.toLowerCase() && f && 'image' === (f.type || '').toLowerCase() && (f.name && 0 <= B.indexOf(f.name.toLowerCase()) || f.alt && 0 <= B.indexOf(f.alt.toLowerCase()) || f.value && 0 <= B.indexOf(f.value.toLowerCase()) || f.src && I(f.src, B))) {
  1178. c = 1;
  1179. d = f;
  1180. break
  1181. }
  1182. if (0 === c && b) {
  1183. var k;
  1184. e = tb(a, b);
  1185. f = 0;
  1186. for (g = e.length; f < g; f++)
  1187. if (l = e[f],
  1188. ub(l)) {
  1189. k = l;
  1190. break
  1191. }
  1192. k && (c = 1,
  1193. d = k)
  1194. }
  1195. if (0 === c && b)
  1196. for (k = b.getElementsByTagName('img'),
  1197. e = 0; e < k.length; ++e) {
  1198. g = k[e];
  1199. f = g.parentElement || g.parentNode;
  1200. if (l = 'a' === Z(f))
  1201. l = (g && 'img' === Z(g) ? I(g.src, B) || g.title && 0 <= B.indexOf(g.title.toLowerCase()) || g.alt && 0 <= B.indexOf(g.alt.toLowerCase()) ? !0 : !1 : !1) || ub(f);
  1202. if (l) {
  1203. c = 1;
  1204. d = f;
  1205. break
  1206. }
  1207. }
  1208. if (1 === c)
  1209. if ('a' === Z(d))
  1210. $(d, 'mousedown'),
  1211. $(d, 'mouseup'),
  1212. $(d, 'click');
  1213. else {
  1214. if (d.onclick)
  1215. d.onclick();
  1216. d.click()
  1217. }
  1218. }
  1219. }
  1220. function vb(a, b, c) {
  1221. setTimeout(function() {
  1222. a.dispatchEvent(b)
  1223. }, c)
  1224. }
  1225. function wb() {
  1226. var a = Ha(), b;
  1227. if (!(b = !a || 'input' !== a.tagName.toLowerCase() || 'password' !== a.type.toLowerCase())) {
  1228. a: if (a == document)
  1229. b = !0;
  1230. else {
  1231. if (a.o && (b = a.o(),
  1232. 0 > b.left || 0 > b.top)) {
  1233. b = !1;
  1234. break a
  1235. }
  1236. b = xb(a)
  1237. }
  1238. b = !b
  1239. }
  1240. if (b)
  1241. return !1;
  1242. b = [{
  1243. timeout: 10,
  1244. event: t(a, 'keydown', 13, 0)
  1245. }, {
  1246. timeout: 60,
  1247. event: t(a, 'keypress', 13, 13)
  1248. }, {
  1249. timeout: 120,
  1250. event: t(a, 'keyup', 13, 0)
  1251. }];
  1252. u || b.push({
  1253. timeout: 300,
  1254. event: qb()
  1255. });
  1256. for (var c = 0; c < b.length; ++c) {
  1257. var d = b[c];
  1258. vb(a, d.event, d.timeout)
  1259. }
  1260. return !0
  1261. }
  1262. function yb() {
  1263. var a;
  1264. return 'www.iwork.com' == document.location.host && (a = document.getElementById('complex_login_button')) ? ($(a, 'click'),
  1265. !0) : 'www.icloud.com' == document.location.host && (a = document.getElementsByClassName('auth-submit'),
  1266. 0 < a.length) ? ($(a[0], 'mousedown'),
  1267. $(a[0], 'mouseup'),
  1268. !0) : !1
  1269. }
  1270. function Sa(a, b, c) {
  1271. var d = new pb, e;
  1272. if (a) {
  1273. var g = Ha();
  1274. if (u)
  1275. 'password' === a.type.toLowerCase() && wb();
  1276. else if (b && null !== g && 'input' === g.tagName.toLowerCase() && 'password' === g.type.toLowerCase())
  1277. setTimeout(Ea, 10, 'pressEnterKey');
  1278. else if (e = a.form,
  1279. a = window.MutationObserver || window.WebKitMutationObserver,
  1280. !yb() && (!e || zb(e)))
  1281. if (wb()) {
  1282. var f = setTimeout(function() {
  1283. c && sb(this, e)
  1284. }
  1285. .bind(d), 1E3);
  1286. b = function() {
  1287. clearTimeout(f)
  1288. }
  1289. ;
  1290. a && (d.l = new a(b),
  1291. d.l.observe(document, {
  1292. childList: !0,
  1293. subtree: !0
  1294. }));
  1295. window.addEventListener('beforeunload', b);
  1296. window.addEventListener('pagehide', b);
  1297. window.addEventListener('unload', b)
  1298. } else
  1299. c && sb(d, e)
  1300. }
  1301. }
  1302. function tb(a, b) {
  1303. if (!b)
  1304. return [];
  1305. for (var c = [], d = b.children, e = 0, g = d.length; e < g; e++) {
  1306. var f = d[e];
  1307. 'a' === Z(f) ? c.push(f) : f.children && 0 < f.children.length && (c = c.concat(tb(a, f)))
  1308. }
  1309. return c
  1310. }
  1311. function ub(a) {
  1312. if (!a || 'a' !== Z(a))
  1313. return !1;
  1314. var b = J(a).toLowerCase()
  1315. , c = (a.href || '').toLowerCase()
  1316. , d = (a.getAttribute('id') || '').toLowerCase();
  1317. return I(a.title, F) || I(a.id, F) || I(b, F) || I(a.title, E) || I(a.id, E) || I(b, E) || 0 !== c.indexOf('javascript:') && !a.onclick ? !1 : 0 <= c.indexOf('login') || 0 <= c.indexOf('signin') || 0 <= d.indexOf('login') || 0 <= d.indexOf('signin') || I(a.title, B) || Ab(b) ? !0 : !1
  1318. }
  1319. function $(a, b) {
  1320. var c = document.createEvent('MouseEvent');
  1321. 'object' === typeof self && 'object' === typeof self.port ? c.initMouseEvent(b, !0, !0, window, 1, 0, 0, 0, 0, !1, !1, !1, !1, 0, null) : c.initMouseEvent(b, !0, !0);
  1322. a.dispatchEvent(c)
  1323. }
  1324. function zb(a) {
  1325. if (!a)
  1326. return !1;
  1327. var b = a.getAttribute('method');
  1328. return !b || 'post' !== b.toLowerCase() || qa(a) ? !1 : !0
  1329. }
  1330. function Ab(a) {
  1331. if (!a || '' == a)
  1332. return !1;
  1333. a = a.replace(/^\s+/m, '').replace(/\s+$/m, '').replace(/\s\s+/, ' ').toLowerCase().trim();
  1334. for (var b = 0, c = B.length; b < c; b++)
  1335. if (a == B[b])
  1336. return !0;
  1337. return !1
  1338. }
  1339. function Z(a) {
  1340. return a ? (a.tagName || '').toLowerCase() : ''
  1341. }
  1342. function xb(a) {
  1343. if (a == document)
  1344. return !0;
  1345. if (!a || !a.parentNode)
  1346. return !1;
  1347. if (window.getComputedStyle) {
  1348. if (!(a instanceof Element))
  1349. return !1;
  1350. var b = window.getComputedStyle(a, null);
  1351. if ('none' == b.display || 'hidden' == b.visibility || 5 > b.width || 5 > b.height)
  1352. return !1
  1353. } else if (a.style && ('none' == a.style.display || 'hidden' == a.style.visibility))
  1354. return !1;
  1355. return xb(a.parentNode)
  1356. }
  1357. ;var Bb = {
  1358. 'true': !0,
  1359. y: !0,
  1360. 1: !0,
  1361. yes: !0,
  1362. '✓': !0
  1363. }
  1364. , Cb = 200;
  1365. function lb(a, b) {
  1366. var c;
  1367. if (!(!a || null === b || void 0 === b || ab && (a.disabled || a.f || a.readOnly)))
  1368. switch ($a && a.form && !a.form.opfilled && (a.form.opfilled = !0),
  1369. a.type ? a.type.toLowerCase() : null) {
  1370. case 'checkbox':
  1371. c = b && 1 <= b.length && Bb.hasOwnProperty(b.toLowerCase()) && !0 === Bb[b.toLowerCase()];
  1372. a.checked === c || Db(a, function(a) {
  1373. a.checked = c
  1374. });
  1375. break;
  1376. case 'radio':
  1377. !0 === Bb[b.toLowerCase()] && a.click();
  1378. break;
  1379. default:
  1380. a.value == b || Db(a, function(a) {
  1381. a.value = b
  1382. })
  1383. }
  1384. }
  1385. function Db(a, b) {
  1386. aa(a);
  1387. b(a);
  1388. ba(a);
  1389. oa(a) && (a.className += ' com-agilebits-onepassword-extension-animated-fill',
  1390. setTimeout(function() {
  1391. a && a.className && (a.className = a.className.replace(/(\s)?com-agilebits-onepassword-extension-animated-fill/, ''))
  1392. }, Cb))
  1393. }
  1394. ;var Eb = 999
  1395. , Fb = 254;
  1396. document.com_agilebits_onepassword_collect = V;
  1397. document.elementsByOPID = {};
  1398. document.addEventListener('input', function(a) {
  1399. !1 !== a.j && 'input' === a.target.tagName.toLowerCase() && (a.target.dataset['com.agilebits.onepassword.userEdited'] = 'yes')
  1400. }, !0);
  1401. function V(a, b) {
  1402. function c(a, b) {
  1403. var c = a[b];
  1404. if ('string' == typeof c)
  1405. return c;
  1406. c = a.getAttribute(b);
  1407. return 'string' == typeof c ? c : null
  1408. }
  1409. function d(a, b) {
  1410. if (-1 === ['text', 'password'].indexOf(b.type.toLowerCase()) || !(x.test(a.value) || x.test(a.htmlID) || x.test(a.htmlName) || x.test(a.placeholder) || x.test(a['label-tag']) || x.test(a['label-data']) || x.test(a['label-aria'])))
  1411. return !1;
  1412. if (!a.visible)
  1413. return !0;
  1414. if ('password' == b.type.toLowerCase())
  1415. return !1;
  1416. var c = b.type;
  1417. w(b, !0);
  1418. return c !== b.type
  1419. }
  1420. function e(a) {
  1421. switch (p(a.type)) {
  1422. case 'checkbox':
  1423. return a.checked ? '✓' : '';
  1424. case 'hidden':
  1425. a = a.value;
  1426. if (!a || 'number' != typeof a.length)
  1427. return '';
  1428. a.length > Fb && (a = a.substr(0, Fb) + '...SNIPPED');
  1429. return a;
  1430. case 'submit':
  1431. case 'button':
  1432. case 'reset':
  1433. if ('' === a.value)
  1434. return K(J(a)) || '';
  1435. default:
  1436. return a.value
  1437. }
  1438. }
  1439. function g(a) {
  1440. return a.options ? (a = Array.prototype.slice.call(a.options).map(function(a) {
  1441. var b = a.text
  1442. , b = b ? p(b).replace(/\s/mg, '').replace(/[~`!@$%^&*()\-_+=:;'"\[\]|\\,<.>\/?]/mg, '') : null;
  1443. return [b ? b : null, a.value]
  1444. }),
  1445. {
  1446. options: a
  1447. }) : null
  1448. }
  1449. function f(a) {
  1450. var b;
  1451. for (a = a.parentElement || a.parentNode; a && 'td' != p(a.tagName); )
  1452. a = a.parentElement || a.parentNode;
  1453. if (!a || void 0 === a)
  1454. return null;
  1455. b = a.parentElement || a.parentNode;
  1456. if ('tr' != b.tagName.toLowerCase())
  1457. return null;
  1458. b = b.previousElementSibling;
  1459. if (!b || 'tr' != (b.tagName + '').toLowerCase() || b.cells && a.cellIndex >= b.cells.length)
  1460. return null;
  1461. a = J(b.cells[a.cellIndex]);
  1462. return a = K(a)
  1463. }
  1464. function l(b) {
  1465. var c, d = [];
  1466. if (b.labels && b.labels.length && 0 < b.labels.length)
  1467. d = Array.prototype.slice.call(b.labels);
  1468. else {
  1469. b.id && (d = d.concat(Array.prototype.slice.call(m(a, 'label[for=' + JSON.stringify(b.id) + ']'))));
  1470. if (b.name) {
  1471. c = m(a, 'label[for=' + JSON.stringify(b.name) + ']');
  1472. for (var e = 0; e < c.length; e++)
  1473. -1 === d.indexOf(c[e]) && d.push(c[e])
  1474. }
  1475. for (c = b; c && c != a; c = c.parentNode)
  1476. 'label' === p(c.tagName) && -1 === d.indexOf(c) && d.push(c)
  1477. }
  1478. 0 === d.length && (c = b.parentNode,
  1479. 'dd' === c.tagName.toLowerCase() && null !== c.previousElementSibling && 'dt' === c.previousElementSibling.tagName.toLowerCase() && d.push(c.previousElementSibling));
  1480. return 0 < d.length ? d.map(function(a) {
  1481. return K(J(a))
  1482. }).join('') : null
  1483. }
  1484. function k(a, b, c, d) {
  1485. void 0 !== d && d === c || null === c || void 0 === c || (a[b] = c)
  1486. }
  1487. function p(a) {
  1488. return 'string' === typeof a ? a.toLowerCase() : ('' + a).toLowerCase()
  1489. }
  1490. function m(a, b) {
  1491. var c = [];
  1492. try {
  1493. c = a.querySelectorAll(b)
  1494. } catch (d) {}
  1495. return c
  1496. }
  1497. var A = a.defaultView ? a.defaultView : window
  1498. , G = a.activeElement
  1499. , x = RegExp('((\\b|_|-)pin(\\b|_|-)|password|passwort|kennwort|(\\b|_|-)passe(\\b|_|-)|contraseña|senha|密码|adgangskode|hasło|wachtwoord)', 'i')
  1500. , s = Array.prototype.slice.call(m(a, 'form')).map(function(a, b) {
  1501. var d = {}
  1502. , e = '__form__' + b;
  1503. a.opid = e;
  1504. d.opid = e;
  1505. k(d, 'htmlName', c(a, 'name'));
  1506. k(d, 'htmlID', c(a, 'id'));
  1507. k(d, 'htmlAction', ta(c(a, 'action')));
  1508. k(d, 'htmlMethod', c(a, 'method'));
  1509. return d
  1510. })
  1511. , H = sa(a).map(function(b, n) {
  1512. b.hasAttribute('value') && !b.dataset['com.agilebits.onepassword.initialValue'] && (b.dataset['com.agilebits.onepassword.initialValue'] = b.value);
  1513. var h = {}
  1514. , m = '__' + n
  1515. , r = -1 == b.maxLength ? Eb : b.maxLength;
  1516. if (!r || 'number' === typeof r && isNaN(r))
  1517. r = Eb;
  1518. a.elementsByOPID[m] = b;
  1519. b.opid = m;
  1520. h.opid = m;
  1521. h.elementNumber = n;
  1522. k(h, 'maxLength', Math.min(r, 999), 999);
  1523. h.visible = M(b);
  1524. h.viewable = na(b);
  1525. k(h, 'htmlID', c(b, 'id'));
  1526. k(h, 'htmlName', c(b, 'name'));
  1527. k(h, 'htmlClass', c(b, 'class'));
  1528. k(h, 'tabindex', c(b, 'tabindex'));
  1529. k(h, 'title', c(b, 'title'));
  1530. k(h, 'userEdited', !!b.dataset['com.agilebits.onepassword.userEdited']);
  1531. if ('hidden' != p(b.type)) {
  1532. k(h, 'label-tag', l(b));
  1533. k(h, 'label-data', c(b, 'data-label'));
  1534. k(h, 'label-aria', c(b, 'aria-label'));
  1535. k(h, 'label-top', f(b));
  1536. m = [];
  1537. for (r = b; r && r.nextSibling; ) {
  1538. r = r.nextSibling;
  1539. if (L(r))
  1540. break;
  1541. ja(m, r)
  1542. }
  1543. k(h, 'label-right', m.join(''));
  1544. m = [];
  1545. ma(b, m);
  1546. m = m.reverse().join('');
  1547. k(h, 'label-left', m);
  1548. k(h, 'placeholder', c(b, 'placeholder'))
  1549. }
  1550. k(h, 'rel', c(b, 'rel'));
  1551. k(h, 'type', p(c(b, 'type')));
  1552. k(h, 'value', e(b));
  1553. k(h, 'checked', b.checked, !1);
  1554. k(h, 'autoCompleteType', b.getAttribute('x-autocompletetype') || b.getAttribute('autocompletetype') || b.getAttribute('autocomplete'), 'off');
  1555. k(h, 'disabled', b.disabled);
  1556. k(h, 'readonly', b.f || b.readOnly);
  1557. k(h, 'selectInfo', g(b));
  1558. k(h, 'aria-hidden', 'true' == b.getAttribute('aria-hidden'), !1);
  1559. k(h, 'aria-disabled', 'true' == b.getAttribute('aria-disabled'), !1);
  1560. k(h, 'aria-haspopup', 'true' == b.getAttribute('aria-haspopup'), !1);
  1561. k(h, 'data-unmasked', b.dataset.unmasked);
  1562. k(h, 'data-stripe', c(b, 'data-stripe'));
  1563. k(h, 'data-braintree-name', c(b, 'data-braintree-name'));
  1564. k(h, 'onepasswordFieldType', b.dataset.onepasswordFieldType || b.type);
  1565. k(h, 'onepasswordDesignation', b.dataset.onepasswordDesignation);
  1566. k(h, 'onepasswordSignInUrl', b.dataset.onepasswordSignInUrl);
  1567. k(h, 'onepasswordSectionTitle', b.dataset.onepasswordSectionTitle);
  1568. k(h, 'onepasswordSectionFieldKind', b.dataset.onepasswordSectionFieldKind);
  1569. k(h, 'onepasswordSectionFieldTitle', b.dataset.onepasswordSectionFieldTitle);
  1570. k(h, 'onepasswordSectionFieldValue', b.dataset.onepasswordSectionFieldValue);
  1571. b.form && (h.form = c(b.form, 'opid'));
  1572. k(h, 'fakeTested', d(h, b), !1);
  1573. return h
  1574. });
  1575. H.filter(function(a) {
  1576. return a.fakeTested
  1577. }).forEach(function(b) {
  1578. var c = a.elementsByOPID[b.opid];
  1579. c.getBoundingClientRect();
  1580. aa(c);
  1581. c.click && c.click();
  1582. b.postFakeTestVisible = M(c);
  1583. b.postFakeTestViewable = na(c);
  1584. b.postFakeTestType = c.type;
  1585. ba(c)
  1586. });
  1587. A = {
  1588. documentUUID: b,
  1589. title: a.title,
  1590. url: A.location.href,
  1591. documentUrl: a.location.href,
  1592. tabUrl: A.location.href,
  1593. forms: function(a) {
  1594. var b = {};
  1595. a.forEach(function(a) {
  1596. b[a.opid] = a
  1597. });
  1598. return b
  1599. }(s),
  1600. fields: H,
  1601. collectedTimestamp: (new Date).getTime()
  1602. };
  1603. (s = document.querySelector('[data-onepassword-title]')) && s.dataset[DISPLAY_TITLE_ATTRIBUE] && (A.displayTitle = s.dataset.onepasswordTitle);
  1604. G && 'input' === G.tagName.toLowerCase() && -1 === G.type.search(/button|submit|reset/i) && w(G, !0);
  1605. return A
  1606. }
  1607. ;function Oa() {
  1608. function a(a) {
  1609. setTimeout(function() {
  1610. var b = a.target;
  1611. b.parentNode.removeChild(b.d);
  1612. b.d = null
  1613. }, 1E3)
  1614. }
  1615. function b(a) {
  1616. a = a.target;
  1617. var b = a.getBoundingClientRect()
  1618. , f = e.createElement('DIV')
  1619. , g = e.createElement('A')
  1620. , A = d(a.opid)
  1621. , G = e.createElement('H1')
  1622. , x = e.createElement('CODE')
  1623. , s = e.createElement('PRE');
  1624. e.createElement('BR');
  1625. a.d = f;
  1626. a.parentNode.appendChild(a.d);
  1627. G.innerText = A.opid;
  1628. x.appendChild(s);
  1629. s.innerText = JSON.stringify(A, null, '\t');
  1630. f.appendChild(G);
  1631. f.appendChild(x);
  1632. f.setAttribute('class', 'onepasswordBubble');
  1633. f.style.top = b.top + b.clientHeight / 2;
  1634. f.style.left = b.left + b.clientWidth + 5;
  1635. f.appendChild(g);
  1636. g.innerText = 'Highlight Same Parents';
  1637. g.addEventListener('click', c.bind(window, A.opid))
  1638. }
  1639. function c(a) {
  1640. var b = d(a);
  1641. f.fields.filter(function(a) {
  1642. return a.parentId == b.parentId
  1643. }).forEach(function(a) {
  1644. e.elementsByOPID[a.opid].style.outline = '1px solid red'
  1645. })
  1646. }
  1647. function d(a) {
  1648. var b;
  1649. f.fields.forEach(function(c) {
  1650. c.opid == a && (b = c)
  1651. });
  1652. return b
  1653. }
  1654. var e = document
  1655. , g = sa(e)
  1656. , f = V(e, R);
  1657. g.forEach(function(c) {
  1658. c.addEventListener('focus', b);
  1659. c.addEventListener('blur', a)
  1660. })
  1661. }
  1662. ;
Advertisement
Add Comment
Please, Sign In to add comment