-
Notifications
You must be signed in to change notification settings - Fork 33
/
bbo.min.js
10 lines (9 loc) · 29.3 KB
/
bbo.min.js
1
2
3
4
5
6
7
8
9
10
/*
* bbo
* bbo is a utility library of zero dependencies for javascript.
* (c) 2011 - 2021
* https://github.com/tnfe/bbo.git
* version 1.1.26
*/
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(e=e||self).bbo=r()}(this,(function(){"use strict";function e(){return(e=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function r(e,r){return o(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(t.push(a.value),!r||t.length!==r);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return t}(e,r)||a(e,r)||c()}function t(e){return o(e)||i(e)||a(e)||c()}function n(e){return function(e){if(Array.isArray(e))return u(e)}(e)||i(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e){if(Array.isArray(e))return e}function i(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function a(e,r){if(e){if("string"==typeof e)return u(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?u(e,r):void 0}}function u(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){return Object.prototype.toString.call(e)}function f(e){return"[object String]"===l(e)}function s(e){return"[object Function]"===l(e)}var p=null;var d=null!==p?p:p="object"==typeof global&&global.Object===Object?global:"object"==typeof self&&self.Object===Object?self:new Function("return this")(),h=d.bbo;function v(e){return e?window.navigator.userAgent.toLowerCase():window.navigator.userAgent}function g(){return/iPad|iPhone|iPod/.test(v())}function m(){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(v("l"))}function y(){var e=v(),r=e.indexOf("MSIE ");if(r>0)return parseInt(e.substring(r+5,e.indexOf(".",r)),10);if(e.indexOf("Trident/")>0){var t=e.indexOf("rv:");return parseInt(e.substring(t+3,e.indexOf(".",t)),10)}var n=e.indexOf("Edge/");return n>0?parseInt(v.substring(n+5,e.indexOf(".",n)),10):""}function w(e,r){return Array.prototype.slice.call(e,r||0)}var b=()=>{};function x(e,r){return Object.prototype.hasOwnProperty.call(e,r)}function O(e,r,t){e.style[r]=t}function S(e,r,t){e.setAttribute(r,t)}var j=(e,r,t)=>{var n=document.createEvent(t||"HTMLEvents");n.initEvent(r,!0,!0),e.dispatchEvent(n)};function C(e){return document.getElementById(e)}function A(e,r,t,n){var o=document.createElement(e);return r&&S(o,"class",r),t&&(o.innerHTML=t),n&&S(o,"id",n),o}function M(e){return"[object Array]"===l(e)}function E(e){return"[object Map]"===l(e)}function P(e){return"[object Set]"===l(e)}function T(e){return null==e?0:M(e)||f(e)?e.length:E(e)||P(e)?e.size:Object.keys(e).length}var k=(e,r)=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase()===r;function I(e,r,t){if(!k(r,"array"))return!1;for(var n in r)if(t){if(e===r[n])return!0}else if(e==r[n])return!0;return!1}function R(e){var r=typeof e;return null!==e&&("object"===r||"function"===r)}var N=e=>R(e)&&!e.hasOwnProperty?{...e}:e,U=e=>e instanceof Date;function D(e){return null===e||(M(e)||f(e)?!e.length:R(e)?!Object.keys(e).length:E(e)||P(e)?!e.size:Object(e)!==e||!Object.keys(e).length)}var B=(e,r)=>{if(e===r)return{};if(!R(e)||!R(r))return r;var t=N(e),n=N(r),o=Object.keys(t).reduce((e,r)=>n.hasOwnProperty(r)?e:{...e,[r]:void 0},{});return U(t)||U(n)?t.valueOf()==n.valueOf()?{}:n:Object.keys(n).reduce((e,r)=>{if(!t.hasOwnProperty(r))return{...e,[r]:n[r]};var o=B(t[r],n[r]);return R(o)&&D(o)&&!U(o)?e:{...e,[r]:o}},o)},_=(e,r)=>{if(e===r||!R(e)||!R(r))return{};var t=N(e),n=N(r);return Object.keys(n).reduce((e,r)=>{if(t.hasOwnProperty(r)){var o=_(t[r],n[r]);return R(o)&&D(o)?e:{...e,[r]:o}}return{...e,[r]:n[r]}},{})},q=(e,r)=>{if(e===r||!R(e)||!R(r))return{};var t=N(e),n=N(r);return Object.keys(t).reduce((e,r)=>{if(n.hasOwnProperty(r)){var o=q(t[r],n[r]);return R(o)&&D(o)?e:{...e,[r]:o}}return{...e,[r]:void 0}},{})},L=(e,r)=>{if(e===r)return{};if(!R(e)||!R(r))return r;var t=N(e),n=N(r);return U(t)||U(n)?t.valueOf()==n.valueOf()?{}:n:Object.keys(n).reduce((e,r)=>{if(t.hasOwnProperty(r)){var o=L(t[r],n[r]);return R(o)&&D(o)&&!U(o)?e:{...e,[r]:o}}return e},{})},F=e=>{if(!e)return null;if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(r){return new Function("return "+("("+e+")"))()}},z=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32,r="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",t="",n=0;n<e;n++)t+=r.charAt(Math.floor(Math.random()*r.length));return t};function $(e){return"[object Number]"===l(e)}var J=(e,r,t)=>{var n=t&&t.raw?r:encodeURIComponent(r),o=encodeURIComponent(e)+"="+n;if(t){if(t.days){var i=new Date,a=24*t.days*3600*1e3;i.setTime(i.getTime()+a),o+="; expires="+i.toGMTString()}else if(t.hour){var u=new Date,c=3600*t.hour*1e3;u.setTime(u.getTime()+c),o+="; expires="+u.toGMTString()}else{var l=new Date;l.setTime(l.getTime()+31536e7),o+="; expires="+l.toGMTString()}t.path&&(o+="; path="+t.path),t.domain&&(o+="; domain="+t.domain),t.secure&&(o+="; true")}document.cookie=o},W=e=>{J(e,"",{hour:-1})},H=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.href,t=r.split("?");if(t.length>=2){for(var n=encodeURIComponent(e)+"=",o=t[1].split(/[&;]/g),i=o.length;i-- >0;)-1!==o[i].lastIndexOf(n,0)&&o.splice(i,1);return t[0]+(o.length>0?"?"+o.join("&"):"")}return r},V=e=>M(e)?e.map(e=>e.name+"="+e.value).join("&"):V(G(e)),G=e=>{var r=[];return Object.keys(e).forEach(t=>{M(e[t])?r=r.concat(e[t].map(e=>({name:t,value:e}))):r.push({name:t,value:e[t]})}),r};function Q(e){return clearInterval(e)}function X(e){var r=parseFloat(e);return r<10?"0"+r:String(r)}var Z=setTimeout;function K(e,r){var t=r.useCachedSetTimeout?Z:setTimeout;return new Promise(r=>{t(r,e)})}function Y(e,r){var t;return function(){return Promise.race([Promise.reject().catch(e),new Promise((function(e,n){t=setTimeout((function(){n("timeout.")}),r||8e3)}))]).then((function(e){return clearTimeout(t),e}),(function(e){return Promise.reject(e)}))}}var ee=(e,r,t)=>{var n=Math.random()*(r-e)+e;return t?Math.floor(n):n};function re(e){if(s(e))return e;var r=M(e)?[]:{};for(var t in e){var n=e[t],o={}.toString.call(n).slice(8,-1);r[t]="Array"==o||"Object"==o?re(n):"Date"==o?new Date(n.getTime()):"RegExp"==o?RegExp(n.source,te(n)):n}return r}function te(e){if("string"==typeof e.source.flags)return e.source.flags;var r=[];return e.global&&r.push("g"),e.ignoreCase&&r.push("i"),e.multiline&&r.push("m"),e.sticky&&r.push("y"),e.unicode&&r.push("u"),r.join("")}function ne(e){return"[object Boolean]"===l(e)}function oe(e){return M(e)||R(e)}function ie(e){return!e||!R(e)&&!s(e)}function ae(e,r){return e===r?0!==e||0!==r||1/e==1/r:e!=e&&r!=r}function ue(e){return"[object Symbol]"===l(e)}function ce(e){return null==e||null==e}function le(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length<2)return!1;for(var n in r)if(void 0!==r[(n=Number(n))+1])if(M(r[n])){if(!se(r[n],r[n+1]))return!1}else if(R(r[n])){if(!pe(r[n],r[n+1]))return!1}else if(U(r[n])){if(!de(r[n],r[n+1]))return!1}else if(r[n]!==r[n+1])return!1;return!0}function fe(e,r){for(var t in e){if(void 0===r[t])return!1;if(M(e[t])){if(!se(e[t],r[t]))return!1}else if(R(e[t])){if(!pe(e[t],r[t]))return!1}else if(U(e[t])){if(!de(e[t],r[t]))return!1}else if(e[t]!==r[t])return!1}return!0}function se(e,r){return!!M(r)&&(e.length===r.length&&fe(e,r))}function pe(e,r){if(!R(r))return!1;for(var t in r)if(void 0===e[t])return!1;return fe(e,r)}function de(e,r){return!(!U(r)||e.getTime()!==r.getTime())}function he(e,r){var t=[],n=0;if(M(e))for(;n<e.length;)t.push(r(e[n],n,e)),n+=1;else if(R(e))for(var o=Object.keys(e);n<o.length;){var i=o[n];t.push(r(e[i],i,e)),n+=1}return t}var ve=".".charCodeAt(0),ge=/\\(\\)?/g,me=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g;function ye(e){if(f(e)||ue(e))return e;var r=""+e;return"0"==r&&1/e==-1/0?"-0":r}function we(e,r){var t=0;if(M(e))for(;t<e.length;){if(!1===r(e[t],t,e))break;t+=1}else if(R(e))for(var n=Object.keys(e);t<n.length;){var o=n[t];if(!1===r(e[o],o,e))break;t+=1}}function be(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase()}var xe={version:"1.1.26",noConflict:function(){return this===d.bbo&&(d.bbo=h),this},ua:v,isIos:g,isIOS:g,isiPhone:function(){return/iPhone/.test(v())},isIPad:function(){return/iPad/.test(v())},isAndroid:function(){return v("l").indexOf("android")>-1},isMobile:m,isPC:function(){return!m()},isWeixin:function(){return/MicroMessenger/i.test(v("l"))},isNewsApp:function(){return/qqnews/.test(v())},isQQ:function(){return/qq\//.test(v("l"))},isQQbrowser:function(){return/mqqbrowser\//.test(v("l"))},isTenvideo:function(){return/qqlivebrowser/.test(v("l"))},isWeiShi:function(){return/weishi/.test(v("l"))},isIphoneXmodel:function(){if("undefined"!=typeof window&&window){var e=window,r=e.devicePixelRatio,t=e.screen,n=t.width,o=t.height;return[{devicePixelRatio:3,width:375,height:812},{devicePixelRatio:3,width:414,height:896},{devicePixelRatio:2,width:414,height:896}].some(e=>e.devicePixelRatio===r&&e.width===n&&e.height===o)}return!1},ieVersion:y,isIE:function(){return y()>0},args:w,noop:b,merge:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return[].concat(r).reduce((e,r)=>Object.keys(r).reduce((t,n)=>(e[n]=e.hasOwnProperty(n)?[].concat(e[n]).concat(r[n]):r[n],e),{}),{})},over:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.map(e=>e.apply(null,t))}},call:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return r=>r[e].apply(r,t)},hasOwnProperty:x,trigger:j,stopPropagation:e=>{var r=e||window.event;return r.stopPropagation?r.stopPropagation():r.cancelBubble=!0},g:C,gc:function(e){return document.getElementsByClassName(e)},c:A,query:function(e){return document.querySelector(e)},show:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return[].concat(r).forEach(e=>{e.style.display=""})},hide:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return[].concat(r).forEach(e=>{e.style.display="none"})},elementContains:(e,r)=>e!==r&&e.contains(r),getStyle:(e,r)=>getComputedStyle(e)[r],setStyle:O,attr:S,uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var r=16*Math.random()|0;return("x"===e?r:3&r|8).toString(16)}))},hash:function(e){var r,t=String(e),n=0;if(0===T(t))return n;for(r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r),n|=0;return n},judge:I,judgment:I,getType:e=>void 0===e?"undefined":null===e?"null":e.constructor.name.toLowerCase(),isTypeof:k,construct:function(){var e=arguments[0];return new(Function.prototype.bind.apply(e,arguments))},paramsName:function(e){return/\(\s*([\s\S]*?)\s*\)/.exec(e.toString())[1].split(/\s*,\s*/)},log:function(e,r){var t=C("_bbo_log");if(null===t&&(S(t=A("div"),"id","_bbo_log"),S(t,"style","position:fixed;left:0;top:0;z-index:9999;padding:4px;"),document.body.appendChild(t)),r)for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t.style[n]=r[n]);t.innerHTML=e},properObject:N,objectDiff:B,addedDiff:_,deletedDiff:q,updatedDiff:L,detailedDiff:(e,r)=>({added:_(e,r),deleted:q(e,r),updated:L(e,r)}),toJson:F,toJSON:F,tojson:F,jsonp:function(e,r,t){s(r)&&(t=r,r={}),r||(r={});var n,o,i=r.prefix||"bbo",a=r.name||i+z(10),u=r.param||"callback",c=null!=r.timeout?r.timeout:6e4,l=encodeURIComponent,f=document.getElementsByTagName("script")[0]||document.head;function p(){n.parentNode&&n.parentNode.removeChild(n),window[a]=void 0,o&&clearTimeout(o)}return c&&(o=setTimeout((function(){p(),t&&t(new Error("Timeout"))}),c)),window[a]=function(e){p(),t&&t(e,null)},console.log(e),e=(e+=(~e.indexOf("?")?"&":"?")+u+"="+l(a)).replace("?&","?"),(n=document.createElement("script")).src=e,f.parentNode.insertBefore(n,f),function(){window[a]&&p()}},cookie:()=>{function e(){for(var e=0,r={};e<arguments.length;e++){var t=arguments[e];for(var n in t)x(t,n)&&(r[n]=t[n])}return r}return function r(t){function n(r,o,i){var a;if(T(arguments)>1){if($((i=e({path:"/"},n.defaults,i)).expires)){var u=new Date;u.setMilliseconds(u.getMilliseconds()+864e5*i.expires),i.expires=u}try{a=JSON.stringify(o),/^[\{\[]/.test(a)&&(o=a)}catch(e){}return o=t.write?t.write(o,r):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),r=(r=(r=encodeURIComponent(String(r))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[r,"=",o,i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}r||(a={});for(var c=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,f=0;f<c.length;f++){var s=c[f].split("="),p=s.slice(1).join("=");'"'===p.charAt(0)&&(p=p.slice(1,-1));try{var d=s[0].replace(l,decodeURIComponent);if(p=t.read?t.read(p,d):t(p,d)||p.replace(l,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch(e){}if(r===d){a=p;break}r||(a[d]=p)}catch(e){}}return a}return n.set=n,n.get=function(e){return n.call(n,e)},n.getJson=n.getJSON=function(){return n.apply({json:!0},[].slice.call(arguments))},n.defaults={},n.remove=function(r,t){n(r,"",e(t,{expires:-1}))},n.withConverter=r,n}((function(){}))},setCookie:J,getCookie:e=>{for(var r=encodeURIComponent(e)+"=",t=document.cookie.split(";"),n=0;n<t.length;n++){for(var o=t[n];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(r))return decodeURIComponent(o.substring(r.length,o.length))}return null},deleteCookie:W,delCookie:W,parseCookie:e=>e.split(";").map(e=>e.split("=")).reduce((e,r)=>(e[decodeURIComponent(r[0].trim())]=decodeURIComponent(r[1].trim()),e),{}),open:e=>{var r="_bbo_open_proxy",t=C(r)||A("a",r,"",r);O(t,"display","none"),S(t,"href",e),S(t,"target","_blank"),t.parentNode||document.body.appendChild(t),j(t,"click","MouseEvents")},getUrlParam:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.href;e.replace(/[\[\]]/g,"\\$&");var t=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)"),n=t.exec(r);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},setUrlParam:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.location.href,n=new RegExp("([?&])"+e+"=.*?(&|$)","i"),o=-1!==t.indexOf("?")?"&":"?";return t.match(n)?t.replace(n,"$1"+e+"="+r+"$2"):t+o+e+"="+r},deleteUrlParam:H,delUrlParam:H,objectParam:V,httpGet:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:console.error,n=new XMLHttpRequest;n.open("GET",e,!0),n.onload=()=>r(n.responseText),n.onerror=()=>t(n),n.send()},httpPost:function(e,r,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:console.error,o=new XMLHttpRequest;o.open("POST",e,!0),o.setRequestHeader("Content-type","application/json; charset=utf-8"),o.onload=()=>t(o.responseText),o.onerror=()=>n(o),o.send(r)},setTimesout:function(){var e=arguments[0],r=void 0===arguments[1]?0:parseFloat(arguments[1]),t=void 0===arguments[2]?1:parseInt(arguments[2],10),n=arguments.length>3?w(arguments,3):null,o={index:0,times:t,over:!1},i=setInterval((function(){o.index++,o.index>t?Q(i):(o.index===t&&(o.over=!0),e.apply(o,n))}),r);return i},clearTimesout:Q,getDate:(e,r)=>{var t=new Date,n=t.getDate(),o=t.getMonth()+1,i=t.getFullYear(),a=t.getHours(),u=t.getMinutes(),c=t.getSeconds();n=X(n);var l=e||"/",f=r||":";return i+l+(o=X(o))+l+n+" "+(a=X(a))+f+(u=X(u))+f+(c=X(c))},formatPassTime:e=>{var r=Math.floor((new Date-e)/1e3),t=r/31536e3;return t>1?Math.floor(t)+" years":(t=r/2592e3)>1?Math.floor(t)+" months":(t=r/86400)>1?Math.floor(t)+" days":(t=r/3600)>1?Math.floor(t)+" hours":(t=r/60)>1?Math.floor(t)+" minutes":Math.floor(r)+" seconds"},formatRemainTime:e=>{var r=new Date,t=new Date(e).getTime()-r.getTime(),n=0,o=0,i=0,a=0;return t>=0&&(n=Math.floor(t/1e3/3600/24),o=Math.floor(t/1e3/60/60%24),i=Math.floor(t/1e3/60%60),a=Math.floor(t/1e3%60)),n+"day "+o+"hour "+i+"minute "+a+"second"},formatDuration:e=>{e<0&&(e=-e);var t={day:Math.floor(e/864e5),hour:Math.floor(e/36e5)%24,minute:Math.floor(e/6e4)%60,second:Math.floor(e/1e3)%60,millisecond:Math.floor(e)%1e3};return Object.entries(t).filter(e=>0!==e[1]).map(e=>{var t=r(e,2),n=t[0],o=t[1];return`${o} ${n}${1!==o?"s":""}`}).join(", ")},sleep:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.useCachedSetTimeout,n=K(e,{useCachedSetTimeout:t});function o(e){return n.then(()=>e)}return o.then=function(){return n.then.apply(n,arguments)},o.catch=Promise.resolve().catch,o},retry:function(e,r){var t=r||{},n=t.interval||400,o=t.retries||2,i=t.timeout||8e3;function a(e){return new Promise((function(r,t){setTimeout(t.bind(null,e),n)}))}for(var u=Promise.reject(),c=0;c<o;c++)u=u.catch(Y(e,i)).catch(a);return u},fill0:X,floor:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Math.floor(e*Math.pow(10,r))/Math.pow(10,r)},chainAsync:e=>{var r=0,t=e[e.length-1],n=()=>{var o=e[r++];o===t?o():o(n)};n()},numberFormat:(e,r,t,n)=>{var o=String(e).replace(/[^0-9+\-Ee.]/g,""),i=r,a=isFinite(Number(o))?Number(o):0,u=isFinite(Number(i))?Math.abs(i):0,c=void 0===n?",":n,l=void 0===t?".":t,f="";return(f=(u?function(e,r){if(-1===String(e).indexOf("e"))return Number(Math.round(e+"e+"+r)+"e-"+r);var t=String(e).split("e"),n="";return Number(t[1])+r>0&&(n="+"),Number(Math.round(Number(t[0])+"e"+n+(Number(t[1])+r))+"e-"+r).toFixed(r)}(a,u).toString():String(Math.round(a))).split("."))[0].length>3&&(f[0]=f[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,c)),(f[1]||"").length<u&&(f[1]=f[1]||"",f[1]+=new Array(u-f[1].length+1).join("0")),f.join(l)},modulo:function(e,r){return 0===r?e:r<0?NaN:(e%r+r)%r},randomColor:function(){return"#"+("00000"+(16777216*Math.random()<<0).toString(16)).slice(-6)},randomA2B:ee,randomFromA2B:ee,randomKey:z,lockTouch:()=>{function e(e,r){return e.target.tagName!==r.toUpperCase()&&e.target.tagName!==r.toLowerCase()}function r(r){e(r,"input")&&e(r,"textarea")&&e(r,"select")&&e(r,"menus")&&r.preventDefault()}document.addEventListener("touchmove",(function(e){e.preventDefault()}),!1),document.addEventListener("touchstart",r,!1),document.addEventListener("touchend",r,!1)},copyToClipboard:function(e){var r=document.createElement("textarea");r.value=e,S(r,"readonly",""),O(r,"position","absolute"),O(r,"left","-9999px"),document.body.appendChild(r);var t=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);r.select(),document.execCommand("copy"),document.body.removeChild(r),t&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(t))},clone:re,deepClone:re,values:function(e){var r=[];if(M(e))return e.slice(0);if(R(e)||s(e)){for(var t=Object.keys(e),n=t.length,o=0;o<n;o++)r.push(e[t[o]]);return r}throw new Error("argument to `values` must be an object")},entries:function(e){if(!R(e)&&!s(e)||null===e)throw new Error("argument to `entries` must be an object");var r=[];for(var t in e)e.hasOwnProperty(t)&&r.push([t,e[t]]);return r},extend:function e(){var r=[].slice.call(arguments),t=!1;ne(r[0])&&(t=r.shift());var n=r[0];if(ie(n))throw new Error("extendee must be an object");for(var o=r.slice(1),i=o.length,a=0;a<i;a++){var u=o[a];for(var c in u)if(u.hasOwnProperty(c)){var l=u[c];if(t&&oe(l)){var f=M(l)?[]:{};n[c]=e(!0,n.hasOwnProperty(c)&&!ie(n[c])?n[c]:f,l)}else n[c]=l}}return n},flush:function(e){var r,t,n;if(e){if(M(e)){for(r=[],t=e.length,n=0;n<t;n++){var o=e[n];null!=o&&r.push(o)}return r}if(R(e)){r={};var i=Object.keys(e);for(t=i.length,n=0;n<t;n++){var a=i[n],u=e[a];null!=u&&(r[a]=u)}return r}}},search:function(e,r,t){var n=!!t,o="";for(o in r)if(x(r,o)&&(n&&r[o]===e||!n&&r[o]==e))return o;return!1},size:T,getTag:l,is:ae,isObject:R,isDate:U,isArray:M,isString:f,isBoolean:ne,isNumber:$,isMap:E,isSet:P,isSymbol:ue,isFunction:s,isEmpty:D,isNil:ce,isShallowEqual:le,isEqual:le,has:function(e,r){return null!=e&&x(e,r)},reduce:function(e,r){var t=[o],n=2 in arguments;function o(t,o,i,a){return n||(t=e[a[0]],n=!0),r(t,o,e[o],i,a)}return n&&t.push(arguments[2]),Array.prototype.reduce.apply(Object.keys(e),t)},forEach:we,each:we,map:he,mapValues:function(e,r){for(var t={},n=Object.keys(e),o=n.length,i=0;i<o;i++){var a=n[i];t[a]=r(e[a],a,e)}return t},findIndex:function(e,r){var t=-1;return we(e,(e,n,o)=>{if(s(r)){if(!0===r(e,n,o))return t=n,!1}else{if(ae(e,r))return t=n,!1;if(R(e)&&R(r)){var i=!0;if(we(r,(r,t)=>i=le(e[t],r)),i)return t=n,!1}}}),t},find:function(e,r){var t=void 0;return we(e,(e,n,o)=>{if(s(r)){if(!0===r(e,n,o))return t=e,!1}else{if(ae(e,r))return t=e,!1;if(R(e)&&R(r)){var i=!0;if(we(r,(r,t)=>i=le(e[t],r)),i)return t=e,!1}}}),t},toPath:function(e){return M(e)?he(e,ye):ue(e)?[e]:re((r=String(e),t=[],r.charCodeAt(0)===ve&&t.push(""),r.replace(me,(e,r,n,o)=>{var i=e;n?i=o.replace(ge,"$1"):r&&(i=r.trim()),t.push(i)}),t));var r,t},get:function(e,r,t){if(!e)return t;var n,o;if(Array.isArray(r)&&(n=r.slice(0)),f(r)&&(n=r.split(".")),ue(r)&&(n=[r]),!M(n))throw new Error("props arg must be an array, a string or a symbol");for(;n.length;){if(o=n.shift(),!e)return t;if(void 0===(e=e[o]))return t}return e},set:function(e,r,t){f(r)&&(r=r.split(".")),ue(r)&&(r=[r]);var n,o=r.pop();if(!o)return!1;for(;n=r.shift();)if(void 0===e[n]&&(e[n]={}),!(e=e[n])||!R(e))return!1;return e[o]=t,!0},debounce:function(e,r,t){var n;return function(){if(!r)return e.apply(this,arguments);var o=this,i=arguments,a=t&&!n;return clearTimeout(n),n=setTimeout((function(){if(n=null,!a)return e.apply(o,i)}),r),a?e.apply(this,arguments):void 0}},throttle:function(e,r,t){var n=!1,o=!1;return function(){o=t&&!n;var i=this,a=arguments;if(n||(n=!0,setTimeout((function(){if(n=!1,!t)return e.apply(i,a)}),r)),o)return o=!1,e.apply(this,arguments)}},pick:function(e,r){var t={};f(r)&&(r=[].slice.call(arguments,1));for(var n=r.length,o=0;o<n;o++){var i=r[o];i in e&&(t[i]=e[i])}return t},omit:function(e,r){var t={};for(var n in f(r)&&(r=[].slice.call(arguments,1)),e)e.hasOwnProperty&&!e.hasOwnProperty(n)||-1===r.indexOf(n)&&(t[n]=e[n]);return t},trim:function(e){return D(e)?e:e.replace(/(^\s*)|(\s*$)/g,"")},fillZero:function(e,r){return(new Array(r).join("0")+e).slice(-r)},longUnique:function(e){for(var r={},t=0;t<e.length;t++)r[e[t]]||(r[e[t]]=-1);for(var n="",o=0;o<e.length;o++)r[e[o]]&&(r[e[o]]=0,n+=e[o]);return n},stripTags:function(e){return e.replace(/<script[^>]*>(\S\s*?)<\/script>/gim,"").replace(/<[^>]+>/g,"")},capitalize:function(e){return String(e).charAt(0).toUpperCase()+String(e).slice(1).toLowerCase()},deCapitalize:function(e){var r=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return ce(e)?r:f(e)?e:String(e)}(e);return""===r?"":r.substr(0,1).toLowerCase()+r.substr(1)},isAbsoluteURL:e=>/^[a-z][a-z0-9+.-]*:/.test(e),mapString:(e,r)=>e.split("").map((t,n)=>r(t,n,e)).join(""),mask:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"*";return(""+e).slice(-r).padStart((""+e).length,t)},splitLines:function(e){return e.split(/\r?\n/)},camelize:function(e){return e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,(function(e){return e.charAt(1).toUpperCase()}))},underscored:be,dasherize:function(e){return be(String(e)).replace(/_/g,"-")},truncate:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,t=T(e);return t>r?e.slice(0,r>3?r-3:r)+"...":e},byteSize:function(e){return new Blob([e]).size},byteLen:function(e,r){var t,n=0;if("utf-8"===r||"utf8"===r)for(var o=0,i=e.length;o<i;o++)(t=e.codePointAt(o))<=127?n+=1:t<=2047?n+=2:t<=65535?n+=3:(n+=4,o++);else if("utf-16"===r||"utf16"===r)for(var a=0,u=e.length;a<u;a++)(t=e.codePointAt(a))<=65535?n+=2:(n+=4,a++);else n=e.replace(/[^\x00-\xff]/g,"aa").length;return n},repeat:function(e,r){for(var t=String(e),n="";r>0&&(r%2==1&&(n+=t),1!==r);)t+=t,r>>=1;return n},endsWith:function(e,r,t){var n=e.slice(-r.length);return t?n.toLowerCase()===r.toLowerCase():n===r},startsWith:function(e,r,t){var n=String(e).slice(0,r.length);return t?n.toLowerCase()===r.toLowerCase():n===r},containsWith:function(e,r){return-1!==String(e).indexOf(r)},xssFilter:function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},effortIndex:function(e,r){return String(e).indexOf(r)},capwords:function(e){return String(e).replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g,(function(e){return e.toUpperCase()}))},unique:e=>n(new Set(e)),uniqueBy:(e,r)=>e.reduce((e,t)=>(e.some(e=>r(t,e))||e.push(t),e),[]),uniqueFrom:function(r,t){return Object.values(r.reduce((r,n)=>e(r,{[n[t]]:n}),{}))},random:e=>e[Math.floor(Math.random()*e.length)],randomSize:function(e){for(var r=t(e),n=r.slice(0),o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=n.length;i;){var a=Math.floor(Math.random()*i--),u=[n[a],n[i]];n[i]=u[0],n[a]=u[1]}return n.slice(0,o)},shuffle:function(e){for(var r=t(e).slice(0),n=r.length;n;){var o=Math.floor(Math.random()*n--),i=[r[o],r[n]];r[n]=i[0],r[o]=i[1]}return r},contains:function(e,r){return e.indexOf(r)>-1},copyArray:function(e,r){var t=-1,n=e.length;for(r||(r=new Array(n));++t<n;)r[t]=e[t];return r},includesAll:(e,r)=>r.every(r=>e.includes(r)),includesAny:(e,r)=>r.some(r=>e.includes(r)),removeAt:function(e,r){return!!e.splice(r,1).length},remove:function(e,r){if(!M(e)||!M(r))throw new Error("expected both arguments to be arrays");for(var t=[],n=e.length,o=0;o<n;o++){var i=e[o];-1===r.indexOf(i)&&t.push(i)}return t},compact:function(e){if(!M(e))throw new Error("expected an array");for(var r=[],t=e.length,n=0;n<t;n++){var o=e[n];o&&r.push(o)}return r},pluck:function(e,r){var t,n=[];return e.forEach((function(e){e[r]&&(t=e[r],n.push(t))})),n},union:(e,r)=>Array.from(new Set([].concat(n(e),n(r)))),unionBy:(e,r,t)=>{var o=new Set(e.map(t));return Array.from(new Set([].concat(n(e),n(r.filter(e=>!o.has(t(e)))))))},unionWith:(e,r,t)=>Array.from(new Set([].concat(n(e),n(r.filter(r=>-1===e.findIndex(e=>t(r,e))))))),intersect:function(e,r){var t=new Set(r);return e.filter(e=>t.has(e))},intersectBy:function(e,r,t){var n=new Set(r.map(t));return e.filter(e=>n.has(t(e)))},difference:function(e,r){var t=new Set(r);return e.filter(e=>!t.has(e))},differenceBy:function(e,r,t){var n=new Set(r.map(t));return e.map(t).filter(e=>!n.has(e))},max:function(e){return Math.max.apply(0,e)},min:function(e){return Math.min.apply(0,e)},equal:function(e,r){var t=T(e);if(t!==T(r))return!1;for(var n=0;n<t;n++)if(e[n]!==r[n])return!1;return!0},allEqual:e=>e.every(r=>r===e[0]),all:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Boolean;return e.every(r)},any:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Boolean;return e.some(r)},chunk:(e,r)=>Array.from({length:Math.ceil(e.length/r)},(t,n)=>e.slice(n*r,n*r+r)),countBy:(e,r)=>e.map(s(r)?r:e=>e[r]).reduce((e,r)=>(e[r]=(e[r]||0)+1,e),{}),countOccurrences:(e,r)=>e.reduce((e,t)=>t===r?e+1:e,0),drop:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.slice(r)},dropRight:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.slice(0,-r)},dropWhile:function(e,r){for(var t=e;t.length>0&&!r(t[0]);)t=t.slice(1);return t},dropRightWhile:function(e,r){for(var t=T(e);t--&&!r(e[t]););return e.slice(0,t+1)},column:function(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(null!==r&&(R(r)||M(r))){var o=[];if(R(r)){var i=[];for(var a of Object.keys(r))i.push(r[a]);r=i}if(M(r))for(var u of r.keys())n&&r[u][n]?o[r[u][n]]=t?r[u][t]:r[u]:t?o.push(r[u][t]):o.push(r[u]);return e({},o)}throw new Error("throw an error")},split:function(e,r){if(!M(e))throw new Error("expected an array for the first argument");if(null!==r&&!$(r))throw new Error("expected a number or null for the second argument");r=null!==r?r:e.length;for(var t=e.length,n=[],o=0;o<t;o+=r)n.push(e.slice(o,o+r));return n},unary:e=>r=>e(r),indexBy:function(e,r){if(!M(e))throw new Error("expected an array for first argument");if(!f(r))throw new Error("expected a string for second argument");for(var t={},n=e.length,o=0;o<n;o++){var i=e[o]&&e[o][r];i&&(t[i]=e[o])}return t}};function Oe(e,r){this._wrappedValue=e,this._explicitChain=r}function Se(e){return new Oe(e,!1)}return Oe.prototype.value=function(){return this._wrappedValue},Oe.prototype.valueOf=function(){return this.value()},Oe.prototype.toJSON=function(){return this.value()},Oe.prototype.toString=function(){return String(this.value())},Oe.prototype.chain=function(){return new Oe(this._wrappedValue,!0)},Oe.prototype.thru=function(e){return s(e)?new Oe(e(this._wrappedValue),this._explicitChain):this},Oe.prototype._explicitChain=!0,Object.keys(xe).forEach((function(e){var r;Oe.prototype[e]=(r=xe[e],function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=r.apply(void 0,[this._wrappedValue].concat(t));return this._explicitChain||f(o)?new Oe(o,this._explicitChain):o})})),e(Se,xe,{chain:function(e){return new Oe(e,!0)}}),Se}));
//# sourceMappingURL=bbo.min.js.map