@thednp/shorty 1.0.0 → 1.0.1

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.
package/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # shorty
1
+ # shorty ![typescript version](https://img.shields.io/badge/typescript-4.5.2-brightgreen) [![ci](https://github.com/thednp/shorty/actions/workflows/ci.yml/badge.svg)](https://github.com/thednp/shorty/actions/workflows/ci.yml)
2
+
2
3
  A small ES6+ library with various JavaScript tools, all ESLint valid and with TypeScript definitions, everything useful for creating light libraries or web components. If there is anything that is consistently repeating itself, **shorty** can help you save up to 50% of the code required, with little to no performance cost.
3
4
 
4
5
  [![NPM Version](https://img.shields.io/npm/v/@thednp/shorty.svg?style=flat-square)](https://www.npmjs.com/package/shorty)
@@ -227,7 +228,7 @@ The ***Data*** and ***Timer*** utilities have their own specifics, you might wan
227
228
  import {
228
229
  emulateTransitionEnd,
229
230
  distinct,
230
- } from 'shorty';
231
+ } from '@thednp/shorty';
231
232
 
232
233
  // execute a callback when transitionend is triggered for the target
233
234
  emulateTransitionEnd(targetElement, callback);
@@ -255,7 +256,7 @@ const array3 = [...array1, ...array2].filter(distinct);
255
256
 
256
257
  ```js
257
258
  // EXAMPLES
258
- import { querySelector, querySelectorAll, documentAll, matches } from 'shorty';
259
+ import { querySelector, querySelectorAll, documentAll, matches } from '@thednp/shorty';
259
260
 
260
261
  // get first element that matches a certain selector
261
262
  const element = querySelector('.my-class-name');
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Shorty v1.0.0 (https://github.com/thednp/shorty)
2
+ * Shorty v1.0.1 (https://github.com/thednp/shorty)
3
3
  * Copyright 2019-2022 © dnp_theme
4
4
  * Licensed under MIT (https://github.com/thednp/shorty/blob/master/LICENSE)
5
5
  */
@@ -1077,14 +1077,16 @@ function getDocument(node) {
1077
1077
  * Utility to check if target is typeof `HTMLElement`, `Element`, `Node`
1078
1078
  * or find one that matches a selector.
1079
1079
  *
1080
- * @param {HTMLElement | Element | string} selector the input selector or target element
1081
- * @param {(HTMLElement | Element | Document)=} parent optional node to look into
1080
+ * @param {Node | HTMLElement | Element | string} selector the input selector or target element
1081
+ * @param {(Node | HTMLElement | Element | Document)=} parent optional node to look into
1082
1082
  * @return {(HTMLElement | Element)?} the `HTMLElement` or `querySelector` result
1083
1083
  */
1084
1084
  function querySelector(selector, parent) {
1085
- const method = 'querySelector';
1086
- const lookUp = parent && parent[method] ? parent : getDocument();
1087
- return selector[method] ? selector : lookUp[method](selector);
1085
+ if (typeof selector === 'string') {
1086
+ const lookUp = typeof parent !== 'object' ? getDocument() : parent;
1087
+ return lookUp.querySelector(selector);
1088
+ }
1089
+ return selector;
1088
1090
  }
1089
1091
 
1090
1092
  /** @type {Map<string, Map<HTMLElement | Element, Record<string, any>>>} */
@@ -2195,9 +2197,8 @@ function closest(element, selector) {
2195
2197
  * @return {HTMLCollectionOf<HTMLElement | Element>} the 'HTMLCollection'
2196
2198
  */
2197
2199
  function getElementsByTagName(selector, parent) {
2198
- const method = 'getElementsByTagName';
2199
- const lookUp = parent && parent[method] ? parent : getDocument();
2200
- return lookUp[method](selector);
2200
+ const lookUp = typeof parent !== 'object' ? getDocument() : parent;
2201
+ return lookUp.getElementsByTagName(selector);
2201
2202
  }
2202
2203
 
2203
2204
  /**
@@ -2206,16 +2207,6 @@ function getElementsByTagName(selector, parent) {
2206
2207
  */
2207
2208
  const documentAll = getElementsByTagName('*');
2208
2209
 
2209
- /**
2210
- * A global array with `Element` | `HTMLElement`.
2211
- */
2212
- const elementNodes = [Element, HTMLElement];
2213
-
2214
- /**
2215
- * A global array of possible `ParentNode`.
2216
- */
2217
- const parentNodes = [Document, Element, HTMLElement];
2218
-
2219
2210
  /**
2220
2211
  * Returns an `Array` of `Node` elements that are registered as
2221
2212
  * `CustomElement`.
@@ -2225,7 +2216,7 @@ const parentNodes = [Document, Element, HTMLElement];
2225
2216
  * @returns {Array<HTMLElement | Element>} the query result
2226
2217
  */
2227
2218
  function getCustomElements(parent) {
2228
- const collection = parent && parentNodes.some((x) => parent instanceof x)
2219
+ const collection = parent && typeof parent === 'object'
2229
2220
  ? getElementsByTagName('*', parent) : documentAll;
2230
2221
  return [...collection].filter(isCustomElement);
2231
2222
  }
@@ -2248,9 +2239,8 @@ function getElementById(id) {
2248
2239
  * @return {NodeListOf<HTMLElement | Element>} the query result
2249
2240
  */
2250
2241
  function querySelectorAll(selector, parent) {
2251
- const method = 'querySelectorAll';
2252
- const lookUp = parent && parent[method] ? parent : getDocument();
2253
- return lookUp[method](selector);
2242
+ const lookUp = typeof parent !== 'object' ? getDocument() : parent;
2243
+ return lookUp.querySelectorAll(selector);
2254
2244
  }
2255
2245
 
2256
2246
  /**
@@ -2262,9 +2252,8 @@ function querySelectorAll(selector, parent) {
2262
2252
  * @return {HTMLCollectionOf<HTMLElement | Element>} the 'HTMLCollection'
2263
2253
  */
2264
2254
  function getElementsByClassName(selector, parent) {
2265
- const method = 'getElementsByClassName';
2266
- const lookUp = parent && parent[method] ? parent : getDocument();
2267
- return lookUp[method](selector);
2255
+ const lookUp = typeof parent !== 'object' ? getDocument() : parent;
2256
+ return lookUp.getElementsByClassName(selector);
2268
2257
  }
2269
2258
 
2270
2259
  /**
@@ -2302,7 +2291,7 @@ function matches(target, selector) {
2302
2291
  return matchesFn.call(target, selector);
2303
2292
  }
2304
2293
 
2305
- var version = "1.0.0";
2294
+ var version = "1.0.1";
2306
2295
 
2307
2296
  // @ts-ignore
2308
2297
 
@@ -2493,8 +2482,6 @@ const SHORTER = {
2493
2482
  isWindow,
2494
2483
  isMedia,
2495
2484
  isRTL,
2496
- elementNodes,
2497
- parentNodes,
2498
2485
  closest,
2499
2486
  documentAll,
2500
2487
  querySelector,
@@ -1,2 +1,2 @@
1
- // Shorty v1.0.0 | dnp_theme © 2022 | MIT-License
2
- const e={DOMContentLoaded:"DOMContentLoaded",DOMMouseScroll:"DOMMouseScroll",abort:"abort",beforeunload:"beforeunload",blur:"blur",change:"change",click:"click",contextmenu:"contextmenu",dblclick:"dblclick",error:"error",focus:"focus",focusin:"focusin",focusout:"focusout",gesturechange:"gesturechange",gestureend:"gestureend",gesturestart:"gesturestart",hover:"hover",keydown:"keydown",keypress:"keypress",keyup:"keyup",load:"load",mousedown:"mousedown",mousemove:"mousemove",mousein:"mousein",mouseout:"mouseout",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseup:"mouseup",mousewheel:"mousewheel",move:"move",orientationchange:"orientationchange",pointercancel:"pointercancel",pointerdown:"pointerdown",pointerleave:"pointerleave",pointermove:"pointermove",pointerup:"pointerup",readystatechange:"readystatechange",reset:"reset",resize:"resize",scroll:"scroll",select:"select",selectend:"selectend",selectstart:"selectstart",submit:"submit",touchcancel:"touchcancel",touchend:"touchend",touchmove:"touchmove",touchstart:"touchstart",unload:"unload"},t="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],{head:n}=document,o="webkitAnimation"in n.style?"webkitAnimationDuration":"animationDuration",i="webkitAnimation"in n.style?"webkitAnimationDelay":"animationDelay",a="webkitAnimation"in n.style?"webkitAnimationName":"animationName",r="webkitAnimation"in n.style?"webkitAnimationEnd":"animationend",s="webkitTransition"in n.style?"webkitTransitionDuration":"transitionDuration",c="webkitTransition"in n.style?"webkitTransitionDelay":"transitionDelay",u="webkitTransition"in n.style?"webkitTransitionEnd":"transitionend",l="webkitTransition"in n.style?"webkitTransitionProperty":"transitionProperty",{userAgentData:m}=navigator,d=m,{userAgent:g}=navigator,p=g,E=/iPhone|iPad|iPod|Android/i;let f=!1;f=d?d.brands.some(e=>E.test(e.brand)):E.test(p);const v=f,y=/(iPhone|iPod|iPad)/,b=d?d.brands.some(e=>y.test(e.brand)):y.test(p),h=!!p&&p.includes("Firefox"),w="webkitPerspective"in n.style||"perspective"in n.style;function A(e,t,n,o){const i=o||!1;e.addEventListener(t,n,i)}function k(e,t,n,o){const i=o||!1;e.removeEventListener(t,n,i)}function L(e,t,n,o){const i=a=>{a.target===e&&(n.apply(e,[a]),k(e,t,i,o))};A(e,t,i,o)}const D=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,e)});L(document,"DOMContentLoaded",()=>{},t)}catch(e){throw Error("Passive events are not supported")}return e})(),N="webkitTransform"in n.style||"transform"in n.style,T="ontouchstart"in window||"msMaxTouchPoints"in navigator,S="webkitAnimation"in n.style||"animation"in n.style,M="webkitTransition"in n.style||"transition"in n.style,C=(e,t)=>e.getAttribute(t);function O(e){return e instanceof HTMLElement?e.ownerDocument:e instanceof Window?e.document:window.document}function z(e,t){const n="querySelector",o=t&&t[n]?t:O();return e[n]?e:o[n](e)}const H=new Map,I={set:(e,t,n)=>{const o=z(e);if(!o)return;H.has(t)||H.set(t,new Map);H.get(t).set(o,n)},getAllFor:e=>H.get(e)||null,get:(e,t)=>{const n=z(e),o=I.getAllFor(t);return n&&o&&o.get(n)||null},remove:(e,t)=>{const n=z(e),o=H.get(t);o&&n&&(o.delete(n),0===o.size&&H.delete(t))}},x=(e,t)=>Object.assign(e,t);function P(e,t){const n=getComputedStyle(e);return t in n?n[t]:""}function B(e){const t=P(e,"animationName"),n=P(e,"animationDelay"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function F(e){const t=P(e,"animationName"),n=P(e,"animationDuration"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function R(e){const t=P(e,a),n=P(e,i),o=n.includes("ms")?1:1e3,r=S&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(r)?0:r}function V(e){const t=P(e,a),n=P(e,o),i=n.includes("ms")?1:1e3,r=S&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(r)?0:r}function W(e){const t=P(e,"transitionProperty"),n=P(e,"transitionDelay"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function Q(e){const t=P(e,"transitionProperty"),n=P(e,"transitionDuration"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function j(e){const t=P(e,l),n=P(e,c),o=n.includes("ms")?1:1e3,i=M&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function U(e){const t=P(e,l),n=P(e,s),o=n.includes("ms")?1:1e3,i=M&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function q(e){return"true"===e||"false"!==e&&(Number.isNaN(+e)?""===e||"null"===e?null:e:+e)}const G=e=>Object.keys(e),K=e=>e.toLowerCase();const X=!!D&&{passive:!0},$=new Map,Y={set:(e,t,n,o)=>{const i=z(e);if(i)if(o&&o.length){$.has(i)||$.set(i,new Map);$.get(i).set(o,setTimeout(t,n))}else $.set(i,setTimeout(t,n))},get:(e,t)=>{const n=z(e);if(!n)return null;const o=$.get(n);return t&&t.length&&o&&o.get?o.get(t)||null:o||null},clear:(e,t)=>{const n=z(e);if(n)if(t&&t.length){const e=$.get(n);e&&e.get&&(clearTimeout(e.get(t)),e.delete(t),0===e.size&&$.delete(n))}else clearTimeout($.get(n)),$.delete(n)}};function Z(e,t){const{width:n,height:o,top:i,right:a,bottom:r,left:s}=e.getBoundingClientRect();let c=1,u=1;if(t&&e instanceof HTMLElement){const{offsetWidth:t,offsetHeight:i}=e;c=t>0&&Math.round(n)/t||1,u=i>0&&Math.round(o)/i||1}return{width:n/c,height:o/u,top:i/u,right:a/c,bottom:r/u,left:s/c,x:s/c,y:i/u}}function J(e){return O(e).documentElement}function _(e){if(null==e)return window;if(!(e instanceof Window)){const{ownerDocument:t}=e;return t&&t.defaultView||window}return e}const ee=e=>e instanceof _(e).ShadowRoot||e instanceof ShadowRoot;function te(e){const{width:t,height:n}=Z(e),{offsetWidth:o,offsetHeight:i}=e;return Math.round(t)!==o||Math.round(n)!==i}let ne=0,oe=0;const ie=new Map;const ae=e=>e&&!!e.shadowRoot;function re(e,t){const n="getElementsByTagName";return(t&&t[n]?t:O())[n](e)}const se=re("*"),ce=[Element,HTMLElement],ue=[Document,Element,HTMLElement];const le=Element.prototype,me=le.matches||le.matchesSelector||le.webkitMatchesSelector||le.mozMatchesSelector||le.msMatchesSelector||le.oMatchesSelector||function(){return!1};const de={ariaChecked:"aria-checked",ariaDescription:"aria-description",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaHasPopup:"aria-haspopup",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",ariaValueMin:"aria-valuemin",ariaValueMax:"aria-valuemax",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",nativeEvents:e,abortEvent:"abort",blurEvent:"blur",moveEvent:"move",changeEvent:"change",errorEvent:"error",resetEvent:"reset",resizeEvent:"resize",scrollEvent:"scroll",submitEvent:"submit",loadEvent:"load",loadstartEvent:"loadstart",unloadEvent:"unload",readystatechangeEvent:"readystatechange",beforeunloadEvent:"beforeunload",orientationchangeEvent:"orientationchange",contextmenuEvent:"contextmenu",DOMContentLoadedEvent:"DOMContentLoaded",DOMMouseScrollEvent:"DOMMouseScroll",selectEvent:"select",selectendEvent:"selectend",selectstartEvent:"selectstart",mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseclickEvent:"click",mousedblclickEvent:"dblclick",mousedownEvent:"mousedown",mouseupEvent:"mouseup",mousehoverEvent:"hover",mouseHoverEvents:t,mouseenterEvent:"mouseenter",mouseleaveEvent:"mouseleave",mouseinEvent:"mousein",mouseoutEvent:"mouseout",mouseoverEvent:"mouseover",mousemoveEvent:"mousemove",mousewheelEvent:"mousewheel",mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"},touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},touchstartEvent:"touchstart",touchmoveEvent:"touchmove",touchcancelEvent:"touchcancel",touchendEvent:"touchend",pointercancelEvent:"pointercancel",pointerdownEvent:"pointerdown",pointerleaveEvent:"pointerleave",pointermoveEvent:"pointermove",pointerupEvent:"pointerup",focusEvents:{in:"focusin",out:"focusout"},focusEvent:"focus",focusinEvent:"focusin",focusoutEvent:"focusout",gesturechangeEvent:"gesturechange",gestureendEvent:"gestureend",gesturestartEvent:"gesturestart",bezierEasings:{linear:"linear",easingSinusoidalIn:"cubic-bezier(0.47,0,0.745,0.715)",easingSinusoidalOut:"cubic-bezier(0.39,0.575,0.565,1)",easingSinusoidalInOut:"cubic-bezier(0.445,0.05,0.55,0.95)",easingQuadraticIn:"cubic-bezier(0.550,0.085,0.680,0.530)",easingQuadraticOut:"cubic-bezier(0.250,0.460,0.450,0.940)",easingQuadraticInOut:"cubic-bezier(0.455,0.030,0.515,0.955)",easingCubicIn:"cubic-bezier(0.55,0.055,0.675,0.19)",easingCubicOut:"cubic-bezier(0.215,0.61,0.355,1)",easingCubicInOut:"cubic-bezier(0.645,0.045,0.355,1)",easingQuarticIn:"cubic-bezier(0.895,0.03,0.685,0.22)",easingQuarticOut:"cubic-bezier(0.165,0.84,0.44,1)",easingQuarticInOut:"cubic-bezier(0.77,0,0.175,1)",easingQuinticIn:"cubic-bezier(0.755,0.05,0.855,0.06)",easingQuinticOut:"cubic-bezier(0.23,1,0.32,1)",easingQuinticInOut:"cubic-bezier(0.86,0,0.07,1)",easingExponentialIn:"cubic-bezier(0.95,0.05,0.795,0.035)",easingExponentialOut:"cubic-bezier(0.19,1,0.22,1)",easingExponentialInOut:"cubic-bezier(1,0,0,1)",easingCircularIn:"cubic-bezier(0.6,0.04,0.98,0.335)",easingCircularOut:"cubic-bezier(0.075,0.82,0.165,1)",easingCircularInOut:"cubic-bezier(0.785,0.135,0.15,0.86)",easingBackIn:"cubic-bezier(0.6,-0.28,0.735,0.045)",easingBackOut:"cubic-bezier(0.175,0.885,0.32,1.275)",easingBackInOut:"cubic-bezier(0.68,-0.55,0.265,1.55)"},animationDuration:"animationDuration",animationDurationLegacy:o,animationDelay:"animationDelay",animationDelayLegacy:i,animationName:"animationName",animationNameLegacy:a,animationEndEvent:"animationend",animationEndEventLegacy:r,transitionDuration:"transitionDuration",transitionDurationLegacy:s,transitionDelay:"transitionDelay",transitionDelayLegacy:c,transitionEndEvent:"transitionend",transitionEndEventLegacy:u,transitionProperty:"transitionProperty",transitionPropertyLegacy:l,isMobile:v,isApple:b,isFirefox:h,support3DTransform:w,supportPassive:D,supportTransform:N,supportTouch:T,supportAnimation:S,supportTransition:M,addEventListener:"addEventListener",removeEventListener:"removeEventListener",keyboardEventKeys:{Backspace:"Backspace",Tab:"Tab",Enter:"Enter",Shift:"Shift",Control:"Control",Alt:"Alt",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Scape:"Space",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Insert:"Insert",Delete:"Delete",Meta:"Meta",ContextMenu:"ContextMenu",ScrollLock:"ScrollLock"},keydownEvent:"keydown",keypressEvent:"keypress",keyupEvent:"keyup",keyAlt:"Alt",keyArrowDown:"ArrowDown",keyArrowLeft:"ArrowLeft",keyArrowRight:"ArrowRight",keyArrowUp:"ArrowUp",keyBackspace:"Backspace",keyCapsLock:"CapsLock",keyControl:"Control",keyDelete:"Delete",keyEnter:"Enter",keyEscape:"Escape",keyInsert:"Insert",keyMeta:"Meta",keyPause:"Pause",keyScrollLock:"ScrollLock",keyShift:"Shift",keySpace:"Space",keyTab:"Tab",offsetHeight:"offsetHeight",offsetWidth:"offsetWidth",scrollHeight:"scrollHeight",scrollWidth:"scrollWidth",userAgentData:d,userAgent:p,addClass:function(e,t){e.classList.add(t)},removeClass:function(e,t){e.classList.remove(t)},hasClass:function(e,t){return e.classList.contains(t)},on:A,off:k,one:L,dispatchEvent:(e,t)=>e.dispatchEvent(t),distinct:(e,t,n)=>n.indexOf(e)===t,Data:I,getInstance:(e,t)=>I.get(e,t),createElement:function e(t){if("string"==typeof t)return O().createElement(t);const{tagName:n}=t,o={...t},i=e(n);return delete o.tagName,x(i,o),i},createElementNS:function e(t,n){if("string"==typeof n)return O().createElementNS(t,n);const{tagName:o}=n,i={...n},a=e(t,o);return delete i.tagName,x(a,i),a},toUpperCase:e=>e.toUpperCase(),toLowerCase:K,Timer:Y,emulateAnimationEnd:function(e,t){let n=0;const o=new Event("animationend"),i=F(e),a=B(e);if(i){const r=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener("animationend",r),n=1)};e.addEventListener("animationend",r),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},emulateAnimationEndLegacy:function(e,t){let n=0;const o=new Event(r),i=V(e),a=R(e);if(S&&i){const s=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener(r,s),n=1)};e.addEventListener(r,s),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},emulateTransitionEnd:function(e,t){let n=0;const o=new Event("transitionend"),i=Q(e),a=W(e);if(i){const r=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener("transitionend",r),n=1)};e.addEventListener("transitionend",r),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},emulateTransitionEndLegacy:function(e,t){let n=0;const o=new Event(u),i=U(e),a=j(e);if(M&&i){const r=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener(u,r),n=1)};e.addEventListener(u,r),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},isElementInScrollRange:e=>{const{top:t,bottom:n}=Z(e),{clientHeight:o}=J(e);return t<=o&&n>=0},isElementInViewport:e=>{const{top:t,left:n,bottom:o,right:i}=Z(e,!0),{clientWidth:a,clientHeight:r}=J(e);return t>=0&&n>=0&&o<=r&&i<=a},passiveHandler:{passive:!0},passiveHandlerLegacy:X,getElementAnimationDuration:F,getElementAnimationDurationLegacy:V,getElementAnimationDelay:B,getElementAnimationDelayLegacy:R,getElementTransitionDuration:Q,getElementTransitionDurationLegacy:U,getElementTransitionDelay:W,getElementTransitionDelayLegacy:j,getNodeScroll:function(e){const t="scrollX"in e;return{x:t?e.scrollX:e.scrollLeft,y:t?e.scrollY:e.scrollTop}},getParentNode:function(e){return"HTML"===e.nodeName?e:e.assignedSlot||e.parentNode||(ee(e)?e.host:null)||J(e)},getRectRelativeToOffsetParent:function(e,t,n){const o=t instanceof HTMLElement,i=Z(e,o&&te(t)),a={x:0,y:0};if(o){const e=Z(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}return{x:i.left+n.x-a.x,y:i.top+n.y-a.y,width:i.width,height:i.height}},getWindow:_,isArray:e=>Array.isArray(e),isString:e=>"string"==typeof e,isCustomElement:ae,isElement:e=>e instanceof Element,isNode:e=>e instanceof Node,isHTMLElement:e=>e instanceof HTMLElement,isHTMLImageElement:e=>e instanceof HTMLImageElement,isSVGElement:e=>e instanceof SVGElement,isNodeList:e=>e instanceof NodeList,isHTMLCollection:e=>e instanceof HTMLCollection,isScaledElement:te,isTableElement:e=>["TABLE","TD","TH"].includes(e.tagName),isShadowRoot:ee,isDocument:e=>e instanceof Document,isElementsArray:e=>Array.isArray(e)&&e.every(e=>[HTMLElement,Element].some(t=>e instanceof t)),isWindow:function(e){return e instanceof Window},isMedia:e=>e&&[SVGElement,HTMLImageElement,HTMLVideoElement].some(t=>e instanceof t),isRTL:e=>"rtl"===J(e).dir,elementNodes:ce,parentNodes:ue,closest:function e(t,n){return t?t.closest(n)||e(t.getRootNode().host,n):null},documentAll:se,querySelector:z,getCustomElements:function(e){return[...e&&ue.some(t=>e instanceof t)?re("*",e):se].filter(ae)},getElementById:function(e){return O().getElementById(e)},querySelectorAll:function(e,t){return(t&&t.querySelectorAll?t:O()).querySelectorAll(e)},getElementsByClassName:function(e,t){const n="getElementsByClassName";return(t&&t[n]?t:O())[n](e)},getElementsByTagName:re,matches:function(e,t){return e.matches(t)},matchesLegacy:function(e,t){return me.call(e,t)},normalizeValue:q,normalizeOptions:function(e,t,n,o){const i={...e.dataset},a={},r={};return G(i).forEach(e=>{const t=o&&e.includes(o)?e.replace(o,"").replace(/[A-Z]/,e=>K(e)):e;r[t]=q(i[e])}),G(n).forEach(e=>{n[e]=q(n[e])}),G(t).forEach(o=>{a[o]=o in n?n[o]:o in r?r[o]:"title"===o?C(e,"title"):t[o]}),a},tryWrapper:function(e,t){try{e()}catch(e){throw TypeError(`${t} ${e}`)}},reflow:e=>e.offsetHeight,noop:()=>{},focus:e=>e.focus(),getUID:function e(t,n){let o=n?ne:oe;if(n){const i=e(t),a=ie.get(i)||new Map;ie.has(i)||ie.set(i,a),a.has(n)?o=a.get(n):(a.set(n,o),ne+=1)}else{const e=t.id||t;ie.has(e)?o=ie.get(e):(ie.set(e,o),oe+=1)}return o},ArrayFrom:e=>Array.from(e),Float32ArrayFrom:e=>Float32Array.from(Array.from(e)),Float64ArrayFrom:e=>Float64Array.from(Array.from(e)),ObjectAssign:x,ObjectKeys:G,ObjectValues:e=>Object.values(e),OriginalEvent:function(e,t){const n=new CustomEvent(e,{cancelable:!0,bubbles:!0});return t instanceof Object&&x(n,t),n},getBoundingClientRect:Z,getDocument:O,getDocumentBody:function(e){return O(e).body},getDocumentElement:J,getDocumentHead:function(e){return O(e).head},getElementStyle:P,setElementStyle:(e,t)=>{x(e.style,t)},hasAttribute:(e,t)=>e.hasAttribute(t),hasAttributeNS:(e,t,n)=>t.hasAttributeNS(e,n),getAttribute:C,getAttributeNS:(e,t,n)=>t.getAttributeNS(e,n),setAttribute:(e,t,n)=>e.setAttribute(t,n),setAttributeNS:(e,t,n,o)=>t.setAttributeNS(e,n,o),removeAttribute:(e,t)=>e.removeAttribute(t),removeAttributeNS:(e,t,n)=>t.removeAttributeNS(e,n),Version:"1.0.0"};export{de as default};
1
+ // Shorty v1.0.1 | dnp_theme © 2022 | MIT-License
2
+ const e={DOMContentLoaded:"DOMContentLoaded",DOMMouseScroll:"DOMMouseScroll",abort:"abort",beforeunload:"beforeunload",blur:"blur",change:"change",click:"click",contextmenu:"contextmenu",dblclick:"dblclick",error:"error",focus:"focus",focusin:"focusin",focusout:"focusout",gesturechange:"gesturechange",gestureend:"gestureend",gesturestart:"gesturestart",hover:"hover",keydown:"keydown",keypress:"keypress",keyup:"keyup",load:"load",mousedown:"mousedown",mousemove:"mousemove",mousein:"mousein",mouseout:"mouseout",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseup:"mouseup",mousewheel:"mousewheel",move:"move",orientationchange:"orientationchange",pointercancel:"pointercancel",pointerdown:"pointerdown",pointerleave:"pointerleave",pointermove:"pointermove",pointerup:"pointerup",readystatechange:"readystatechange",reset:"reset",resize:"resize",scroll:"scroll",select:"select",selectend:"selectend",selectstart:"selectstart",submit:"submit",touchcancel:"touchcancel",touchend:"touchend",touchmove:"touchmove",touchstart:"touchstart",unload:"unload"},t="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],{head:n}=document,o="webkitAnimation"in n.style?"webkitAnimationDuration":"animationDuration",i="webkitAnimation"in n.style?"webkitAnimationDelay":"animationDelay",a="webkitAnimation"in n.style?"webkitAnimationName":"animationName",r="webkitAnimation"in n.style?"webkitAnimationEnd":"animationend",s="webkitTransition"in n.style?"webkitTransitionDuration":"transitionDuration",c="webkitTransition"in n.style?"webkitTransitionDelay":"transitionDelay",u="webkitTransition"in n.style?"webkitTransitionEnd":"transitionend",l="webkitTransition"in n.style?"webkitTransitionProperty":"transitionProperty",{userAgentData:m}=navigator,d=m,{userAgent:g}=navigator,p=g,f=/iPhone|iPad|iPod|Android/i;let v=!1;v=d?d.brands.some(e=>f.test(e.brand)):f.test(p);const E=v,y=/(iPhone|iPod|iPad)/,b=d?d.brands.some(e=>y.test(e.brand)):y.test(p),h=!!p&&p.includes("Firefox"),w="webkitPerspective"in n.style||"perspective"in n.style;function A(e,t,n,o){const i=o||!1;e.addEventListener(t,n,i)}function k(e,t,n,o){const i=o||!1;e.removeEventListener(t,n,i)}function L(e,t,n,o){const i=a=>{a.target===e&&(n.apply(e,[a]),k(e,t,i,o))};A(e,t,i,o)}const D=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,e)});L(document,"DOMContentLoaded",()=>{},t)}catch(e){throw Error("Passive events are not supported")}return e})(),N="webkitTransform"in n.style||"transform"in n.style,T="ontouchstart"in window||"msMaxTouchPoints"in navigator,S="webkitAnimation"in n.style||"animation"in n.style,M="webkitTransition"in n.style||"transition"in n.style,C=(e,t)=>e.getAttribute(t);function O(e){return e instanceof HTMLElement?e.ownerDocument:e instanceof Window?e.document:window.document}function z(e,t){if("string"==typeof e){return("object"!=typeof t?O():t).querySelector(e)}return e}const H=new Map,I={set:(e,t,n)=>{const o=z(e);if(!o)return;H.has(t)||H.set(t,new Map);H.get(t).set(o,n)},getAllFor:e=>H.get(e)||null,get:(e,t)=>{const n=z(e),o=I.getAllFor(t);return n&&o&&o.get(n)||null},remove:(e,t)=>{const n=z(e),o=H.get(t);o&&n&&(o.delete(n),0===o.size&&H.delete(t))}},x=(e,t)=>Object.assign(e,t);function P(e,t){const n=getComputedStyle(e);return t in n?n[t]:""}function B(e){const t=P(e,"animationName"),n=P(e,"animationDelay"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function F(e){const t=P(e,"animationName"),n=P(e,"animationDuration"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function R(e){const t=P(e,a),n=P(e,i),o=n.includes("ms")?1:1e3,r=S&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(r)?0:r}function j(e){const t=P(e,a),n=P(e,o),i=n.includes("ms")?1:1e3,r=S&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(r)?0:r}function V(e){const t=P(e,"transitionProperty"),n=P(e,"transitionDelay"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function W(e){const t=P(e,"transitionProperty"),n=P(e,"transitionDuration"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function Q(e){const t=P(e,l),n=P(e,c),o=n.includes("ms")?1:1e3,i=M&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function U(e){const t=P(e,l),n=P(e,s),o=n.includes("ms")?1:1e3,i=M&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function q(e){return"true"===e||"false"!==e&&(Number.isNaN(+e)?""===e||"null"===e?null:e:+e)}const G=e=>Object.keys(e),K=e=>e.toLowerCase();const X=!!D&&{passive:!0},$=new Map,Y={set:(e,t,n,o)=>{const i=z(e);if(i)if(o&&o.length){$.has(i)||$.set(i,new Map);$.get(i).set(o,setTimeout(t,n))}else $.set(i,setTimeout(t,n))},get:(e,t)=>{const n=z(e);if(!n)return null;const o=$.get(n);return t&&t.length&&o&&o.get?o.get(t)||null:o||null},clear:(e,t)=>{const n=z(e);if(n)if(t&&t.length){const e=$.get(n);e&&e.get&&(clearTimeout(e.get(t)),e.delete(t),0===e.size&&$.delete(n))}else clearTimeout($.get(n)),$.delete(n)}};function Z(e,t){const{width:n,height:o,top:i,right:a,bottom:r,left:s}=e.getBoundingClientRect();let c=1,u=1;if(t&&e instanceof HTMLElement){const{offsetWidth:t,offsetHeight:i}=e;c=t>0&&Math.round(n)/t||1,u=i>0&&Math.round(o)/i||1}return{width:n/c,height:o/u,top:i/u,right:a/c,bottom:r/u,left:s/c,x:s/c,y:i/u}}function J(e){return O(e).documentElement}function _(e){if(null==e)return window;if(!(e instanceof Window)){const{ownerDocument:t}=e;return t&&t.defaultView||window}return e}const ee=e=>e instanceof _(e).ShadowRoot||e instanceof ShadowRoot;function te(e){const{width:t,height:n}=Z(e),{offsetWidth:o,offsetHeight:i}=e;return Math.round(t)!==o||Math.round(n)!==i}let ne=0,oe=0;const ie=new Map;const ae=e=>e&&!!e.shadowRoot;function re(e,t){return("object"!=typeof t?O():t).getElementsByTagName(e)}const se=re("*");const ce=Element.prototype,ue=ce.matches||ce.matchesSelector||ce.webkitMatchesSelector||ce.mozMatchesSelector||ce.msMatchesSelector||ce.oMatchesSelector||function(){return!1};const le={ariaChecked:"aria-checked",ariaDescription:"aria-description",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaHasPopup:"aria-haspopup",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",ariaValueMin:"aria-valuemin",ariaValueMax:"aria-valuemax",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",nativeEvents:e,abortEvent:"abort",blurEvent:"blur",moveEvent:"move",changeEvent:"change",errorEvent:"error",resetEvent:"reset",resizeEvent:"resize",scrollEvent:"scroll",submitEvent:"submit",loadEvent:"load",loadstartEvent:"loadstart",unloadEvent:"unload",readystatechangeEvent:"readystatechange",beforeunloadEvent:"beforeunload",orientationchangeEvent:"orientationchange",contextmenuEvent:"contextmenu",DOMContentLoadedEvent:"DOMContentLoaded",DOMMouseScrollEvent:"DOMMouseScroll",selectEvent:"select",selectendEvent:"selectend",selectstartEvent:"selectstart",mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseclickEvent:"click",mousedblclickEvent:"dblclick",mousedownEvent:"mousedown",mouseupEvent:"mouseup",mousehoverEvent:"hover",mouseHoverEvents:t,mouseenterEvent:"mouseenter",mouseleaveEvent:"mouseleave",mouseinEvent:"mousein",mouseoutEvent:"mouseout",mouseoverEvent:"mouseover",mousemoveEvent:"mousemove",mousewheelEvent:"mousewheel",mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"},touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},touchstartEvent:"touchstart",touchmoveEvent:"touchmove",touchcancelEvent:"touchcancel",touchendEvent:"touchend",pointercancelEvent:"pointercancel",pointerdownEvent:"pointerdown",pointerleaveEvent:"pointerleave",pointermoveEvent:"pointermove",pointerupEvent:"pointerup",focusEvents:{in:"focusin",out:"focusout"},focusEvent:"focus",focusinEvent:"focusin",focusoutEvent:"focusout",gesturechangeEvent:"gesturechange",gestureendEvent:"gestureend",gesturestartEvent:"gesturestart",bezierEasings:{linear:"linear",easingSinusoidalIn:"cubic-bezier(0.47,0,0.745,0.715)",easingSinusoidalOut:"cubic-bezier(0.39,0.575,0.565,1)",easingSinusoidalInOut:"cubic-bezier(0.445,0.05,0.55,0.95)",easingQuadraticIn:"cubic-bezier(0.550,0.085,0.680,0.530)",easingQuadraticOut:"cubic-bezier(0.250,0.460,0.450,0.940)",easingQuadraticInOut:"cubic-bezier(0.455,0.030,0.515,0.955)",easingCubicIn:"cubic-bezier(0.55,0.055,0.675,0.19)",easingCubicOut:"cubic-bezier(0.215,0.61,0.355,1)",easingCubicInOut:"cubic-bezier(0.645,0.045,0.355,1)",easingQuarticIn:"cubic-bezier(0.895,0.03,0.685,0.22)",easingQuarticOut:"cubic-bezier(0.165,0.84,0.44,1)",easingQuarticInOut:"cubic-bezier(0.77,0,0.175,1)",easingQuinticIn:"cubic-bezier(0.755,0.05,0.855,0.06)",easingQuinticOut:"cubic-bezier(0.23,1,0.32,1)",easingQuinticInOut:"cubic-bezier(0.86,0,0.07,1)",easingExponentialIn:"cubic-bezier(0.95,0.05,0.795,0.035)",easingExponentialOut:"cubic-bezier(0.19,1,0.22,1)",easingExponentialInOut:"cubic-bezier(1,0,0,1)",easingCircularIn:"cubic-bezier(0.6,0.04,0.98,0.335)",easingCircularOut:"cubic-bezier(0.075,0.82,0.165,1)",easingCircularInOut:"cubic-bezier(0.785,0.135,0.15,0.86)",easingBackIn:"cubic-bezier(0.6,-0.28,0.735,0.045)",easingBackOut:"cubic-bezier(0.175,0.885,0.32,1.275)",easingBackInOut:"cubic-bezier(0.68,-0.55,0.265,1.55)"},animationDuration:"animationDuration",animationDurationLegacy:o,animationDelay:"animationDelay",animationDelayLegacy:i,animationName:"animationName",animationNameLegacy:a,animationEndEvent:"animationend",animationEndEventLegacy:r,transitionDuration:"transitionDuration",transitionDurationLegacy:s,transitionDelay:"transitionDelay",transitionDelayLegacy:c,transitionEndEvent:"transitionend",transitionEndEventLegacy:u,transitionProperty:"transitionProperty",transitionPropertyLegacy:l,isMobile:E,isApple:b,isFirefox:h,support3DTransform:w,supportPassive:D,supportTransform:N,supportTouch:T,supportAnimation:S,supportTransition:M,addEventListener:"addEventListener",removeEventListener:"removeEventListener",keyboardEventKeys:{Backspace:"Backspace",Tab:"Tab",Enter:"Enter",Shift:"Shift",Control:"Control",Alt:"Alt",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Scape:"Space",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Insert:"Insert",Delete:"Delete",Meta:"Meta",ContextMenu:"ContextMenu",ScrollLock:"ScrollLock"},keydownEvent:"keydown",keypressEvent:"keypress",keyupEvent:"keyup",keyAlt:"Alt",keyArrowDown:"ArrowDown",keyArrowLeft:"ArrowLeft",keyArrowRight:"ArrowRight",keyArrowUp:"ArrowUp",keyBackspace:"Backspace",keyCapsLock:"CapsLock",keyControl:"Control",keyDelete:"Delete",keyEnter:"Enter",keyEscape:"Escape",keyInsert:"Insert",keyMeta:"Meta",keyPause:"Pause",keyScrollLock:"ScrollLock",keyShift:"Shift",keySpace:"Space",keyTab:"Tab",offsetHeight:"offsetHeight",offsetWidth:"offsetWidth",scrollHeight:"scrollHeight",scrollWidth:"scrollWidth",userAgentData:d,userAgent:p,addClass:function(e,t){e.classList.add(t)},removeClass:function(e,t){e.classList.remove(t)},hasClass:function(e,t){return e.classList.contains(t)},on:A,off:k,one:L,dispatchEvent:(e,t)=>e.dispatchEvent(t),distinct:(e,t,n)=>n.indexOf(e)===t,Data:I,getInstance:(e,t)=>I.get(e,t),createElement:function e(t){if("string"==typeof t)return O().createElement(t);const{tagName:n}=t,o={...t},i=e(n);return delete o.tagName,x(i,o),i},createElementNS:function e(t,n){if("string"==typeof n)return O().createElementNS(t,n);const{tagName:o}=n,i={...n},a=e(t,o);return delete i.tagName,x(a,i),a},toUpperCase:e=>e.toUpperCase(),toLowerCase:K,Timer:Y,emulateAnimationEnd:function(e,t){let n=0;const o=new Event("animationend"),i=F(e),a=B(e);if(i){const r=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener("animationend",r),n=1)};e.addEventListener("animationend",r),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},emulateAnimationEndLegacy:function(e,t){let n=0;const o=new Event(r),i=j(e),a=R(e);if(S&&i){const s=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener(r,s),n=1)};e.addEventListener(r,s),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},emulateTransitionEnd:function(e,t){let n=0;const o=new Event("transitionend"),i=W(e),a=V(e);if(i){const r=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener("transitionend",r),n=1)};e.addEventListener("transitionend",r),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},emulateTransitionEndLegacy:function(e,t){let n=0;const o=new Event(u),i=U(e),a=Q(e);if(M&&i){const r=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener(u,r),n=1)};e.addEventListener(u,r),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},isElementInScrollRange:e=>{const{top:t,bottom:n}=Z(e),{clientHeight:o}=J(e);return t<=o&&n>=0},isElementInViewport:e=>{const{top:t,left:n,bottom:o,right:i}=Z(e,!0),{clientWidth:a,clientHeight:r}=J(e);return t>=0&&n>=0&&o<=r&&i<=a},passiveHandler:{passive:!0},passiveHandlerLegacy:X,getElementAnimationDuration:F,getElementAnimationDurationLegacy:j,getElementAnimationDelay:B,getElementAnimationDelayLegacy:R,getElementTransitionDuration:W,getElementTransitionDurationLegacy:U,getElementTransitionDelay:V,getElementTransitionDelayLegacy:Q,getNodeScroll:function(e){const t="scrollX"in e;return{x:t?e.scrollX:e.scrollLeft,y:t?e.scrollY:e.scrollTop}},getParentNode:function(e){return"HTML"===e.nodeName?e:e.assignedSlot||e.parentNode||(ee(e)?e.host:null)||J(e)},getRectRelativeToOffsetParent:function(e,t,n){const o=t instanceof HTMLElement,i=Z(e,o&&te(t)),a={x:0,y:0};if(o){const e=Z(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}return{x:i.left+n.x-a.x,y:i.top+n.y-a.y,width:i.width,height:i.height}},getWindow:_,isArray:e=>Array.isArray(e),isString:e=>"string"==typeof e,isCustomElement:ae,isElement:e=>e instanceof Element,isNode:e=>e instanceof Node,isHTMLElement:e=>e instanceof HTMLElement,isHTMLImageElement:e=>e instanceof HTMLImageElement,isSVGElement:e=>e instanceof SVGElement,isNodeList:e=>e instanceof NodeList,isHTMLCollection:e=>e instanceof HTMLCollection,isScaledElement:te,isTableElement:e=>["TABLE","TD","TH"].includes(e.tagName),isShadowRoot:ee,isDocument:e=>e instanceof Document,isElementsArray:e=>Array.isArray(e)&&e.every(e=>[HTMLElement,Element].some(t=>e instanceof t)),isWindow:function(e){return e instanceof Window},isMedia:e=>e&&[SVGElement,HTMLImageElement,HTMLVideoElement].some(t=>e instanceof t),isRTL:e=>"rtl"===J(e).dir,closest:function e(t,n){return t?t.closest(n)||e(t.getRootNode().host,n):null},documentAll:se,querySelector:z,getCustomElements:function(e){return[...e&&"object"==typeof e?re("*",e):se].filter(ae)},getElementById:function(e){return O().getElementById(e)},querySelectorAll:function(e,t){return("object"!=typeof t?O():t).querySelectorAll(e)},getElementsByClassName:function(e,t){return("object"!=typeof t?O():t).getElementsByClassName(e)},getElementsByTagName:re,matches:function(e,t){return e.matches(t)},matchesLegacy:function(e,t){return ue.call(e,t)},normalizeValue:q,normalizeOptions:function(e,t,n,o){const i={...e.dataset},a={},r={};return G(i).forEach(e=>{const t=o&&e.includes(o)?e.replace(o,"").replace(/[A-Z]/,e=>K(e)):e;r[t]=q(i[e])}),G(n).forEach(e=>{n[e]=q(n[e])}),G(t).forEach(o=>{a[o]=o in n?n[o]:o in r?r[o]:"title"===o?C(e,"title"):t[o]}),a},tryWrapper:function(e,t){try{e()}catch(e){throw TypeError(`${t} ${e}`)}},reflow:e=>e.offsetHeight,noop:()=>{},focus:e=>e.focus(),getUID:function e(t,n){let o=n?ne:oe;if(n){const i=e(t),a=ie.get(i)||new Map;ie.has(i)||ie.set(i,a),a.has(n)?o=a.get(n):(a.set(n,o),ne+=1)}else{const e=t.id||t;ie.has(e)?o=ie.get(e):(ie.set(e,o),oe+=1)}return o},ArrayFrom:e=>Array.from(e),Float32ArrayFrom:e=>Float32Array.from(Array.from(e)),Float64ArrayFrom:e=>Float64Array.from(Array.from(e)),ObjectAssign:x,ObjectKeys:G,ObjectValues:e=>Object.values(e),OriginalEvent:function(e,t){const n=new CustomEvent(e,{cancelable:!0,bubbles:!0});return t instanceof Object&&x(n,t),n},getBoundingClientRect:Z,getDocument:O,getDocumentBody:function(e){return O(e).body},getDocumentElement:J,getDocumentHead:function(e){return O(e).head},getElementStyle:P,setElementStyle:(e,t)=>{x(e.style,t)},hasAttribute:(e,t)=>e.hasAttribute(t),hasAttributeNS:(e,t,n)=>t.hasAttributeNS(e,n),getAttribute:C,getAttributeNS:(e,t,n)=>t.getAttributeNS(e,n),setAttribute:(e,t,n)=>e.setAttribute(t,n),setAttributeNS:(e,t,n,o)=>t.setAttributeNS(e,n,o),removeAttribute:(e,t)=>e.removeAttribute(t),removeAttributeNS:(e,t,n)=>t.removeAttributeNS(e,n),Version:"1.0.1"};export{le as default};
package/dist/shorty.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Shorty v1.0.0 (https://github.com/thednp/shorty)
2
+ * Shorty v1.0.1 (https://github.com/thednp/shorty)
3
3
  * Copyright 2019-2022 © dnp_theme
4
4
  * Licensed under MIT (https://github.com/thednp/shorty/blob/master/LICENSE)
5
5
  */
@@ -1083,14 +1083,16 @@
1083
1083
  * Utility to check if target is typeof `HTMLElement`, `Element`, `Node`
1084
1084
  * or find one that matches a selector.
1085
1085
  *
1086
- * @param {HTMLElement | Element | string} selector the input selector or target element
1087
- * @param {(HTMLElement | Element | Document)=} parent optional node to look into
1086
+ * @param {Node | HTMLElement | Element | string} selector the input selector or target element
1087
+ * @param {(Node | HTMLElement | Element | Document)=} parent optional node to look into
1088
1088
  * @return {(HTMLElement | Element)?} the `HTMLElement` or `querySelector` result
1089
1089
  */
1090
1090
  function querySelector(selector, parent) {
1091
- var method = 'querySelector';
1092
- var lookUp = parent && parent[method] ? parent : getDocument();
1093
- return selector[method] ? selector : lookUp[method](selector);
1091
+ if (typeof selector === 'string') {
1092
+ var lookUp = typeof parent !== 'object' ? getDocument() : parent;
1093
+ return lookUp.querySelector(selector);
1094
+ }
1095
+ return selector;
1094
1096
  }
1095
1097
 
1096
1098
  /** @type {Map<string, Map<HTMLElement | Element, Record<string, any>>>} */
@@ -2216,9 +2218,8 @@
2216
2218
  * @return {HTMLCollectionOf<HTMLElement | Element>} the 'HTMLCollection'
2217
2219
  */
2218
2220
  function getElementsByTagName(selector, parent) {
2219
- var method = 'getElementsByTagName';
2220
- var lookUp = parent && parent[method] ? parent : getDocument();
2221
- return lookUp[method](selector);
2221
+ var lookUp = typeof parent !== 'object' ? getDocument() : parent;
2222
+ return lookUp.getElementsByTagName(selector);
2222
2223
  }
2223
2224
 
2224
2225
  /**
@@ -2227,16 +2228,6 @@
2227
2228
  */
2228
2229
  var documentAll = getElementsByTagName('*');
2229
2230
 
2230
- /**
2231
- * A global array with `Element` | `HTMLElement`.
2232
- */
2233
- var elementNodes = [Element, HTMLElement];
2234
-
2235
- /**
2236
- * A global array of possible `ParentNode`.
2237
- */
2238
- var parentNodes = [Document, Element, HTMLElement];
2239
-
2240
2231
  /**
2241
2232
  * Returns an `Array` of `Node` elements that are registered as
2242
2233
  * `CustomElement`.
@@ -2246,7 +2237,7 @@
2246
2237
  * @returns {Array<HTMLElement | Element>} the query result
2247
2238
  */
2248
2239
  function getCustomElements(parent) {
2249
- var collection = parent && parentNodes.some(function (x) { return parent instanceof x; })
2240
+ var collection = parent && typeof parent === 'object'
2250
2241
  ? getElementsByTagName('*', parent) : documentAll;
2251
2242
  return [].concat( collection ).filter(isCustomElement);
2252
2243
  }
@@ -2269,9 +2260,8 @@
2269
2260
  * @return {NodeListOf<HTMLElement | Element>} the query result
2270
2261
  */
2271
2262
  function querySelectorAll(selector, parent) {
2272
- var method = 'querySelectorAll';
2273
- var lookUp = parent && parent[method] ? parent : getDocument();
2274
- return lookUp[method](selector);
2263
+ var lookUp = typeof parent !== 'object' ? getDocument() : parent;
2264
+ return lookUp.querySelectorAll(selector);
2275
2265
  }
2276
2266
 
2277
2267
  /**
@@ -2283,9 +2273,8 @@
2283
2273
  * @return {HTMLCollectionOf<HTMLElement | Element>} the 'HTMLCollection'
2284
2274
  */
2285
2275
  function getElementsByClassName(selector, parent) {
2286
- var method = 'getElementsByClassName';
2287
- var lookUp = parent && parent[method] ? parent : getDocument();
2288
- return lookUp[method](selector);
2276
+ var lookUp = typeof parent !== 'object' ? getDocument() : parent;
2277
+ return lookUp.getElementsByClassName(selector);
2289
2278
  }
2290
2279
 
2291
2280
  /**
@@ -2323,7 +2312,7 @@
2323
2312
  return matchesFn.call(target, selector);
2324
2313
  }
2325
2314
 
2326
- var version = "1.0.0";
2315
+ var version = "1.0.1";
2327
2316
 
2328
2317
  // @ts-ignore
2329
2318
 
@@ -2514,8 +2503,6 @@
2514
2503
  isWindow: isWindow,
2515
2504
  isMedia: isMedia,
2516
2505
  isRTL: isRTL,
2517
- elementNodes: elementNodes,
2518
- parentNodes: parentNodes,
2519
2506
  closest: closest,
2520
2507
  documentAll: documentAll,
2521
2508
  querySelector: querySelector,
@@ -1,2 +1,2 @@
1
- // Shorty v1.0.0 | dnp_theme © 2022 | MIT-License
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).SHORTY=t()}(this,(function(){"use strict";var e={DOMContentLoaded:"DOMContentLoaded",DOMMouseScroll:"DOMMouseScroll",abort:"abort",beforeunload:"beforeunload",blur:"blur",change:"change",click:"click",contextmenu:"contextmenu",dblclick:"dblclick",error:"error",focus:"focus",focusin:"focusin",focusout:"focusout",gesturechange:"gesturechange",gestureend:"gestureend",gesturestart:"gesturestart",hover:"hover",keydown:"keydown",keypress:"keypress",keyup:"keyup",load:"load",mousedown:"mousedown",mousemove:"mousemove",mousein:"mousein",mouseout:"mouseout",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseup:"mouseup",mousewheel:"mousewheel",move:"move",orientationchange:"orientationchange",pointercancel:"pointercancel",pointerdown:"pointerdown",pointerleave:"pointerleave",pointermove:"pointermove",pointerup:"pointerup",readystatechange:"readystatechange",reset:"reset",resize:"resize",scroll:"scroll",select:"select",selectend:"selectend",selectstart:"selectstart",submit:"submit",touchcancel:"touchcancel",touchend:"touchend",touchmove:"touchmove",touchstart:"touchstart",unload:"unload"},t="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],n=document.head,i="webkitAnimation"in n.style?"webkitAnimationDuration":"animationDuration",r="webkitAnimation"in n.style?"webkitAnimationDelay":"animationDelay",o="webkitAnimation"in n.style?"webkitAnimationName":"animationName",a="webkitAnimation"in n.style?"webkitAnimationEnd":"animationend",u="webkitTransition"in n.style?"webkitTransitionDuration":"transitionDuration",s="webkitTransition"in n.style?"webkitTransitionDelay":"transitionDelay",c="webkitTransition"in n.style?"webkitTransitionEnd":"transitionend",l="webkitTransition"in n.style?"webkitTransitionProperty":"transitionProperty",m=navigator.userAgentData,d=navigator.userAgent,f=/iPhone|iPad|iPod|Android/i,v=m?m.brands.some((function(e){return f.test(e.brand)})):f.test(d),g=/(iPhone|iPod|iPad)/,p=m?m.brands.some((function(e){return g.test(e.brand)})):g.test(d),E=!!d&&d.includes("Firefox"),b="webkitPerspective"in n.style||"perspective"in n.style;function y(e,t,n,i){var r=i||!1;e.addEventListener(t,n,r)}function h(e,t,n,i){var r=i||!1;e.removeEventListener(t,n,r)}function w(e,t,n,i){var r=function(o){o.target===e&&(n.apply(e,[o]),h(e,t,r,i))};y(e,t,r,i)}var A=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0}});w(document,"DOMContentLoaded",(function(){}),t)}catch(e){throw Error("Passive events are not supported")}return e}(),k="webkitTransform"in n.style||"transform"in n.style,L="ontouchstart"in window||"msMaxTouchPoints"in navigator,D="webkitAnimation"in n.style||"animation"in n.style,N="webkitTransition"in n.style||"transition"in n.style,T=function(e,t){return e.getAttribute(t)};function S(e){return e instanceof HTMLElement?e.ownerDocument:e instanceof Window?e.document:window.document}function M(e,t){var n="querySelector",i=t&&t[n]?t:S();return e[n]?e:i[n](e)}var O=new Map,C={set:function(e,t,n){var i=M(e);i&&(O.has(t)||O.set(t,new Map),O.get(t).set(i,n))},getAllFor:function(e){return O.get(e)||null},get:function(e,t){var n=M(e),i=C.getAllFor(t);return n&&i&&i.get(n)||null},remove:function(e,t){var n=M(e),i=O.get(t);i&&n&&(i.delete(n),0===i.size&&O.delete(t))}},z=function(e,t){return Object.assign(e,t)};function H(e,t){var n=getComputedStyle(e);return t in n?n[t]:""}function x(e){var t=H(e,"animationName"),n=H(e,"animationDelay"),i=n.includes("ms")?1:1e3,r=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(r)?0:r}function I(e){var t=H(e,"animationName"),n=H(e,"animationDuration"),i=n.includes("ms")?1:1e3,r=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(r)?0:r}function P(e){var t=H(e,o),n=H(e,r),i=n.includes("ms")?1:1e3,a=D&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(a)?0:a}function B(e){var t=H(e,o),n=H(e,i),r=n.includes("ms")?1:1e3,a=D&&t&&"none"!==t?parseFloat(n)*r:0;return Number.isNaN(a)?0:a}function F(e){var t=H(e,"transitionProperty"),n=H(e,"transitionDelay"),i=n.includes("ms")?1:1e3,r=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(r)?0:r}function R(e){var t=H(e,"transitionProperty"),n=H(e,"transitionDuration"),i=n.includes("ms")?1:1e3,r=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(r)?0:r}function V(e){var t=H(e,l),n=H(e,s),i=n.includes("ms")?1:1e3,r=N&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(r)?0:r}function W(e){var t=H(e,l),n=H(e,u),i=n.includes("ms")?1:1e3,r=N&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(r)?0:r}function j(e){return"true"===e||"false"!==e&&(Number.isNaN(+e)?""===e||"null"===e?null:e:+e)}var Q=function(e){return Object.keys(e)},U=function(e){return e.toLowerCase()};var q=!!A&&{passive:!0},G=new Map,K={set:function(e,t,n,i){var r=M(e);r&&(i&&i.length?(G.has(r)||G.set(r,new Map),G.get(r).set(i,setTimeout(t,n))):G.set(r,setTimeout(t,n)))},get:function(e,t){var n=M(e);if(!n)return null;var i=G.get(n);return t&&t.length&&i&&i.get?i.get(t)||null:i||null},clear:function(e,t){var n=M(e);if(n)if(t&&t.length){var i=G.get(n);i&&i.get&&(clearTimeout(i.get(t)),i.delete(t),0===i.size&&G.delete(n))}else clearTimeout(G.get(n)),G.delete(n)}};function X(e,t){var n=e.getBoundingClientRect(),i=n.width,r=n.height,o=n.top,a=n.right,u=n.bottom,s=n.left,c=1,l=1;if(t&&e instanceof HTMLElement){var m=e.offsetWidth,d=e.offsetHeight;c=m>0&&Math.round(i)/m||1,l=d>0&&Math.round(r)/d||1}return{width:i/c,height:r/l,top:o/l,right:a/c,bottom:u/l,left:s/c,x:s/c,y:o/l}}function Y(e){return S(e).documentElement}function Z(e){if(null==e)return window;if(!(e instanceof Window)){var t=e.ownerDocument;return t&&t.defaultView||window}return e}var J=function(e){return e instanceof Z(e).ShadowRoot||e instanceof ShadowRoot};function $(e){var t=X(e),n=t.width,i=t.height,r=e.offsetWidth,o=e.offsetHeight;return Math.round(n)!==r||Math.round(i)!==o}var _=0,ee=0,te=new Map;var ne=function(e){return e&&!!e.shadowRoot};function ie(e,t){var n="getElementsByTagName";return(t&&t[n]?t:S())[n](e)}var re=ie("*"),oe=[Element,HTMLElement],ae=[Document,Element,HTMLElement];var ue=Element.prototype,se=ue.matches||ue.matchesSelector||ue.webkitMatchesSelector||ue.mozMatchesSelector||ue.msMatchesSelector||ue.oMatchesSelector||function(){return!1};return{ariaChecked:"aria-checked",ariaDescription:"aria-description",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaHasPopup:"aria-haspopup",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",ariaValueMin:"aria-valuemin",ariaValueMax:"aria-valuemax",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",nativeEvents:e,abortEvent:"abort",blurEvent:"blur",moveEvent:"move",changeEvent:"change",errorEvent:"error",resetEvent:"reset",resizeEvent:"resize",scrollEvent:"scroll",submitEvent:"submit",loadEvent:"load",loadstartEvent:"loadstart",unloadEvent:"unload",readystatechangeEvent:"readystatechange",beforeunloadEvent:"beforeunload",orientationchangeEvent:"orientationchange",contextmenuEvent:"contextmenu",DOMContentLoadedEvent:"DOMContentLoaded",DOMMouseScrollEvent:"DOMMouseScroll",selectEvent:"select",selectendEvent:"selectend",selectstartEvent:"selectstart",mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseclickEvent:"click",mousedblclickEvent:"dblclick",mousedownEvent:"mousedown",mouseupEvent:"mouseup",mousehoverEvent:"hover",mouseHoverEvents:t,mouseenterEvent:"mouseenter",mouseleaveEvent:"mouseleave",mouseinEvent:"mousein",mouseoutEvent:"mouseout",mouseoverEvent:"mouseover",mousemoveEvent:"mousemove",mousewheelEvent:"mousewheel",mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"},touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},touchstartEvent:"touchstart",touchmoveEvent:"touchmove",touchcancelEvent:"touchcancel",touchendEvent:"touchend",pointercancelEvent:"pointercancel",pointerdownEvent:"pointerdown",pointerleaveEvent:"pointerleave",pointermoveEvent:"pointermove",pointerupEvent:"pointerup",focusEvents:{in:"focusin",out:"focusout"},focusEvent:"focus",focusinEvent:"focusin",focusoutEvent:"focusout",gesturechangeEvent:"gesturechange",gestureendEvent:"gestureend",gesturestartEvent:"gesturestart",bezierEasings:{linear:"linear",easingSinusoidalIn:"cubic-bezier(0.47,0,0.745,0.715)",easingSinusoidalOut:"cubic-bezier(0.39,0.575,0.565,1)",easingSinusoidalInOut:"cubic-bezier(0.445,0.05,0.55,0.95)",easingQuadraticIn:"cubic-bezier(0.550,0.085,0.680,0.530)",easingQuadraticOut:"cubic-bezier(0.250,0.460,0.450,0.940)",easingQuadraticInOut:"cubic-bezier(0.455,0.030,0.515,0.955)",easingCubicIn:"cubic-bezier(0.55,0.055,0.675,0.19)",easingCubicOut:"cubic-bezier(0.215,0.61,0.355,1)",easingCubicInOut:"cubic-bezier(0.645,0.045,0.355,1)",easingQuarticIn:"cubic-bezier(0.895,0.03,0.685,0.22)",easingQuarticOut:"cubic-bezier(0.165,0.84,0.44,1)",easingQuarticInOut:"cubic-bezier(0.77,0,0.175,1)",easingQuinticIn:"cubic-bezier(0.755,0.05,0.855,0.06)",easingQuinticOut:"cubic-bezier(0.23,1,0.32,1)",easingQuinticInOut:"cubic-bezier(0.86,0,0.07,1)",easingExponentialIn:"cubic-bezier(0.95,0.05,0.795,0.035)",easingExponentialOut:"cubic-bezier(0.19,1,0.22,1)",easingExponentialInOut:"cubic-bezier(1,0,0,1)",easingCircularIn:"cubic-bezier(0.6,0.04,0.98,0.335)",easingCircularOut:"cubic-bezier(0.075,0.82,0.165,1)",easingCircularInOut:"cubic-bezier(0.785,0.135,0.15,0.86)",easingBackIn:"cubic-bezier(0.6,-0.28,0.735,0.045)",easingBackOut:"cubic-bezier(0.175,0.885,0.32,1.275)",easingBackInOut:"cubic-bezier(0.68,-0.55,0.265,1.55)"},animationDuration:"animationDuration",animationDurationLegacy:i,animationDelay:"animationDelay",animationDelayLegacy:r,animationName:"animationName",animationNameLegacy:o,animationEndEvent:"animationend",animationEndEventLegacy:a,transitionDuration:"transitionDuration",transitionDurationLegacy:u,transitionDelay:"transitionDelay",transitionDelayLegacy:s,transitionEndEvent:"transitionend",transitionEndEventLegacy:c,transitionProperty:"transitionProperty",transitionPropertyLegacy:l,isMobile:v,isApple:p,isFirefox:E,support3DTransform:b,supportPassive:A,supportTransform:k,supportTouch:L,supportAnimation:D,supportTransition:N,addEventListener:"addEventListener",removeEventListener:"removeEventListener",keyboardEventKeys:{Backspace:"Backspace",Tab:"Tab",Enter:"Enter",Shift:"Shift",Control:"Control",Alt:"Alt",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Scape:"Space",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Insert:"Insert",Delete:"Delete",Meta:"Meta",ContextMenu:"ContextMenu",ScrollLock:"ScrollLock"},keydownEvent:"keydown",keypressEvent:"keypress",keyupEvent:"keyup",keyAlt:"Alt",keyArrowDown:"ArrowDown",keyArrowLeft:"ArrowLeft",keyArrowRight:"ArrowRight",keyArrowUp:"ArrowUp",keyBackspace:"Backspace",keyCapsLock:"CapsLock",keyControl:"Control",keyDelete:"Delete",keyEnter:"Enter",keyEscape:"Escape",keyInsert:"Insert",keyMeta:"Meta",keyPause:"Pause",keyScrollLock:"ScrollLock",keyShift:"Shift",keySpace:"Space",keyTab:"Tab",offsetHeight:"offsetHeight",offsetWidth:"offsetWidth",scrollHeight:"scrollHeight",scrollWidth:"scrollWidth",userAgentData:m,userAgent:d,addClass:function(e,t){e.classList.add(t)},removeClass:function(e,t){e.classList.remove(t)},hasClass:function(e,t){return e.classList.contains(t)},on:y,off:h,one:w,dispatchEvent:function(e,t){return e.dispatchEvent(t)},distinct:function(e,t,n){return n.indexOf(e)===t},Data:C,getInstance:function(e,t){return C.get(e,t)},createElement:function e(t){if("string"==typeof t)return S().createElement(t);var n=t.tagName,i=Object.assign({},t),r=e(n);return delete i.tagName,z(r,i),r},createElementNS:function e(t,n){if("string"==typeof n)return S().createElementNS(t,n);var i=n.tagName,r=Object.assign({},n),o=e(t,i);return delete r.tagName,z(o,r),o},toUpperCase:function(e){return e.toUpperCase()},toLowerCase:U,Timer:K,emulateAnimationEnd:function(e,t){var n=0,i=new Event("animationend"),r=I(e),o=x(e);if(r){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener("animationend",a),n=1)};e.addEventListener("animationend",a),setTimeout((function(){n||e.dispatchEvent(i)}),r+o+17)}else t.apply(e,[i])},emulateAnimationEndLegacy:function(e,t){var n=0,i=new Event(a),r=B(e),o=P(e);if(D&&r){var u=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener(a,u),n=1)};e.addEventListener(a,u),setTimeout((function(){n||e.dispatchEvent(i)}),r+o+17)}else t.apply(e,[i])},emulateTransitionEnd:function(e,t){var n=0,i=new Event("transitionend"),r=R(e),o=F(e);if(r){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener("transitionend",a),n=1)};e.addEventListener("transitionend",a),setTimeout((function(){n||e.dispatchEvent(i)}),r+o+17)}else t.apply(e,[i])},emulateTransitionEndLegacy:function(e,t){var n=0,i=new Event(c),r=W(e),o=V(e);if(N&&r){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener(c,a),n=1)};e.addEventListener(c,a),setTimeout((function(){n||e.dispatchEvent(i)}),r+o+17)}else t.apply(e,[i])},isElementInScrollRange:function(e){var t=X(e),n=t.top,i=t.bottom;return n<=Y(e).clientHeight&&i>=0},isElementInViewport:function(e){var t=X(e,!0),n=t.top,i=t.left,r=t.bottom,o=t.right,a=Y(e),u=a.clientWidth,s=a.clientHeight;return n>=0&&i>=0&&r<=s&&o<=u},passiveHandler:{passive:!0},passiveHandlerLegacy:q,getElementAnimationDuration:I,getElementAnimationDurationLegacy:B,getElementAnimationDelay:x,getElementAnimationDelayLegacy:P,getElementTransitionDuration:R,getElementTransitionDurationLegacy:W,getElementTransitionDelay:F,getElementTransitionDelayLegacy:V,getNodeScroll:function(e){var t="scrollX"in e;return{x:t?e.scrollX:e.scrollLeft,y:t?e.scrollY:e.scrollTop}},getParentNode:function(e){return"HTML"===e.nodeName?e:e.assignedSlot||e.parentNode||(J(e)?e.host:null)||Y(e)},getRectRelativeToOffsetParent:function(e,t,n){var i=t instanceof HTMLElement,r=X(e,i&&$(t)),o={x:0,y:0};if(i){var a=X(t,!0);o.x=a.x+t.clientLeft,o.y=a.y+t.clientTop}return{x:r.left+n.x-o.x,y:r.top+n.y-o.y,width:r.width,height:r.height}},getWindow:Z,isArray:function(e){return Array.isArray(e)},isString:function(e){return"string"==typeof e},isCustomElement:ne,isElement:function(e){return e instanceof Element},isNode:function(e){return e instanceof Node},isHTMLElement:function(e){return e instanceof HTMLElement},isHTMLImageElement:function(e){return e instanceof HTMLImageElement},isSVGElement:function(e){return e instanceof SVGElement},isNodeList:function(e){return e instanceof NodeList},isHTMLCollection:function(e){return e instanceof HTMLCollection},isScaledElement:$,isTableElement:function(e){return["TABLE","TD","TH"].includes(e.tagName)},isShadowRoot:J,isDocument:function(e){return e instanceof Document},isElementsArray:function(e){return Array.isArray(e)&&e.every((function(e){return[HTMLElement,Element].some((function(t){return e instanceof t}))}))},isWindow:function(e){return e instanceof Window},isMedia:function(e){return e&&[SVGElement,HTMLImageElement,HTMLVideoElement].some((function(t){return e instanceof t}))},isRTL:function(e){return"rtl"===Y(e).dir},elementNodes:oe,parentNodes:ae,closest:function e(t,n){return t?t.closest(n)||e(t.getRootNode().host,n):null},documentAll:re,querySelector:M,getCustomElements:function(e){var t=e&&ae.some((function(t){return e instanceof t}))?ie("*",e):re;return[].concat(t).filter(ne)},getElementById:function(e){return S().getElementById(e)},querySelectorAll:function(e,t){return(t&&t.querySelectorAll?t:S()).querySelectorAll(e)},getElementsByClassName:function(e,t){var n="getElementsByClassName";return(t&&t[n]?t:S())[n](e)},getElementsByTagName:ie,matches:function(e,t){return e.matches(t)},matchesLegacy:function(e,t){return se.call(e,t)},normalizeValue:j,normalizeOptions:function(e,t,n,i){var r=Object.assign({},e.dataset),o={},a={};return Q(r).forEach((function(e){var t=i&&e.includes(i)?e.replace(i,"").replace(/[A-Z]/,(function(e){return U(e)})):e;a[t]=j(r[e])})),Q(n).forEach((function(e){n[e]=j(n[e])})),Q(t).forEach((function(i){o[i]=i in n?n[i]:i in a?a[i]:"title"===i?T(e,"title"):t[i]})),o},tryWrapper:function(e,t){try{e()}catch(e){throw TypeError(t+" "+e)}},reflow:function(e){return e.offsetHeight},noop:function(){},focus:function(e){return e.focus()},getUID:function e(t,n){var i=n?_:ee;if(n){var r=e(t),o=te.get(r)||new Map;te.has(r)||te.set(r,o),o.has(n)?i=o.get(n):(o.set(n,i),_+=1)}else{var a=t.id||t;te.has(a)?i=te.get(a):(te.set(a,i),ee+=1)}return i},ArrayFrom:function(e){return Array.from(e)},Float32ArrayFrom:function(e){return Float32Array.from(Array.from(e))},Float64ArrayFrom:function(e){return Float64Array.from(Array.from(e))},ObjectAssign:z,ObjectKeys:Q,ObjectValues:function(e){return Object.values(e)},OriginalEvent:function(e,t){var n=new CustomEvent(e,{cancelable:!0,bubbles:!0});return t instanceof Object&&z(n,t),n},getBoundingClientRect:X,getDocument:S,getDocumentBody:function(e){return S(e).body},getDocumentElement:Y,getDocumentHead:function(e){return S(e).head},getElementStyle:H,setElementStyle:function(e,t){z(e.style,t)},hasAttribute:function(e,t){return e.hasAttribute(t)},hasAttributeNS:function(e,t,n){return t.hasAttributeNS(e,n)},getAttribute:T,getAttributeNS:function(e,t,n){return t.getAttributeNS(e,n)},setAttribute:function(e,t,n){return e.setAttribute(t,n)},setAttributeNS:function(e,t,n,i){return t.setAttributeNS(e,n,i)},removeAttribute:function(e,t){return e.removeAttribute(t)},removeAttributeNS:function(e,t,n){return t.removeAttributeNS(e,n)},Version:"1.0.0"}}));
1
+ // Shorty v1.0.1 | dnp_theme © 2022 | MIT-License
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).SHORTY=t()}(this,(function(){"use strict";var e={DOMContentLoaded:"DOMContentLoaded",DOMMouseScroll:"DOMMouseScroll",abort:"abort",beforeunload:"beforeunload",blur:"blur",change:"change",click:"click",contextmenu:"contextmenu",dblclick:"dblclick",error:"error",focus:"focus",focusin:"focusin",focusout:"focusout",gesturechange:"gesturechange",gestureend:"gestureend",gesturestart:"gesturestart",hover:"hover",keydown:"keydown",keypress:"keypress",keyup:"keyup",load:"load",mousedown:"mousedown",mousemove:"mousemove",mousein:"mousein",mouseout:"mouseout",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseup:"mouseup",mousewheel:"mousewheel",move:"move",orientationchange:"orientationchange",pointercancel:"pointercancel",pointerdown:"pointerdown",pointerleave:"pointerleave",pointermove:"pointermove",pointerup:"pointerup",readystatechange:"readystatechange",reset:"reset",resize:"resize",scroll:"scroll",select:"select",selectend:"selectend",selectstart:"selectstart",submit:"submit",touchcancel:"touchcancel",touchend:"touchend",touchmove:"touchmove",touchstart:"touchstart",unload:"unload"},t="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],n=document.head,i="webkitAnimation"in n.style?"webkitAnimationDuration":"animationDuration",o="webkitAnimation"in n.style?"webkitAnimationDelay":"animationDelay",r="webkitAnimation"in n.style?"webkitAnimationName":"animationName",a="webkitAnimation"in n.style?"webkitAnimationEnd":"animationend",u="webkitTransition"in n.style?"webkitTransitionDuration":"transitionDuration",s="webkitTransition"in n.style?"webkitTransitionDelay":"transitionDelay",c="webkitTransition"in n.style?"webkitTransitionEnd":"transitionend",l="webkitTransition"in n.style?"webkitTransitionProperty":"transitionProperty",m=navigator.userAgentData,f=navigator.userAgent,d=/iPhone|iPad|iPod|Android/i,v=m?m.brands.some((function(e){return d.test(e.brand)})):d.test(f),g=/(iPhone|iPod|iPad)/,p=m?m.brands.some((function(e){return g.test(e.brand)})):g.test(f),b=!!f&&f.includes("Firefox"),y="webkitPerspective"in n.style||"perspective"in n.style;function E(e,t,n,i){var o=i||!1;e.addEventListener(t,n,o)}function h(e,t,n,i){var o=i||!1;e.removeEventListener(t,n,o)}function w(e,t,n,i){var o=function(r){r.target===e&&(n.apply(e,[r]),h(e,t,o,i))};E(e,t,o,i)}var A=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0}});w(document,"DOMContentLoaded",(function(){}),t)}catch(e){throw Error("Passive events are not supported")}return e}(),k="webkitTransform"in n.style||"transform"in n.style,L="ontouchstart"in window||"msMaxTouchPoints"in navigator,D="webkitAnimation"in n.style||"animation"in n.style,N="webkitTransition"in n.style||"transition"in n.style,T=function(e,t){return e.getAttribute(t)};function S(e){return e instanceof HTMLElement?e.ownerDocument:e instanceof Window?e.document:window.document}function M(e,t){return"string"==typeof e?("object"!=typeof t?S():t).querySelector(e):e}var O=new Map,C={set:function(e,t,n){var i=M(e);i&&(O.has(t)||O.set(t,new Map),O.get(t).set(i,n))},getAllFor:function(e){return O.get(e)||null},get:function(e,t){var n=M(e),i=C.getAllFor(t);return n&&i&&i.get(n)||null},remove:function(e,t){var n=M(e),i=O.get(t);i&&n&&(i.delete(n),0===i.size&&O.delete(t))}},z=function(e,t){return Object.assign(e,t)};function H(e,t){var n=getComputedStyle(e);return t in n?n[t]:""}function x(e){var t=H(e,"animationName"),n=H(e,"animationDelay"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function I(e){var t=H(e,"animationName"),n=H(e,"animationDuration"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function P(e){var t=H(e,r),n=H(e,o),i=n.includes("ms")?1:1e3,a=D&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(a)?0:a}function B(e){var t=H(e,r),n=H(e,i),o=n.includes("ms")?1:1e3,a=D&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(a)?0:a}function F(e){var t=H(e,"transitionProperty"),n=H(e,"transitionDelay"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function j(e){var t=H(e,"transitionProperty"),n=H(e,"transitionDuration"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function R(e){var t=H(e,l),n=H(e,s),i=n.includes("ms")?1:1e3,o=N&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function V(e){var t=H(e,l),n=H(e,u),i=n.includes("ms")?1:1e3,o=N&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function W(e){return"true"===e||"false"!==e&&(Number.isNaN(+e)?""===e||"null"===e?null:e:+e)}var Q=function(e){return Object.keys(e)},U=function(e){return e.toLowerCase()};var q=!!A&&{passive:!0},G=new Map,K={set:function(e,t,n,i){var o=M(e);o&&(i&&i.length?(G.has(o)||G.set(o,new Map),G.get(o).set(i,setTimeout(t,n))):G.set(o,setTimeout(t,n)))},get:function(e,t){var n=M(e);if(!n)return null;var i=G.get(n);return t&&t.length&&i&&i.get?i.get(t)||null:i||null},clear:function(e,t){var n=M(e);if(n)if(t&&t.length){var i=G.get(n);i&&i.get&&(clearTimeout(i.get(t)),i.delete(t),0===i.size&&G.delete(n))}else clearTimeout(G.get(n)),G.delete(n)}};function X(e,t){var n=e.getBoundingClientRect(),i=n.width,o=n.height,r=n.top,a=n.right,u=n.bottom,s=n.left,c=1,l=1;if(t&&e instanceof HTMLElement){var m=e.offsetWidth,f=e.offsetHeight;c=m>0&&Math.round(i)/m||1,l=f>0&&Math.round(o)/f||1}return{width:i/c,height:o/l,top:r/l,right:a/c,bottom:u/l,left:s/c,x:s/c,y:r/l}}function Y(e){return S(e).documentElement}function Z(e){if(null==e)return window;if(!(e instanceof Window)){var t=e.ownerDocument;return t&&t.defaultView||window}return e}var J=function(e){return e instanceof Z(e).ShadowRoot||e instanceof ShadowRoot};function $(e){var t=X(e),n=t.width,i=t.height,o=e.offsetWidth,r=e.offsetHeight;return Math.round(n)!==o||Math.round(i)!==r}var _=0,ee=0,te=new Map;var ne=function(e){return e&&!!e.shadowRoot};function ie(e,t){return("object"!=typeof t?S():t).getElementsByTagName(e)}var oe=ie("*");var re=Element.prototype,ae=re.matches||re.matchesSelector||re.webkitMatchesSelector||re.mozMatchesSelector||re.msMatchesSelector||re.oMatchesSelector||function(){return!1};return{ariaChecked:"aria-checked",ariaDescription:"aria-description",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaHasPopup:"aria-haspopup",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",ariaValueMin:"aria-valuemin",ariaValueMax:"aria-valuemax",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",nativeEvents:e,abortEvent:"abort",blurEvent:"blur",moveEvent:"move",changeEvent:"change",errorEvent:"error",resetEvent:"reset",resizeEvent:"resize",scrollEvent:"scroll",submitEvent:"submit",loadEvent:"load",loadstartEvent:"loadstart",unloadEvent:"unload",readystatechangeEvent:"readystatechange",beforeunloadEvent:"beforeunload",orientationchangeEvent:"orientationchange",contextmenuEvent:"contextmenu",DOMContentLoadedEvent:"DOMContentLoaded",DOMMouseScrollEvent:"DOMMouseScroll",selectEvent:"select",selectendEvent:"selectend",selectstartEvent:"selectstart",mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseclickEvent:"click",mousedblclickEvent:"dblclick",mousedownEvent:"mousedown",mouseupEvent:"mouseup",mousehoverEvent:"hover",mouseHoverEvents:t,mouseenterEvent:"mouseenter",mouseleaveEvent:"mouseleave",mouseinEvent:"mousein",mouseoutEvent:"mouseout",mouseoverEvent:"mouseover",mousemoveEvent:"mousemove",mousewheelEvent:"mousewheel",mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"},touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},touchstartEvent:"touchstart",touchmoveEvent:"touchmove",touchcancelEvent:"touchcancel",touchendEvent:"touchend",pointercancelEvent:"pointercancel",pointerdownEvent:"pointerdown",pointerleaveEvent:"pointerleave",pointermoveEvent:"pointermove",pointerupEvent:"pointerup",focusEvents:{in:"focusin",out:"focusout"},focusEvent:"focus",focusinEvent:"focusin",focusoutEvent:"focusout",gesturechangeEvent:"gesturechange",gestureendEvent:"gestureend",gesturestartEvent:"gesturestart",bezierEasings:{linear:"linear",easingSinusoidalIn:"cubic-bezier(0.47,0,0.745,0.715)",easingSinusoidalOut:"cubic-bezier(0.39,0.575,0.565,1)",easingSinusoidalInOut:"cubic-bezier(0.445,0.05,0.55,0.95)",easingQuadraticIn:"cubic-bezier(0.550,0.085,0.680,0.530)",easingQuadraticOut:"cubic-bezier(0.250,0.460,0.450,0.940)",easingQuadraticInOut:"cubic-bezier(0.455,0.030,0.515,0.955)",easingCubicIn:"cubic-bezier(0.55,0.055,0.675,0.19)",easingCubicOut:"cubic-bezier(0.215,0.61,0.355,1)",easingCubicInOut:"cubic-bezier(0.645,0.045,0.355,1)",easingQuarticIn:"cubic-bezier(0.895,0.03,0.685,0.22)",easingQuarticOut:"cubic-bezier(0.165,0.84,0.44,1)",easingQuarticInOut:"cubic-bezier(0.77,0,0.175,1)",easingQuinticIn:"cubic-bezier(0.755,0.05,0.855,0.06)",easingQuinticOut:"cubic-bezier(0.23,1,0.32,1)",easingQuinticInOut:"cubic-bezier(0.86,0,0.07,1)",easingExponentialIn:"cubic-bezier(0.95,0.05,0.795,0.035)",easingExponentialOut:"cubic-bezier(0.19,1,0.22,1)",easingExponentialInOut:"cubic-bezier(1,0,0,1)",easingCircularIn:"cubic-bezier(0.6,0.04,0.98,0.335)",easingCircularOut:"cubic-bezier(0.075,0.82,0.165,1)",easingCircularInOut:"cubic-bezier(0.785,0.135,0.15,0.86)",easingBackIn:"cubic-bezier(0.6,-0.28,0.735,0.045)",easingBackOut:"cubic-bezier(0.175,0.885,0.32,1.275)",easingBackInOut:"cubic-bezier(0.68,-0.55,0.265,1.55)"},animationDuration:"animationDuration",animationDurationLegacy:i,animationDelay:"animationDelay",animationDelayLegacy:o,animationName:"animationName",animationNameLegacy:r,animationEndEvent:"animationend",animationEndEventLegacy:a,transitionDuration:"transitionDuration",transitionDurationLegacy:u,transitionDelay:"transitionDelay",transitionDelayLegacy:s,transitionEndEvent:"transitionend",transitionEndEventLegacy:c,transitionProperty:"transitionProperty",transitionPropertyLegacy:l,isMobile:v,isApple:p,isFirefox:b,support3DTransform:y,supportPassive:A,supportTransform:k,supportTouch:L,supportAnimation:D,supportTransition:N,addEventListener:"addEventListener",removeEventListener:"removeEventListener",keyboardEventKeys:{Backspace:"Backspace",Tab:"Tab",Enter:"Enter",Shift:"Shift",Control:"Control",Alt:"Alt",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Scape:"Space",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Insert:"Insert",Delete:"Delete",Meta:"Meta",ContextMenu:"ContextMenu",ScrollLock:"ScrollLock"},keydownEvent:"keydown",keypressEvent:"keypress",keyupEvent:"keyup",keyAlt:"Alt",keyArrowDown:"ArrowDown",keyArrowLeft:"ArrowLeft",keyArrowRight:"ArrowRight",keyArrowUp:"ArrowUp",keyBackspace:"Backspace",keyCapsLock:"CapsLock",keyControl:"Control",keyDelete:"Delete",keyEnter:"Enter",keyEscape:"Escape",keyInsert:"Insert",keyMeta:"Meta",keyPause:"Pause",keyScrollLock:"ScrollLock",keyShift:"Shift",keySpace:"Space",keyTab:"Tab",offsetHeight:"offsetHeight",offsetWidth:"offsetWidth",scrollHeight:"scrollHeight",scrollWidth:"scrollWidth",userAgentData:m,userAgent:f,addClass:function(e,t){e.classList.add(t)},removeClass:function(e,t){e.classList.remove(t)},hasClass:function(e,t){return e.classList.contains(t)},on:E,off:h,one:w,dispatchEvent:function(e,t){return e.dispatchEvent(t)},distinct:function(e,t,n){return n.indexOf(e)===t},Data:C,getInstance:function(e,t){return C.get(e,t)},createElement:function e(t){if("string"==typeof t)return S().createElement(t);var n=t.tagName,i=Object.assign({},t),o=e(n);return delete i.tagName,z(o,i),o},createElementNS:function e(t,n){if("string"==typeof n)return S().createElementNS(t,n);var i=n.tagName,o=Object.assign({},n),r=e(t,i);return delete o.tagName,z(r,o),r},toUpperCase:function(e){return e.toUpperCase()},toLowerCase:U,Timer:K,emulateAnimationEnd:function(e,t){var n=0,i=new Event("animationend"),o=I(e),r=x(e);if(o){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener("animationend",a),n=1)};e.addEventListener("animationend",a),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},emulateAnimationEndLegacy:function(e,t){var n=0,i=new Event(a),o=B(e),r=P(e);if(D&&o){var u=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener(a,u),n=1)};e.addEventListener(a,u),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},emulateTransitionEnd:function(e,t){var n=0,i=new Event("transitionend"),o=j(e),r=F(e);if(o){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener("transitionend",a),n=1)};e.addEventListener("transitionend",a),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},emulateTransitionEndLegacy:function(e,t){var n=0,i=new Event(c),o=V(e),r=R(e);if(N&&o){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener(c,a),n=1)};e.addEventListener(c,a),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},isElementInScrollRange:function(e){var t=X(e),n=t.top,i=t.bottom;return n<=Y(e).clientHeight&&i>=0},isElementInViewport:function(e){var t=X(e,!0),n=t.top,i=t.left,o=t.bottom,r=t.right,a=Y(e),u=a.clientWidth,s=a.clientHeight;return n>=0&&i>=0&&o<=s&&r<=u},passiveHandler:{passive:!0},passiveHandlerLegacy:q,getElementAnimationDuration:I,getElementAnimationDurationLegacy:B,getElementAnimationDelay:x,getElementAnimationDelayLegacy:P,getElementTransitionDuration:j,getElementTransitionDurationLegacy:V,getElementTransitionDelay:F,getElementTransitionDelayLegacy:R,getNodeScroll:function(e){var t="scrollX"in e;return{x:t?e.scrollX:e.scrollLeft,y:t?e.scrollY:e.scrollTop}},getParentNode:function(e){return"HTML"===e.nodeName?e:e.assignedSlot||e.parentNode||(J(e)?e.host:null)||Y(e)},getRectRelativeToOffsetParent:function(e,t,n){var i=t instanceof HTMLElement,o=X(e,i&&$(t)),r={x:0,y:0};if(i){var a=X(t,!0);r.x=a.x+t.clientLeft,r.y=a.y+t.clientTop}return{x:o.left+n.x-r.x,y:o.top+n.y-r.y,width:o.width,height:o.height}},getWindow:Z,isArray:function(e){return Array.isArray(e)},isString:function(e){return"string"==typeof e},isCustomElement:ne,isElement:function(e){return e instanceof Element},isNode:function(e){return e instanceof Node},isHTMLElement:function(e){return e instanceof HTMLElement},isHTMLImageElement:function(e){return e instanceof HTMLImageElement},isSVGElement:function(e){return e instanceof SVGElement},isNodeList:function(e){return e instanceof NodeList},isHTMLCollection:function(e){return e instanceof HTMLCollection},isScaledElement:$,isTableElement:function(e){return["TABLE","TD","TH"].includes(e.tagName)},isShadowRoot:J,isDocument:function(e){return e instanceof Document},isElementsArray:function(e){return Array.isArray(e)&&e.every((function(e){return[HTMLElement,Element].some((function(t){return e instanceof t}))}))},isWindow:function(e){return e instanceof Window},isMedia:function(e){return e&&[SVGElement,HTMLImageElement,HTMLVideoElement].some((function(t){return e instanceof t}))},isRTL:function(e){return"rtl"===Y(e).dir},closest:function e(t,n){return t?t.closest(n)||e(t.getRootNode().host,n):null},documentAll:oe,querySelector:M,getCustomElements:function(e){var t=e&&"object"==typeof e?ie("*",e):oe;return[].concat(t).filter(ne)},getElementById:function(e){return S().getElementById(e)},querySelectorAll:function(e,t){return("object"!=typeof t?S():t).querySelectorAll(e)},getElementsByClassName:function(e,t){return("object"!=typeof t?S():t).getElementsByClassName(e)},getElementsByTagName:ie,matches:function(e,t){return e.matches(t)},matchesLegacy:function(e,t){return ae.call(e,t)},normalizeValue:W,normalizeOptions:function(e,t,n,i){var o=Object.assign({},e.dataset),r={},a={};return Q(o).forEach((function(e){var t=i&&e.includes(i)?e.replace(i,"").replace(/[A-Z]/,(function(e){return U(e)})):e;a[t]=W(o[e])})),Q(n).forEach((function(e){n[e]=W(n[e])})),Q(t).forEach((function(i){r[i]=i in n?n[i]:i in a?a[i]:"title"===i?T(e,"title"):t[i]})),r},tryWrapper:function(e,t){try{e()}catch(e){throw TypeError(t+" "+e)}},reflow:function(e){return e.offsetHeight},noop:function(){},focus:function(e){return e.focus()},getUID:function e(t,n){var i=n?_:ee;if(n){var o=e(t),r=te.get(o)||new Map;te.has(o)||te.set(o,r),r.has(n)?i=r.get(n):(r.set(n,i),_+=1)}else{var a=t.id||t;te.has(a)?i=te.get(a):(te.set(a,i),ee+=1)}return i},ArrayFrom:function(e){return Array.from(e)},Float32ArrayFrom:function(e){return Float32Array.from(Array.from(e))},Float64ArrayFrom:function(e){return Float64Array.from(Array.from(e))},ObjectAssign:z,ObjectKeys:Q,ObjectValues:function(e){return Object.values(e)},OriginalEvent:function(e,t){var n=new CustomEvent(e,{cancelable:!0,bubbles:!0});return t instanceof Object&&z(n,t),n},getBoundingClientRect:X,getDocument:S,getDocumentBody:function(e){return S(e).body},getDocumentElement:Y,getDocumentHead:function(e){return S(e).head},getElementStyle:H,setElementStyle:function(e,t){z(e.style,t)},hasAttribute:function(e,t){return e.hasAttribute(t)},hasAttributeNS:function(e,t,n){return t.hasAttributeNS(e,n)},getAttribute:T,getAttributeNS:function(e,t,n){return t.getAttributeNS(e,n)},setAttribute:function(e,t,n){return e.setAttribute(t,n)},setAttributeNS:function(e,t,n,i){return t.setAttributeNS(e,n,i)},removeAttribute:function(e,t){return e.removeAttribute(t)},removeAttributeNS:function(e,t,n){return t.removeAttributeNS(e,n)},Version:"1.0.1"}}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@thednp/shorty",
3
- "version": "1.0.0",
4
- "description": "JavaScript shorties.",
3
+ "version": "1.0.1",
4
+ "description": "ES6 JavaScript shorties",
5
5
  "main": "dist/shorty.min.js",
6
6
  "module": "dist/shorty.esm.js",
7
7
  "jsnext": "src/index.js",
package/src/index.js CHANGED
@@ -236,8 +236,6 @@ import isWindow from './is/isWindow';
236
236
  // selectors
237
237
  import closest from './selectors/closest';
238
238
  import documentAll from './selectors/documentAll';
239
- import elementNodes from './selectors/elementNodes';
240
- import parentNodes from './selectors/parentNodes';
241
239
  import querySelector from './selectors/querySelector';
242
240
  import getCustomElements from './selectors/getCustomElements';
243
241
  import getElementById from './selectors/getElementById';
@@ -428,8 +426,6 @@ const SHORTER = {
428
426
  isWindow,
429
427
  isMedia,
430
428
  isRTL,
431
- elementNodes,
432
- parentNodes,
433
429
  closest,
434
430
  documentAll,
435
431
  querySelector,
@@ -1,6 +1,5 @@
1
1
  import documentAll from './documentAll';
2
2
  import isCustomElement from '../is/isCustomElement';
3
- import parentNodes from './parentNodes';
4
3
  import getElementsByTagName from './getElementsByTagName';
5
4
 
6
5
  /**
@@ -12,7 +11,7 @@ import getElementsByTagName from './getElementsByTagName';
12
11
  * @returns {Array<HTMLElement | Element>} the query result
13
12
  */
14
13
  export default function getCustomElements(parent) {
15
- const collection = parent && parentNodes.some((x) => parent instanceof x)
14
+ const collection = parent && typeof parent === 'object'
16
15
  ? getElementsByTagName('*', parent) : documentAll;
17
16
  return [...collection].filter(isCustomElement);
18
17
  }
@@ -9,7 +9,6 @@ import getDocument from '../get/getDocument';
9
9
  * @return {HTMLCollectionOf<HTMLElement | Element>} the 'HTMLCollection'
10
10
  */
11
11
  export default function getElementsByClassName(selector, parent) {
12
- const method = 'getElementsByClassName';
13
- const lookUp = parent && parent[method] ? parent : getDocument();
14
- return lookUp[method](selector);
12
+ const lookUp = typeof parent !== 'object' ? getDocument() : parent;
13
+ return lookUp.getElementsByClassName(selector);
15
14
  }
@@ -9,7 +9,6 @@ import getDocument from '../get/getDocument';
9
9
  * @return {HTMLCollectionOf<HTMLElement | Element>} the 'HTMLCollection'
10
10
  */
11
11
  export default function getElementsByTagName(selector, parent) {
12
- const method = 'getElementsByTagName';
13
- const lookUp = parent && parent[method] ? parent : getDocument();
14
- return lookUp[method](selector);
12
+ const lookUp = typeof parent !== 'object' ? getDocument() : parent;
13
+ return lookUp.getElementsByTagName(selector);
15
14
  }
@@ -4,12 +4,14 @@ import getDocument from '../get/getDocument';
4
4
  * Utility to check if target is typeof `HTMLElement`, `Element`, `Node`
5
5
  * or find one that matches a selector.
6
6
  *
7
- * @param {HTMLElement | Element | string} selector the input selector or target element
8
- * @param {(HTMLElement | Element | Document)=} parent optional node to look into
7
+ * @param {Node | HTMLElement | Element | string} selector the input selector or target element
8
+ * @param {(Node | HTMLElement | Element | Document)=} parent optional node to look into
9
9
  * @return {(HTMLElement | Element)?} the `HTMLElement` or `querySelector` result
10
10
  */
11
11
  export default function querySelector(selector, parent) {
12
- const method = 'querySelector';
13
- const lookUp = parent && parent[method] ? parent : getDocument();
14
- return selector[method] ? selector : lookUp[method](selector);
12
+ if (typeof selector === 'string') {
13
+ const lookUp = typeof parent !== 'object' ? getDocument() : parent;
14
+ return lookUp.querySelector(selector);
15
+ }
16
+ return selector;
15
17
  }
@@ -8,7 +8,6 @@ import getDocument from '../get/getDocument';
8
8
  * @return {NodeListOf<HTMLElement | Element>} the query result
9
9
  */
10
10
  export default function querySelectorAll(selector, parent) {
11
- const method = 'querySelectorAll';
12
- const lookUp = parent && parent[method] ? parent : getDocument();
13
- return lookUp[method](selector);
11
+ const lookUp = typeof parent !== 'object' ? getDocument() : parent;
12
+ return lookUp.querySelectorAll(selector);
14
13
  }
package/types/index.d.ts CHANGED
@@ -208,8 +208,6 @@ export { default as isString } from 'shorty/src/is/isString';
208
208
  export { default as isSVGElement } from 'shorty/src/is/isSVGElement';
209
209
  export { default as isTableElement } from 'shorty/src/is/isTableElement';
210
210
  export { default as isWindow } from 'shorty/src/is/isWindow';
211
- export { default as parentNodes } from 'shorty/src/selectors/parentNodes';
212
- export { default as elementNodes } from 'shorty/src/selectors/elementNodes';
213
211
  export { default as closest } from 'shorty/src/selectors/closest';
214
212
  export { default as documentAll } from 'shorty/src/selectors/documentAll';
215
213
  export { default as getCustomElements } from 'shorty/src/selectors/getCustomElements';
@@ -233,8 +233,6 @@ export { default as isTableElement } from '../../src/is/isTableElement';
233
233
  export { default as isWindow } from '../../src/is/isWindow';
234
234
 
235
235
  // selectors
236
- export { default as elementNodes } from '../../src/selectors/elementNodes';
237
- export { default as parentNodes } from '../../src/selectors/parentNodes';
238
236
  export { default as closest } from '../../src/selectors/closest';
239
237
  export { default as documentAll } from '../../src/selectors/documentAll';
240
238
  export { default as getCustomElements } from '../../src/selectors/getCustomElements';
package/types/shorty.d.ts CHANGED
@@ -1484,29 +1484,6 @@ declare module "shorty/src/class/hasClass" {
1484
1484
  */
1485
1485
  export default function hasClass(element: HTMLElement | Element, classNAME: string): boolean;
1486
1486
  }
1487
- declare module "shorty/src/selectors/parentNodes" {
1488
- export default parentNodes;
1489
- /**
1490
- * A global array of possible `ParentNode`.
1491
- */
1492
- const parentNodes: ({
1493
- new (): Document;
1494
- prototype: Document;
1495
- } | {
1496
- new (): Element;
1497
- prototype: Element;
1498
- })[];
1499
- }
1500
- declare module "shorty/src/selectors/elementNodes" {
1501
- export default elementNodes;
1502
- /**
1503
- * A global array with `Element` | `HTMLElement`.
1504
- */
1505
- const elementNodes: {
1506
- new (): Element;
1507
- prototype: Element;
1508
- }[];
1509
- }
1510
1487
  declare module "shorty/src/selectors/querySelector" {
1511
1488
  /**
1512
1489
  * Utility to check if target is typeof `HTMLElement`, `Element`, `Node`
@@ -2301,8 +2278,6 @@ declare module "shorty/types/module/SHORTY" {
2301
2278
  export { default as isSVGElement } from "shorty/src/is/isSVGElement";
2302
2279
  export { default as isTableElement } from "shorty/src/is/isTableElement";
2303
2280
  export { default as isWindow } from "shorty/src/is/isWindow";
2304
- export { default as elementNodes } from "shorty/src/selectors/elementNodes";
2305
- export { default as parentNodes } from "shorty/src/selectors/parentNodes";
2306
2281
  export { default as closest } from "shorty/src/selectors/closest";
2307
2282
  export { default as documentAll } from "shorty/src/selectors/documentAll";
2308
2283
  export { default as getCustomElements } from "shorty/src/selectors/getCustomElements";
@@ -1,5 +0,0 @@
1
- /**
2
- * A global array with `Element` | `HTMLElement`.
3
- */
4
- const elementNodes = [Element, HTMLElement];
5
- export default elementNodes;
@@ -1,5 +0,0 @@
1
- /**
2
- * A global array of possible `ParentNode`.
3
- */
4
- const parentNodes = [Document, Element, HTMLElement];
5
- export default parentNodes;