2 lines
34 KiB
JavaScript
2 lines
34 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.perspective=e():t.perspective=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=71)}([function(t,e,n){var r=n(7);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(18)("wks"),o=n(20),i=n(2).Symbol,s="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=s&&i[t]||(s?i:o)("Symbol."+t))}).store=r},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(11),o=n(32);t.exports=n(4)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){t.exports=!n(5)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(2),o=n(3),i=n(12),s=n(20)("src"),a=n(45),u=(""+a).split("toString");n(19).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var c="function"==typeof n;c&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(c&&(i(n,s)||o(n,s,t[e]?""+t[e]:u.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[s]||a.call(this)}))},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(10),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(0),o=n(43),i=n(44),s=Object.defineProperty;e.f=n(4)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){for(var r=n(47),o=n(34),i=n(6),s=n(2),a=n(3),u=n(24),c=n(1),l=c("iterator"),f=c("toStringTag"),p=u.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=o(d),g=0;g<h.length;g++){var m,_=h[g],v=d[_],y=s[_],w=y&&y.prototype;if(w&&(w[l]||a(w,l,p),w[f]||a(w,f,_),u[_]=p,v))for(m in r)w[m]||i(w,m,r[m],!0)}},function(t,e,n){(function(t,e,r){n(63),n(13);const o=n(66).default,i=["perspective.config.js","perspective.config.json","package.json"];function s(t){return t&&"object"==typeof t&&!Array.isArray(t)}function a(t,...e){if(!e.length)return t;const n=e.shift();if(s(t)&&s(n))for(const e in n)s(n[e])?(t[e]||Object.assign(t,{[e]:{}}),a(t[e],n[e])):Object.assign(t,{[e]:n[e]});return a(t,...e)}t.exports.get_types=function(){return Object.keys(t.exports.get_config().types)},t.exports.get_type_config=function(e){const n={};if(t.exports.get_config().types[e]&&Object.assign(n,t.exports.get_config().types[e]),n.type){const e=t.exports.get_type_config(n.type);return Object.assign(e,n),e}return n},r.__PERSPECTIVE_CONFIG__=void 0,t.exports.override_config=function(t){r.__PERSPECTIVE_CONFIG__&&console.warn("Config already initialized!"),r.__PERSPECTIVE_CONFIG__=a(o,t)},t.exports.get_config=function(){return r.__PERSPECTIVE_CONFIG__||(r.__PERSPECTIVE_CONFIG__=a(o,"undefined"==typeof window?function(){const n="undefined"!=typeof require?require:t.require,r=n("path"),o=n("fs"),[s,...a]=e.cwd().split(r.sep);for(;a.length>0;){for(const t of i){const e="".concat(s).concat(r.sep).concat(r.join(...a,t));if(o.existsSync(e)){if(!t.endsWith("json")){const t=n(e);return t.default||t}{const n=JSON.parse(o.readFileSync(e));if("package.json"!==t)return n;if(n.perspective)return n.perspective}}}a.pop()}}():{types:{float:{filter_operator:"==",aggregate:"sum",format:{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}},string:{filter_operator:"==",aggregate:"count"},integer:{filter_operator:"==",aggregate:"sum",format:{}},boolean:{filter_operator:"==",aggregate:"count"},datetime:{filter_operator:"==",aggregate:"count",format:{week:"numeric",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"},null_value:-1},date:{filter_operator:"==",aggregate:"count",format:{week:"numeric",year:"numeric",month:"numeric",day:"numeric"},null_value:-1}}}||{})),r.__PERSPECTIVE_CONFIG__}}).call(this,n(60)(t),n(61),n(62))},function(t,e,n){"use strict";var r=n(40)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},function(t,e,n){"use strict";var r=n(41),o=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var i=n.call(t,e);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(19),o=n(2),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(29)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){var n=t.exports={version:"2.6.10"};"number"==typeof __e&&(__e=n)},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){"use strict";n(42);var r=n(6),o=n(3),i=n(5),s=n(8),a=n(1),u=n(22),c=a("species"),l=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),f=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var p=a(t),d=!i((function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})),h=d?!i((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[c]=function(){return n}),n[p](""),!e})):void 0;if(!d||!h||"replace"===t&&!l||"split"===t&&!f){var g=/./[p],m=n(s,p,""[t],(function(t,e,n,r,o){return e.exec===u?d&&!o?{done:!0,value:g.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),_=m[0],v=m[1];r(String.prototype,t,_),o(RegExp.prototype,p,2==e?function(t,e){return v.call(t,this,e)}:function(t){return v.call(t,this)})}}},function(t,e,n){"use strict";var r,o,i=n(23),s=RegExp.prototype.exec,a=String.prototype.replace,u=s,c=(r=/a/,o=/b*/g,s.call(r,"a"),s.call(o,"a"),0!==r.lastIndex||0!==o.lastIndex),l=void 0!==/()??/.exec("")[1];(c||l)&&(u=function(t){var e,n,r,o,u=this;return l&&(n=new RegExp("^"+u.source+"$(?!\\s)",i.call(u))),c&&(e=u.lastIndex),r=s.call(u,t),c&&r&&(u.lastIndex=u.global?r.index+r[0].length:e),l&&r&&r.length>1&&a.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r}),t.exports=u},function(t,e,n){"use strict";var r=n(0);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e){t.exports={}},function(t,e,n){var r=n(50),o=n(8);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(18)("keys"),o=n(20);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){"use strict";var r=n(0),o=n(28),i=n(9),s=n(10),a=n(15),u=n(16),c=Math.max,l=Math.min,f=Math.floor,p=/\$([$&`']|\d\d?|<[^>]*>)/g,d=/\$([$&`']|\d\d?)/g;n(21)("replace",2,(function(t,e,n,h){return[function(r,o){var i=t(this),s=null==r?void 0:r[e];return void 0!==s?s.call(r,i,o):n.call(String(i),r,o)},function(t,e){var o=h(n,t,this,e);if(o.done)return o.value;var f=r(t),p=String(this),d="function"==typeof e;d||(e=String(e));var m=f.global;if(m){var _=f.unicode;f.lastIndex=0}for(var v=[];;){var y=u(f,p);if(null===y)break;if(v.push(y),!m)break;""===String(y[0])&&(f.lastIndex=a(p,i(f.lastIndex),_))}for(var w,b="",x=0,k=0;k<v.length;k++){y=v[k];for(var O=String(y[0]),S=c(l(s(y.index),p.length),0),E=[],T=1;T<y.length;T++)E.push(void 0===(w=y[T])?w:String(w));var j=y.groups;if(d){var P=[O].concat(E,S,p);void 0!==j&&P.push(j);var I=String(e.apply(void 0,P))}else I=g(O,p,S,E,j,e);S>=x&&(b+=p.slice(x,S)+I,x=S+O.length)}return b+p.slice(x)}];function g(t,e,r,i,s,a){var u=r+t.length,c=i.length,l=d;return void 0!==s&&(s=o(s),l=p),n.call(a,l,(function(n,o){var a;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(u);case"<":a=s[o.slice(1,-1)];break;default:var l=+o;if(0===l)return n;if(l>c){var p=f(l/10);return 0===p?n:p<=c?void 0===i[p-1]?o.charAt(1):i[p-1]+o.charAt(1):n}a=i[l-1]}return void 0===a?"":a}))}}))},function(t,e,n){var r=n(8);t.exports=function(t){return Object(r(t))}},function(t,e){t.exports=!1},function(t,e,n){var r=n(2),o=n(19),i=n(3),s=n(6),a=n(46),u=function(t,e,n){var c,l,f,p,d=t&u.F,h=t&u.G,g=t&u.S,m=t&u.P,_=t&u.B,v=h?r:g?r[e]||(r[e]={}):(r[e]||{}).prototype,y=h?o:o[e]||(o[e]={}),w=y.prototype||(y.prototype={});for(c in h&&(n=e),n)f=((l=!d&&v&&void 0!==v[c])?v:n)[c],p=_&&l?a(f,r):m&&"function"==typeof f?a(Function.call,f):f,v&&s(v,c,f,t&u.U),y[c]!=f&&i(y,c,p),m&&w[c]!=f&&(w[c]=f)};r.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e,n){var r=n(7),o=n(2).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(55),o=n(35);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(11).f,o=n(12),i=n(1)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e){var n=new function(){var t;try{throw new Error}catch(o){var e=o.stack.split("\n"),n=0;for(var r in e)if(e[r].match(/http[s]?:\/\//)){n=Number(r);break}t=e[n].match(/((http[s]?:\/\/.+\/)([^\/]+\.(js|html))).*?:/)}this.fullPath=function(){return t?t[1]:"undefined"!=typeof window?window.location.origin+window.location.pathname:""},this.path=function(){return t?t[2]:"undefined"!=typeof window?window.location.pathname:""},this.host=function(){var t=this.path().match(/.+?\/\/.+?\//);return t?t[0]:"undefined"!=typeof window?window.location.hostname:""},this.file=function(){return t?t[3]:""}};t.exports.host=n.host(),t.exports.path=n.path(),t.exports.isCrossOrigin=function(e){if(!(!e||!e.length)){var n=document.createElement("a");return n.href=e,!n.href.startsWith(window.location.origin)}return window.location.origin!==t.exports.host.slice(0,window.location.origin.length)},t.exports.publicPath=function(e){return!(!e||!e.length)?e:t.exports.path},t.exports.BlobWorker=function(t,e){var n=new Blob([t]),r=window.URL.createObjectURL(n),o=new Worker(r);e&&e(o)},t.exports.XHRWorker=function(e,n){var r=new XMLHttpRequest;r.addEventListener("load",(function(){t.exports.BlobWorker(r.responseText,n)}),r),r.open("get",e,!0),r.send()}},function(t,e,n){t.exports=function(){var t=n(37),e=t.publicPath(n.p)+"perspective.wasm.worker.js";return t.isCrossOrigin(n.p)?new Promise((function(n){t.XHRWorker(e,n)})):new Promise((function(t){t(new Worker(e))}))}},function(t,e,n){var r=n(37);t.exports=r.publicPath(n.p)+"psp.async.wasm"},function(t,e,n){var r=n(10),o=n(8);t.exports=function(t){return function(e,n){var i,s,a=String(o(e)),u=r(n),c=a.length;return u<0||u>=c?t?"":void 0:(i=a.charCodeAt(u))<55296||i>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):i:t?a.slice(u,u+2):s-56320+(i-55296<<10)+65536}}},function(t,e,n){var r=n(17),o=n(1)("toStringTag"),i="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:i?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e,n){"use strict";var r=n(22);n(30)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(t,e,n){t.exports=!n(4)&&!n(5)((function(){return 7!=Object.defineProperty(n(31)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(7);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){t.exports=n(18)("native-function-to-string",Function.toString)},function(t,e,n){var r=n(33);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){"use strict";var r=n(48),o=n(49),i=n(24),s=n(25);t.exports=n(51)(Array,"Array",(function(t,e){this._t=s(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e,n){var r=n(1)("unscopables"),o=Array.prototype;null==o[r]&&n(3)(o,r,{}),t.exports=function(t){o[r][t]=!0}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var r=n(17);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){"use strict";var r=n(29),o=n(30),i=n(6),s=n(3),a=n(24),u=n(52),c=n(36),l=n(59),f=n(1)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,h,g,m,_){u(n,e,h);var v,y,w,b=function(t){if(!p&&t in S)return S[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",k="values"==g,O=!1,S=t.prototype,E=S[f]||S["@@iterator"]||g&&S[g],T=E||b(g),j=g?k?b("entries"):T:void 0,P="Array"==e&&S.entries||E;if(P&&(w=l(P.call(new t)))!==Object.prototype&&w.next&&(c(w,x,!0),r||"function"==typeof w[f]||s(w,f,d)),k&&E&&"values"!==E.name&&(O=!0,T=function(){return E.call(this)}),r&&!_||!p&&!O&&S[f]||s(S,f,T),a[e]=T,a[x]=d,g)if(v={values:k?T:b("values"),keys:m?T:b("keys"),entries:j},_)for(y in v)y in S||i(S,y,v[y]);else o(o.P+o.F*(p||O),e,v);return v}},function(t,e,n){"use strict";var r=n(53),o=n(32),i=n(36),s={};n(3)(s,n(1)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(s,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e,n){var r=n(0),o=n(54),i=n(35),s=n(26)("IE_PROTO"),a=function(){},u=function(){var t,e=n(31)("iframe"),r=i.length;for(e.style.display="none",n(58).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;r--;)delete u.prototype[i[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[s]=t):n=u(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(11),o=n(0),i=n(34);t.exports=n(4)?Object.defineProperties:function(t,e){o(t);for(var n,s=i(e),a=s.length,u=0;a>u;)r.f(t,n=s[u++],e[n]);return t}},function(t,e,n){var r=n(12),o=n(25),i=n(56)(!1),s=n(26)("IE_PROTO");t.exports=function(t,e){var n,a=o(t),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~i(c,n)||c.push(n));return c}},function(t,e,n){var r=n(25),o=n(9),i=n(57);t.exports=function(t){return function(e,n,s){var a,u=r(e),c=o(u.length),l=i(s,c);if(t&&n!=n){for(;c>l;)if((a=u[l++])!=a)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var r=n(10),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},function(t,e,n){var r=n(2).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(12),o=n(28),i=n(26)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var t=a(p);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f<e;)u&&u[f].run();f=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function g(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new h(t,e)),1!==c.length||l||a(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(64),o=n(0),i=n(65),s=n(15),a=n(9),u=n(16),c=n(22),l=n(5),f=Math.min,p=[].push,d=!l((function(){RegExp(4294967295,"y")}));n(21)("split",2,(function(t,e,n,l){var h;return h="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var o=String(this);if(void 0===t&&0===e)return[];if(!r(t))return n.call(o,t,e);for(var i,s,a,u=[],l=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),f=0,d=void 0===e?4294967295:e>>>0,h=new RegExp(t.source,l+"g");(i=c.call(h,o))&&!((s=h.lastIndex)>f&&(u.push(o.slice(f,i.index)),i.length>1&&i.index<o.length&&p.apply(u,i.slice(1)),a=i[0].length,f=s,u.length>=d));)h.lastIndex===i.index&&h.lastIndex++;return f===o.length?!a&&h.test("")||u.push(""):u.push(o.slice(f)),u.length>d?u.slice(0,d):u}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,r){var o=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,o,r):h.call(String(o),n,r)},function(t,e){var r=l(h,t,this,e,h!==n);if(r.done)return r.value;var c=o(t),p=String(this),g=i(c,RegExp),m=c.unicode,_=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(d?"y":"g"),v=new g(d?c:"^(?:"+c.source+")",_),y=void 0===e?4294967295:e>>>0;if(0===y)return[];if(0===p.length)return null===u(v,p)?[p]:[];for(var w=0,b=0,x=[];b<p.length;){v.lastIndex=d?b:0;var k,O=u(v,d?p:p.slice(b));if(null===O||(k=f(a(v.lastIndex+(d?0:b)),p.length))===w)b=s(p,b,m);else{if(x.push(p.slice(w,b)),x.length===y)return x;for(var S=1;S<=O.length-1;S++)if(x.push(O[S]),x.length===y)return x;b=w=k}}return x.push(p.slice(w)),x}]}))},function(t,e,n){var r=n(7),o=n(17),i=n(1)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},function(t,e,n){var r=n(0),o=n(33),i=n(1)("species");t.exports=function(t,e){var n,s=r(t).constructor;return void 0===s||null==(n=r(s)[i])?e:o(n)}},function(t,e){t.exports.default={types:{float:{filter_operator:"==",aggregate:"sum",format:{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}},string:{filter_operator:"==",aggregate:"count"},integer:{filter_operator:"==",aggregate:"sum",format:{}},boolean:{filter_operator:"==",aggregate:"count"},datetime:{filter_operator:"==",aggregate:"count",format:{week:"numeric",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"},null_value:-1},date:{filter_operator:"==",aggregate:"count",format:{week:"numeric",year:"numeric",month:"numeric",day:"numeric"},null_value:-1}}}},function(t,e,n){"use strict";n(68);var r=n(0),o=n(23),i=n(4),s=/./.toString,a=function(t){n(6)(RegExp.prototype,"toString",t,!0)};n(5)((function(){return"/a/b"!=s.call({source:"a",flags:"b"})}))?a((function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!i&&t instanceof RegExp?o.call(t):void 0)})):"toString"!=s.name&&a((function(){return s.call(this)}))},function(t,e,n){n(4)&&"g"!=/./g.flags&&n(11).f(RegExp.prototype,"flags",{configurable:!0,get:n(23)})},function(t,e,n){"use strict";var r=n(0),o=n(9),i=n(15),s=n(16);n(21)("match",1,(function(t,e,n,a){return[function(n){var r=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=a(n,t,this);if(e.done)return e.value;var u=r(t),c=String(this);if(!u.global)return s(u,c);var l=u.unicode;u.lastIndex=0;for(var f,p=[],d=0;null!==(f=s(u,c));){var h=String(f[0]);p[d]=h,""===h&&(u.lastIndex=i(c,o(u.lastIndex),l)),d++}return 0===d?null:p}]}))},function(t,e){t.exports=function(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(t.indexOf("Trident/")>0){var n=t.indexOf("rv:");return parseInt(t.substring(n+3,t.indexOf(".",n)),10)}var r=t.indexOf("Edge/");return r>0&&parseInt(t.substring(r+5,t.indexOf(".",r)),10)}},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"CONFIG_ALIASES",(function(){return o})),n.d(r,"CONFIG_VALID_KEYS",(function(){return i})),n.d(r,"SORT_ORDERS",(function(){return u})),n.d(r,"SORT_ORDER_IDS",(function(){return c})),n.d(r,"TYPE_AGGREGATES",(function(){return l})),n.d(r,"FILTER_OPERATORS",(function(){return f})),n.d(r,"COLUMN_SEPARATOR_STRING",(function(){return m})),n.d(r,"TYPE_FILTERS",(function(){return _}));n(27),n(13);const o={row_pivot:"row_pivots","row-pivot":"row_pivots","row-pivots":"row_pivots",col_pivot:"column_pivots",col_pivots:"column_pivots",column_pivot:"column_pivots","column-pivot":"column_pivots","column-pivots":"column_pivots",filters:"filter",sorts:"sort"},i=["viewport","row_pivots","column_pivots","aggregates","columns","filter","sort","row_pivot_depth","filter_op"],s=["any","avg","count","distinct count","dominant","first by index","last by index","last","high","low","mean","mean by count","median","pct sum parent","pct sum grand total","sum","sum abs","sum not null","unique"],a=["any","count","distinct count","distinct leaf","dominant","first by index","last by index","last","mean by count","unique"],u=["none","asc","desc","col asc","col desc","asc abs","desc abs","col asc abs","col desc abs"],c=[2,0,1,0,1,3,4,3,4],l={string:a,float:s,integer:s,boolean:["any","count","distinct count","distinct leaf","dominant","first by index","last by index","last","mean by count","unique","and","or"],datetime:a,date:a},f={lessThan:"<",greaterThan:">",equals:"==",lessThanOrEquals:"<=",greaterThanOrEquals:">=",doesNotEqual:"!=",isNull:"is null",isNotNull:"is not null",isIn:"in",isNotIn:"not in",contains:"contains",bitwiseAnd:"&",bitwiseOr:"|",and:"and",or:"or",beginsWith:"begins with",endsWith:"ends with"},p=[f.bitwiseAnd,f.bitwiseOr,f.equals,f.doesNotEqual,f.or,f.and,f.isNull,f.isNotNull],d=[f.lessThan,f.greaterThan,f.equals,f.lessThanOrEquals,f.greaterThanOrEquals,f.doesNotEqual,f.isNull,f.isNotNull],h=[f.equals,f.contains,f.doesNotEqual,f.isIn,f.isNotIn,f.beginsWith,f.endsWith,f.isNull,f.isNotNull],g=[f.lessThan,f.greaterThan,f.equals,f.lessThanOrEquals,f.greaterThanOrEquals,f.doesNotEqual,f.isNull,f.isNotNull],m="|",_={string:h,float:d,integer:d,boolean:p,datetime:g,date:g};var v=n(14);n(67);const y=new WeakMap;let w=0;function b(t,e){return function(){let n,r=()=>{},o=Array.prototype.slice.call(arguments,0,arguments.length);for(let t=o.length-1;t>=0;t--)"function"==typeof o[t]&&(n=o.splice(t,1)[0]);const i=y.get(n);y.delete(n);let s={cmd:e||"view_method",name:this._name,method:t,args:o,subscribe:!0,callback_id:i};this._worker.post(s,n,r),this._worker.unsubscribe(e,n)}}function x(t,e){return function(){let n,r=()=>{},o=Array.prototype.slice.call(arguments,0,arguments.length);for(let t=o.length-1;t>=0;t--)"function"==typeof o[t]&&(n=o.splice(t,1)[0]);w++,y.set(n,w);let i={cmd:e||"view_method",name:this._name,method:t,args:o,subscribe:!0,callback_id:w};this._worker.post(i,n,r,!0)}}function k(t,e){return function(){var n=Array.prototype.slice.call(arguments,0,arguments.length);return new Promise(function(r,o){var i={cmd:e||"view_method",name:this._name,method:t,args:n,subscribe:!1};this._worker.post(i,r,o)}.bind(this))}}n(69);function O(t){let e=t;do{for(const n of Object.getOwnPropertyNames(e)){const e=t[n];"constructor"!==n&&"function"==typeof e&&(t[n]=e.bind(t))}}while(e=e!==Object&&Object.getPrototypeOf(e))}n(70);function S(t,e,n){this._worker=t,this._name=Math.random()+"";var r={cmd:"view",view_name:this._name,table_name:e,config:n};this._worker.post(r),O(this)}function E(t,e){this._worker=t,this._name=e}function T(t,e,n){this._worker=t;let r=n.name||Math.random()+"";if(this._name=r,O(this),e.to_arrow){var o={cmd:"table",name:r,args:[],options:n||{}};this._worker.post(o),e.to_arrow().then(t=>{var o={cmd:"table",name:r,args:[t],options:n||{}};this._worker.post(o),e.on_update(this.update,{mode:"row"})})}else{o={cmd:"table",name:r,args:[e],options:n||{}};this._worker.post(o)}}function j(t,e,n){this._worker=t,this._name=Math.random()+"";let r=n;for(let t=0;t<e.length;++t){let n=e[t],r=n.func;"function"==typeof r&&(n.func=r.toString())}var o={cmd:"add_computed",original:r,name:this._name,computed:e};this._worker.post(o)}function P(t,e){this._worker=t,this._name=e}String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),r=n.length>>>0;if(0===r)return!1;var o,i,s=0|e,a=Math.max(s>=0?s:r-Math.abs(s),0);for(;a<r;){if((o=n[a])===(i=t)||"number"==typeof o&&"number"==typeof i&&isNaN(o)&&isNaN(i))return!0;a++}return!1}}),E.prototype=S.prototype,S.prototype.get_config=k("get_config"),S.prototype.to_json=k("to_json"),S.prototype.to_arrow=k("to_arrow"),S.prototype.to_columns=k("to_columns"),S.prototype.to_csv=k("to_csv"),S.prototype.schema=k("schema"),S.prototype.column_paths=k("column_paths"),S.prototype.num_columns=k("num_columns"),S.prototype.num_rows=k("num_rows"),S.prototype.set_depth=k("set_depth"),S.prototype.get_row_expanded=k("get_row_expanded"),S.prototype.expand=k("expand"),S.prototype.collapse=k("collapse"),S.prototype.delete=k("delete"),S.prototype.col_to_js_typed_array=k("col_to_js_typed_array"),S.prototype.on_update=x("on_update","view_method"),S.prototype.remove_update=b("remove_update","view_method"),S.prototype.on_delete=x("on_delete","view_method"),S.prototype.remove_delete=b("remove_delete","view_method"),T.prototype.type="table",j.prototype=T.prototype,P.prototype=T.prototype,T.prototype.add_computed=function(t){return new j(this._worker,t,this._name)},T.prototype.view=function(t){return new S(this._worker,this._name,t)},T.prototype.compute=k("compute","table_method"),T.prototype.schema=k("schema","table_method"),T.prototype.computed_schema=k("computed_schema","table_method"),T.prototype.is_valid_filter=k("is_valid_filter","table_method"),T.prototype.size=k("size","table_method"),T.prototype.columns=k("columns","table_method"),T.prototype.clear=k("clear","table_method"),T.prototype.replace=k("replace","table_method"),T.prototype.delete=k("delete","table_method"),T.prototype.on_delete=x("on_delete","table_method"),T.prototype.remove=k("remove","table_method"),T.prototype.remove_delete=b("remove_delete","table_method"),T.prototype.update=function(t){return new Promise((e,n)=>{var r={name:this._name,cmd:"table_method",method:"update",args:[t]};this._worker.post(r,e,n,!1)})},T.prototype.execute=function(t){var e={cmd:"table_execute",name:this._name,f:t.toString()};this._worker.post(e)};class I{constructor(){this._initialized=!1,this._worker={initialized:{value:!1},transferable:!1,msg_id:0,handlers:{},messages:[]},O(this)}unsubscribe(t,e){for(let t of Object.keys(this._worker.handlers))this._worker.handlers[t].resolve===e&&delete this._worker.handlers[t]}post(t,e,n,r=!1){(e||n)&&(this._worker.handlers[++this._worker.msg_id]={resolve:e,reject:n,keep_alive:r}),t.id=this._worker.msg_id,this._worker.initialized.value?this.send(t):this._worker.messages.push(()=>this.send(t))}initialize_profile_thread(){this._worker.initialized.value?this.send({id:-1,cmd:"init_profile_thread"}):this._worker.messages.push(()=>this.send({id:-1,cmd:"init_profile_thread"}))}send(){throw new Error("send() not implemented")}open_table(t){return new P(this,t)}open_view(t){return new E(this,t)}_handle(t){if(!this._worker.initialized.value){if(!this._initialized&&"undefined"!=typeof document&&document&&void 0!==typeof window&&window){try{const t=document.createEvent("Event");t.initEvent("perspective-ready",!1,!0),window.dispatchEvent(t)}catch(t){}this._initialized=!0}const e=this._worker.messages;if(this._worker.initialized.value=!0,this._worker.messages=[],e)for(const t in e)e.hasOwnProperty(t)&&e[t]()}if(t.data.id){var e=this._worker.handlers[t.data.id];e&&(t.data.error?e.reject(t.data.error):e.resolve(t.data.data),e.keep_alive||delete this._worker.handlers[t.data.id])}}table(t,e){return new T(this,t,e||{})}terminate(){this._worker.terminate(),this._worker=void 0}}var R=n(38),N=n.n(R),A=n(39),L=n.n(A);const M=15e3,C=new class{_fetch(t){return new Promise(e=>{let n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{e(n.response)},n.send(null)})}set({wasm:t,worker:e}){this._wasm=t||this._wasm,this._worker=e||this._worker}worker(){return(this._worker||N.a)()}async wasm(){return this._wasm||(this._wasm=await this._fetch(L.a)),this._wasm}};class F extends I{constructor(t){t&&Object(v.override_config)(t),super(),this.register()}async register(){let t;const e={cmd:"init",config:Object(v.get_config)()};if("undefined"==typeof WebAssembly)throw new Error("WebAssembly not supported. Support for ASM.JS has been removed as of 0.3.1.");for(var n in[t,e.buffer]=await Promise.all([C.worker(),C.wasm()]),this._worker)t[n]=this._worker[n];this._worker=t,this._worker.addEventListener("message",this._handle.bind(this)),this._worker.postMessage(e),this._detect_transferable()}send(t){this._worker.transferable&&t.args&&t.args[0]instanceof ArrayBuffer?this._worker.postMessage(t,t.args):this._worker.postMessage(t)}terminate(){this._worker.terminate(),this._worker=void 0}_detect_transferable(){var t=new ArrayBuffer(1);this._worker.postMessage(t,[t]),this._worker.transferable=0===t.byteLength,this._worker.transferable?console.log("Transferable support detected"):console.warn("Transferable support not detected")}}class q extends I{constructor(t){super(),this._ws=new WebSocket(t),this._ws.binaryType="arraybuffer",this._ws.onopen=()=>{this.send({id:-1,cmd:"init"})};const e=()=>{this._ws.send("heartbeat"),setTimeout(e,M)};setTimeout(e,15e3),this._ws.onmessage=t=>{"heartbeat"!==t.data&&(this._pending_arrow?(this._handle({data:{id:this._pending_arrow,data:t.data}}),delete this._pending_arrow):(t=JSON.parse(t.data)).is_transferable?this._pending_arrow=t.id:this._handle({data:t}))}}send(t){this._ws.send(JSON.stringify(t))}terminate(){this._ws.close()}}const G=function(){let t,e;return{getInstance:function(n){void 0===t&&(t=new F(n));const r=JSON.stringify(n);if(e&&r!==e)throw new Error("Confiuration object for shared_worker() has changed - this is probably a bug in your application.");return e=r,t}}}();document.currentScript&&document.currentScript.hasAttribute("preload")&&G.getInstance();const W={override:t=>C.set(t),worker:t=>new F(t),websocket:(t=window.location.origin.replace("http","ws"))=>new q(t),shared_worker:t=>G.getInstance(t)};for(let t of Object.keys(r))W[t]=r[t];e.default=W}]).default}));
|
|
//# sourceMappingURL=perspective.js.map
|