UNPKG

query-result

Version:
2 lines 3.97 kB
/*! (c) Andrea Giammarchi - ISC */ var $=function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function i(t,e,n){return i=u()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var u=Function.bind.apply(t,r),i=new u;return n&&o(i,n.prototype),i},i.apply(null,arguments)}function c(t){return-1!==Function.toString.call(t).indexOf("[native code]")}function f(t){var e="function"==typeof Map?new Map:undefined;return(f=function(t){function n(){return i(t,arguments,r(this).constructor)}if(null===t||!c(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(n,t)})(t)}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?a(t):e}var p=function(t){function o(){return e(this,o),l(this,r(o).apply(this,arguments))}return n(o,t),o}(f(Array)),s=Object.create,y=Object.defineProperty,d=Array.prototype,h=new p instanceof p,v=p.prototype;h||Object.getOwnPropertyNames(d).forEach(function(t){var e=Object.getOwnPropertyDescriptor(d,t);if("function"==typeof e.value){var n=e.value;e.value=function(){var t=n.apply(this,arguments);return t instanceof Array?b(t):t}}y(v,t,e)});var b=h?function(t){return t}:function(t){var e=s(v);return g.apply(e,O(t)),e},g=d.push,m=function(t,e){for(var n=[],r=t.length,o=0;o<r;o++){var u=t[o].trim();if(":first"===u.slice(-6)){var c=e.querySelector(u.slice(0,-6));c&&g.call(n,c)}else g.apply(n,O(e.querySelectorAll(u)))}return i(p,n)},O=h?b:function(t){for(var e=[],n=t.length,r=0;r<n;r++)e[r]=t[r];return e},w=function S(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:document;switch(t(e)){case"string":return b(m(e.split(","),n));case"object":var r=[],o="nodeType"in e||"postMessage"in e?[e]:e;return g.apply(r,O(o)),b(i(p,r));case"function":var u=S(n),c=S(n.defaultView),f={handleEvent:function(t){u.off("DOMContentLoaded",f),c.off("load",f),e(t)}};u.on("DOMContentLoaded",f),c.on("load",f);var a=n.readyState;return("complete"==a||"loading"!=a&&!n.documentElement.doScroll)&&setTimeout(function(){return u.dispatch("DOMContentLoaded")}),S}};return w.prototype=v,w.extend=function(t,e){return y(v,t,{configurable:!0,value:e}),w},w.extend("dispatch",function(t){for(var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=new CustomEvent(t,e),r=this.length,o=0;o<r;o++)this[o].dispatchEvent(n);return this}).extend("off",function(t,e){for(var n=arguments.length>2&&arguments[2]!==undefined&&arguments[2],r=this.length,o=0;o<r;o++)this[o].removeEventListener(t,e,n);return this}).extend("on",function(t,e){for(var n=arguments.length>2&&arguments[2]!==undefined&&arguments[2],r=this.length,o=0;o<r;o++)this[o].addEventListener(t,e,n);return this}),w}();