-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.min.js
1 lines (1 loc) · 3.48 KB
/
index.min.js
1
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.name=e()}}(function(){return function(){function e(t,n,r){function i(u,a){if(!n[u]){if(!t[u]){var f="function"==typeof require&&require;if(!a&&f)return f(u,!0);if(o)return o(u,!0);var l=new Error("Cannot find module '"+u+"'");throw l.code="MODULE_NOT_FOUND",l}var p=n[u]={exports:{}};t[u][0].call(p.exports,function(e){return i(t[u][1][e]||e)},p,p.exports,e,t,n,r)}return n[u].exports}for(var o="function"==typeof require&&require,u=0;u<r.length;u++)i(r[u]);return i}return e}()({1:[function(e,t,n){e("./src/listener")},{"./src/listener":2}],2:[function(e,t,n){function r(e,t){i++,o.push(e),setTimeout(function(){i>1?(o.shift(),i--):(t(o[0]),o=[],i=0)},50)}e("./main");var i=0,o=[];"undefined"!=typeof HTMLElement&&HTMLElement&&(HTMLElement.prototype.catchSingleEvent=function(e,t){this.addEventListener(e,function(e){r(e,function(e){t(e)})})}),"undefined"!=typeof SVGSVGElement&&SVGSVGElement&&(SVGSVGElement.prototype.catchSingleEvent=function(e,t){this.addEventListener(e,function(e){r(e,function(e){t(e)})})})},{"./main":3}],3:[function(e,t,n){function r(e,t){var n=document.querySelectorAll(t);return!(!n.length||1!==n.length||n[0]!==e)}function i(e){var t=e.getAttribute("href");if(t){if("#"===t)return null;if(t.match("\\?")){var n=t.split("?",1);return e.tagName+'[href*="'+n[0]+'"]'}return e.tagName+'[href="'+t+'"]'}return null}function o(e,t){for(var n=null,r=0;r<t.length;r++){var i=e.getAttribute(t[r]);if(i){var o=i.replace(new RegExp("'","g"),"\\'");n=e.tagName+"["+t[r]+'="'+o+'"]';break}}return n}function u(e,t){for(var n=null,i=0;i<t.length;i++){var o=e.getAttribute(t[i]);if(o)var u=o.replace(new RegExp("'","g"),"\\'"),a=e.tagName+"["+t[i]+'="'+u+'"]';if(a&&r(e,a)){n=a;break}}return n}function a(e){for(var t=e;t.parentElement;){if("BUTTON"===t.parentElement.tagName||"A"===t.parentElement.tagName){e=t.parentElement;break}t=t.parentElement}return e}function f(e){for(var t=1,n=e;n.previousElementSibling;)t++,n=n.previousElementSibling;return t}function l(e,t){for(var n=e,i="";n;){var u=o(n,t);if(u)i=u+i;else{var a=f(n);i=a>1?n.tagName+":nth-child("+a+")"+i:n.tagName+i}if(r(e,i)){n=null;break}if(n.parentElement&&"BODY"!==n.parentElement.tagName&&"HTML"!==n.parentElement.tagName)i=" > "+i,n=n.parentElement;else{if(n.parentElement&&"BODY"===n.parentElement.tagName){i="BODY > "+i,n=null;break}if(n.parentElement&&"HTML"===n.parentElement.tagName){i="HTML > "+i,n=null;break}n=null}}return i.toString()}function p(e,t,n,r){var o=[],f=e,p=["name","id","type","action","for","src","alt","data-tl-id","data-id","aria-label"];n&&Array.isArray(n)&&(p=n),r&&(f=a(f));var c=i(f),m=u(f,p),s=l(f,p),d=l(f,[]),g=l(f,["id","name"]);return c&&o.push(c),m&&o.push(m),s&&o.indexOf(s)<0&&o.push(s),d&&o.indexOf(d)<0&&o.push(d),g&&o.indexOf(g)<0&&o.push(g),t?o:o[0]}function c(e,t){return p(this,!0,e,t)}function m(e,t){return p(this,!1,e,t)}"undefined"!=typeof HTMLElement&&HTMLElement&&(HTMLElement.prototype.getSelectors=function(e,t){return p(this,!0,e,t)},HTMLElement.prototype.getSelector=function(e,t){return p(this,!1,e,t)}),"undefined"!=typeof SVGSVGElement&&SVGSVGElement&&(SVGSVGElement.prototype.getSelectors=function(e,t){return p(this,!0,e,t)},SVGSVGElement.prototype.getSelector=function(e,t){return p(this,!1,e,t)}),t.exports={getSelectors:c,getSelector:m}},{}]},{},[1])(1)});