Newer
Older
smartwell_front_dz / smartwell / static / js / chunk-libs-fa70753b.791dec5e.js
wangxitong on 11 Sep 2023 19 KB first commit
(self["webpackChunknewfront"]=self["webpackChunknewfront"]||[]).push([[1105],{11895:e=>{e.exports=function(e,t,r,n){var i=e[0],o=e[1],a=!1;void 0===r&&(r=0),void 0===n&&(n=t.length);for(var l=(n-r)/2,c=0,s=l-1;c<l;s=c++){var u=t[r+2*c+0],f=t[r+2*c+1],h=t[r+2*s+0],p=t[r+2*s+1],d=f>o!==p>o&&i<(h-u)*(o-f)/(p-f)+u;d&&(a=!a)}return a}},26960:(e,t,r)=>{var n=r(11895),i=r(88139);e.exports=function(e,t,r,o){return t.length>0&&Array.isArray(t[0])?i(e,t,r,o):n(e,t,r,o)},e.exports.nested=i,e.exports.flat=n},88139:e=>{e.exports=function(e,t,r,n){var i=e[0],o=e[1],a=!1;void 0===r&&(r=0),void 0===n&&(n=t.length);for(var l=n-r,c=0,s=l-1;c<l;s=c++){var u=t[c+r][0],f=t[c+r][1],h=t[s+r][0],p=t[s+r][1],d=f>o!==p>o&&i<(h-u)*(o-f)/(p-f)+u;d&&(a=!a)}return a}},34155:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}function l(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(function(){try{t="function"===typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"===typeof clearTimeout?clearTimeout:o}catch(e){r=o}})();var c,s=[],u=!1,f=-1;function h(){u&&c&&(u=!1,c.length?s=c.concat(s):f=-1,s.length&&p())}function p(){if(!u){var e=a(h);u=!0;var t=s.length;while(t){c=s,s=[];while(++f<t)c&&c[f].run();f=-1,t=s.length}c=null,u=!1,l(e)}}function d(e,t){this.fun=e,this.array=t}function m(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];s.push(new d(e,t)),1!==s.length||u||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},55798:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports={default:n.RFC3986,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:n.RFC1738,RFC3986:n.RFC3986}},80129:(e,t,r)=>{"use strict";var n=r(58261),i=r(55235),o=r(55798);e.exports={formats:o,parse:i,stringify:n}},55235:(e,t,r)=>{"use strict";var n=r(12769),i=Object.prototype.hasOwnProperty,o=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},l=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"===typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},s="utf8=%26%2310003%3B",u="utf8=%E2%9C%93",f=function(e,t){var r,f={},h=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,d=h.split(t.delimiter,p),m=-1,y=t.charset;if(t.charsetSentinel)for(r=0;r<d.length;++r)0===d[r].indexOf("utf8=")&&(d[r]===u?y="utf-8":d[r]===s&&(y="iso-8859-1"),m=r,r=d.length);for(r=0;r<d.length;++r)if(r!==m){var g,v,x=d[r],b=x.indexOf("]="),w=-1===b?x.indexOf("="):b+1;-1===w?(g=t.decoder(x,a.decoder,y,"key"),v=t.strictNullHandling?null:""):(g=t.decoder(x.slice(0,w),a.decoder,y,"key"),v=n.maybeMap(c(x.slice(w+1),t),(function(e){return t.decoder(e,a.decoder,y,"value")}))),v&&t.interpretNumericEntities&&"iso-8859-1"===y&&(v=l(v)),x.indexOf("[]=")>-1&&(v=o(v)?[v]:v),i.call(f,g)?f[g]=n.combine(f[g],v):f[g]=v}return f},h=function(e,t,r,n){for(var i=n?t:c(t,r),o=e.length-1;o>=0;--o){var a,l=e[o];if("[]"===l&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var s="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,u=parseInt(s,10);r.parseArrays||""!==s?!isNaN(u)&&l!==s&&String(u)===s&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(a=[],a[u]=i):"__proto__"!==s&&(a[s]=i):a={0:i}}i=a}return i},p=function(e,t,r,n){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,l=/(\[[^[\]]*])/g,c=r.depth>0&&a.exec(o),s=c?o.slice(0,c.index):o,u=[];if(s){if(!r.plainObjects&&i.call(Object.prototype,s)&&!r.allowPrototypes)return;u.push(s)}var f=0;while(r.depth>0&&null!==(c=l.exec(o))&&f<r.depth){if(f+=1,!r.plainObjects&&i.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(c[1])}return c&&u.push("["+o.slice(c.index)+"]"),h(u,t,r,n)}},d=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!==typeof e.decoder)throw new TypeError("Decoder has to be a function.");if("undefined"!==typeof e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t="undefined"===typeof e.charset?a.charset:e.charset;return{allowDots:"undefined"===typeof e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"===typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"===typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"===typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"===typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"===typeof e.comma?e.comma:a.comma,decoder:"function"===typeof e.decoder?e.decoder:a.decoder,delimiter:"string"===typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"===typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"===typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"===typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"===typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"===typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}};e.exports=function(e,t){var r=d(t);if(""===e||null===e||"undefined"===typeof e)return r.plainObjects?Object.create(null):{};for(var i="string"===typeof e?f(e,r):e,o=r.plainObjects?Object.create(null):{},a=Object.keys(i),l=0;l<a.length;++l){var c=a[l],s=p(c,i[c],r,"string"===typeof e);o=n.merge(o,s,r)}return!0===r.allowSparse?o:n.compact(o)}},58261:(e,t,r)=>{"use strict";var n=r(37478),i=r(12769),o=r(55798),a=Object.prototype.hasOwnProperty,l={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,s=String.prototype.split,u=Array.prototype.push,f=function(e,t){u.apply(e,c(t)?t:[t])},h=Date.prototype.toISOString,p=o["default"],d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:i.encode,encodeValuesOnly:!1,format:p,formatter:o.formatters[p],indices:!1,serializeDate:function(e){return h.call(e)},skipNulls:!1,strictNullHandling:!1},m=function(e){return"string"===typeof e||"number"===typeof e||"boolean"===typeof e||"symbol"===typeof e||"bigint"===typeof e},y={},g=function e(t,r,o,a,l,u,h,p,g,v,x,b,w,j,O){var M=t,B=O,S=0,_=!1;while(void 0!==(B=B.get(y))&&!_){var X=B.get(t);if(S+=1,"undefined"!==typeof X){if(X===S)throw new RangeError("Cyclic object value");_=!0}"undefined"===typeof B.get(y)&&(S=0)}if("function"===typeof h?M=h(r,M):M instanceof Date?M=v(M):"comma"===o&&c(M)&&(M=i.maybeMap(M,(function(e){return e instanceof Date?v(e):e}))),null===M){if(a)return u&&!w?u(r,d.encoder,j,"key",x):r;M=""}if(m(M)||i.isBuffer(M)){if(u){var Y=w?r:u(r,d.encoder,j,"key",x);if("comma"===o&&w){for(var E=s.call(String(M),","),N="",k=0;k<E.length;++k)N+=(0===k?"":",")+b(u(E[k],d.encoder,j,"value",x));return[b(Y)+"="+N]}return[b(Y)+"="+b(u(M,d.encoder,j,"value",x))]}return[b(r)+"="+b(String(M))]}var D,T=[];if("undefined"===typeof M)return T;if("comma"===o&&c(M))D=[{value:M.length>0?M.join(",")||null:void 0}];else if(c(h))D=h;else{var A=Object.keys(M);D=p?A.sort(p):A}for(var C=0;C<D.length;++C){var P=D[C],R="object"===typeof P&&"undefined"!==typeof P.value?P.value:M[P];if(!l||null!==R){var F=c(M)?"function"===typeof o?o(r,P):r:r+(g?"."+P:"["+P+"]");O.set(t,S);var L=n();L.set(y,O),f(T,e(R,F,o,a,l,u,h,p,g,v,x,b,w,j,L))}}return T},v=function(e){if(!e)return d;if(null!==e.encoder&&"undefined"!==typeof e.encoder&&"function"!==typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||d.charset;if("undefined"!==typeof e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=o["default"];if("undefined"!==typeof e.format){if(!a.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=o.formatters[r],i=d.filter;return("function"===typeof e.filter||c(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"===typeof e.addQueryPrefix?e.addQueryPrefix:d.addQueryPrefix,allowDots:"undefined"===typeof e.allowDots?d.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"===typeof e.charsetSentinel?e.charsetSentinel:d.charsetSentinel,delimiter:"undefined"===typeof e.delimiter?d.delimiter:e.delimiter,encode:"boolean"===typeof e.encode?e.encode:d.encode,encoder:"function"===typeof e.encoder?e.encoder:d.encoder,encodeValuesOnly:"boolean"===typeof e.encodeValuesOnly?e.encodeValuesOnly:d.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"===typeof e.serializeDate?e.serializeDate:d.serializeDate,skipNulls:"boolean"===typeof e.skipNulls?e.skipNulls:d.skipNulls,sort:"function"===typeof e.sort?e.sort:null,strictNullHandling:"boolean"===typeof e.strictNullHandling?e.strictNullHandling:d.strictNullHandling}};e.exports=function(e,t){var r,i,o=e,a=v(t);"function"===typeof a.filter?(i=a.filter,o=i("",o)):c(a.filter)&&(i=a.filter,r=i);var s,u=[];if("object"!==typeof o||null===o)return"";s=t&&t.arrayFormat in l?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var h=l[s];r||(r=Object.keys(o)),a.sort&&r.sort(a.sort);for(var p=n(),d=0;d<r.length;++d){var m=r[d];a.skipNulls&&null===o[m]||f(u,g(o[m],m,h,a.strictNullHandling,a.skipNulls,a.encode?a.encoder:null,a.filter,a.sort,a.allowDots,a.serializeDate,a.format,a.formatter,a.encodeValuesOnly,a.charset,p))}var y=u.join(a.delimiter),x=!0===a.addQueryPrefix?"?":"";return a.charsetSentinel&&("iso-8859-1"===a.charset?x+="utf8=%26%2310003%3B&":x+="utf8=%E2%9C%93&"),y.length>0?x+y:""}},12769:(e,t,r)=>{"use strict";var n=r(55798),i=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),l=function(e){while(e.length>1){var t=e.pop(),r=t.obj[t.prop];if(o(r)){for(var n=[],i=0;i<r.length;++i)"undefined"!==typeof r[i]&&n.push(r[i]);t.obj[t.prop]=n}}},c=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)"undefined"!==typeof e[n]&&(r[n]=e[n]);return r},s=function e(t,r,n){if(!r)return t;if("object"!==typeof r){if(o(t))t.push(r);else{if(!t||"object"!==typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!==typeof t)return[t].concat(r);var a=t;return o(t)&&!o(r)&&(a=c(t,n)),o(t)&&o(r)?(r.forEach((function(r,o){if(i.call(t,o)){var a=t[o];a&&"object"===typeof a&&r&&"object"===typeof r?t[o]=e(a,r,n):t.push(r)}else t[o]=r})),t):Object.keys(r).reduce((function(t,o){var a=r[o];return i.call(t,o)?t[o]=e(t[o],a,n):t[o]=a,t}),a)},u=function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},f=function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(i){return n}},h=function(e,t,r,i,o){if(0===e.length)return e;var l=e;if("symbol"===typeof e?l=Symbol.prototype.toString.call(e):"string"!==typeof e&&(l=String(e)),"iso-8859-1"===r)return escape(l).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",s=0;s<l.length;++s){var u=l.charCodeAt(s);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===n.RFC1738&&(40===u||41===u)?c+=l.charAt(s):u<128?c+=a[u]:u<2048?c+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?c+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(s+=1,u=65536+((1023&u)<<10|1023&l.charCodeAt(s)),c+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return c},p=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var i=t[n],o=i.obj[i.prop],a=Object.keys(o),c=0;c<a.length;++c){var s=a[c],u=o[s];"object"===typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:o,prop:s}),r.push(u))}return l(t),e},d=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},m=function(e){return!(!e||"object"!==typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},y=function(e,t){return[].concat(e,t)},g=function(e,t){if(o(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)};e.exports={arrayToObject:c,assign:u,combine:y,compact:p,decode:f,encode:h,isBuffer:m,isRegExp:d,maybeMap:g,merge:s}},48166:function(e){(function(t,r){e.exports=r()})(0,(function(){"use strict";function e(e,r,i,o,a){t(e,r,i||0,o||e.length-1,a||n)}function t(e,n,i,o,a){while(o>i){if(o-i>600){var l=o-i+1,c=n-i+1,s=Math.log(l),u=.5*Math.exp(2*s/3),f=.5*Math.sqrt(s*u*(l-u)/l)*(c-l/2<0?-1:1),h=Math.max(i,Math.floor(n-c*u/l+f)),p=Math.min(o,Math.floor(n+(l-c)*u/l+f));t(e,n,h,p,a)}var d=e[n],m=i,y=o;r(e,i,n),a(e[o],d)>0&&r(e,i,o);while(m<y){r(e,m,y),m++,y--;while(a(e[m],d)<0)m++;while(a(e[y],d)>0)y--}0===a(e[i],d)?r(e,i,y):(y++,r(e,y,o)),y<=n&&(i=y+1),n<=y&&(o=y-1)}}function r(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function n(e,t){return e<t?-1:e>t?1:0}return e}))},65510:(e,t,r)=>{"use strict";e.exports=i,e.exports["default"]=i;var n=r(48166);function i(e,t){if(!(this instanceof i))return new i(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function o(e,t,r){if(!r)return t.indexOf(e);for(var n=0;n<t.length;n++)if(r(e,t[n]))return n;return-1}function a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,r,n,i){i||(i=g(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,a=t;a<r;a++)o=e.children[a],c(i,e.leaf?n(o):o);return i}function c(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function s(e,t){return e.minX-t.minX}function u(e,t){return e.minY-t.minY}function f(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function h(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function d(e,t){var r=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}function m(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function y(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function g(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(e,t,r,i,o){var a,l=[t,r];while(l.length)r=l.pop(),t=l.pop(),r-t<=i||(a=t+Math.ceil((r-t)/i/2)*i,n(e,a,t,r,o),l.push(t,a,a,r))}i.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,r=[],n=this.toBBox;if(!y(e,t))return r;var i,o,a,l,c=[];while(t){for(i=0,o=t.children.length;i<o;i++)a=t.children[i],l=t.leaf?n(a):a,y(e,l)&&(t.leaf?r.push(a):m(e,l)?this._all(a,r):c.push(a));t=c.pop()}return r},collides:function(e){var t=this.data,r=this.toBBox;if(!y(e,t))return!1;var n,i,o,a,l=[];while(t){for(n=0,i=t.children.length;n<i;n++)if(o=t.children[n],a=t.leaf?r(o):o,y(e,a)){if(t.leaf||m(e,a))return!0;l.push(o)}t=l.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,r=e.length;t<r;t++)this.insert(e[t]);return this}var n=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=g([]),this},remove:function(e,t){if(!e)return this;var r,n,i,a,l=this.data,c=this.toBBox(e),s=[],u=[];while(l||s.length){if(l||(l=s.pop(),n=s[s.length-1],r=u.pop(),a=!0),l.leaf&&(i=o(e,l.children,t),-1!==i))return l.children.splice(i,1),s.push(l),this._condense(s),this;a||l.leaf||!m(l,c)?n?(r++,l=n.children[r],a=!1):l=null:(s.push(l),u.push(r),r=0,n=l,l=l.children[0])}return this},toBBox:function(e){return e},compareMinX:s,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){var r=[];while(e)e.leaf?t.push.apply(t,e.children):r.push.apply(r,e.children),e=r.pop();return t},_build:function(e,t,r,n){var i,o=r-t+1,l=this._maxEntries;if(o<=l)return i=g(e.slice(t,r+1)),a(i,this.toBBox),i;n||(n=Math.ceil(Math.log(o)/Math.log(l)),l=Math.ceil(o/Math.pow(l,n-1))),i=g([]),i.leaf=!1,i.height=n;var c,s,u,f,h=Math.ceil(o/l),p=h*Math.ceil(Math.sqrt(l));for(v(e,t,r,p,this.compareMinX),c=t;c<=r;c+=p)for(u=Math.min(c+p-1,r),v(e,c,u,h,this.compareMinY),s=c;s<=u;s+=h)f=Math.min(s+h-1,u),i.children.push(this._build(e,s,f,n-1));return a(i,this.toBBox),i},_chooseSubtree:function(e,t,r,n){var i,o,a,l,c,s,u,h;while(1){if(n.push(t),t.leaf||n.length-1===r)break;for(u=h=1/0,i=0,o=t.children.length;i<o;i++)a=t.children[i],c=f(a),s=p(e,a)-c,s<h?(h=s,u=c<u?c:u,l=a):s===h&&c<u&&(u=c,l=a);t=l||t.children[0]}return t},_insert:function(e,t,r){var n=this.toBBox,i=r?e:n(e),o=[],a=this._chooseSubtree(i,this.data,t,o);a.children.push(e),c(a,i);while(t>=0){if(!(o[t].children.length>this._maxEntries))break;this._split(o,t),t--}this._adjustParentBBoxes(i,o,t)},_split:function(e,t){var r=e[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var o=this._chooseSplitIndex(r,i,n),l=g(r.children.splice(o,r.children.length-o));l.height=r.height,l.leaf=r.leaf,a(r,this.toBBox),a(l,this.toBBox),t?e[t-1].children.push(l):this._splitRoot(r,l)},_splitRoot:function(e,t){this.data=g([e,t]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,r){var n,i,o,a,c,s,u,h;for(s=u=1/0,n=t;n<=r-t;n++)i=l(e,0,n,this.toBBox),o=l(e,n,r,this.toBBox),a=d(i,o),c=f(i)+f(o),a<s?(s=a,h=n,u=c<u?c:u):a===s&&c<u&&(u=c,h=n);return h},_chooseSplitAxis:function(e,t,r){var n=e.leaf?this.compareMinX:s,i=e.leaf?this.compareMinY:u,o=this._allDistMargin(e,t,r,n),a=this._allDistMargin(e,t,r,i);o<a&&e.children.sort(n)},_allDistMargin:function(e,t,r,n){e.children.sort(n);var i,o,a=this.toBBox,s=l(e,0,t,a),u=l(e,r-t,r,a),f=h(s)+h(u);for(i=t;i<r-t;i++)o=e.children[i],c(s,e.leaf?a(o):o),f+=h(s);for(i=r-t-1;i>=t;i--)o=e.children[i],c(u,e.leaf?a(o):o),f+=h(u);return f},_adjustParentBBoxes:function(e,t,r){for(var n=r;n>=0;n--)c(t[n],e)},_condense:function(e){for(var t,r=e.length-1;r>=0;r--)0===e[r].children.length?r>0?(t=e[r-1].children,t.splice(t.indexOf(e[r]),1)):this.clear():a(e[r],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}}}]);