Commit 4de87f6a authored by Nikola's avatar Nikola

Perspective gadget works as a root gadget.

The perspective gadget creates child gadgets which need to implement the getData method.
The child gadget can, but is not required to, provide the postprocessing method to manipulate the perspective table.
parent 2db6b86c
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>perspective@2.3.0</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>2fa644521b73c4857f3d.wasm</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/wasm</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>3ad444d7560308669cb9.wasm</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/wasm</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>LICENSE.txt</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/plain</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
(()=>{"use strict";var t={508:(t,e,n)=>{t.exports=n.p+"2fa644521b73c4857f3d.wasm"}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.m=t,n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var i=r.length-1;i>-1&&!t;)t=r[i--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})(),n.b=self.location+"",(()=>{var t,e={};n.r(e),n.d(e,{COLUMN_SEPARATOR_STRING:()=>g,CONFIG_ALIASES:()=>o,CONFIG_VALID_KEYS:()=>a,DATA_TYPES:()=>i,FILTER_OPERATORS:()=>d,SORT_ORDERS:()=>u,SORT_ORDER_IDS:()=>c,TYPE_AGGREGATES:()=>f,TYPE_FILTERS:()=>y});const r=(t="file:///home/benutzer/perspective/node_modules/@finos/perspective/dist/pkg/web/perspective.cpp.js",function(e={}){var r,i,o=void 0!==e?e:{};o.ready=new Promise((function(t,e){r=t,i=e}));var a,s=Object.assign({},o),l="./this.program",u="";"undefined"!=typeof document&&document.currentScript&&(u=document.currentScript.src),t&&(u=t),u=0!==u.indexOf("blob:")?u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var c,f,d=o.print||console.log.bind(console),h=o.printErr||console.warn.bind(console);Object.assign(o,s),s=null,o.arguments&&o.arguments,o.thisProgram&&(l=o.thisProgram),o.quit&&o.quit,o.wasmBinary&&(c=o.wasmBinary),o.noExitRuntime,"object"!=typeof WebAssembly&&R("no native wasm support detected");var p,_,m,g,y,v,w,b,T,C=!1,P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(t,e,n){for(var r=(e>>>=0)+n,i=e;t[i]&&!(i>=r);)++i;if(i-e>16&&t.buffer&&P)return P.decode(t.subarray(e,i));for(var o="";e<i;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var l=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|l:(7&a)<<18|s<<12|l<<6|63&t[e++])<65536)o+=String.fromCharCode(a);else{var u=a-65536;o+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o}function $(t,e){return(t>>>=0)?O(_,t,e):""}function k(t,e,n,r){if(!(r>0))return 0;for(var i=n>>>=0,o=n+r-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(n>=o)break;e[n++>>>0]=s}else if(s<=2047){if(n+1>=o)break;e[n++>>>0]=192|s>>6,e[n++>>>0]=128|63&s}else if(s<=65535){if(n+2>=o)break;e[n++>>>0]=224|s>>12,e[n++>>>0]=128|s>>6&63,e[n++>>>0]=128|63&s}else{if(n+3>=o)break;e[n++>>>0]=240|s>>18,e[n++>>>0]=128|s>>12&63,e[n++>>>0]=128|s>>6&63,e[n++>>>0]=128|63&s}}return e[n>>>0]=0,n-i}function A(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);r<=127?e++:r<=2047?e+=2:r>=55296&&r<=57343?(e+=4,++n):e+=3}return e}function E(){var t=f.buffer;o.HEAP8=p=new Int8Array(t),o.HEAP16=m=new Int16Array(t),o.HEAP32=y=new Int32Array(t),o.HEAPU8=_=new Uint8Array(t),o.HEAPU16=g=new Uint16Array(t),o.HEAPU32=v=new Uint32Array(t),o.HEAPF32=w=new Float32Array(t),o.HEAPF64=b=new Float64Array(t)}var j=[],S=[],x=[],D=0,F=null,V=null;function R(t){o.onAbort&&o.onAbort(t),h(t="Aborted("+t+")"),C=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw i(e),e}var N,M;function I(t){return t.startsWith("data:application/octet-stream;base64,")}function W(t){try{if(t==N&&c)return new Uint8Array(c);if(a)return a(t);throw"both async and sync fetching of the wasm failed"}catch(t){R(t)}}function z(t,e,n){return function(t){return c||"function"!=typeof fetch?Promise.resolve().then((function(){return W(t)})):fetch(t,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()})).catch((function(){return W(t)}))}(t).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(t){return t})).then(n,(function(t){h("failed to asynchronously prepare wasm: "+t),R(t)}))}o.locateFile?I(N="perspective.cpp.wasm")||(M=N,N=o.locateFile?o.locateFile(M,u):u+M):N=new URL(n(508),n.b).href;var H={833172:t=>{throw new Error($(t))}};function U(t){for(;t.length>0;)t.shift()(o)}function Y(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){v[this.ptr+4>>>2]=t},this.get_type=function(){return v[this.ptr+4>>>2]},this.set_destructor=function(t){v[this.ptr+8>>>2]=t},this.get_destructor=function(){return v[this.ptr+8>>>2]},this.set_refcount=function(t){y[this.ptr>>>2]=t},this.set_caught=function(t){t=t?1:0,p[this.ptr+12>>>0]=t},this.get_caught=function(){return 0!=p[this.ptr+12>>>0]},this.set_rethrown=function(t){t=t?1:0,p[this.ptr+13>>>0]=t},this.get_rethrown=function(){return 0!=p[this.ptr+13>>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=y[this.ptr>>>2];y[this.ptr>>>2]=t+1},this.release_ref=function(){var t=y[this.ptr>>>2];return y[this.ptr>>>2]=t-1,1===t},this.set_adjusted_ptr=function(t){v[this.ptr+16>>>2]=t},this.get_adjusted_ptr=function(){return v[this.ptr+16>>>2]},this.get_exception_ptr=function(){if(Fe(this.get_type()))return v[this.excPtr>>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}var q={varargs:void 0,get:function(){return q.varargs+=4,y[q.varargs-4>>>2]},getStr:function(t){return $(t)}},L={};function B(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function G(t){return this.fromWireType(y[t>>>2])}var J={},X={},Z={},K=48,Q=57;function tt(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=K&&e<=Q?"_"+t:t}function et(t,e){return{[t=tt(t)]:function(){return e.apply(this,arguments)}}[t]}function nt(t,e){var n=et(e,(function(t){this.name=e,this.message=t;var n=new Error(t).stack;void 0!==n&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))}));return n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var rt=void 0;function it(t){throw new rt(t)}function ot(t,e,n){function r(e){var r=n(e);r.length!==t.length&&it("Mismatched type converter count");for(var i=0;i<t.length;++i)ft(t[i],r[i])}t.forEach((function(t){Z[t]=e}));var i=new Array(e.length),o=[],a=0;e.forEach(((t,e)=>{X.hasOwnProperty(t)?i[e]=X[t]:(o.push(t),J.hasOwnProperty(t)||(J[t]=[]),J[t].push((()=>{i[e]=X[t],++a===o.length&&r(i)})))})),0===o.length&&r(i)}function at(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}var st=void 0;function lt(t){for(var e="",n=t;_[n>>>0];)e+=st[_[n++>>>0]];return e}var ut=void 0;function ct(t){throw new ut(t)}function ft(t,e,n={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=e.name;if(t||ct('type "'+r+'" must have a positive integer typeid pointer'),X.hasOwnProperty(t)){if(n.ignoreDuplicateRegistrations)return;ct("Cannot register type '"+r+"' twice")}if(X[t]=e,delete Z[t],J.hasOwnProperty(t)){var i=J[t];delete J[t],i.forEach((t=>t()))}}function dt(t){ct(t.$$.ptrType.registeredClass.name+" instance already deleted")}var ht=!1;function pt(t){}function _t(t){t.count.value-=1,0===t.count.value&&function(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}(t)}function mt(t,e,n){if(e===n)return t;if(void 0===n.baseClass)return null;var r=mt(t,e,n.baseClass);return null===r?null:n.downcast(r)}var gt={};var yt=[];function vt(){for(;yt.length;){var t=yt.pop();t.$$.deleteScheduled=!1,t.delete()}}var wt=void 0;var bt={};function Tt(t,e){return e.ptrType&&e.ptr||it("makeClassHandle requires ptr and ptrType"),!!e.smartPtrType!=!!e.smartPtr&&it("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Ct(Object.create(t,{$$:{value:e}}))}function Ct(t){return"undefined"==typeof FinalizationRegistry?(Ct=t=>t,t):(ht=new FinalizationRegistry((t=>{_t(t.$$)})),Ct=t=>{var e=t.$$;if(e.smartPtr){var n={$$:e};ht.register(t,n,t)}return t},pt=t=>ht.unregister(t),Ct(t))}function Pt(){}function Ot(t,e,n){if(void 0===t[e].overloadTable){var r=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||ct("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[e].overloadTable+")!"),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[r.argCount]=r}}function $t(t,e,n){o.hasOwnProperty(t)?((void 0===n||void 0!==o[t].overloadTable&&void 0!==o[t].overloadTable[n])&&ct("Cannot register public name '"+t+"' twice"),Ot(o,t,t),o.hasOwnProperty(n)&&ct("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),o[t].overloadTable[n]=e):(o[t]=e,void 0!==n&&(o[t].numArguments=n))}function kt(t,e,n,r,i,o,a,s){this.name=t,this.constructor=e,this.instancePrototype=n,this.rawDestructor=r,this.baseClass=i,this.getActualType=o,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function At(t,e,n){for(;e!==n;)e.upcast||ct("Expected null or instance of "+n.name+", got an instance of "+e.name),t=e.upcast(t),e=e.baseClass;return t}function Et(t,e){if(null===e)return this.isReference&&ct("null is not a valid "+this.name),0;e.$$||ct('Cannot pass "'+Jt(e)+'" as a '+this.name),e.$$.ptr||ct("Cannot pass deleted object as a pointer of type "+this.name);var n=e.$$.ptrType.registeredClass;return At(e.$$.ptr,n,this.registeredClass)}function jt(t,e){var n;if(null===e)return this.isReference&&ct("null is not a valid "+this.name),this.isSmartPointer?(n=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,n),n):0;e.$$||ct('Cannot pass "'+Jt(e)+'" as a '+this.name),e.$$.ptr||ct("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&e.$$.ptrType.isConst&&ct("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);var r=e.$$.ptrType.registeredClass;if(n=At(e.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(void 0===e.$$.smartPtr&&ct("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?n=e.$$.smartPtr:ct("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:n=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)n=e.$$.smartPtr;else{var i=e.clone();n=this.rawShare(n,Lt.toHandle((function(){i.delete()}))),null!==t&&t.push(this.rawDestructor,n)}break;default:ct("Unsupporting sharing policy")}return n}function St(t,e){if(null===e)return this.isReference&&ct("null is not a valid "+this.name),0;e.$$||ct('Cannot pass "'+Jt(e)+'" as a '+this.name),e.$$.ptr||ct("Cannot pass deleted object as a pointer of type "+this.name),e.$$.ptrType.isConst&&ct("Cannot convert argument of type "+e.$$.ptrType.name+" to parameter type "+this.name);var n=e.$$.ptrType.registeredClass;return At(e.$$.ptr,n,this.registeredClass)}function xt(t,e,n,r,i,o,a,s,l,u,c){this.name=t,this.registeredClass=e,this.isReference=n,this.isConst=r,this.isSmartPointer=i,this.pointeeType=o,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=u,this.rawDestructor=c,i||void 0!==e.baseClass?this.toWireType=jt:r?(this.toWireType=Et,this.destructorFunction=null):(this.toWireType=St,this.destructorFunction=null)}function Dt(t,e,n){o.hasOwnProperty(t)||it("Replacing nonexistant public symbol"),void 0!==o[t].overloadTable&&void 0!==n?o[t].overloadTable[n]=e:(o[t]=e,o[t].argCount=n)}var Ft=[];function Vt(t){var e=Ft[t];return e||(t>=Ft.length&&(Ft.length=t+1),Ft[t]=e=T.get(t)),e}function Rt(t,e){var n,r,i,a=(t=lt(t)).includes("j")?(n=t,r=e,i=[],function(){return i.length=0,Object.assign(i,arguments),function(t,e,n){return t.includes("j")?function(t,e,n){var r=o["dynCall_"+t];return n&&n.length?r.apply(null,[e].concat(n)):r.call(null,e)}(t,e,n):Vt(e).apply(null,n)}(n,r,i)}):Vt(e);return"function"!=typeof a&&ct("unknown function pointer with signature "+t+": "+e),a}var Nt=void 0;function Mt(t){var e=De(t),n=lt(e);return xe(e),n}function It(t,e){var n=[],r={};throw e.forEach((function t(e){r[e]||X[e]||(Z[e]?Z[e].forEach(t):(n.push(e),r[e]=!0))})),new Nt(t+": "+n.map(Mt).join([", "]))}function Wt(t,e){for(var n=[],r=0;r<t;r++)n.push(v[e+4*r>>>2]);return n}function zt(t,e){if(!(t instanceof Function))throw new TypeError("new_ called with constructor type "+typeof t+" which is not a function");var n=et(t.name||"unknownFunctionName",(function(){}));n.prototype=t.prototype;var r=new n,i=t.apply(r,e);return i instanceof Object?i:r}function Ht(t,e,n,r,i){var o=e.length;o<2&&ct("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==e[1]&&null!==n,s=!1,l=1;l<e.length;++l)if(null!==e[l]&&void 0===e[l].destructorFunction){s=!0;break}var u="void"!==e[0].name,c="",f="";for(l=0;l<o-2;++l)c+=(0!==l?", ":"")+"arg"+l,f+=(0!==l?", ":"")+"arg"+l+"Wired";var d="return function "+tt(t)+"("+c+") {\nif (arguments.length !== "+(o-2)+") {\nthrowBindingError('function "+t+" called with ' + arguments.length + ' arguments, expected "+(o-2)+" args!');\n}\n";s&&(d+="var destructors = [];\n");var h=s?"destructors":"null",p=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],_=[ct,r,i,B,e[0],e[1]];for(a&&(d+="var thisWired = classParam.toWireType("+h+", this);\n"),l=0;l<o-2;++l)d+="var arg"+l+"Wired = argType"+l+".toWireType("+h+", arg"+l+"); // "+e[l+2].name+"\n",p.push("argType"+l),_.push(e[l+2]);if(a&&(f="thisWired"+(f.length>0?", ":"")+f),d+=(u?"var rv = ":"")+"invoker(fn"+(f.length>0?", ":"")+f+");\n",s)d+="runDestructors(destructors);\n";else for(l=a?1:2;l<e.length;++l){var m=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==e[l].destructorFunction&&(d+=m+"_dtor("+m+"); // "+e[l].name+"\n",p.push(m+"_dtor"),_.push(e[l].destructorFunction))}return u&&(d+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),d+="}\n",p.push(d),zt(Function,p).apply(null,_)}var Ut=[],Yt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function qt(t){t>4&&0==--Yt[t].refcount&&(Yt[t]=void 0,Ut.push(t))}var Lt={toValue:t=>(t||ct("Cannot use deleted val. handle = "+t),Yt[t].value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=Ut.length?Ut.pop():Yt.length;return Yt[e]={refcount:1,value:t},e}}};function Bt(t,e,n){switch(e){case 0:return function(t){var e=n?p:_;return this.fromWireType(e[t>>>0])};case 1:return function(t){var e=n?m:g;return this.fromWireType(e[t>>>1])};case 2:return function(t){var e=n?y:v;return this.fromWireType(e[t>>>2])};default:throw new TypeError("Unknown integer type: "+t)}}function Gt(t,e){var n=X[t];return void 0===n&&ct(e+" has unknown type "+Mt(t)),n}function Jt(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function Xt(t,e){switch(e){case 2:return function(t){return this.fromWireType(w[t>>>2])};case 3:return function(t){return this.fromWireType(b[t>>>3])};default:throw new TypeError("Unknown float type: "+t)}}function Zt(t,e,n){switch(e){case 0:return n?function(t){return p[t>>>0]}:function(t){return _[t>>>0]};case 1:return n?function(t){return m[t>>>1]}:function(t){return g[t>>>1]};case 2:return n?function(t){return y[t>>>2]}:function(t){return v[t>>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var Kt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function Qt(t,e){for(var n=t,r=n>>1,i=r+e/2;!(r>=i)&&g[r>>>0];)++r;if((n=r<<1)-t>32&&Kt)return Kt.decode(_.subarray(t>>>0,n>>>0));for(var o="",a=0;!(a>=e/2);++a){var s=m[t+2*a>>>1];if(0==s)break;o+=String.fromCharCode(s)}return o}function te(t,e,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=e,i=(n-=2)<2*t.length?n/2:t.length,o=0;o<i;++o){var a=t.charCodeAt(o);m[e>>>1]=a,e+=2}return m[e>>>1]=0,e-r}function ee(t){return 2*t.length}function ne(t,e){for(var n=0,r="";!(n>=e/4);){var i=y[t+4*n>>>2];if(0==i)break;if(++n,i>=65536){var o=i-65536;r+=String.fromCharCode(55296|o>>10,56320|1023&o)}else r+=String.fromCharCode(i)}return r}function re(t,e,n){if(void 0===n&&(n=2147483647),n<4)return 0;for(var r=e>>>=0,i=r+n-4,o=0;o<t.length;++o){var a=t.charCodeAt(o);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),y[e>>>2]=a,(e+=4)+4>i)break}return y[e>>>2]=0,e-r}function ie(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);r>=55296&&r<=57343&&++n,e+=4}return e}function oe(t,e){for(var n=new Array(t),r=0;r<t;++r)n[r]=Gt(v[e+4*r>>>2],"parameter "+r);return n}var ae={};function se(t){var e=ae[t];return void 0===e?lt(t):e}var le=[];function ue(){return"object"==typeof globalThis?globalThis:Function("return this")()}var ce=[],fe={};function de(t){return t%4==0&&(t%100!=0||t%400==0)}var he=[0,31,60,91,121,152,182,213,244,274,305,335],pe=[0,31,59,90,120,151,181,212,243,273,304,334];function _e(t){var e=A(t)+1,n=Se(e);return n&&k(t,p,n,e),n}var me,ge=[];function ye(t){var e=f.buffer;try{return f.grow(t-e.byteLength+65535>>>16),E(),1}catch(t){}}me=()=>performance.now();var ve={};function we(){if(!we.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:l||"./this.program"};for(var e in ve)void 0===ve[e]?delete t[e]:t[e]=ve[e];var n=[];for(var e in t)n.push(e+"="+t[e]);we.strings=n}return we.strings}var be=[null,[],[]];function Te(t,e){for(var n=0,r=0;r<=e;n+=t[r++]);return n}var Ce=[31,29,31,30,31,30,31,31,30,31,30,31],Pe=[31,28,31,30,31,30,31,31,30,31,30,31];function Oe(t,e){for(var n=new Date(t.getTime());e>0;){var r=de(n.getFullYear()),i=n.getMonth(),o=(r?Ce:Pe)[i];if(!(e>o-n.getDate()))return n.setDate(n.getDate()+e),n;e-=o-n.getDate()+1,n.setDate(1),i<11?n.setMonth(i+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return n}function $e(t,e,n){var r=n>0?n:A(t)+1,i=new Array(r),o=k(t,i,0,i.length);return e&&(i.length=o),i}function ke(t,e,n,r){var i=y[r+40>>>2],o={tm_sec:y[r>>>2],tm_min:y[r+4>>>2],tm_hour:y[r+8>>>2],tm_mday:y[r+12>>>2],tm_mon:y[r+16>>>2],tm_year:y[r+20>>>2],tm_wday:y[r+24>>>2],tm_yday:y[r+28>>>2],tm_isdst:y[r+32>>>2],tm_gmtoff:y[r+36>>>2],tm_zone:i?$(i):""},a=$(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in s)a=a.replace(new RegExp(l,"g"),s[l]);var u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"];function f(t,e,n){for(var r="number"==typeof t?t.toString():t||"";r.length<e;)r=n[0]+r;return r}function d(t,e){return f(t,e,"0")}function h(t,e){function n(t){return t<0?-1:t>0?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function _(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function m(t){var e=Oe(new Date(t.tm_year+1900,0,1),t.tm_yday),n=new Date(e.getFullYear(),0,4),r=new Date(e.getFullYear()+1,0,4),i=_(n),o=_(r);return h(i,e)<=0?h(o,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var g={"%a":function(t){return u[t.tm_wday].substring(0,3)},"%A":function(t){return u[t.tm_wday]},"%b":function(t){return c[t.tm_mon].substring(0,3)},"%B":function(t){return c[t.tm_mon]},"%C":function(t){return d((t.tm_year+1900)/100|0,2)},"%d":function(t){return d(t.tm_mday,2)},"%e":function(t){return f(t.tm_mday,2," ")},"%g":function(t){return m(t).toString().substring(2)},"%G":function(t){return m(t)},"%H":function(t){return d(t.tm_hour,2)},"%I":function(t){var e=t.tm_hour;return 0==e?e=12:e>12&&(e-=12),d(e,2)},"%j":function(t){return d(t.tm_mday+Te(de(t.tm_year+1900)?Ce:Pe,t.tm_mon-1),3)},"%m":function(t){return d(t.tm_mon+1,2)},"%M":function(t){return d(t.tm_min,2)},"%n":function(){return"\n"},"%p":function(t){return t.tm_hour>=0&&t.tm_hour<12?"AM":"PM"},"%S":function(t){return d(t.tm_sec,2)},"%t":function(){return"\t"},"%u":function(t){return t.tm_wday||7},"%U":function(t){var e=t.tm_yday+7-t.tm_wday;return d(Math.floor(e/7),2)},"%V":function(t){var e=Math.floor((t.tm_yday+7-(t.tm_wday+6)%7)/7);if((t.tm_wday+371-t.tm_yday-2)%7<=2&&e++,e){if(53==e){var n=(t.tm_wday+371-t.tm_yday)%7;4==n||3==n&&de(t.tm_year)||(e=1)}}else{e=52;var r=(t.tm_wday+7-t.tm_yday-1)%7;(4==r||5==r&&de(t.tm_year%400-1))&&e++}return d(e,2)},"%w":function(t){return t.tm_wday},"%W":function(t){var e=t.tm_yday+7-(t.tm_wday+6)%7;return d(Math.floor(e/7),2)},"%y":function(t){return(t.tm_year+1900).toString().substring(2)},"%Y":function(t){return t.tm_year+1900},"%z":function(t){var e=t.tm_gmtoff,n=e>=0;return e=(e=Math.abs(e)/60)/60*100+e%60,(n?"+":"-")+String("0000"+e).slice(-4)},"%Z":function(t){return t.tm_zone},"%%":function(){return"%"}};for(var l in a=a.replace(/%%/g,"\0\0"),g)a.includes(l)&&(a=a.replace(new RegExp(l,"g"),g[l](o)));var v,w,b=$e(a=a.replace(/\0\0/g,"%"),!1);return b.length>e?0:(v=b,w=t,p.set(v,w>>>0),b.length-1)}function Ae(t){return parseInt(t)}rt=o.InternalError=nt(Error,"InternalError"),function(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);st=t}(),ut=o.BindingError=nt(Error,"BindingError"),Pt.prototype.isAliasOf=function(t){if(!(this instanceof Pt))return!1;if(!(t instanceof Pt))return!1;for(var e=this.$$.ptrType.registeredClass,n=this.$$.ptr,r=t.$$.ptrType.registeredClass,i=t.$$.ptr;e.baseClass;)n=e.upcast(n),e=e.baseClass;for(;r.baseClass;)i=r.upcast(i),r=r.baseClass;return e===r&&n===i},Pt.prototype.clone=function(){if(this.$$.ptr||dt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t,e=Ct(Object.create(Object.getPrototypeOf(this),{$$:{value:(t=this.$$,{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType})}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},Pt.prototype.delete=function(){this.$$.ptr||dt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ct("Object already scheduled for deletion"),pt(this),_t(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},Pt.prototype.isDeleted=function(){return!this.$$.ptr},Pt.prototype.deleteLater=function(){return this.$$.ptr||dt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ct("Object already scheduled for deletion"),yt.push(this),1===yt.length&&wt&&wt(vt),this.$$.deleteScheduled=!0,this},o.getInheritedInstanceCount=function(){return Object.keys(bt).length},o.getLiveInheritedInstances=function(){var t=[];for(var e in bt)bt.hasOwnProperty(e)&&t.push(bt[e]);return t},o.flushPendingDeletes=vt,o.setDelayFunction=function(t){wt=t,yt.length&&wt&&wt(vt)},xt.prototype.getPointee=function(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},xt.prototype.destructor=function(t){this.rawDestructor&&this.rawDestructor(t)},xt.prototype.argPackAdvance=8,xt.prototype.readValueFromPointer=G,xt.prototype.deleteObject=function(t){null!==t&&t.delete()},xt.prototype.fromWireType=function(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var n=function(t,e){return e=function(t,e){for(void 0===e&&ct("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}(t,e),bt[e]}(this.registeredClass,e);if(void 0!==n){if(0===n.$$.count.value)return n.$$.ptr=e,n.$$.smartPtr=t,n.clone();var r=n.clone();return this.destructor(t),r}function i(){return this.isSmartPointer?Tt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Tt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o,a=this.registeredClass.getActualType(e),s=gt[a];if(!s)return i.call(this);o=this.isConst?s.constPointerType:s.pointerType;var l=mt(e,this.registeredClass,o.registeredClass);return null===l?i.call(this):this.isSmartPointer?Tt(o.registeredClass.instancePrototype,{ptrType:o,ptr:l,smartPtrType:this,smartPtr:t}):Tt(o.registeredClass.instancePrototype,{ptrType:o,ptr:l})},Nt=o.UnboundTypeError=nt(Error,"UnboundTypeError"),o.count_emval_handles=function(){for(var t=0,e=5;e<Yt.length;++e)void 0!==Yt[e]&&++t;return t},o.get_first_emval=function(){for(var t=5;t<Yt.length;++t)if(void 0!==Yt[t])return Yt[t];return null};var Ee,je={g:function(t,e,n){throw new Y(t).init(e,n),t},H:function(t,e,n){return q.varargs=n,0},Q:function(t,e,n){},W:function(t,e,n){},S:function(t,e,n){return q.varargs=n,0},K:function(t,e,n,r){q.varargs=r},ea:function(t,e){},E:function(t){var e=L[t];delete L[t];var n=e.rawConstructor,r=e.rawDestructor,i=e.fields;ot([t],i.map((t=>t.getterReturnType)).concat(i.map((t=>t.setterArgumentType))),(t=>{var o={};return i.forEach(((e,n)=>{var r=e.fieldName,a=t[n],s=e.getter,l=e.getterContext,u=t[n+i.length],c=e.setter,f=e.setterContext;o[r]={read:t=>a.fromWireType(s(l,t)),write:(t,e)=>{var n=[];c(f,t,u.toWireType(n,e)),B(n)}}})),[{name:e.name,fromWireType:function(t){var e={};for(var n in o)e[n]=o[n].read(t);return r(t),e},toWireType:function(t,e){for(var i in o)if(!(i in e))throw new TypeError('Missing field: "'+i+'"');var a=n();for(i in o)o[i].write(a,e[i]);return null!==t&&t.push(r,a),a},argPackAdvance:8,readValueFromPointer:G,destructorFunction:r}]}))},R:function(t,e,n,r,i){},ha:function(t,e,n,r,i){var o=at(n);ft(t,{name:e=lt(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?r:i},argPackAdvance:8,readValueFromPointer:function(t){var r;if(1===n)r=p;else if(2===n)r=m;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+e);r=y}return this.fromWireType(r[t>>>o])},destructorFunction:null})},o:function(t,e,n,r,i,o,a,s,l,u,c,f,d){c=lt(c),o=Rt(i,o),s&&(s=Rt(a,s)),u&&(u=Rt(l,u)),d=Rt(f,d);var h=tt(c);$t(h,(function(){It("Cannot construct "+c+" due to unbound types",[r])})),ot([t,e,n],r?[r]:[],(function(e){var n,i;e=e[0],i=r?(n=e.registeredClass).instancePrototype:Pt.prototype;var a=et(h,(function(){if(Object.getPrototypeOf(this)!==l)throw new ut("Use 'new' to construct "+c);if(void 0===f.constructor_body)throw new ut(c+" has no accessible constructor");var t=f.constructor_body[arguments.length];if(void 0===t)throw new ut("Tried to invoke ctor of "+c+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(f.constructor_body).toString()+") parameters instead!");return t.apply(this,arguments)})),l=Object.create(i,{constructor:{value:a}});a.prototype=l;var f=new kt(c,a,l,d,n,o,s,u),p=new xt(c,f,!0,!1,!1),_=new xt(c+"*",f,!1,!1,!1),m=new xt(c+" const*",f,!1,!0,!1);return gt[t]={pointerType:_,constPointerType:m},Dt(h,a),[p,_,m]}))},t:function(t,e,n,r,i,o){e>0||R(undefined);var a=Wt(e,n);i=Rt(r,i),ot([],[t],(function(t){var n="constructor "+(t=t[0]).name;if(void 0===t.registeredClass.constructor_body&&(t.registeredClass.constructor_body=[]),void 0!==t.registeredClass.constructor_body[e-1])throw new ut("Cannot register multiple constructors with identical number of parameters ("+(e-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.registeredClass.constructor_body[e-1]=()=>{It("Cannot construct "+t.name+" due to unbound types",a)},ot([],a,(function(r){return r.splice(1,0,null),t.registeredClass.constructor_body[e-1]=Ht(n,r,null,i,o),[]})),[]}))},c:function(t,e,n,r,i,o,a,s){var l=Wt(n,r);e=lt(e),o=Rt(i,o),ot([],[t],(function(t){var r=(t=t[0]).name+"."+e;function i(){It("Cannot call "+r+" due to unbound types",l)}e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&t.registeredClass.pureVirtualFunctions.push(e);var u=t.registeredClass.instancePrototype,c=u[e];return void 0===c||void 0===c.overloadTable&&c.className!==t.name&&c.argCount===n-2?(i.argCount=n-2,i.className=t.name,u[e]=i):(Ot(u,e,r),u[e].overloadTable[n-2]=i),ot([],l,(function(i){var s=Ht(r,i,t,o,a);return void 0===u[e].overloadTable?(s.argCount=n-2,u[e]=s):u[e].overloadTable[n-2]=s,[]})),[]}))},ga:function(t,e){ft(t,{name:e=lt(e),fromWireType:function(t){var e=Lt.toValue(t);return qt(t),e},toWireType:function(t,e){return Lt.toHandle(e)},argPackAdvance:8,readValueFromPointer:G,destructorFunction:null})},N:function(t,e,n,r){var i=at(n);function o(){}e=lt(e),o.values={},ft(t,{name:e,constructor:o,fromWireType:function(t){return this.constructor.values[t]},toWireType:function(t,e){return e.value},argPackAdvance:8,readValueFromPointer:Bt(e,i,r),destructorFunction:null}),$t(e,o)},s:function(t,e,n){var r=Gt(t,"enum");e=lt(e);var i=r.constructor,o=Object.create(r.constructor.prototype,{value:{value:n},constructor:{value:et(r.name+"_"+e,(function(){}))}});i.values[n]=o,i[e]=o},L:function(t,e,n){var r=at(n);ft(t,{name:e=lt(e),fromWireType:function(t){return t},toWireType:function(t,e){return e},argPackAdvance:8,readValueFromPointer:Xt(e,r),destructorFunction:null})},n:function(t,e,n,r,i,o){var a=Wt(e,n);t=lt(t),i=Rt(r,i),$t(t,(function(){It("Cannot call "+t+" due to unbound types",a)}),e-1),ot([],a,(function(n){var r=[n[0],null].concat(n.slice(1));return Dt(t,Ht(t,r,null,i,o),e-1),[]}))},z:function(t,e,n,r,i){e=lt(e),-1===i&&(i=4294967295);var o=at(n),a=t=>t;if(0===r){var s=32-8*n;a=t=>t<<s>>>s}var l=e.includes("unsigned");ft(t,{name:e,fromWireType:a,toWireType:l?function(t,e){return this.name,e>>>0}:function(t,e){return this.name,e},argPackAdvance:8,readValueFromPointer:Zt(e,o,0!==r),destructorFunction:null})},v:function(t,e,n){var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function i(t){var e=v,n=e[(t>>=2)>>>0],i=e[t+1>>>0];return new r(e.buffer,i,n)}ft(t,{name:n=lt(n),fromWireType:i,argPackAdvance:8,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},w:function(t,e,n,r,i,o,a,s,l,u,c,f){n=lt(n),o=Rt(i,o),s=Rt(a,s),u=Rt(l,u),f=Rt(c,f),ot([t],[e],(function(t){return t=t[0],[new xt(n,t.registeredClass,!1,!1,!0,t,r,o,s,u,f)]}))},M:function(t,e){var n="std::string"===(e=lt(e));ft(t,{name:e,fromWireType:function(t){var e,r=v[t>>>2],i=t+4;if(n)for(var o=i,a=0;a<=r;++a){var s=i+a;if(a==r||0==_[s>>>0]){var l=$(o,s-o);void 0===e?e=l:(e+=String.fromCharCode(0),e+=l),o=s+1}}else{var u=new Array(r);for(a=0;a<r;++a)u[a]=String.fromCharCode(_[i+a>>>0]);e=u.join("")}return xe(t),e},toWireType:function(t,e){var r;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var i="string"==typeof e;i||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||ct("Cannot pass non-string to std::string"),r=n&&i?A(e):e.length;var o=Se(4+r+1),a=o+4;if(a>>>=0,v[o>>>2]=r,n&&i)k(e,_,a,r+1);else if(i)for(var s=0;s<r;++s){var l=e.charCodeAt(s);l>255&&(xe(a),ct("String has UTF-16 code units that do not fit in 8 bits")),_[a+s>>>0]=l}else for(s=0;s<r;++s)_[a+s>>>0]=e[s];return null!==t&&t.push(xe,o),o},argPackAdvance:8,readValueFromPointer:G,destructorFunction:function(t){xe(t)}})},G:function(t,e,n){var r,i,o,a,s;n=lt(n),2===e?(r=Qt,i=te,a=ee,o=()=>g,s=1):4===e&&(r=ne,i=re,a=ie,o=()=>v,s=2),ft(t,{name:n,fromWireType:function(t){for(var n,i=v[t>>>2],a=o(),l=t+4,u=0;u<=i;++u){var c=t+4+u*e;if(u==i||0==a[c>>>s]){var f=r(l,c-l);void 0===n?n=f:(n+=String.fromCharCode(0),n+=f),l=c+e}}return xe(t),n},toWireType:function(t,r){"string"!=typeof r&&ct("Cannot pass non-string to C++ string type "+n);var o=a(r),l=Se(4+o+e);return v[(l>>>=0)>>>2]=o>>s,i(r,l+4,o+e),null!==t&&t.push(xe,l),l},argPackAdvance:8,readValueFromPointer:G,destructorFunction:function(t){xe(t)}})},F:function(t,e,n,r,i,o){L[t]={name:lt(e),rawConstructor:Rt(n,r),rawDestructor:Rt(i,o),fields:[]}},y:function(t,e,n,r,i,o,a,s,l,u){L[t].fields.push({fieldName:lt(e),getterReturnType:n,getter:Rt(r,i),getterContext:o,setterArgumentType:a,setter:Rt(s,l),setterContext:u})},ia:function(t,e){ft(t,{isVoid:!0,name:e=lt(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(t,e){}})},Z:function(){return!0},j:function(t,e,n){t=Lt.toValue(t),e=Gt(e,"emval::as");var r=[],i=Lt.toHandle(r);return v[n>>>2]=i,e.toWireType(r,t)},la:function(t,e,n,r){t=Lt.toValue(t);for(var i=oe(e,n),o=new Array(e),a=0;a<e;++a){var s=i[a];o[a]=s.readValueFromPointer(r),r+=s.argPackAdvance}var l=t.apply(void 0,o);return Lt.toHandle(l)},m:function(t,e,n,r,i){return(t=le[t])(e=Lt.toValue(e),n=se(n),function(t){var e=[];return v[t>>>2]=Lt.toHandle(e),e}(r),i)},p:function(t,e,n,r){(t=le[t])(e=Lt.toValue(e),n=se(n),null,r)},a:qt,q:function(t){return 0===t?Lt.toHandle(ue()):(t=se(t),Lt.toHandle(ue()[t]))},h:function(t,e){var n=oe(t,e),r=n[0],i=r.name+"_$"+n.slice(1).map((function(t){return t.name})).join("_")+"$",o=ce[i];if(void 0!==o)return o;for(var a=["retType"],s=[r],l="",u=0;u<t-1;++u)l+=(0!==u?", ":"")+"arg"+u,a.push("argType"+u),s.push(n[1+u]);var c,f,d="return function "+tt("methodCaller_"+i)+"(handle, name, destructors, args) {\n",h=0;for(u=0;u<t-1;++u)d+=" var arg"+u+" = argType"+u+".readValueFromPointer(args"+(h?"+"+h:"")+");\n",h+=n[u+1].argPackAdvance;for(d+=" var rv = handle[name]("+l+");\n",u=0;u<t-1;++u)n[u+1].deleteObject&&(d+=" argType"+u+".deleteObject(arg"+u+");\n");return r.isVoid||(d+=" return retType.toWireType(destructors, rv);\n"),d+="};\n",a.push(d),c=zt(Function,a).apply(null,s),f=le.length,le.push(c),o=f,ce[i]=o,o},u:function(t){return t=se(t),Lt.toHandle(o[t])},k:function(t,e){return t=Lt.toValue(t),e=Lt.toValue(e),Lt.toHandle(t[e])},d:function(t){t>4&&(Yt[t].refcount+=1)},O:function(t,e){return(t=Lt.toValue(t))instanceof Lt.toValue(e)},r:function(t,e,n,r){t=Lt.toValue(t);var i=fe[e];return i||(i=function(t){for(var e="",n=0;n<t;++n)e+=(0!==n?", ":"")+"arg"+n;var r="return function emval_allocator_"+t+"(constructor, argTypes, args) {\n var HEAPU32 = getMemory();\n";for(n=0;n<t;++n)r+="var argType"+n+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+n+"');\nvar arg"+n+" = argType"+n+".readValueFromPointer(args);\nargs += argType"+n+"['argPackAdvance'];\nargTypes += 4;\n";return r+="var obj = new constructor("+e+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle","getMemory",r)(Gt,o,Lt.toHandle,(()=>v))}(e),fe[e]=i),i(t,n,r)},C:function(){return Lt.toHandle([])},l:function(t){return Lt.toHandle(se(t))},I:function(){return Lt.toHandle({})},f:function(t){B(Lt.toValue(t)),qt(t)},A:function(t,e,n){t=Lt.toValue(t),e=Lt.toValue(e),n=Lt.toValue(n),t[e]=n},i:function(t,e){var n=(t=Gt(t,"_emval_take_value")).readValueFromPointer(e);return Lt.toHandle(n)},B:function(t){return t=Lt.toValue(t),Lt.toHandle(typeof t)},$:function(t,e){var n,r=new Date(1e3*(v[(n=t)>>>2]+4294967296*y[n+4>>>2]));y[e>>>2]=r.getSeconds(),y[e+4>>>2]=r.getMinutes(),y[e+8>>>2]=r.getHours(),y[e+12>>>2]=r.getDate(),y[e+16>>>2]=r.getMonth(),y[e+20>>>2]=r.getFullYear()-1900,y[e+24>>>2]=r.getDay();var i=0|function(t){return(de(t.getFullYear())?he:pe)[t.getMonth()]+t.getDate()-1}(r);y[e+28>>>2]=i,y[e+36>>>2]=-60*r.getTimezoneOffset();var o=new Date(r.getFullYear(),0,1),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),l=0|(a!=s&&r.getTimezoneOffset()==Math.min(s,a));y[e+32>>>2]=l},X:function(t,e,n,r,i,o,a){return-52},Y:function(t,e,n,r,i,o){},aa:function(t,e,n){var r=(new Date).getFullYear(),i=new Date(r,0,1),o=new Date(r,6,1),a=i.getTimezoneOffset(),s=o.getTimezoneOffset(),l=Math.max(a,s);function u(t){var e=t.toTimeString().match(/\(([A-Za-z ]+)\)$/);return e?e[1]:"GMT"}v[t>>>2]=60*l,y[e>>>2]=Number(a!=s);var c=u(i),f=u(o),d=_e(c),h=_e(f);s<a?(v[n>>>2]=d,v[n+4>>>2]=h):(v[n>>>2]=h,v[n+4>>>2]=d)},e:function(){R("")},b:function(t,e,n){return function(t,e,n){var r=function(t,e){var n;for(ge.length=0,e>>=2;n=_[t++>>>0];)e+=105!=n&e,ge.push(105==n?y[e>>>0]:b[e++>>>1]),++e;return ge}(e,n);return H[t].apply(null,r)}(t,e,n)},_:function(){return Date.now()},U:function(){return 4294901760},ba:me,fa:function(t,e,n){_.copyWithin(t>>>0,e>>>0,e+n>>>0)},T:function(t){var e,n=_.length,r=4294901760;if((t>>>=0)>r)return!1;for(var i=1;i<=4;i*=2){var o=n*(1+.2/i);if(o=Math.min(o,t+100663296),ye(Math.min(r,(e=Math.max(t,o))+(65536-e%65536)%65536)))return!0}return!1},ca:function(t,e){var n=0;return we().forEach((function(r,i){var o=e+n;v[t+4*i>>>2]=o,function(t,e,n){for(var r=0;r<t.length;++r)p[e++>>>0]=t.charCodeAt(r);p[e>>>0]=0}(r,o),n+=r.length+1})),0},da:function(t,e){var n=we();v[t>>>2]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),v[e>>>2]=r,0},D:function(t){return 52},J:function(t,e,n,r){return 52},P:function(t,e,n,r,i){return 70},V:function(t,e,n,r){for(var i,o,a,s=0,l=0;l<n;l++){var u=v[e>>>2],c=v[e+4>>>2];e+=8;for(var f=0;f<c;f++)i=t,o=_[u+f>>>0],a=void 0,a=be[i],0===o||10===o?((1===i?d:h)(O(a,0)),a.length=0):a.push(o);s+=c}return v[r>>>2]=s,0},ka:ke,x:function(t,e,n,r,i){return ke(t,e,n,r)},ja:function(t,e,n){for(var r=$(e),i="\\!@#$^&*()+=-[]/{}|:<>?,.",o=0;o<25;++o)r=r.replace(new RegExp("\\"+i[o],"g"),"\\"+i[o]);var a={"%A":"%a","%B":"%b","%c":"%a %b %d %H:%M:%S %Y","%D":"%m\\/%d\\/%y","%e":"%d","%F":"%Y-%m-%d","%h":"%b","%R":"%H\\:%M","%r":"%I\\:%M\\:%S\\s%p","%T":"%H\\:%M\\:%S","%x":"%m\\/%d\\/(?:%y|%Y)","%X":"%H\\:%M\\:%S"};for(var s in a)r=r.replace(s,a[s]);var l={"%a":"(?:Sun(?:day)?)|(?:Mon(?:day)?)|(?:Tue(?:sday)?)|(?:Wed(?:nesday)?)|(?:Thu(?:rsday)?)|(?:Fri(?:day)?)|(?:Sat(?:urday)?)","%b":"(?:Jan(?:uary)?)|(?:Feb(?:ruary)?)|(?:Mar(?:ch)?)|(?:Apr(?:il)?)|May|(?:Jun(?:e)?)|(?:Jul(?:y)?)|(?:Aug(?:ust)?)|(?:Sep(?:tember)?)|(?:Oct(?:ober)?)|(?:Nov(?:ember)?)|(?:Dec(?:ember)?)","%C":"\\d\\d","%d":"0[1-9]|[1-9](?!\\d)|1\\d|2\\d|30|31","%H":"\\d(?!\\d)|[0,1]\\d|20|21|22|23","%I":"\\d(?!\\d)|0\\d|10|11|12","%j":"00[1-9]|0?[1-9](?!\\d)|0?[1-9]\\d(?!\\d)|[1,2]\\d\\d|3[0-6]\\d","%m":"0[1-9]|[1-9](?!\\d)|10|11|12","%M":"0\\d|\\d(?!\\d)|[1-5]\\d","%n":"\\s","%p":"AM|am|PM|pm|A\\.M\\.|a\\.m\\.|P\\.M\\.|p\\.m\\.","%S":"0\\d|\\d(?!\\d)|[1-5]\\d|60","%U":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%W":"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53","%w":"[0-6]","%y":"\\d\\d","%Y":"\\d\\d\\d\\d","%%":"%","%t":"\\s"};for(var u in l)r=r.replace(u,"("+u+l[u]+")");var c=[];for(o=r.indexOf("%");o>=0;o=r.indexOf("%"))c.push(r[o+1]),r=r.replace(new RegExp("\\%"+r[o+1],"g"),"");var f=new RegExp("^"+r,"i").exec($(t));if(f){var d,h=function(){function t(t,e,n){return"number"!=typeof t||isNaN(t)?e:t>=e?t<=n?t:n:e}return{year:t(y[n+20>>>2]+1900,1970,9999),month:t(y[n+16>>>2],0,11),day:t(y[n+12>>>2],1,31),hour:t(y[n+8>>>2],0,23),min:t(y[n+4>>>2],0,59),sec:t(y[n>>>2],0,59)}}(),p=t=>{var e=c.indexOf(t);if(e>=0)return f[e+1]};if((d=p("S"))&&(h.sec=Ae(d)),(d=p("M"))&&(h.min=Ae(d)),d=p("H"))h.hour=Ae(d);else if(d=p("I")){var _=Ae(d);(d=p("p"))&&(_+="P"===d.toUpperCase()[0]?12:0),h.hour=_}if(d=p("Y"))h.year=Ae(d);else if(d=p("y")){var m=Ae(d);(d=p("C"))?m+=100*Ae(d):m+=m<69?2e3:1900,h.year=m}if((d=p("m"))?h.month=Ae(d)-1:(d=p("b"))&&(h.month={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11}[d.substring(0,3).toUpperCase()]||0),d=p("d"))h.day=Ae(d);else if(d=p("j"))for(var g=Ae(d),v=de(h.year),w=0;w<12;++w){var b=Te(v?Ce:Pe,w-1);g<=b+(v?Ce:Pe)[w]&&(h.day=g-b)}else if(d=p("a")){var T=d.substring(0,3).toUpperCase();if(d=p("U")){var C={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6}[T],P=Ae(d);k=0===(O=new Date(h.year,0,1)).getDay()?Oe(O,C+7*(P-1)):Oe(O,7-O.getDay()+C+7*(P-1)),h.day=k.getDate(),h.month=k.getMonth()}else if(d=p("W")){var O,k;C={MON:0,TUE:1,WED:2,THU:3,FRI:4,SAT:5,SUN:6}[T],P=Ae(d),k=1===(O=new Date(h.year,0,1)).getDay()?Oe(O,C+7*(P-1)):Oe(O,7-O.getDay()+1+C+7*(P-1)),h.day=k.getDate(),h.month=k.getMonth()}}var A=new Date(h.year,h.month,h.day,h.hour,h.min,h.sec,0);return y[n>>>2]=A.getSeconds(),y[n+4>>>2]=A.getMinutes(),y[n+8>>>2]=A.getHours(),y[n+12>>>2]=A.getDate(),y[n+16>>>2]=A.getMonth(),y[n+20>>>2]=A.getFullYear()-1900,y[n+24>>>2]=A.getDay(),y[n+28>>>2]=Te(de(A.getFullYear())?Ce:Pe,A.getMonth()-1)+A.getDate()-1,y[n+32>>>2]=0,t+$e(f[0]).length-1}return 0}},Se=(function(){var t,e,n,r,a={a:je};function s(t,e){var n,r=t.exports;return o.asm=r,f=o.asm.ma,E(),T=o.asm.qa,n=o.asm.na,S.unshift(n),function(t){if(D--,o.monitorRunDependencies&&o.monitorRunDependencies(D),0==D&&(null!==F&&(clearInterval(F),F=null),V)){var e=V;V=null,e()}}(),r}if(D++,o.monitorRunDependencies&&o.monitorRunDependencies(D),o.instantiateWasm)try{return o.instantiateWasm(a,s)}catch(t){h("Module.instantiateWasm callback failed with error: "+t),i(t)}(t=c,e=N,n=a,r=function(t){s(t.instance)},t||"function"!=typeof WebAssembly.instantiateStreaming||I(e)||"function"!=typeof fetch?z(e,n,r):fetch(e,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,n).then(r,(function(t){return h("wasm streaming compile failed: "+t),h("falling back to ArrayBuffer instantiation"),z(e,n,r)}))}))).catch(i)}(),function(){return(Se=o.asm.oa).apply(null,arguments)}),xe=function(){return(xe=o.asm.pa).apply(null,arguments)},De=o.___getTypeName=function(){return(De=o.___getTypeName=o.asm.ra).apply(null,arguments)},Fe=(o.__embind_initialize_bindings=function(){return(o.__embind_initialize_bindings=o.asm.sa).apply(null,arguments)},function(){return(Fe=o.asm.ta).apply(null,arguments)});function Ve(){function t(){Ee||(Ee=!0,o.calledRun=!0,C||(U(S),r(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)t=o.postRun.shift(),x.unshift(t);var t;U(x)}()))}D>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)t=o.preRun.shift(),j.unshift(t);var t;U(j)}(),D>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}if(o.dynCall_ji=function(){return(o.dynCall_ji=o.asm.ua).apply(null,arguments)},o.dynCall_viij=function(){return(o.dynCall_viij=o.asm.va).apply(null,arguments)},o.dynCall_viiij=function(){return(o.dynCall_viiij=o.asm.wa).apply(null,arguments)},o.dynCall_viiijj=function(){return(o.dynCall_viiijj=o.asm.xa).apply(null,arguments)},o.dynCall_viji=function(){return(o.dynCall_viji=o.asm.ya).apply(null,arguments)},o.dynCall_viiji=function(){return(o.dynCall_viiji=o.asm.za).apply(null,arguments)},o.dynCall_viijji=function(){return(o.dynCall_viijji=o.asm.Aa).apply(null,arguments)},o.dynCall_viijj=function(){return(o.dynCall_viijj=o.asm.Ba).apply(null,arguments)},o.dynCall_viijij=function(){return(o.dynCall_viijij=o.asm.Ca).apply(null,arguments)},o.dynCall_viiiijii=function(){return(o.dynCall_viiiijii=o.asm.Da).apply(null,arguments)},o.dynCall_vijjji=function(){return(o.dynCall_vijjji=o.asm.Ea).apply(null,arguments)},o.dynCall_jiji=function(){return(o.dynCall_jiji=o.asm.Fa).apply(null,arguments)},o.dynCall_viijii=function(){return(o.dynCall_viijii=o.asm.Ga).apply(null,arguments)},o.dynCall_iiiiij=function(){return(o.dynCall_iiiiij=o.asm.Ha).apply(null,arguments)},o.dynCall_iiiiijj=function(){return(o.dynCall_iiiiijj=o.asm.Ia).apply(null,arguments)},o.dynCall_iiiiiijj=function(){return(o.dynCall_iiiiiijj=o.asm.Ja).apply(null,arguments)},V=function t(){Ee||Ve(),Ee||(V=t)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return Ve(),e.ready}),i={integer:"integer",float:"float",string:"string",boolean:"boolean",date:"date",datetime:"datetime",object:"object"},o={row_pivot:"group_by","row-pivot":"group_by","row-pivots":"group_by",col_pivot:"split_by",col_pivots:"split_by",column_pivot:"split_by","column-pivot":"split_by","column-pivots":"split_by",filters:"filter",sorts:"sort"},a=["viewport","group_by","split_by","aggregates","columns","filter","sort","computed_columns","expressions","group_by_depth","split_by_depth","filter_op"],s=["any","avg","abs sum","count","distinct count","dominant","first by index","last by index","last minus first","last","high","join","low","high minus low","max","mean","median","min","pct sum parent","pct sum grand total","stddev","sum","sum abs","sum not null","unique","var"],l=["any","count","distinct count","distinct leaf","dominant","first by index","join","last by index","last","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],f={string:l,float:s,integer:s,boolean:["any","count","distinct count","distinct leaf","dominant","first by index","last by index","last","unique"],datetime:l,date:l},d={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"},h=[d.bitwiseAnd,d.bitwiseOr,d.equals,d.doesNotEqual,d.or,d.and,d.isNull,d.isNotNull],p=[d.lessThan,d.greaterThan,d.equals,d.lessThanOrEquals,d.greaterThanOrEquals,d.doesNotEqual,d.isNull,d.isNotNull],_=[d.equals,d.contains,d.doesNotEqual,d.isIn,d.isNotIn,d.beginsWith,d.endsWith,d.isNull,d.isNotNull],m=[d.lessThan,d.greaterThan,d.equals,d.lessThanOrEquals,d.greaterThanOrEquals,d.doesNotEqual,d.isNull,d.isNotNull],g="|",y={string:_,float:p,integer:p,boolean:h,datetime:m,date:m},v={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:{dateStyle:"short",timeStyle:"medium"},null_value:-1},date:{filter_operator:"==",aggregate:"count",format:{dateStyle:"short"},null_value:-1}}};function w(t){const e={};if(C().types[t]&&Object.assign(e,C().types[t]),e.type){const t=w(e.type);return Object.assign(t,e),t}return e}function b(t){return t&&"object"==typeof t&&!Array.isArray(t)}function T(t,...e){if(!e.length)return t;const n=e.shift();if(b(t)&&b(n))for(const e in n)b(n[e])?(t[e]||Object.assign(t,{[e]:{}}),T(t[e],n[e])):Object.assign(t,{[e]:n[e]});return T(t,...e)}function C(){return globalThis.__PERSPECTIVE_CONFIG__||(globalThis.__PERSPECTIVE_CONFIG__=T(v,globalThis.__TEMPLATE_CONFIG__||{})),globalThis.__PERSPECTIVE_CONFIG__}function P(t){return t>=1&&t<=8?"integer":19===t?"string":10===t||9===t?"float":11===t?"boolean":12===t?"datetime":13===t?"date":void console.warn(`Unknown type for value ${t} with JS type ${typeof t}`)}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))}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;for(var i,o,a=0|e,s=Math.max(a>=0?a:r-Math.abs(a),0);s<r;){if((i=n[s])===(o=t)||"number"==typeof i&&"number"==typeof o&&isNaN(i)&&isNaN(o))return!0;s++}return!1}});class ${constructor(){this.data_formats={row:0,column:1,schema:2},this.format=void 0,this.data=void 0,this.names=void 0,this.types=void 0,this.row_count=void 0}is_format(t){if(Array.isArray(t))return this.data_formats.row;if(Array.isArray(t[Object.keys(t)[0]]))return this.data_formats.column;if("string"==typeof t[Object.keys(t)[0]]||"function"==typeof t[Object.keys(t)[0]])return this.data_formats.schema;throw`Could not determine data format for ${JSON.stringify(t)}, with JS typeof ${typeof t}`}count_rows(t){return this.format===this.data_formats.row?t.length:this.format===this.data_formats.column?t[Object.keys(t)[0]].length:0}get_format(){return this.format}get(t,e){let n;if(this.format===this.data_formats.row){let r=this.data[e];r.hasOwnProperty(t)&&(n=r[t])}else if(this.format===this.data_formats.column)this.data.hasOwnProperty(t)&&(n=this.data[t][e]);else{if(this.format!==this.data_formats.schema)throw`Could not get() from dataset - ${this.data} is poorly formatted.`;n=void 0}return n}marshal(t,e,n){const r=this.names[t];let i=null===(o=this.get(r,e))||"null"===o?null:void 0===o||"undefined"===o?void 0:o;var o;if(null===i)return null;if(void 0!==i){switch(P(n.value)){case"float":case"integer":i=Number(i);break;case"boolean":i="string"==typeof i?"true"===i.toLowerCase():!!i;break;case"datetime":case"date":break;default:i+=""}return i}}clean(){this.names=void 0,this.types=void 0}init(t){this.data=t,this.format=this.is_format(this.data),this.row_count=this.count_rows(this.data);const e={};if(this.format===this.data_formats.row)t.length>0?this.names=Object.keys(t[0]):this.clean.names=[];else if(this.format===this.data_formats.column)this.names=Object.keys(t);else{if(this.format!==this.data_formats.schema)throw`Could not initialize - failed to determine format for ${t}`;this.names=Object.keys(t);for(const n of this.names){const r=w(t[n]);r.type&&(console.debug(`Converting "${t[n]}" to "${r.type}"`),e[n]=t[n],t[n]=r.type)}}return e}}const k=function(t){let e=[];for(let n=0;n<t.size();n++){let r=t.get(n);e.push(r)}return t.delete(),e},A=function(t){let e={},n=t.keys();for(let r=0;r<n.size();r++){let i=n.get(r);e[i]=t.get(i)}return t.delete(),n.delete(),e},E=function(t,e){for(const n of e)t.push_back(n);return t};function j(t){const e={};return"string"!=typeof t?Object.getOwnPropertyNames(t).forEach((n=>{e[n]=t[n]}),t):e.message=t,e}class S{constructor(t){this.perspective=t,this._tables={},this._views={},this._callback_cache=new Map}init(t){var e;t.config&&(e=t.config,globalThis.__PERSPECTIVE_CONFIG__&&console.warn("Config already initialized!"),globalThis.__PERSPECTIVE_CONFIG__=T(v,e)),t.data=["wait_for_response"],this.post(t)}post(t){throw new Error(`Posting ${t} failed - post() not implemented!`)}process(t,e){switch(t.cmd){case"init_profile_thread":this.perspective.initialize_profile_thread();break;case"memory_usage":this.post({id:t.id,data:this.perspective.memory_usage()});break;case"init":this.init(t);break;case"table":if(void 0===t.args[0])this._tables[t.name]=[];else try{const e=this._tables[t.name],n=this.perspective.table(t.args[0],t.options);if(n&&n.then)n.then((n=>{if(this._tables[t.name]=n,e)for(const t of e)this.process(t);this.post({id:t.id,data:t.name})})).catch((e=>this.process_error(t,e)));else{if(this._tables[t.name]=n,e)for(const t of e)this.process(t);this.post({id:t.id,data:t.name})}}catch(e){return void this.process_error(t,e)}break;case"table_generate":(0,eval)(t.args)((function(e){this._tables[t.name]=e,this.post({id:t.id,data:"created!"})}));break;case"table_execute":(0,eval)(t.f)(this._tables[t.name]);break;case"table_method":case"view_method":this.process_method_call(t);break;case"view":const n=this._tables[t.table_name];if(n&&Array.isArray(n))n.push(t),this._views[t.view_name]=[];else try{const n=this._views[t.view_name],r=this._tables[t.table_name].view(t.config);if(r&&r.then)r.then((r=>{if(this._views[t.view_name]=r,this._views[t.view_name].client_id=e,n)for(const t of n)this.process(t);this.post({id:t.id,data:t.view_name})})).catch((e=>this.process_error(t,e)));else{if(this._views[t.view_name]=r,this._views[t.view_name].client_id=e,n)for(const t of n)this.process(t);this.post({id:t.id,data:t.view_name})}}catch(e){return void this.process_error(t,e)}}}process_subscribe(t,e){try{let n;"on"===t.method.slice(0,2)?(n=r=>{let i={id:t.id,data:r};try{if(t.args&&t.args[0]&&"on_update"===t.method&&"row"===t.args[0].mode)return void this.post(i,[r.delta]);this.post(i)}catch(r){console.error(`Removing failed callback to \`${t.method}()\` (presumably due to failed connection)`);const i=t.method.substring(3);e[`remove_${i}`](n)}},t.callback_id&&this._callback_cache.set(t.callback_id,n)):t.callback_id&&(n=this._callback_cache.get(t.callback_id),this._callback_cache.delete(t.callback_id)),n?e[t.method](n,...t.args):console.error(`Callback not found for remote call "${JSON.stringify(t)}"`)}catch(e){return void this.process_error(t,e)}}process_method_call(t){let e,n;const r=t.view_name||t.name;if(e="table_method"===t.cmd?this._tables[r]:this._views[r],e||"view_method"!==t.cmd)if(e&&e.push)e.push(t);else try{if(t.subscribe)return void this.process_subscribe(t,e);n=e[t.method].apply(e,t.args),n instanceof Promise?n.then((e=>this.process_method_call_response(t,e))).catch((e=>this.process_error(t,e))):this.process_method_call_response(t,n)}catch(e){return void this.process_error(t,e)}else this.process_error(t,{message:"View method cancelled"})}process_method_call_response(t,e){"delete"===t.method&&delete this._views[t.name],"to_arrow"===t.method?this.post({id:t.id,data:e},[e]):this.post({id:t.id,data:e})}process_error(t,e){try{this.post({id:t.id,error:j(e)})}catch(t){console.error("Error handler failed: {}",e)}}clear_views(t){for(let e of Object.keys(this._views))if(this._views[e].client_id===t){try{this._views[e].delete()}catch(t){console.error(t)}delete this._views[e]}console.debug(`GC ${Object.keys(this._views).length} views in memory`)}}const x={jsonFormatter:{initDataValue:()=>[],initRowValue:()=>({}),initColumnValue:(t,e)=>{},initColumnRowPath:(t,e,n)=>e[n]=[],setColumnValue:(t,e,n,r)=>e[n]=r,addColumnValue:(t,e,n,r)=>e[n].unshift(r),addRow:(t,e)=>t.push(e),formatData:t=>t,slice:(t,e)=>t.slice(e)},jsonTableFormatter:{initDataValue:()=>new Object,initRowValue:()=>{},initColumnValue:(t,e)=>{t[e]=[]},setColumnValue:(t,e,n,r)=>{t[n].push(r)},addColumnValue:(t,e,n,r)=>{t[n][t[n].length-1].unshift(r)},initColumnRowPath:(t,e,n)=>{t[n]=t[n]||[],t[n].push([])},addRow:()=>{},formatData:t=>t,slice:(t,e)=>{let n={};for(let r in t)n[r]=t[r].slice(e);return n}}};"undefined"!=typeof self&&void 0===self.performance&&(self.performance={now:Date.now});const D=new Set;globalThis.perspective=function(t){let n=t,r=new $;const i=["zero","one","two"];let s={};function l(t){const e=s[t];e&&(e._process(),u(t))}function u(t){s[t]?.delete(),delete s[t]}function c(t,e,r,i,o,a,u,c,f){r||(r=""),i||(i=4294967295);const d=(e=n.make_table(e,t,i,r,o,a,u,c,f)).get_pool(),h=e.get_id();return a||o==n.t_op.OP_DELETE?function(t,e){s[e]?t.delete():(s[e]=t,setTimeout((()=>l(e))))}(d,h):(d._process(),d.delete()),e}function f(t,e,r,i,o){this.name=o,this._View=void 0,this.table=t,this.config=r||{},this.view_config=i||new i,this.is_unit_context=""===this.table.index&&0===e&&0===this.view_config.group_by.length&&0===this.view_config.split_by.length&&0===this.view_config.filter.length&&0===this.view_config.sort.length&&0===this.view_config.expressions.length,this.is_unit_context?this._View=n.make_view_unit(t._Table,o,g,this.view_config,null):0===e?this._View=n.make_view_zero(t._Table,o,g,this.view_config,null):1===e?this._View=n.make_view_one(t._Table,o,g,this.view_config,null):2===e&&(this._View=n.make_view_two(t._Table,o,g,this.view_config,null)),this.ctx=this._View.get_context(),this.column_only=this._View.is_column_only(),this.update_callbacks=this.table.update_callbacks,this.overridden_types=this.table.overridden_types,this._delete_callbacks=[],O(this)}function d(t){let e=[];for(let r=0;r<t.size();r++){let i=t.get(r);e.push(n.scalar_to_val(i,!1,!0)),i.delete()}return t.delete(),e}f.prototype.get_config=function(){return JSON.parse(JSON.stringify(this.config))},f.prototype.delete=function(){u(this.table.get_id()),this._View.delete(),this.ctx.delete(),this.table.views.splice(this.table.views.indexOf(this),1),this.table=void 0;let t=0,e=0;for(;t<this.update_callbacks.length;){let n=this.update_callbacks[t];n.view!==this&&(this.update_callbacks[e++]=n),t++}this.update_callbacks.length=e,this._delete_callbacks.forEach((t=>t()))},f.prototype.sides=function(){return this._View.sides()},f.prototype._num_hidden=function(){let t=0;for(const e of this.config.sort)-1===this.config.columns.indexOf(e[0])&&t++;return t};const h=function(t){let e=[];for(let n=0;n<t.size();n++){let r=t.get(n);e.push(d(r))}return t.delete(),e};f.prototype.schema=function(t=!0){const e=A(this._View.schema());if(t)for(const t of Object.keys(e)){let n=t.split(g);n=n[n.length-1],this.overridden_types[n]&&w(this.overridden_types[n]).type===e[t]&&(e[t]=this.overridden_types[n])}return e},f.prototype.expression_schema=function(t=!0){const e=A(this._View.expression_schema());if(t)for(const t of Object.keys(e)){let n=t.split(g);n=n[n.length-1],this.overridden_types[n]&&w(this.overridden_types[n]).type===e[t]&&(e[t]=this.overridden_types[n])}return e},f.prototype._column_names=function(t=!1,e=0){return h(this._View.column_names(t,e)).map((t=>t.join(g)))},f.prototype.column_paths=function(){return h(this._View.column_paths()).map((t=>t.join(g)))},f.prototype.get_data_slice=function(t,e,r,o){if(this.is_unit_context)return n.get_data_slice_unit(this._View,t,e,r,o);{const a=this.sides();return n[`get_data_slice_${i[a]}`](this._View,t,e,r,o)}};const p=function(t){t=t||{};const e=this._View.num_columns()+(0===this.sides()?0:1),n=this._View.num_rows(),r=this._num_hidden(),i=this.sides()>0||this.column_only?1:0,o=this.config.viewport?this.config.viewport:{},a=t.start_row||(o.top?o.top:0),s=Math.min(n,void 0!==t.end_row?t.end_row:o.height?a+o.height:n),l=t.start_col||(o.left?o.left:0),u=Math.min(e,(void 0!==t.end_col?t.end_col+i:o.width?l+o.width:e)*(r+1));return t.start_row=Math.floor(a),t.end_row=Math.ceil(s),t.start_col=Math.floor(l),t.end_col=Math.ceil(u),t};f.prototype.get_min_max=function(t){if(this.is_unit_context)return n.get_min_max_unit(this._View,t);{const e=this.sides();return n[`get_min_max_${i[e]}`](this._View,t)}};const _=function(t,e){l(this.table.get_id());const r=(t=p.bind(this)(t)).start_row,o=t.end_row,a=t.start_col,s=t.end_col,u=this._num_hidden(),c=t.formatted,f=!!t.index,d=!!t.id,_=!!t.leaves_only,m=this.sides(),y=0!==m&&!this.column_only,v=i[m];let b;b=this.is_unit_context?n.get_from_data_slice_unit:n[`get_from_data_slice_${v}`];const T=this.get_data_slice(r,o,a,s),C=T.get_column_names(),P=h(C).map((t=>t.join(g))),O=this.schema();let $=e.initDataValue();for(let t=a;t<s;t++){const n=P[t];e.initColumnValue($,n)}for(let t=r;t<o;t++){let r=y?T.get_row_path(t):void 0;if(y&&_&&r.size()<this.config.group_by.length){r.delete();continue}let i=e.initRowValue();d&&e.initColumnRowPath($,i,"__ID__");for(let o=a;o<s;o++){const s=P[o],l=O[s],f=w(l);if(o===a&&0!==m){if(!this.column_only){e.initColumnRowPath($,i,"__ROW_PATH__");for(let t=0;t<r.size();t++){const o=r.get(t),a=n.scalar_to_val(o,!1,!1);o.delete(),e.addColumnValue($,i,"__ROW_PATH__",a),d&&e.addColumnValue($,i,"__ID__",a)}}}else{if((o-(m>0?1:0))%(this.config.columns.length+u)>=this.config.columns.length)continue;{let n=b(T,t,o);c&&null!=n&&("datetime"!==l&&"date"!==l||(n=new Date(n),n=n.toLocaleString([],f.format))),e.setColumnValue($,i,s,n)}}}if(f){const r=T.get_pkeys(t,0);e.initColumnRowPath($,i,"__INDEX__");for(let t=0;t<r.size();t++){const o=r.get(t),a=n.scalar_to_val(o,!1,!1);o.delete(),e.addColumnValue($,i,"__INDEX__",a)}r.delete()}if(d&&0===m){const r=T.get_pkeys(t,0);for(let t=0;t<r.size();t++){const o=r.get(t),a=n.scalar_to_val(o,!1,!1);o.delete(),e.addColumnValue($,i,"__ID__",a)}r.delete()}r&&r.delete(),e.addRow($,i)}return T.delete(),e.formatData($,t.config)},m=function(t,e,n){const r=this.num_rows(),i=e.start_row||0,o=e.end_row||r;let a,s,l=this._column_names().indexOf(t);if(-1===l)return;this.sides()>0&&l++,e.data_slice?a=e.data_slice.get_column_slice(l):(s=this.get_data_slice(i,o,l,l+1),a=s.get_slice());const u=n(a,this._View.get_column_dtype(l),l);return a.delete(),s&&s.delete(),u};function y(t,e){let n=0,r=0;for(;n<t.length;){const i=t[n];e(i,n,t)&&(t[r++]=i),n++}return t.length=r,t}function v(t){this.group_by=t.group_by||[],this.split_by=t.split_by||[],this.aggregates=t.aggregates||{},this.columns=t.columns,this.filter=t.filter||[],this.sort=t.sort||[],this.expressions=t.expressions||[],this.filter_op=t.filter_op||"and",this.group_by_depth=t.group_by_depth,this.split_by_depth=t.split_by_depth}function b(t,e,n,r){this._Table=t;const i=this._Table.get_gnode();this.gnode_id=i.get_id(),i.delete();const o=this._Table.get_pool();o.set_update_delegate(this),o.delete(),this.name=Math.random()+"",this.initialized=!1,this.index=e,this.limit=n,this.update_callbacks=[],this._delete_callbacks=[],this.views=[],this.overridden_types=r,O(this)}function T(t){let e=[];const n={};for(let r of t){if(r.includes('""')){console.error(`Skipping expression '${r}', as it cannot reference an empty column!`);continue}let t,i={},o={},a=0,s=r.match(/^\/\/(?<alias>.+?)\n/);s?.groups?.alias&&(t=s.groups.alias.trim()),t&&0!=t.length||(t=r);let l=r.replace(/([a-zA-Z_]+[a-zA-Z0-9_]*)/g,(t=>"true"==t?"True":"false"==t?"False":t));l=l.replace(/\"(.*?[^\\])\"/g,((t,e)=>{if(e=e.replace(/\\"/g,'"'),void 0===i[e]){let t=`COLUMN${a}`;i[e]=t,o[t]=e}return a++,i[e]})),l=l.replace(/'(.*?[^\\])'/g,(t=>`intern(${t})`));const u=(t,e,n,r)=>{const i=t.indexOf(n);return`${t.substring(0,i)}'${r}'${t.substring(i+n.length)}`};l=l.replace(/(bucket|match|match_all|search|indexof)\(.*?,\s*(intern\(\'(.+)\'\)).*\)/g,u),l=l.replace(/(replace_all|replace)\(.*?,\s*(intern\(\'(.*)\'\)),.*\)/g,u);const c=[t,r,l,o];void 0!==n[t]?e[n[t]]=c:(e.push(c),n[t]=e.length-1)}return e}let C;f.prototype.to_columns=function(t){return _.call(this,t,x.jsonTableFormatter)},f.prototype.to_json=function(t){return _.call(this,t,x.jsonFormatter)},f.prototype.to_csv=function(t){l(this.table.get_id());const e=(t=p.bind(this)(t)).start_row,r=t.end_row,i=t.start_col,o=t.end_col,a=this.sides();return this.is_unit_context?n.to_csv_unit(this._View,e,r,i,o):0===a?n.to_csv_zero(this._View,e,r,i,o):1===a?n.to_csv_one(this._View,e,r,i,o):2===a?n.to_csv_two(this._View,e,r,i,o):void 0},f.prototype.col_to_js_typed_array=function(t,e={}){l(this.table.get_id());const r=n.col_to_js_typed_array;return m.call(this,t,e,r)},f.prototype.to_arrow=function(t={}){l(this.table.get_id());const e=(t=p.bind(this)(t)).start_row,r=t.end_row,i=t.start_col,o=t.end_col,a=this.sides();return this.is_unit_context?n.to_arrow_unit(this._View,e,r,i,o):0===a?n.to_arrow_zero(this._View,e,r,i,o):1===a?n.to_arrow_one(this._View,e,r,i,o):2===a?n.to_arrow_two(this._View,e,r,i,o):void 0},f.prototype.num_rows=function(){return l(this.table.get_id()),this._View.num_rows()},f.prototype.num_columns=function(){const t=this._View.num_columns(),e=this._num_hidden();return t-t/(this.config.columns.length+e)*e},f.prototype.dimensions=function(){return{num_table_rows:this.table.num_rows(),num_table_columns:this.table.num_columns(),num_view_rows:this._View.num_rows(),num_view_columns:this.num_columns()}},f.prototype.get_row_expanded=function(t){return this._View.get_row_expanded(t)},f.prototype.expand=function(t){return this._View.expand(t,this.config.group_by.length)},f.prototype.collapse=function(t){return this._View.collapse(t)},f.prototype.set_depth=function(t){return this._View.set_depth(t,this.config.group_by.length)},f.prototype._get_step_delta=async function(){let t,e=this._View.get_step_delta(0,2147483647);if(0===e.cells.size())t=this.to_json();else{let n={};for(let t=0;t<e.cells.size();t++)n[e.cells.get(t).row]=!0;n=Object.keys(n);const r=n.map((t=>this.to_json({start_row:Number.parseInt(t),end_row:Number.parseInt(t)+1})));t=[].concat.apply([],r)}return e.cells.delete(),t},f.prototype._get_row_delta=async function(){if(this.is_unit_context)return n.get_row_delta_unit(this._View);{const t=this.sides();return n[`get_row_delta_${i[t]}`](this._View)}},f.prototype.on_update=function(t,{mode:e="none"}={}){if(l(this.table.get_id()),-1===["none","row"].indexOf(e))throw new Error(`Invalid update mode "${e}" - valid modes are "none" and "row".`);"row"===e&&(this._View._get_deltas_enabled()||this._View._set_deltas_enabled(!0)),this.update_callbacks.push({view:this,orig_callback:t,callback:async(n,r)=>{void 0===r[n]&&(r[n]={});let i={port_id:n};"row"===e&&(void 0===r[n].row_delta&&(r[n].row_delta=await this._get_row_delta()),i.delta=r[n].row_delta),t(i)}})},f.prototype.remove_update=function(t){l(this.table.get_id());const e=this.update_callbacks.length;y(this.update_callbacks,(e=>e.orig_callback!==t)),console.assert(e>this.update_callbacks.length,'"callback" does not match a registered updater')},f.prototype.on_delete=function(t){this._delete_callbacks.push(t)},f.prototype.remove_delete=function(t){const e=this._delete_callbacks.length;y(this._delete_callbacks,(e=>e!==t)),console.assert(e>this._delete_callbacks.length,'"callback" does not match a registered delete callbacks')},v.prototype.get_group_by=function(){let t=n.make_string_vector();return E(t,this.group_by)},v.prototype.get_split_by=function(){let t=n.make_string_vector();return E(t,this.split_by)},v.prototype.get_columns=function(){let t=n.make_string_vector();return E(t,this.columns)},v.prototype.get_filter=function(){let t=n.make_2d_val_vector();for(let e of this.filter){let r=n.make_val_vector(),i=E(r,e);t.push_back(i)}return t},v.prototype.get_sort=function(){let t=n.make_2d_string_vector();for(let e of this.sort){let r=n.make_string_vector(),i=E(r,e);t.push_back(i)}return t},v.prototype.get_expressions=function(){let t=n.make_2d_val_vector();for(let e of this.expressions){let r=n.make_val_vector();for(let t of e)r.push_back(t);t.push_back(r)}return t},b.prototype.get_id=function(){return this._Table.get_id()},b.prototype.get_pool=function(){return this._Table.get_pool()},b.prototype.make_port=function(){return this._Table.make_port()},b.prototype.remove_port=function(){this._Table.remove_port()},b.prototype._update_callback=function(t){let e={};for(let n in this.update_callbacks)this.update_callbacks[n].callback(t,e)},b.prototype.get_index=function(){return this.index},b.prototype.get_limit=function(){return this.limit},b.prototype.clear=function(){l(this.get_id()),this._Table.reset_gnode(this.gnode_id)},b.prototype.replace=function(t){u(this.get_id()),this._Table.reset_gnode(this.gnode_id),this.update(t),l(this.get_id())},b.prototype.delete=function(){if(this.views.length>0)throw`Cannot delete Table as it still has ${this.views.length} registered View(s).`;u(this.get_id()),this._Table.unregister_gnode(this.gnode_id),this._Table.delete();for(const t of this._delete_callbacks)t()},b.prototype.on_delete=function(t){this._delete_callbacks.push(t)},b.prototype.remove_delete=function(t){const e=this._delete_callbacks.length;y(this._delete_callbacks,(e=>e!==t)),console.assert(e>this._delete_callbacks.length,'"callback" does not match a registered delete callbacks')},b.prototype.size=function(){return l(this._Table.get_id()),this._Table.size()},b.prototype.num_rows=function(){return this.size()},b.prototype.num_columns=function(){let t=this._Table.get_schema(),e=t.columns();const n=e.size();return e.delete(),t.delete(),n-1},b.prototype.schema=function(t=!0){let e=this._Table.get_schema(),n=e.columns(),r=e.types(),i={};for(let e=0;e<n.size();e++){const o=n.get(e);"psp_okey"!==o&&(t&&this.overridden_types[o]?i[o]=this.overridden_types[o]:i[o]=P(r.get(e).value))}return e.delete(),n.delete(),r.delete(),i},b.prototype.validate_expressions=function(t,e=!0){const r={expression_schema:{},expression_alias:{},errors:{}};if(!t||0===t.length)return r;t=T(t);let i=n.make_2d_val_vector();for(let e of t){let t=n.make_val_vector();for(let n of e)t.push_back(n);i.push_back(t),r.expression_alias[e[0]]=e[1]}const o=n.validate_expressions(this._Table,i),a=o.get_expression_schema(),s=o.get_expression_errors(),l=a.keys();for(let t=0;t<l.size();t++){const n=l.get(t);let i=a.get(n);e&&this.overridden_types[n]&&(i=this.overridden_types[n]),r.expression_schema[n]=i}const u=s.keys();for(let t=0;t<u.size();t++){const e=u.get(t),n=s.get(e);r.errors[e]=n}return u.delete(),l.delete(),s.delete(),a.delete(),o.delete(),r},b.prototype.is_valid_filter=function(t){if(t[1]===j.FILTER_OPERATORS.isNull||t[1]===j.FILTER_OPERATORS.isNotNull)return!0;let e=t[2];if(null===e)return!1;const r=this.schema();return!r[t[0]]||"date"!==r[t[0]]&&"datetime"!==r[t[0]]?null!=e:n.is_valid_datetime(t[2])},b.prototype.view=function(t={}){l(this._Table.get_id());let e={};for(const n of Object.keys(t))if(o[n]){if(e[o[n]])throw new Error(`Duplicate configuration parameter "${n}"`);D.has(n)||(console.warn(`Deprecated: "${n}" config parameter, please use "${o[n]}" instead`),D.add(n)),e[o[n]]=t[n]}else if("aggregate"===n){D.has("aggregate")||(console.warn('Deprecated: "aggregate" config parameter has been replaced by "aggregates" and "columns"'),D.add("aggregate")),e.aggregates={},e.columns=[];for(const n of t.aggregate)e.aggregates[n.column]=n.op,e.columns.push(n.column)}else{if(!(a.indexOf(n)>-1))throw new Error(`Unrecognized config parameter "${n}"`);e[n]=t[n]}e.group_by=e.group_by||[],e.split_by=e.split_by||[],e.aggregates=e.aggregates||{},e.filter=e.filter||[],e.sort=e.sort||[],e.expressions=e.expressions||[];const n=this.schema();if(e.expressions.length>0&&(e.expressions=T(e.expressions)),void 0===e.columns&&(e.columns=this.columns(),e.expressions.length>0))for(const t of e.expressions)e.columns.push(t[0]);if(e.filter.length>0)for(let t of e.filter){const e=n[t[0]];t[1]===j.FILTER_OPERATORS.isNull||t[1]===j.FILTER_OPERATORS.isNotNull||"date"!==e&&"datetime"!==e||(t[2]=new Date(t[2]))}let r,i=Math.random()+"";r=e.group_by.length>0||e.split_by.length>0?e.split_by&&e.split_by.length>0?2:1:0;let s=new f(this,r,e,new v(e),i);return this.views.push(s),s},b.prototype.query_columns=function(t,e){const n=this.view(t),r=n.to_columns(e);return n.delete(),r},b.prototype.update=function(t,e){let i;(e=e||{}).port_id=e.port_id||0;let o=this.columns(),a=this._Table.get_schema(),s=a.types(),l=!1,u=!1;if(i=r,t instanceof ArrayBuffer?(i=new Uint8Array(t),l=!0):"string"==typeof t?(","===t[0]&&(t="_"+t),u=!0,l=!0,i=t):(r.init(t),r.names=o.concat(r.names.filter((t=>"__INDEX__"===t))),r.types=k(s).slice(0,o.length),C&&C(r.row_count)),!l){if(0===i.row_count)return void console.warn("table.update called with no data - ignoring");-1!=r.names.indexOf("__INDEX__")&&(this.index?r.types.push(r.types[r.names.indexOf(this.index)]):r.types.push(n.t_dtype.DTYPE_INT32))}try{const t=n.t_op.OP_INSERT;c(i,this._Table,this.index,this.limit,t,!0,l,u,e.port_id).delete(),this.initialized=!0}catch(t){console.error(`Update failed: ${t}`)}finally{a.delete()}},b.prototype.remove=function(t,e){if(!this.index)return void console.error("Cannot call `remove()` on a Table without a user-specified index.");let i;(e=e||{}).port_id=e.port_id||0;let o=this.columns(),a=this._Table.get_schema(),s=a.types(),l=!1;(t=t.map((t=>({[this.index]:t}))))instanceof ArrayBuffer?(i=new Uint8Array(t),l=!0):(r.init(t),r.names=[this.index],r.types=[k(s)[o.indexOf(this.index)]],i=r);try{const t=n.t_op.OP_DELETE;c(i,this._Table,this.index,this.limit,t,!1,l,!1,e.port_id).delete(),this.initialized=!0}catch(t){console.error("Remove failed",t)}finally{a.delete()}},b.prototype.columns=function(){let t=this._Table.get_schema(),e=t.columns(),n=[];for(let t=0;t<e.size();t++){let r=e.get(t);"psp_okey"!==r&&n.push(r)}return t.delete(),e.delete(),n},b.prototype.execute=function(t){t(this)};const j={__module__:n,Server:S,worker:function(){return this},initialize_profile_thread:function(){if(void 0===C){let t=0,e=performance.now();setTimeout((function n(){let r=performance.now();console.log(`${(1e3*t/(r-e)).toFixed(2)} msgs/sec`),t=0,e=r,setTimeout(n,5e3)}),5e3),C=function(e){t+=e},console.log("Profiling initialized")}},memory_usage:function(){const t=performance.memory?JSON.parse(JSON.stringify(performance.memory,["totalJSHeapSize","usedJSHeapSize","jsHeapSizeLimit"])):process.memoryUsage();return t.wasmHeap=n.HEAP8.length,t},table:function(t,e){let i;(e=e||{}).index=e.index||null,e.limit=e.limit||null;let o,a=!1,s={},l=!1;if(t instanceof ArrayBuffer||"undefined"!=typeof Buffer&&t instanceof Buffer?(i=new Uint8Array(t),a=!0):"string"==typeof t?(","===t[0]&&(t="_"+t),l=!0,a=!0,i=t):(r.clean(),s=r.init(t),i=r),e.index&&e.limit)throw`Cannot specify both index '${e.index}' and limit '${e.limit}'.`;try{const t=n.t_op.OP_INSERT;return o=c(i,void 0,e.index,e.limit,t,!1,a,l,0),new b(o,e.index,e.limit,s)}catch(t){throw o&&o.delete(),console.error(`Table initialization failed: ${t}`),t}}};for(let t of Object.keys(e))j[t]=e[t];return"undefined"!=typeof self&&self.addEventListener&&new class extends S{constructor(t){super(t),self.addEventListener("message",(t=>this.process(t.data)),!1)}post(t,e){self.postMessage(t,e)}init(t){if("undefined"==typeof WebAssembly)throw new Error("WebAssembly not supported");n({wasmBinary:t.buffer,wasmJSMethod:"native-wasm",locateFile:t=>t}).then((e=>{n=e,n.init(),super.init(t)}))}}(j),j}(r)})()})();
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>perspective.worker.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/x-javascript</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>perspective@2.7.1</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/**
ColorBrewer colors for chroma.js
Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The
Pennsylvania State University.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
@preserve
*/
/**
* @license
*
* chroma.js - JavaScript library for color conversions
*
* Copyright (c) 2011-2017, Gregor Aisch
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name Gregor Aisch may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>perspective_with_viewer.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/x-javascript</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
<title>Perspective Gadget</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="perspective_with_viewer.js" type="text/javascript"></script>
<script src="perspective@2.3.0/perspective_with_viewer.js" type="text/javascript"></script>
<script src="perspective_base_gadget.js" type="text/javascript"></script>
<link rel="stylesheet" crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/@finos/perspective-viewer/dist/css/themes.css" />
<style>
regular-table {
scrollbar-color: #000000f7 transparent;
scrollbar-width: auto;
outline: none;
}
perspective-viewer {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
td.psp-align-left {
text-align: right;
}
/*
td.psp-align-left {
box-shadow: 5px -4px 0px -4px var(--inactive--border-color,#8b868045);
}*/
perspective-viewer regular-table tbody td:hover {
text-decoration: underline;
cursor: pointer;
/* Optional, changes the cursor to a pointer to indicate interactivity */
overflow-x: visible;
}
</style>
</head>
<body>
<perspective-viewer></perspective-viewer>
</body>
</html>
\ No newline at end of file
/*global window, rJS */
/*global window, rJS, document */
/*jslint nomen: true, indent:2*/
// Provides perspective worker
(function (window, rJS) {
"use strict";
rJS(window)
.declareMethod("render", function (options) {
var gadget = this,
child_html = options.child_html,
el = document.getElementsByTagName("perspective-viewer")[0];
gadget.getChildData(options.child_html)
.push(function (data) {
return gadget.getTable(data);
})
.push(function (table) {
return el.load(table);
})
.push(function () {
gadget.getDeclaredGadget(child_html)
.push(function (child) {
return child.postprocessing(el);
});
});
})
.declareMethod("getTable", function (data) {
return window.Worker.table(data);
})
.declareMethod("getChildData", function (data) {
return this.declareGadget(data, {
scope: data
})
.push(function (child) {
return child.getData();
});
});
}(window, rJS));
}(window, rJS));
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment