helper-js
Advanced tools
Comparing version 1.4.8 to 1.4.9
/*! | ||
* helper-js v1.4.8 | ||
* helper-js v1.4.9 | ||
* (c) phphe <phphe@outlook.com> (https://github.com/phphe) | ||
@@ -1169,3 +1169,3 @@ * Released under the MIT License. | ||
function getOffset(el) { | ||
var rect = el.getBoundingClientRect(); | ||
var rect = getBoundingClientRect(el); | ||
var scroll = getScroll(); | ||
@@ -1221,2 +1221,48 @@ return { | ||
} | ||
function getBoundingClientRect(el) { | ||
// refer: http://www.51xuediannao.com/javascript/getBoundingClientRect.html | ||
var xy = el.getBoundingClientRect(); | ||
var top = xy.top - document.documentElement.clientTop, | ||
//document.documentElement.clientTop 在IE67中始终为2,其他高级点的浏览器为0 | ||
bottom = xy.bottom, | ||
left = xy.left - document.documentElement.clientLeft, | ||
//document.documentElement.clientLeft 在IE67中始终为2,其他高级点的浏览器为0 | ||
right = xy.right, | ||
width = xy.width || right - left, | ||
//IE67不存在width 使用right - left获得 | ||
height = xy.height || bottom - top; | ||
var x = left; | ||
var y = top; | ||
return { | ||
top: top, | ||
right: right, | ||
bottom: bottom, | ||
left: left, | ||
width: width, | ||
height: height, | ||
x: x, | ||
y: y | ||
}; | ||
} | ||
var getViewportPosition = getBoundingClientRect; // todo not tested | ||
function viewportPositionToOffset(position) { | ||
var body = document.body; | ||
var bodyOf = getOffset(body); | ||
var bodyVP = getViewportPosition(body); | ||
return { | ||
x: position.x + bodyOf.x - bodyVP.x, | ||
y: position.y + bodyOf.y - bodyVP.y | ||
}; | ||
} // todo not tested | ||
function offsetToViewportPosition(offset) { | ||
var body = document.body; | ||
var bodyOf = getOffset(body); | ||
var bodyVP = getViewportPosition(body); | ||
return { | ||
x: offset.x + bodyVP.x - bodyOf.x, | ||
y: offset.y + bodyVP.y - bodyOf.y | ||
}; | ||
} | ||
function findParent(el, callback, opt) { | ||
@@ -2348,2 +2394,3 @@ var cur = opt && opt.withSelf ? el : el.parentElement; | ||
exports.getBorder = getBorder; | ||
exports.getBoundingClientRect = getBoundingClientRect; | ||
exports.getCss3Prefix = getCss3Prefix; | ||
@@ -2361,2 +2408,3 @@ exports.getElSize = getElSize; | ||
exports.getUserLanguage = getUserLanguage; | ||
exports.getViewportPosition = getViewportPosition; | ||
exports.glb = glb; | ||
@@ -2395,2 +2443,3 @@ exports.groupArray = groupArray; | ||
exports.offDOM = offDOM; | ||
exports.offsetToViewportPosition = offsetToViewportPosition; | ||
exports.onDOM = onDOM; | ||
@@ -2420,2 +2469,3 @@ exports.onDOMMany = onDOMMany; | ||
exports.unset = unset; | ||
exports.viewportPositionToOffset = viewportPositionToOffset; | ||
exports.waitFor = waitFor; | ||
@@ -2422,0 +2472,0 @@ exports.waitTime = waitTime; |
/*! | ||
* helper-js v1.4.8 | ||
* helper-js v1.4.9 | ||
* (c) phphe <phphe@outlook.com> (https://github.com/phphe) | ||
@@ -1165,3 +1165,3 @@ * Released under the MIT License. | ||
function getOffset(el) { | ||
var rect = el.getBoundingClientRect(); | ||
var rect = getBoundingClientRect(el); | ||
var scroll = getScroll(); | ||
@@ -1217,2 +1217,48 @@ return { | ||
} | ||
function getBoundingClientRect(el) { | ||
// refer: http://www.51xuediannao.com/javascript/getBoundingClientRect.html | ||
var xy = el.getBoundingClientRect(); | ||
var top = xy.top - document.documentElement.clientTop, | ||
//document.documentElement.clientTop 在IE67中始终为2,其他高级点的浏览器为0 | ||
bottom = xy.bottom, | ||
left = xy.left - document.documentElement.clientLeft, | ||
//document.documentElement.clientLeft 在IE67中始终为2,其他高级点的浏览器为0 | ||
right = xy.right, | ||
width = xy.width || right - left, | ||
//IE67不存在width 使用right - left获得 | ||
height = xy.height || bottom - top; | ||
var x = left; | ||
var y = top; | ||
return { | ||
top: top, | ||
right: right, | ||
bottom: bottom, | ||
left: left, | ||
width: width, | ||
height: height, | ||
x: x, | ||
y: y | ||
}; | ||
} | ||
var getViewportPosition = getBoundingClientRect; // todo not tested | ||
function viewportPositionToOffset(position) { | ||
var body = document.body; | ||
var bodyOf = getOffset(body); | ||
var bodyVP = getViewportPosition(body); | ||
return { | ||
x: position.x + bodyOf.x - bodyVP.x, | ||
y: position.y + bodyOf.y - bodyVP.y | ||
}; | ||
} // todo not tested | ||
function offsetToViewportPosition(offset) { | ||
var body = document.body; | ||
var bodyOf = getOffset(body); | ||
var bodyVP = getViewportPosition(body); | ||
return { | ||
x: offset.x + bodyVP.x - bodyOf.x, | ||
y: offset.y + bodyVP.y - bodyOf.y | ||
}; | ||
} | ||
function findParent(el, callback, opt) { | ||
@@ -2314,2 +2360,2 @@ var cur = opt && opt.withSelf ? el : el.parentElement; | ||
export { CrossWindow, CrossWindowEventProcessor, EventProcessor, URLHelper, addClass, arrayAt, arrayDiff, arrayDistinct, arrayFirst, arrayLast, arrayRemove, arrayRemoveBySortedIndexes, arraySibling, assignIfDifferent, backupAttr, binarySearch, camelCase, camelToWords, cloneObj, copyTextToClipboard, debounce, debounceImmediate, debounceTrailing, empty, executeOnceInScopeByName, executePromiseGetters, executeWithCount, findParent, forAll, getBorder, getCss3Prefix, getElSize, getImageSizeByUrl, getLocalStorage2, getOffset, getOffsetParent, getPosition, getPositionFromOffset, getScroll, getSessionStorage2, getUrlParam, getUserLanguage, glb, groupArray, hasClass, isArray, isBool, isDescendantOf, isFunction, isNumber, isNumeric, isObject, isOffsetInEl, isPromise, isString, isset, joinMethods, jqFixedSize, jqMakeCarousel, kebabCase, makeStorageHelper, mapObjectTree, mapObjects, max, min, newArrayRemoveAt, numPad, numRand, objectExcept, objectGet, objectMap, objectMerge, objectOnly, objectSet, offDOM, onDOM, onDOMMany, onQuickKeydown, openCenterWindow, openWindow, pairRows, promiseTimeout, removeClass, removeEl, replaceMultiple, resolveArgsByType, restoreAttr, retry, setElChildByIndex, snakeCase, splitArray, store, store_executeOnceInScopeByName, strRand, studlyCase, titleCase, toArrayIfNot, uniqueId, unset, waitFor, waitTime, watchChange, windowLoaded }; | ||
export { CrossWindow, CrossWindowEventProcessor, EventProcessor, URLHelper, addClass, arrayAt, arrayDiff, arrayDistinct, arrayFirst, arrayLast, arrayRemove, arrayRemoveBySortedIndexes, arraySibling, assignIfDifferent, backupAttr, binarySearch, camelCase, camelToWords, cloneObj, copyTextToClipboard, debounce, debounceImmediate, debounceTrailing, empty, executeOnceInScopeByName, executePromiseGetters, executeWithCount, findParent, forAll, getBorder, getBoundingClientRect, getCss3Prefix, getElSize, getImageSizeByUrl, getLocalStorage2, getOffset, getOffsetParent, getPosition, getPositionFromOffset, getScroll, getSessionStorage2, getUrlParam, getUserLanguage, getViewportPosition, glb, groupArray, hasClass, isArray, isBool, isDescendantOf, isFunction, isNumber, isNumeric, isObject, isOffsetInEl, isPromise, isString, isset, joinMethods, jqFixedSize, jqMakeCarousel, kebabCase, makeStorageHelper, mapObjectTree, mapObjects, max, min, newArrayRemoveAt, numPad, numRand, objectExcept, objectGet, objectMap, objectMerge, objectOnly, objectSet, offDOM, offsetToViewportPosition, onDOM, onDOMMany, onQuickKeydown, openCenterWindow, openWindow, pairRows, promiseTimeout, removeClass, removeEl, replaceMultiple, resolveArgsByType, restoreAttr, retry, setElChildByIndex, snakeCase, splitArray, store, store_executeOnceInScopeByName, strRand, studlyCase, titleCase, toArrayIfNot, uniqueId, unset, viewportPositionToOffset, waitFor, waitTime, watchChange, windowLoaded }; |
/*! | ||
* helper-js v1.4.8 | ||
* helper-js v1.4.9 | ||
* (c) phphe <phphe@outlook.com> (https://github.com/phphe) | ||
* Released under the MIT License. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self)["helper-js"]={})}(this,function(e){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t,n){return(l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function s(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var f={};function d(){if(f.glb)return f.glb;var e;try{e=global}catch(t){e=window}return f.glb=e,e}function v(e){return void 0!==e}function h(e){return"[object Array]"===Object.prototype.toString.call(e)}function p(e){return"[object Boolean]"===Object.prototype.toString.call(e)}function y(e){return"[object Number]"===Object.prototype.toString.call(e)}function g(e){return isFinite(e)&&!isNaN(parseFloat(e))}function m(e){return"[object String]"===Object.prototype.toString.call(e)}function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return"function"==typeof e}function x(e,t){return 1===arguments.length&&(t=e,e=0),Math.floor(Math.random()*(t-e+1)+e)}function O(e,t){return e<t?e:t}function S(e){return e&&e[0].toUpperCase()+e.substr(1)}function j(e){return e.replace(/ /g,"-").replace(/_/g,"-").replace(/([A-Z])/g,"-$1").replace(/--+/g,"-").replace(/^-|-$|/g,"").toLowerCase()}function k(e){for(var t=e.toString().split(/[-_]/),n=1;n<t.length;n++)t[n]=S(t[n]);return t.join("")}function E(e){return e.toString().trim().split(/(?=[A-Z])/)}function P(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=0;o<e;o++)n+=r[x(r.length-1)];return t+n}function T(e,t){for(var n,r=0;(n=e.indexOf(t))>-1;)e.splice(n,1),r++;return r}function A(e){return e[e.length-1]}function _(e){return h(e)?e:[e]}function C(e,t){var n=[];if(b(t))for(var r=t,o=1,i=0;i<e.length;){var a=i+r(o);n.push(e.slice(i,a)),i=a,o++}else for(var c=0;c<e.length;){var u=c+t;n.push(e.slice(c,u)),c=u}return n}function I(e,t,n){var r=h(t)?t:t.split("."),o=e;try{var i=!0,a=!1,c=void 0;try{for(var u,l=r[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){o=o[u.value]}}catch(e){a=!0,c=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw c}}}catch(e){if(n)throw"Path does not exist"}return o}function N(e,t){for(var n={},r=e.length,o=0;o<r;o++){var i=e[o];n[b(t)?t(i,o):i[t]]=i}return n}function L(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=[],a=[],c=function(){for(var c=this,u=arguments.length,l=new Array(u),f=0;f<u;f++)l[f]=arguments[f];return new Promise(function(u,f){i.push(u),a.push(f),r=l,n||(n=!0,t=setTimeout(function(){var o=e.call.apply(e,[c].concat(s(r)));t=null,n=!1,i.forEach(function(e){return e(o)}),i=[],a=[]},o))})};return c.stop=function(){t&&(clearTimeout(t),t=null),n=!1,i=[],a.forEach(function(e){return e()}),a=[]},c}function R(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=function(){var i=this;return new Promise(function(a,c){n?a(r):(n=!0,a(r=e.call.apply(e,[i].concat(s(lastArgs)))),t=setTimeout(function(){t=null,n=!1,r=null},o))})};return i.stop=function(){t&&(clearTimeout(t),t=null),n=!1},i}function M(){if("undefined"!=typeof pageYOffset)return{top:pageYOffset,left:pageXOffset};var e=document.body,t=document.documentElement;return{top:(t=t.clientHeight?t:e).scrollTop,left:t.scrollLeft}}function B(e){var t=e.getBoundingClientRect(),n=M();return{x:t.left+n.left,y:t.top+n.top}}function D(e){var t=e.offsetParent;return(!t||t===document.body&&"static"===getComputedStyle(document.body).position)&&(t=document.body.parentElement),t}function F(e,t,n){for(var r=n&&n.withSelf?e:e.parentElement;r;){var o=t(r);if("break"===o)return;if(o)return r;r=r.parentElement}}function H(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}function U(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];e.addEventListener?e.addEventListener.apply(e,[t,n].concat(o)):e.attachEvent&&e.attachEvent.apply(e,["on".concat(t),n].concat(o))}function W(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];e.removeEventListener?e.removeEventListener.apply(e,[t,n].concat(o)):e.detachEvent&&e.detachEvent.apply(e,["on".concat(t),n].concat(o))}function q(e,t,n,r,o){var i,a,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1e3;null==n&&(n=0,r=e.length-1);for(var u,l=0;n>=0&&n<=r;){if(l>=c)throw Error("binarySearch: loop times is over ".concat(c,", you can increase the limit."));if((u=t(a=e[i=Math.floor((r-n)/2+n)],l))>0)r=i-1;else{if(!(u<0))return{index:i,value:a,count:l+1,hit:!0};n=i+1}l++}return o?{index:i,value:a,count:l+1,hit:!1,bigger:u>0}:null}function z(e,t){return new Promise(function(n,r){setTimeout(function(){t&&t(),n()},e)})}function G(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};d().open(e,t,Object.keys(n).map(function(e){return"".concat(e,"=").concat(n[e])}).join(","))}var J=function(){function e(t){var r=this;n(this,e),i(this,"baseUrl",""),i(this,"search",{});var o=decodeURI(t).split("?");this.baseUrl=o[0],o[1]&&o[1].split("&").forEach(function(e){var t=e.split("=");r.search[t[0]]=null==t[1]?"":decodeURIComponent(t[1])})}return o(e,[{key:"getHref",value:function(){var e=this,t=[this.baseUrl],n=Object.keys(this.search).map(function(t){return"".concat(t,"=").concat(encodeURIComponent(e.search[t]))}).join("&");return n&&t.push(n),t.join("?")}}]),e}();function $(e){return{storage:e,set:function(e,t,n){null==t?this.storage.removeItem(e):this.storage.setItem(e,JSON.stringify({value:t,expired_at:n?(new Date).getTime()+60*n*1e3:null}))},get:function(e){var t=this.storage.getItem(e);if(t){if(!(t=JSON.parse(t)).expired_at||t.expired_at>(new Date).getTime())return t.value;this.storage.removeItem(e)}return null},clear:function(){this.storage.clear()}}}var Q=function(){function e(){n(this,e),i(this,"eventStore",[])}return o(e,[{key:"on",value:function(e,t){this.eventStore.push({name:e,handler:t})}},{key:"once",value:function(e,t){var n=this,r=function(){n.off(e,o)},o=function(){t.apply(void 0,arguments),r()};return this.on(e,o),r}},{key:"onceTimeout",value:function(e,t,n){var r,o=this;return{off:function(){r&&r()},promise:new Promise(function(i,a){r=o.once(e,function(){t.apply(void 0,arguments),i()}),z(n).then(function(){r(),a()})})}}},{key:"off",value:function(e,t){for(var n=[],r=this.eventStore.length,o=0;o<r;o++){var i=this.eventStore[o];i.name===e&&i.handler===t&&n.unshift(o)}for(var a=0,c=n;a<c.length;a++){var u=c[a];this.eventStore.splice(u,1)}}},{key:"emit",value:function(e){var t=[],n=!0,r=!1,o=void 0;try{for(var i,a=this.eventStore[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var c=i.value;c.name===e&&t.push(c)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}for(var u=arguments.length,l=new Array(u>1?u-1:0),s=1;s<u;s++)l[s-1]=arguments[s];for(var f=0,d=t;f<d.length;f++){var v=d[f];v.handler.apply(v,l)}}}]),e}(),Y=function(e){function t(e){var r,o,c;return n(this,t),o=this,c=a(t).call(this),r=!c||"object"!=typeof c&&"function"!=typeof c?u(o):c,i(u(r),"storageName","_crossWindow"),i(u(r),"windows",[]),i(u(r),"timeout",200),i(u(r),"BROADCAST","__BROADCAST__"),e&&Object.assign(u(r),e),U(window,"storage",function(e){if(e.key===r.storageName){var t,n=JSON.parse(e.newValue);if(!n.targets||n.targets.includes(r.id))(t=r).emitLocal.apply(t,[n.name].concat(s(n.args)))}}),r.id=P(),r.windows=[r.id],r.ready=new Promise(function(e,t){r.onceTimeout("_windows_updated",function(e){var t=e.windows;r.windows=t},r.timeout).promise.then(function(){e()},function(){e()}),r.broadcast("_join",r.id)}),r.ready.then(function(){r.on("_join",function(e){r.windows.push(e),r.isMain()&&r.broadcast("_windows_updated",{windows:r.windows,type:"join",id:e})}),r.on("_windows_updated",function(e){var t=e.windows;r.windows=t}),r.on("_exit",function(e){var t=r.windows[0];T(r.windows,e),r.isMain()&&(r.emit("_windows_updated",{windows:r.windows,type:"exit",id:e}),t!=r.id&&(console.log("_main_updated"),r.emit("_main_updated",{windows:r.windows,old:t,new:r.id})))}),U(window,"beforeunload",function(){r.exitGroup()})}),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,Q),o(t,[{key:"isMain",value:function(){return this.id===this.windows[0]}},{key:"emitTo",value:function(e,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];var c;n===this.BROADCAST?n=null:(n&&!h(n)&&(n=[n]),n.includes(this.id)&&(c=l(a(t.prototype),"emit",this)).call.apply(c,[this,e].concat(o)));d().localStorage.setItem(this.storageName,JSON.stringify({name:e,targets:n,args:o,random:Math.random()}))}},{key:"emitLocal",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.emitTo.apply(this,[e,this.id].concat(n))}},{key:"broadcast",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.emitTo.apply(this,[e,this.BROADCAST].concat(n))}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.emitTo.apply(this,[e,this.windows].concat(n))}},{key:"exitGroup",value:function(){this.broadcast("_exit",this.id)}}]),t}(),Z=Y;e.CrossWindow=Z,e.CrossWindowEventProcessor=Y,e.EventProcessor=Q,e.URLHelper=J,e.addClass=function(e,t){H(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)},e.arrayAt=function(e,t){return e[t>=0?t:e.length+t]},e.arrayDiff=function(e,t){for(var n=e.length,r=[];n--;)t.indexOf(e[n])<0&&r.push(e[n]);return r},e.arrayDistinct=function(e){return d().Set?s(new Set(e)):e.filter(function(e,t,n){return n.indexOf(e)===t})},e.arrayFirst=function(e){return e[0]},e.arrayLast=A,e.arrayRemove=T,e.arrayRemoveBySortedIndexes=function(e,t){for(var n=t.length-1;n>=0;n--){var r=t[n];e.splice(r,1)}},e.arraySibling=function(e,t,n){var r=e.indexOf(t);if(-1===r)throw"item is not in array";return h(n)?n.map(function(t){return e[r+t]}):e[r+n]},e.assignIfDifferent=function(e,t,n){e[t]!==n&&(e[t]=n)},e.backupAttr=function(e,t){e["original_".concat(t)]=e.getAttribute(t)},e.binarySearch=q,e.camelCase=k,e.camelToWords=E,e.cloneObj=function e(n,r){switch(t(n)){case"undefined":case"boolean":case"nuber":case"string":case"function":return n;case"object":if(null===n)return n;var o;if(h(n)){o=[];var i=!0,a=!1,c=void 0;try{for(var u,l=n[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var s=u.value;o.push(e(s,r))}}catch(e){a=!0,c=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw c}}}else{o={};for(var f=0,d=Object.keys(n);f<d.length;f++){var v=d[f];r&&(!h(r)||r.includes(v))&&r(v,n[v],n)||(o[v]=e(n[v],r))}}return o;default:return n}},e.copyTextToClipboard=function(e){try{return void navigator.clipboard.writeText(e)}catch(e){}var t=document.createElement("textarea");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="2em",t.style.height="2em",t.style.padding=0,t.style.border="none",t.style.outline="none",t.style.boxShadow="none",t.style.background="transparent",t.value=e,document.body.appendChild(t),t.select();try{var n=document.execCommand("copy")?"successful":"unsuccessful";console.log("Copying text command was "+n)}catch(e){console.log("Oops, unable to copy")}document.body.removeChild(t)},e.debounce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).immediate?R(e,t):L(e,t)},e.debounceImmediate=R,e.debounceTrailing=L,e.empty=function(e){return null==e||(null!=e.length?0===e.length:!p(e)&&(y(e)?isNaN(e):w(e)?0===Object.keys(e).length:void 0))},e.executeOnceInScopeByName=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:scope_executeOnceInScopeByName,r=arguments.length>3?arguments[3]:void 0;if(e="executeOnceInScopeByName_".concat(e),!n[e]){var o=t();n[e]={destroy:function(){delete n[e]}},r&&(n[e].value=o)}return n[e]},e.executePromiseGetters=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return{promise:new Promise(function(r,o){var i=[],a=C(e,n),c=Promise.resolve();a.forEach(function(e){c=c.then(function(n){if(n&&i.push.apply(i,s(n)),!t)return Promise.all(e.map(function(e){return e()}));o("stopped")})}),c.then(function(e){i.push.apply(i,s(e)),r(i)})}),destroy:function(){t=!0}}},e.executeWithCount=function(e){var t=0;return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.call.apply(e,[this,t++].concat(r))}},e.findParent=F,e.forAll=function(e,t,n){if(n){if(h(e)||m(e))for(var r=e.length-1;r>=0&&!1!==t(e[r],r);r--);else if(w(e)){var o=Object.keys(e);o.reverse();for(var i=0,a=o;i<a.length;i++){var c=a[i];if(!1===t(e[c],c))break}}else if(Number.isInteger(e))for(var u=e-1;u>=0&&!1!==t(u,u);u--);}else if(h(e)||m(e))for(var l=0;l<e.length&&!1!==t(e[l],l);l++);else if(w(e))for(var s=0,f=Object.keys(e);s<f.length;s++){var d=f[s];if(!1===t(e[d],d))break}else if(Number.isInteger(e))for(var v=0;v<e&&!1!==t(v,v);v++);},e.getBorder=function(e){var t=document.body,n=F(e,function(e){return H(e,"work-area")}),r=B(n);return{left:r.x,right:r.x+n.offsetWidth,top:r.y+50,bottom:t.offsetHeight<d().innerHeight?d().innerHeight:t.offsetHeight}},e.getCss3Prefix=function(){return((arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).noCache||null==f.css3Prefix)&&(f.css3Prefix=function(){var e=document.createElement("div");e.style.cssText="-webkit-transition:all .1s; -moz-transition:all .1s; -o-transition:all .1s; -ms-transition:all .1s; transition:all .1s;";var t=e.style;return t.webkitTransition?"-webkit-":t.MozTransition?"-moz-":t.oTransition?"-o-":t.msTransition?"-ms-":""}()),f.css3Prefix},e.getElSize=function(e){var t=e.style.display;e.style.display="block";var n={width:e.offsetWidth,height:e.offsetHeight};return e.style.display=t,n},e.getImageSizeByUrl=function(e){var t=document.createElement("img");return new Promise(function(n,r){U(t,"load",function(){n({width:t.width,height:t.height})}),U(t,"error",function(e){r(e)}),t.src=e})},e.getLocalStorage2=function(){return f.localStorage2||(f.localStorage2=$(d().localStorage)),f.localStorage2},e.getOffset=B,e.getOffsetParent=D,e.getPosition=function(e){for(var t=D(e),n={x:e.offsetLeft,y:e.offsetTop},r=e;(r=r.parentElement)!==t&&r;)n.x-=r.scrollLeft,n.y-=r.scrollTop;return n},e.getPositionFromOffset=function(e,t){var n=B(D(e));return{x:t.x-n.x,y:t.y-n.y}},e.getScroll=M,e.getSessionStorage2=function(){return f.sessionStorage2||(f.sessionStorage2=$(d().sessionStorage)),f.sessionStorage2},e.getUrlParam=function(e){var t=document.location.href,n=t.indexOf(e+"=");if(-1==n)return!1;var r=t.slice(e.length+n+1),o=r.indexOf("&");return-1!=o&&(r=r.slice(0,o)),r},e.getUserLanguage=function(){return navigator.language||navigator.userLanguage},e.glb=d,e.groupArray=function(e,t){var n=new Map;e.forEach(function(e){var r=t(e);n.has(r)||n.set(r,[]),n.get(r).push(e)});var r=[];return n.forEach(function(e,t){r.push([t,e])}),r},e.hasClass=H,e.isArray=h,e.isBool=p,e.isDescendantOf=function(e,t){for(;;){if(null==e.parentElement)return!1;if(e.parentElement===t)return!0;e=e.parentElement}},e.isFunction=b,e.isNumber=y,e.isNumeric=g,e.isObject=w,e.isOffsetInEl=function(e,t,n){var r=B(n);return r.x<=e&&r.x+n.offsetWidth>=e&&r.y<=t&&r.y+n.offsetHeight>=t},e.isPromise=function(e){return"[object Promise]"===Object.prototype.toString.call(e)},e.isString=m,e.isset=v,e.joinMethods=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value",r=!0,o=!1,i=void 0;try{for(var a,c=function(){var e=a.value,r=t;t=r?function(){for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return e.call.apply(e,[this,"value"===n?r.call.apply(r,[this].concat(o)):r].concat(o))}:e},u=e[Symbol.iterator]();!(r=(a=u.next()).done);r=!0)c()}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return t},e.jqFixedSize=function(e){var t=d().jQuery;t(e).each(function(){var e=t(this);e.css({width:e.width()+"px",height:e.height()+"px"})})},e.jqMakeCarousel=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:16,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"left",a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;o.toString().match(/^\d+$/)&&(o+="px");var c=parseFloat(o),u=d().jQuery,l=u(e),s=l.find(t);l.css({position:"relative",height:l.height()+"px"});var f=s.find(n);f.css({margin:"0",marginRight:o});var v=(Math.ceil(f.width())+c)*f.length;s.css({position:"absolute",margin:"0",width:v+"px"});var h=s.height(),p=s.clone(),y=s.clone();s.css({left:0}),p.css({left:v+"px"}),y.css({left:2*v+"px"});var g=u("<div></div>");g.css({position:"absolute",width:3*v+"px",height:h+"px",left:0,top:a}),g.append(s).append(p).append(y),l.append(g);var m=0;!function e(){"left"===i?m-=100:m+=100,g.animate({left:"".concat(m,"px")},r,"linear",function(){Math.abs(m)>v&&("left"===i?m+=v:m-=v,g.css({left:m+"px"})),e()})}()},e.kebabCase=j,e.makeStorageHelper=$,e.mapObjectTree=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4,o=0,i=[{value:e}],a=function(){if(o>=r)throw"mapObjectTree: limit(".concat(r,") reached, object may has circular reference");o++;var e=i.shift(),a=e.value,c=e.key,u=e.parent,l=e.newParent,s=t(a,c,u,l),f=function(e,t,r){return h(e)?e=[]:w(e)&&(e={}),u?h(l)&&r?l.push(e):l[t]=e:n=e,e},d=void 0,v=void 0,p=void 0,y=void 0,g=void 0;if(s){var m=s.key,b=s.value;v=b,s.delete||!1===m?p=!0:null==m?d=f(b,c,!0):s.hasOwnProperty("value")&&(d=f(b,m)),y=s.stop,g=s.skip}else v=a,d=f(a,c);if(p)return"continue";if(g)return"continue";if(y)return"break";if(h(v))for(var x=v.length,O=0;O<x;O++)i.push({value:v[O],key:O,parent:v,newParent:d});else w(v)&&Object.keys(v).forEach(function(e){i.push({value:v[e],key:e,parent:v,newParent:d})})};e:for(;i.length>0;)switch(a()){case"continue":continue;case"break":break e}return n},e.mapObjects=N,e.max=O,e.min=function(e,t){return e<t?t:e},e.newArrayRemoveAt=function(e,t){t=_(t);var n={},r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done);r=!0)n[a.value]=!0}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}for(var u=[],l=e.length,s=0;s<l;s++)n[s]||u.push(e[s]);return u},e.numPad=function(e,t){for(var n=e.toString().length;n<t;)e="0"+e,n++;return e},e.numRand=x,e.objectExcept=function(e,t){var n={};for(var r in e)-1===t.indexOf(r)&&(n[r]=e[r]);return n},e.objectGet=I,e.objectMap=function(e,t){var n={};for(var r in e)n[r]=t(e[r],r,e);return n},e.objectMerge=function(e,t){for(var n in t)e.hasOwnProperty(n)&&w(e[n])&&w(t[n])?Object.assign(e[n],t[n]):e[n]=t[n];return e},e.objectOnly=function(e,t){var n={};for(var r in e)t.indexOf(r)>-1&&(n[r]=e[r]);return n},e.objectSet=function(e,t,n){var r=h(t)?t:t.split("."),o=A(r),i=I(e,r.slice(0,r.length-1));if(!i)throw"Path does not exist";i[o]=n},e.offDOM=W,e.onDOM=U,e.onDOMMany=function(e,t,n){e=_(e),t=_(t);for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];var a=!0,c=!1,u=void 0;try{for(var l,s=e[Symbol.iterator]();!(a=(l=s.next()).done);a=!0){var f=l.value,d=!0,v=!1,h=void 0;try{for(var p,y=t[Symbol.iterator]();!(d=(p=y.next()).done);d=!0){var g=p.value;U.apply(void 0,[f,g,n].concat(o))}}catch(e){v=!0,h=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw h}}}}catch(e){c=!0,u=e}finally{try{a||null==s.return||s.return()}finally{if(c)throw u}}return function(){var r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done);r=!0){var u=a.value,l=!0,s=!1,f=void 0;try{for(var d,v=t[Symbol.iterator]();!(l=(d=v.next()).done);l=!0)W(u,d.value,n)}catch(e){s=!0,f=e}finally{try{l||null==v.return||v.return()}finally{if(s)throw f}}}}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}}},e.onQuickKeydown=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Object.assign({timeout:1e3},t);var n,r="",o=function(o){o.key&&1===o.key.length&&(r="".concat(r).concat(o.key),e(r),n&&(clearTimeout(n),n=null),setTimeout(function(){r=""},t.timeout))};return U(document,"keydown",o),function(){W(document,"keydown",o)}},e.openCenterWindow=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i={width:n,height:r,top:(d().screen.availHeight-30-r)/2,left:(d().screen.availWidth-30-n)/2};Object.assign(i,o),G(e,t,i)},e.openWindow=G,e.pairRows=function(e,t,n,r){r||(r=n);var o=N(t,r);return e.map(function(e){return[e,o[e[n]]]})},e.promiseTimeout=function(e,t){return new Promise(function(n,r){var o,i;e.then(function(){clearTimeout(o),n.apply(void 0,arguments)},function(){i||(clearTimeout(o),r.apply(void 0,arguments))}),o=setTimeout(function(){i=!0;var e=new Error("Promise timeout!");e.name="timeout",r(e)},t)})},e.removeClass=function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")},e.removeEl=function(e){if(null!==e.parentNode)return e.parentNode.removeChild(e)},e.replaceMultiple=function(e,t){var n=new RegExp(Object.keys(e).join("|"),"g");return t.replace(n,function(t){return e[t]})},e.resolveArgsByType=function(e,t){var n=0;return t.map(function(t){var r,o;if(h(t)?(r=t[0],o=t[1]):(r=t,o=void 0),!b(r))if(null==r)r=function(){return!0};else{var i=r;r=function(e){return Object.prototype.toString.call(e)==="[object ".concat(i,"]")}}var a=e[n];return r(a)?(n++,a):o})},e.restoreAttr=function(e,t){var n="original_".concat(t);e.setAttribute(t,e[n])},e.retry=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;f.retry||(f.retry={});var r=e,o=function e(){var t=Math.random()+"";return r[t]?e():t}();return r[o]=0,function e(i,a,c){return t(i,a,c).then(function(e){return delete r[o],e}).catch(function(t){return r[o]++,r[o]>=n?(delete r[o],Promise.reject(t)):e(i,a,c)})}},e.setElChildByIndex=function(e,t,n){n.childComponentIndex=t;var r=e.childNodes.length;if(0===r)e.appendChild(n);else if(0===t)e.insertBefore(n,e.childNodes[0]);else{var o=q(e.childNodes,function(e){return e.childComponentIndex-t},0,O(t,r-1),!0),i=o.index,a=o.value;if(o.bigger)e.insertBefore(n,a);else{var c=e.childNodes[i+1];c?e.insertBefore(n,c):e.appendChild(n)}}},e.snakeCase=function(e){return j(e).replace(/-/g,"_")},e.splitArray=C,e.store=f,e.store_executeOnceInScopeByName={},e.strRand=P,e.studlyCase=S,e.titleCase=function(e){return E(S(k(e))).join(" ").replace(/\bid\b/gi,"ID")},e.toArrayIfNot=_,e.uniqueId=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id_",n=t+P();f.uniqueId||(f.uniqueId={});var r=f.uniqueId;return document.getElementById(n)||r[n]?e(t):(r[n]=!0,n)},e.unset=function(e,t){e[t]=void 0;try{delete e[t]}catch(e){}},e.waitFor=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3;b(e)&&(r=n,n=g(t)?t:100,t=e,e=null),f.waitFor||(f.waitFor={});var o=f.waitFor;return e&&v(o[e])&&(d().clearInterval(o[e]),delete o[e]),new Promise(function(i,a){var c=0;function u(n){c<=r?t()&&(l(n,e),i()):(l(n,e),a(new Error("waitFor: Limit is reached"))),c++}function l(e,t){e&&(t&&v(o[t])?(d().clearInterval(o[t]),delete o[t]):d().clearInterval(e))}var s=d().setInterval(function(){u(s)},n);e&&(o[e]=s),u()})},e.waitTime=z,e.watchChange=function(e,t){var n;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=e.apply(void 0,o);n!==a&&t.apply(void 0,[a].concat(o)),n=a}},e.windowLoaded=function(){return new Promise(function(e,t){document&&"complete"===document.readyState?e():d().addEventListener("load",function t(){e(),d().removeEventListener("load",t)})})},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self)["helper-js"]={})}(this,function(e){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t,n){return(l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function f(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var s={};function d(){if(s.glb)return s.glb;var e;try{e=global}catch(t){e=window}return s.glb=e,e}function v(e){return void 0!==e}function h(e){return"[object Array]"===Object.prototype.toString.call(e)}function p(e){return"[object Boolean]"===Object.prototype.toString.call(e)}function y(e){return"[object Number]"===Object.prototype.toString.call(e)}function g(e){return isFinite(e)&&!isNaN(parseFloat(e))}function m(e){return"[object String]"===Object.prototype.toString.call(e)}function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return"function"==typeof e}function x(e,t){return 1===arguments.length&&(t=e,e=0),Math.floor(Math.random()*(t-e+1)+e)}function O(e,t){return e<t?e:t}function S(e){return e&&e[0].toUpperCase()+e.substr(1)}function j(e){return e.replace(/ /g,"-").replace(/_/g,"-").replace(/([A-Z])/g,"-$1").replace(/--+/g,"-").replace(/^-|-$|/g,"").toLowerCase()}function k(e){for(var t=e.toString().split(/[-_]/),n=1;n<t.length;n++)t[n]=S(t[n]);return t.join("")}function P(e){return e.toString().trim().split(/(?=[A-Z])/)}function E(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=0;o<e;o++)n+=r[x(r.length-1)];return t+n}function T(e,t){for(var n,r=0;(n=e.indexOf(t))>-1;)e.splice(n,1),r++;return r}function A(e){return e[e.length-1]}function _(e){return h(e)?e:[e]}function C(e,t){var n=[];if(b(t))for(var r=t,o=1,i=0;i<e.length;){var a=i+r(o);n.push(e.slice(i,a)),i=a,o++}else for(var c=0;c<e.length;){var u=c+t;n.push(e.slice(c,u)),c=u}return n}function I(e,t,n){var r=h(t)?t:t.split("."),o=e;try{var i=!0,a=!1,c=void 0;try{for(var u,l=r[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){o=o[u.value]}}catch(e){a=!0,c=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw c}}}catch(e){if(n)throw"Path does not exist"}return o}function N(e,t){for(var n={},r=e.length,o=0;o<r;o++){var i=e[o];n[b(t)?t(i,o):i[t]]=i}return n}function L(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=[],a=[],c=function(){for(var c=this,u=arguments.length,l=new Array(u),s=0;s<u;s++)l[s]=arguments[s];return new Promise(function(u,s){i.push(u),a.push(s),r=l,n||(n=!0,t=setTimeout(function(){var o=e.call.apply(e,[c].concat(f(r)));t=null,n=!1,i.forEach(function(e){return e(o)}),i=[],a=[]},o))})};return c.stop=function(){t&&(clearTimeout(t),t=null),n=!1,i=[],a.forEach(function(e){return e()}),a=[]},c}function R(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=function(){var i=this;return new Promise(function(a,c){n?a(r):(n=!0,a(r=e.call.apply(e,[i].concat(f(lastArgs)))),t=setTimeout(function(){t=null,n=!1,r=null},o))})};return i.stop=function(){t&&(clearTimeout(t),t=null),n=!1},i}function M(){if("undefined"!=typeof pageYOffset)return{top:pageYOffset,left:pageXOffset};var e=document.body,t=document.documentElement;return{top:(t=t.clientHeight?t:e).scrollTop,left:t.scrollLeft}}function B(e){var t=F(e),n=M();return{x:t.left+n.left,y:t.top+n.top}}function D(e){var t=e.offsetParent;return(!t||t===document.body&&"static"===getComputedStyle(document.body).position)&&(t=document.body.parentElement),t}function F(e){var t=e.getBoundingClientRect(),n=t.top-document.documentElement.clientTop,r=t.bottom,o=t.left-document.documentElement.clientLeft,i=t.right;return{top:n,right:i,bottom:r,left:o,width:t.width||i-o,height:t.height||r-n,x:o,y:n}}var H=F;function U(e,t,n){for(var r=n&&n.withSelf?e:e.parentElement;r;){var o=t(r);if("break"===o)return;if(o)return r;r=r.parentElement}}function W(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}function q(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];e.addEventListener?e.addEventListener.apply(e,[t,n].concat(o)):e.attachEvent&&e.attachEvent.apply(e,["on".concat(t),n].concat(o))}function z(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];e.removeEventListener?e.removeEventListener.apply(e,[t,n].concat(o)):e.detachEvent&&e.detachEvent.apply(e,["on".concat(t),n].concat(o))}function G(e,t,n,r,o){var i,a,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1e3;null==n&&(n=0,r=e.length-1);for(var u,l=0;n>=0&&n<=r;){if(l>=c)throw Error("binarySearch: loop times is over ".concat(c,", you can increase the limit."));if((u=t(a=e[i=Math.floor((r-n)/2+n)],l))>0)r=i-1;else{if(!(u<0))return{index:i,value:a,count:l+1,hit:!0};n=i+1}l++}return o?{index:i,value:a,count:l+1,hit:!1,bigger:u>0}:null}function J(e,t){return new Promise(function(n,r){setTimeout(function(){t&&t(),n()},e)})}function $(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};d().open(e,t,Object.keys(n).map(function(e){return"".concat(e,"=").concat(n[e])}).join(","))}var Q=function(){function e(t){var r=this;n(this,e),i(this,"baseUrl",""),i(this,"search",{});var o=decodeURI(t).split("?");this.baseUrl=o[0],o[1]&&o[1].split("&").forEach(function(e){var t=e.split("=");r.search[t[0]]=null==t[1]?"":decodeURIComponent(t[1])})}return o(e,[{key:"getHref",value:function(){var e=this,t=[this.baseUrl],n=Object.keys(this.search).map(function(t){return"".concat(t,"=").concat(encodeURIComponent(e.search[t]))}).join("&");return n&&t.push(n),t.join("?")}}]),e}();function V(e){return{storage:e,set:function(e,t,n){null==t?this.storage.removeItem(e):this.storage.setItem(e,JSON.stringify({value:t,expired_at:n?(new Date).getTime()+60*n*1e3:null}))},get:function(e){var t=this.storage.getItem(e);if(t){if(!(t=JSON.parse(t)).expired_at||t.expired_at>(new Date).getTime())return t.value;this.storage.removeItem(e)}return null},clear:function(){this.storage.clear()}}}var Y=function(){function e(){n(this,e),i(this,"eventStore",[])}return o(e,[{key:"on",value:function(e,t){this.eventStore.push({name:e,handler:t})}},{key:"once",value:function(e,t){var n=this,r=function(){n.off(e,o)},o=function(){t.apply(void 0,arguments),r()};return this.on(e,o),r}},{key:"onceTimeout",value:function(e,t,n){var r,o=this;return{off:function(){r&&r()},promise:new Promise(function(i,a){r=o.once(e,function(){t.apply(void 0,arguments),i()}),J(n).then(function(){r(),a()})})}}},{key:"off",value:function(e,t){for(var n=[],r=this.eventStore.length,o=0;o<r;o++){var i=this.eventStore[o];i.name===e&&i.handler===t&&n.unshift(o)}for(var a=0,c=n;a<c.length;a++){var u=c[a];this.eventStore.splice(u,1)}}},{key:"emit",value:function(e){var t=[],n=!0,r=!1,o=void 0;try{for(var i,a=this.eventStore[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var c=i.value;c.name===e&&t.push(c)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}for(var u=arguments.length,l=new Array(u>1?u-1:0),f=1;f<u;f++)l[f-1]=arguments[f];for(var s=0,d=t;s<d.length;s++){var v=d[s];v.handler.apply(v,l)}}}]),e}(),Z=function(e){function t(e){var r,o,c;return n(this,t),o=this,c=a(t).call(this),r=!c||"object"!=typeof c&&"function"!=typeof c?u(o):c,i(u(r),"storageName","_crossWindow"),i(u(r),"windows",[]),i(u(r),"timeout",200),i(u(r),"BROADCAST","__BROADCAST__"),e&&Object.assign(u(r),e),q(window,"storage",function(e){if(e.key===r.storageName){var t,n=JSON.parse(e.newValue);if(!n.targets||n.targets.includes(r.id))(t=r).emitLocal.apply(t,[n.name].concat(f(n.args)))}}),r.id=E(),r.windows=[r.id],r.ready=new Promise(function(e,t){r.onceTimeout("_windows_updated",function(e){var t=e.windows;r.windows=t},r.timeout).promise.then(function(){e()},function(){e()}),r.broadcast("_join",r.id)}),r.ready.then(function(){r.on("_join",function(e){r.windows.push(e),r.isMain()&&r.broadcast("_windows_updated",{windows:r.windows,type:"join",id:e})}),r.on("_windows_updated",function(e){var t=e.windows;r.windows=t}),r.on("_exit",function(e){var t=r.windows[0];T(r.windows,e),r.isMain()&&(r.emit("_windows_updated",{windows:r.windows,type:"exit",id:e}),t!=r.id&&(console.log("_main_updated"),r.emit("_main_updated",{windows:r.windows,old:t,new:r.id})))}),q(window,"beforeunload",function(){r.exitGroup()})}),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,Y),o(t,[{key:"isMain",value:function(){return this.id===this.windows[0]}},{key:"emitTo",value:function(e,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];var c;n===this.BROADCAST?n=null:(n&&!h(n)&&(n=[n]),n.includes(this.id)&&(c=l(a(t.prototype),"emit",this)).call.apply(c,[this,e].concat(o)));d().localStorage.setItem(this.storageName,JSON.stringify({name:e,targets:n,args:o,random:Math.random()}))}},{key:"emitLocal",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.emitTo.apply(this,[e,this.id].concat(n))}},{key:"broadcast",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.emitTo.apply(this,[e,this.BROADCAST].concat(n))}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.emitTo.apply(this,[e,this.windows].concat(n))}},{key:"exitGroup",value:function(){this.broadcast("_exit",this.id)}}]),t}(),K=Z;e.CrossWindow=K,e.CrossWindowEventProcessor=Z,e.EventProcessor=Y,e.URLHelper=Q,e.addClass=function(e,t){W(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)},e.arrayAt=function(e,t){return e[t>=0?t:e.length+t]},e.arrayDiff=function(e,t){for(var n=e.length,r=[];n--;)t.indexOf(e[n])<0&&r.push(e[n]);return r},e.arrayDistinct=function(e){return d().Set?f(new Set(e)):e.filter(function(e,t,n){return n.indexOf(e)===t})},e.arrayFirst=function(e){return e[0]},e.arrayLast=A,e.arrayRemove=T,e.arrayRemoveBySortedIndexes=function(e,t){for(var n=t.length-1;n>=0;n--){var r=t[n];e.splice(r,1)}},e.arraySibling=function(e,t,n){var r=e.indexOf(t);if(-1===r)throw"item is not in array";return h(n)?n.map(function(t){return e[r+t]}):e[r+n]},e.assignIfDifferent=function(e,t,n){e[t]!==n&&(e[t]=n)},e.backupAttr=function(e,t){e["original_".concat(t)]=e.getAttribute(t)},e.binarySearch=G,e.camelCase=k,e.camelToWords=P,e.cloneObj=function e(n,r){switch(t(n)){case"undefined":case"boolean":case"nuber":case"string":case"function":return n;case"object":if(null===n)return n;var o;if(h(n)){o=[];var i=!0,a=!1,c=void 0;try{for(var u,l=n[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var f=u.value;o.push(e(f,r))}}catch(e){a=!0,c=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw c}}}else{o={};for(var s=0,d=Object.keys(n);s<d.length;s++){var v=d[s];r&&(!h(r)||r.includes(v))&&r(v,n[v],n)||(o[v]=e(n[v],r))}}return o;default:return n}},e.copyTextToClipboard=function(e){try{return void navigator.clipboard.writeText(e)}catch(e){}var t=document.createElement("textarea");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="2em",t.style.height="2em",t.style.padding=0,t.style.border="none",t.style.outline="none",t.style.boxShadow="none",t.style.background="transparent",t.value=e,document.body.appendChild(t),t.select();try{var n=document.execCommand("copy")?"successful":"unsuccessful";console.log("Copying text command was "+n)}catch(e){console.log("Oops, unable to copy")}document.body.removeChild(t)},e.debounce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).immediate?R(e,t):L(e,t)},e.debounceImmediate=R,e.debounceTrailing=L,e.empty=function(e){return null==e||(null!=e.length?0===e.length:!p(e)&&(y(e)?isNaN(e):w(e)?0===Object.keys(e).length:void 0))},e.executeOnceInScopeByName=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:scope_executeOnceInScopeByName,r=arguments.length>3?arguments[3]:void 0;if(e="executeOnceInScopeByName_".concat(e),!n[e]){var o=t();n[e]={destroy:function(){delete n[e]}},r&&(n[e].value=o)}return n[e]},e.executePromiseGetters=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return{promise:new Promise(function(r,o){var i=[],a=C(e,n),c=Promise.resolve();a.forEach(function(e){c=c.then(function(n){if(n&&i.push.apply(i,f(n)),!t)return Promise.all(e.map(function(e){return e()}));o("stopped")})}),c.then(function(e){i.push.apply(i,f(e)),r(i)})}),destroy:function(){t=!0}}},e.executeWithCount=function(e){var t=0;return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.call.apply(e,[this,t++].concat(r))}},e.findParent=U,e.forAll=function(e,t,n){if(n){if(h(e)||m(e))for(var r=e.length-1;r>=0&&!1!==t(e[r],r);r--);else if(w(e)){var o=Object.keys(e);o.reverse();for(var i=0,a=o;i<a.length;i++){var c=a[i];if(!1===t(e[c],c))break}}else if(Number.isInteger(e))for(var u=e-1;u>=0&&!1!==t(u,u);u--);}else if(h(e)||m(e))for(var l=0;l<e.length&&!1!==t(e[l],l);l++);else if(w(e))for(var f=0,s=Object.keys(e);f<s.length;f++){var d=s[f];if(!1===t(e[d],d))break}else if(Number.isInteger(e))for(var v=0;v<e&&!1!==t(v,v);v++);},e.getBorder=function(e){var t=document.body,n=U(e,function(e){return W(e,"work-area")}),r=B(n);return{left:r.x,right:r.x+n.offsetWidth,top:r.y+50,bottom:t.offsetHeight<d().innerHeight?d().innerHeight:t.offsetHeight}},e.getBoundingClientRect=F,e.getCss3Prefix=function(){return((arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).noCache||null==s.css3Prefix)&&(s.css3Prefix=function(){var e=document.createElement("div");e.style.cssText="-webkit-transition:all .1s; -moz-transition:all .1s; -o-transition:all .1s; -ms-transition:all .1s; transition:all .1s;";var t=e.style;return t.webkitTransition?"-webkit-":t.MozTransition?"-moz-":t.oTransition?"-o-":t.msTransition?"-ms-":""}()),s.css3Prefix},e.getElSize=function(e){var t=e.style.display;e.style.display="block";var n={width:e.offsetWidth,height:e.offsetHeight};return e.style.display=t,n},e.getImageSizeByUrl=function(e){var t=document.createElement("img");return new Promise(function(n,r){q(t,"load",function(){n({width:t.width,height:t.height})}),q(t,"error",function(e){r(e)}),t.src=e})},e.getLocalStorage2=function(){return s.localStorage2||(s.localStorage2=V(d().localStorage)),s.localStorage2},e.getOffset=B,e.getOffsetParent=D,e.getPosition=function(e){for(var t=D(e),n={x:e.offsetLeft,y:e.offsetTop},r=e;(r=r.parentElement)!==t&&r;)n.x-=r.scrollLeft,n.y-=r.scrollTop;return n},e.getPositionFromOffset=function(e,t){var n=B(D(e));return{x:t.x-n.x,y:t.y-n.y}},e.getScroll=M,e.getSessionStorage2=function(){return s.sessionStorage2||(s.sessionStorage2=V(d().sessionStorage)),s.sessionStorage2},e.getUrlParam=function(e){var t=document.location.href,n=t.indexOf(e+"=");if(-1==n)return!1;var r=t.slice(e.length+n+1),o=r.indexOf("&");return-1!=o&&(r=r.slice(0,o)),r},e.getUserLanguage=function(){return navigator.language||navigator.userLanguage},e.getViewportPosition=H,e.glb=d,e.groupArray=function(e,t){var n=new Map;e.forEach(function(e){var r=t(e);n.has(r)||n.set(r,[]),n.get(r).push(e)});var r=[];return n.forEach(function(e,t){r.push([t,e])}),r},e.hasClass=W,e.isArray=h,e.isBool=p,e.isDescendantOf=function(e,t){for(;;){if(null==e.parentElement)return!1;if(e.parentElement===t)return!0;e=e.parentElement}},e.isFunction=b,e.isNumber=y,e.isNumeric=g,e.isObject=w,e.isOffsetInEl=function(e,t,n){var r=B(n);return r.x<=e&&r.x+n.offsetWidth>=e&&r.y<=t&&r.y+n.offsetHeight>=t},e.isPromise=function(e){return"[object Promise]"===Object.prototype.toString.call(e)},e.isString=m,e.isset=v,e.joinMethods=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value",r=!0,o=!1,i=void 0;try{for(var a,c=function(){var e=a.value,r=t;t=r?function(){for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return e.call.apply(e,[this,"value"===n?r.call.apply(r,[this].concat(o)):r].concat(o))}:e},u=e[Symbol.iterator]();!(r=(a=u.next()).done);r=!0)c()}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return t},e.jqFixedSize=function(e){var t=d().jQuery;t(e).each(function(){var e=t(this);e.css({width:e.width()+"px",height:e.height()+"px"})})},e.jqMakeCarousel=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:16,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"left",a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;o.toString().match(/^\d+$/)&&(o+="px");var c=parseFloat(o),u=d().jQuery,l=u(e),f=l.find(t);l.css({position:"relative",height:l.height()+"px"});var s=f.find(n);s.css({margin:"0",marginRight:o});var v=(Math.ceil(s.width())+c)*s.length;f.css({position:"absolute",margin:"0",width:v+"px"});var h=f.height(),p=f.clone(),y=f.clone();f.css({left:0}),p.css({left:v+"px"}),y.css({left:2*v+"px"});var g=u("<div></div>");g.css({position:"absolute",width:3*v+"px",height:h+"px",left:0,top:a}),g.append(f).append(p).append(y),l.append(g);var m=0;!function e(){"left"===i?m-=100:m+=100,g.animate({left:"".concat(m,"px")},r,"linear",function(){Math.abs(m)>v&&("left"===i?m+=v:m-=v,g.css({left:m+"px"})),e()})}()},e.kebabCase=j,e.makeStorageHelper=V,e.mapObjectTree=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4,o=0,i=[{value:e}],a=function(){if(o>=r)throw"mapObjectTree: limit(".concat(r,") reached, object may has circular reference");o++;var e=i.shift(),a=e.value,c=e.key,u=e.parent,l=e.newParent,f=t(a,c,u,l),s=function(e,t,r){return h(e)?e=[]:w(e)&&(e={}),u?h(l)&&r?l.push(e):l[t]=e:n=e,e},d=void 0,v=void 0,p=void 0,y=void 0,g=void 0;if(f){var m=f.key,b=f.value;v=b,f.delete||!1===m?p=!0:null==m?d=s(b,c,!0):f.hasOwnProperty("value")&&(d=s(b,m)),y=f.stop,g=f.skip}else v=a,d=s(a,c);if(p)return"continue";if(g)return"continue";if(y)return"break";if(h(v))for(var x=v.length,O=0;O<x;O++)i.push({value:v[O],key:O,parent:v,newParent:d});else w(v)&&Object.keys(v).forEach(function(e){i.push({value:v[e],key:e,parent:v,newParent:d})})};e:for(;i.length>0;)switch(a()){case"continue":continue;case"break":break e}return n},e.mapObjects=N,e.max=O,e.min=function(e,t){return e<t?t:e},e.newArrayRemoveAt=function(e,t){t=_(t);var n={},r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done);r=!0)n[a.value]=!0}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}for(var u=[],l=e.length,f=0;f<l;f++)n[f]||u.push(e[f]);return u},e.numPad=function(e,t){for(var n=e.toString().length;n<t;)e="0"+e,n++;return e},e.numRand=x,e.objectExcept=function(e,t){var n={};for(var r in e)-1===t.indexOf(r)&&(n[r]=e[r]);return n},e.objectGet=I,e.objectMap=function(e,t){var n={};for(var r in e)n[r]=t(e[r],r,e);return n},e.objectMerge=function(e,t){for(var n in t)e.hasOwnProperty(n)&&w(e[n])&&w(t[n])?Object.assign(e[n],t[n]):e[n]=t[n];return e},e.objectOnly=function(e,t){var n={};for(var r in e)t.indexOf(r)>-1&&(n[r]=e[r]);return n},e.objectSet=function(e,t,n){var r=h(t)?t:t.split("."),o=A(r),i=I(e,r.slice(0,r.length-1));if(!i)throw"Path does not exist";i[o]=n},e.offDOM=z,e.offsetToViewportPosition=function(e){var t=document.body,n=B(t),r=H(t);return{x:e.x+r.x-n.x,y:e.y+r.y-n.y}},e.onDOM=q,e.onDOMMany=function(e,t,n){e=_(e),t=_(t);for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];var a=!0,c=!1,u=void 0;try{for(var l,f=e[Symbol.iterator]();!(a=(l=f.next()).done);a=!0){var s=l.value,d=!0,v=!1,h=void 0;try{for(var p,y=t[Symbol.iterator]();!(d=(p=y.next()).done);d=!0){var g=p.value;q.apply(void 0,[s,g,n].concat(o))}}catch(e){v=!0,h=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw h}}}}catch(e){c=!0,u=e}finally{try{a||null==f.return||f.return()}finally{if(c)throw u}}return function(){var r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done);r=!0){var u=a.value,l=!0,f=!1,s=void 0;try{for(var d,v=t[Symbol.iterator]();!(l=(d=v.next()).done);l=!0)z(u,d.value,n)}catch(e){f=!0,s=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw s}}}}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}}},e.onQuickKeydown=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Object.assign({timeout:1e3},t);var n,r="",o=function(o){o.key&&1===o.key.length&&(r="".concat(r).concat(o.key),e(r),n&&(clearTimeout(n),n=null),setTimeout(function(){r=""},t.timeout))};return q(document,"keydown",o),function(){z(document,"keydown",o)}},e.openCenterWindow=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i={width:n,height:r,top:(d().screen.availHeight-30-r)/2,left:(d().screen.availWidth-30-n)/2};Object.assign(i,o),$(e,t,i)},e.openWindow=$,e.pairRows=function(e,t,n,r){r||(r=n);var o=N(t,r);return e.map(function(e){return[e,o[e[n]]]})},e.promiseTimeout=function(e,t){return new Promise(function(n,r){var o,i;e.then(function(){clearTimeout(o),n.apply(void 0,arguments)},function(){i||(clearTimeout(o),r.apply(void 0,arguments))}),o=setTimeout(function(){i=!0;var e=new Error("Promise timeout!");e.name="timeout",r(e)},t)})},e.removeClass=function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")},e.removeEl=function(e){if(null!==e.parentNode)return e.parentNode.removeChild(e)},e.replaceMultiple=function(e,t){var n=new RegExp(Object.keys(e).join("|"),"g");return t.replace(n,function(t){return e[t]})},e.resolveArgsByType=function(e,t){var n=0;return t.map(function(t){var r,o;if(h(t)?(r=t[0],o=t[1]):(r=t,o=void 0),!b(r))if(null==r)r=function(){return!0};else{var i=r;r=function(e){return Object.prototype.toString.call(e)==="[object ".concat(i,"]")}}var a=e[n];return r(a)?(n++,a):o})},e.restoreAttr=function(e,t){var n="original_".concat(t);e.setAttribute(t,e[n])},e.retry=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;s.retry||(s.retry={});var r=e,o=function e(){var t=Math.random()+"";return r[t]?e():t}();return r[o]=0,function e(i,a,c){return t(i,a,c).then(function(e){return delete r[o],e}).catch(function(t){return r[o]++,r[o]>=n?(delete r[o],Promise.reject(t)):e(i,a,c)})}},e.setElChildByIndex=function(e,t,n){n.childComponentIndex=t;var r=e.childNodes.length;if(0===r)e.appendChild(n);else if(0===t)e.insertBefore(n,e.childNodes[0]);else{var o=G(e.childNodes,function(e){return e.childComponentIndex-t},0,O(t,r-1),!0),i=o.index,a=o.value;if(o.bigger)e.insertBefore(n,a);else{var c=e.childNodes[i+1];c?e.insertBefore(n,c):e.appendChild(n)}}},e.snakeCase=function(e){return j(e).replace(/-/g,"_")},e.splitArray=C,e.store=s,e.store_executeOnceInScopeByName={},e.strRand=E,e.studlyCase=S,e.titleCase=function(e){return P(S(k(e))).join(" ").replace(/\bid\b/gi,"ID")},e.toArrayIfNot=_,e.uniqueId=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id_",n=t+E();s.uniqueId||(s.uniqueId={});var r=s.uniqueId;return document.getElementById(n)||r[n]?e(t):(r[n]=!0,n)},e.unset=function(e,t){e[t]=void 0;try{delete e[t]}catch(e){}},e.viewportPositionToOffset=function(e){var t=document.body,n=B(t),r=H(t);return{x:e.x+n.x-r.x,y:e.y+n.y-r.y}},e.waitFor=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3;b(e)&&(r=n,n=g(t)?t:100,t=e,e=null),s.waitFor||(s.waitFor={});var o=s.waitFor;return e&&v(o[e])&&(d().clearInterval(o[e]),delete o[e]),new Promise(function(i,a){var c=0;function u(n){c<=r?t()&&(l(n,e),i()):(l(n,e),a(new Error("waitFor: Limit is reached"))),c++}function l(e,t){e&&(t&&v(o[t])?(d().clearInterval(o[t]),delete o[t]):d().clearInterval(e))}var f=d().setInterval(function(){u(f)},n);e&&(o[e]=f),u()})},e.waitTime=J,e.watchChange=function(e,t){var n;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=e.apply(void 0,o);n!==a&&t.apply(void 0,[a].concat(o)),n=a}},e.windowLoaded=function(){return new Promise(function(e,t){document&&"complete"===document.readyState?e():d().addEventListener("load",function t(){e(),d().removeEventListener("load",t)})})},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=helper-js.min.js.map |
{ | ||
"name": "helper-js", | ||
"version": "1.4.8", | ||
"version": "1.4.9", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/helper-js.cjs.js", |
@@ -122,2 +122,6 @@ # helper-js | ||
###### getPositionFromOffset (el, offset) // get position of a el if its offset is given. like jQuery.offset. | ||
###### getBoundingClientRect (el) // get size and position relative to viewport, return {top, right, bottom, left, width, height, x, y} | ||
###### getViewportPosition = getBoundingClientRect | ||
###### viewportPositionToOffset (position) // return {x, y} | ||
###### offsetToViewportPosition(offset) // return {x, y} | ||
###### findParent (el, callback, opt={withSelf: false}) // callback return 'break' to break loop | ||
@@ -124,0 +128,0 @@ ###### backupAttr (el, name) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
298571
6404
189