-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathperspective-TSKH3D5G.js
More file actions
3 lines (3 loc) · 42.2 KB
/
perspective-TSKH3D5G.js
File metadata and controls
3 lines (3 loc) · 42.2 KB
1
2
3
import"./chunk-FW4363Y4.js";var fe=Object.defineProperty,we=(t,e)=>{for(var n in e)fe(t,n,{get:e[n],enumerable:!0})};function pe(t,e){let n;async function _(l,s){if(s.data.cmd==="init")try{n=new t.VirtualServer(e),s.data.id!==void 0?l.postMessage({id:s.data.id}):l.postMessage(null)}catch(u){throw console.error("Error initializing worker:",u),u}else try{let u=new Uint8Array(s.data),g=(await n.handleRequest(u)).slice().buffer;l.postMessage(g,{transfer:[g]})}catch(u){throw console.error("Error handling request in worker:",u),u}}let i=new MessageChannel;return i.port1.onmessage=l=>{_(i.port1,l)},i.port2}var _e={};we(_e,{Client:()=>U,GenericSQLVirtualServerModel:()=>C,ProxySession:()=>P,Table:()=>z,View:()=>R,VirtualDataSlice:()=>N,VirtualServer:()=>F,default:()=>ge,init:()=>le,initSync:()=>Me});var U=class ie{static __wrap(e){e=e>>>0;let n=Object.create(ie.prototype);return n.__wbg_ptr=e,D.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,D.unregister(this),e}free(){let e=this.__destroy_into_raw();r.__wbg_client_free(e,0)}__getClassname(){try{let i=r.__wbindgen_add_to_stack_pointer(-16);r.client___getClassname(i,this.__wbg_ptr);var e=c().getInt32(i+0,!0),n=c().getInt32(i+4,!0),_=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),_}finally{r.__wbindgen_add_to_stack_pointer(16)}}get_hosted_table_names(){let e=r.client_get_hosted_table_names(this.__wbg_ptr);return b(e)}handle_error(e,n){let _=p(e,r.__wbindgen_export,r.__wbindgen_export2),i=f,l=r.client_handle_error(this.__wbg_ptr,_,i,d(n)?0:a(n));return b(l)}handle_response(e){let n=r.client_handle_response(this.__wbg_ptr,a(e));return b(n)}join(e,n,_,i){let l=p(_,r.__wbindgen_export,r.__wbindgen_export2),s=f,u=r.client_join(this.__wbg_ptr,a(e),a(n),l,s,d(i)?0:a(i));return b(u)}constructor(e,n){try{let s=r.__wbindgen_add_to_stack_pointer(-16);r.client_new(s,a(e),d(n)?0:a(n));var _=c().getInt32(s+0,!0),i=c().getInt32(s+4,!0),l=c().getInt32(s+8,!0);if(l)throw b(i);return this.__wbg_ptr=_>>>0,D.register(this,this.__wbg_ptr,this),this}finally{r.__wbindgen_add_to_stack_pointer(16)}}new_proxy_session(e){try{let n=r.client_new_proxy_session(this.__wbg_ptr,ue(e));return P.__wrap(n)}finally{I[M++]=void 0}}on_error(e){let n=r.client_on_error(this.__wbg_ptr,a(e));return b(n)}on_hosted_tables_update(e){let n=r.client_on_hosted_tables_update(this.__wbg_ptr,a(e));return b(n)}open_table(e){let n=p(e,r.__wbindgen_export,r.__wbindgen_export2),_=f,i=r.client_open_table(this.__wbg_ptr,n,_);return b(i)}remove_hosted_tables_update(e){let n=r.client_remove_hosted_tables_update(this.__wbg_ptr,e);return b(n)}system_info(){let e=r.client_system_info(this.__wbg_ptr);return b(e)}table(e,n){let _=r.client_table(this.__wbg_ptr,a(e),d(n)?0:a(n));return b(_)}terminate(){try{let i=r.__wbindgen_add_to_stack_pointer(-16);r.client_terminate(i,this.__wbg_ptr);var e=c().getInt32(i+0,!0),n=c().getInt32(i+4,!0),_=c().getInt32(i+8,!0);if(_)throw b(n);return b(e)}finally{r.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(U.prototype[Symbol.dispose]=U.prototype.free);var C=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,Q.unregister(this),t}free(){let t=this.__destroy_into_raw();r.__wbg_genericsqlvirtualservermodel_free(t,0)}getHostedTables(){try{let l=r.__wbindgen_add_to_stack_pointer(-16);r.genericsqlvirtualservermodel_getHostedTables(l,this.__wbg_ptr);var t=c().getInt32(l+0,!0),e=c().getInt32(l+4,!0),n=c().getInt32(l+8,!0),_=c().getInt32(l+12,!0);if(_)throw b(n);var i=h(t,e);return t!==0&&r.__wbindgen_export4(t,e,1),i}finally{r.__wbindgen_add_to_stack_pointer(16)}}constructor(t){try{let i=r.__wbindgen_add_to_stack_pointer(-16);r.genericsqlvirtualservermodel_new(i,d(t)?0:a(t));var e=c().getInt32(i+0,!0),n=c().getInt32(i+4,!0),_=c().getInt32(i+8,!0);if(_)throw b(n);return this.__wbg_ptr=e>>>0,Q.register(this,this.__wbg_ptr,this),this}finally{r.__wbindgen_add_to_stack_pointer(16)}}tableMakeView(t,e,n){try{let g=r.__wbindgen_add_to_stack_pointer(-16),w=p(t,r.__wbindgen_export,r.__wbindgen_export2),y=f,m=p(e,r.__wbindgen_export,r.__wbindgen_export2),x=f;r.genericsqlvirtualservermodel_tableMakeView(g,this.__wbg_ptr,w,y,m,x,a(n));var _=c().getInt32(g+0,!0),i=c().getInt32(g+4,!0),l=c().getInt32(g+8,!0),s=c().getInt32(g+12,!0);if(s)throw b(l);var u=h(_,i);return _!==0&&r.__wbindgen_export4(_,i,1),u}finally{r.__wbindgen_add_to_stack_pointer(16)}}tableSchema(t){try{let s=r.__wbindgen_add_to_stack_pointer(-16),u=p(t,r.__wbindgen_export,r.__wbindgen_export2),g=f;r.genericsqlvirtualservermodel_tableSchema(s,this.__wbg_ptr,u,g);var e=c().getInt32(s+0,!0),n=c().getInt32(s+4,!0),_=c().getInt32(s+8,!0),i=c().getInt32(s+12,!0);if(i)throw b(_);var l=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),l}finally{r.__wbindgen_add_to_stack_pointer(16)}}tableSize(t){try{let s=r.__wbindgen_add_to_stack_pointer(-16),u=p(t,r.__wbindgen_export,r.__wbindgen_export2),g=f;r.genericsqlvirtualservermodel_tableSize(s,this.__wbg_ptr,u,g);var e=c().getInt32(s+0,!0),n=c().getInt32(s+4,!0),_=c().getInt32(s+8,!0),i=c().getInt32(s+12,!0);if(i)throw b(_);var l=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),l}finally{r.__wbindgen_add_to_stack_pointer(16)}}tableValidateExpression(t,e){try{let u=r.__wbindgen_add_to_stack_pointer(-16),g=p(t,r.__wbindgen_export,r.__wbindgen_export2),w=f,y=p(e,r.__wbindgen_export,r.__wbindgen_export2),m=f;r.genericsqlvirtualservermodel_tableValidateExpression(u,this.__wbg_ptr,g,w,y,m);var n=c().getInt32(u+0,!0),_=c().getInt32(u+4,!0),i=c().getInt32(u+8,!0),l=c().getInt32(u+12,!0);if(l)throw b(i);var s=h(n,_);return n!==0&&r.__wbindgen_export4(n,_,1),s}finally{r.__wbindgen_add_to_stack_pointer(16)}}viewColumnSize(t){try{let s=r.__wbindgen_add_to_stack_pointer(-16),u=p(t,r.__wbindgen_export,r.__wbindgen_export2),g=f;r.genericsqlvirtualservermodel_viewColumnSize(s,this.__wbg_ptr,u,g);var e=c().getInt32(s+0,!0),n=c().getInt32(s+4,!0),_=c().getInt32(s+8,!0),i=c().getInt32(s+12,!0);if(i)throw b(_);var l=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),l}finally{r.__wbindgen_add_to_stack_pointer(16)}}viewDelete(t){try{let s=r.__wbindgen_add_to_stack_pointer(-16),u=p(t,r.__wbindgen_export,r.__wbindgen_export2),g=f;r.genericsqlvirtualservermodel_viewDelete(s,this.__wbg_ptr,u,g);var e=c().getInt32(s+0,!0),n=c().getInt32(s+4,!0),_=c().getInt32(s+8,!0),i=c().getInt32(s+12,!0);if(i)throw b(_);var l=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),l}finally{r.__wbindgen_add_to_stack_pointer(16)}}viewGetData(t,e,n,_){try{let w=r.__wbindgen_add_to_stack_pointer(-16),y=p(t,r.__wbindgen_export,r.__wbindgen_export2),m=f;r.genericsqlvirtualservermodel_viewGetData(w,this.__wbg_ptr,y,m,a(e),a(n),a(_));var i=c().getInt32(w+0,!0),l=c().getInt32(w+4,!0),s=c().getInt32(w+8,!0),u=c().getInt32(w+12,!0);if(u)throw b(s);var g=h(i,l);return i!==0&&r.__wbindgen_export4(i,l,1),g}finally{r.__wbindgen_add_to_stack_pointer(16)}}viewGetMinMax(t,e,n){try{let g=r.__wbindgen_add_to_stack_pointer(-16),w=p(t,r.__wbindgen_export,r.__wbindgen_export2),y=f,m=p(e,r.__wbindgen_export,r.__wbindgen_export2),x=f;r.genericsqlvirtualservermodel_viewGetMinMax(g,this.__wbg_ptr,w,y,m,x,a(n));var _=c().getInt32(g+0,!0),i=c().getInt32(g+4,!0),l=c().getInt32(g+8,!0),s=c().getInt32(g+12,!0);if(s)throw b(l);var u=h(_,i);return _!==0&&r.__wbindgen_export4(_,i,1),u}finally{r.__wbindgen_add_to_stack_pointer(16)}}viewSchema(t){try{let s=r.__wbindgen_add_to_stack_pointer(-16),u=p(t,r.__wbindgen_export,r.__wbindgen_export2),g=f;r.genericsqlvirtualservermodel_viewSchema(s,this.__wbg_ptr,u,g);var e=c().getInt32(s+0,!0),n=c().getInt32(s+4,!0),_=c().getInt32(s+8,!0),i=c().getInt32(s+12,!0);if(i)throw b(_);var l=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),l}finally{r.__wbindgen_add_to_stack_pointer(16)}}viewSize(t){try{let s=r.__wbindgen_add_to_stack_pointer(-16),u=p(t,r.__wbindgen_export,r.__wbindgen_export2),g=f;r.genericsqlvirtualservermodel_viewSize(s,this.__wbg_ptr,u,g);var e=c().getInt32(s+0,!0),n=c().getInt32(s+4,!0),_=c().getInt32(s+8,!0),i=c().getInt32(s+12,!0);if(i)throw b(_);var l=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),l}finally{r.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(C.prototype[Symbol.dispose]=C.prototype.free);var P=class oe{static __wrap(e){e=e>>>0;let n=Object.create(oe.prototype);return n.__wbg_ptr=e,V.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),e}free(){let e=this.__destroy_into_raw();r.__wbg_proxysession_free(e,0)}close(){let e=this.__destroy_into_raw(),n=r.proxysession_close(e);return b(n)}handle_request(e){let n=r.proxysession_handle_request(this.__wbg_ptr,a(e));return b(n)}constructor(e,n){try{ve(e,U);let _=r.proxysession_new(e.__wbg_ptr,ue(n));return this.__wbg_ptr=_>>>0,V.register(this,this.__wbg_ptr,this),this}finally{I[M++]=void 0}}};Symbol.dispose&&(P.prototype[Symbol.dispose]=P.prototype.free);var z=class se{static __wrap(e){e=e>>>0;let n=Object.create(se.prototype);return n.__wbg_ptr=e,K.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),e}free(){let e=this.__destroy_into_raw();r.__wbg_table_free(e,0)}__getClassname(){try{let i=r.__wbindgen_add_to_stack_pointer(-16);r.table___getClassname(i,this.__wbg_ptr);var e=c().getInt32(i+0,!0),n=c().getInt32(i+4,!0),_=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),_}finally{r.__wbindgen_add_to_stack_pointer(16)}}clear(){let e=r.table_clear(this.__wbg_ptr);return b(e)}columns(){let e=r.table_columns(this.__wbg_ptr);return b(e)}delete(e){let n=this.__destroy_into_raw(),_=r.table_delete(n,d(e)?0:a(e));return b(_)}get_client(){let e=r.table_get_client(this.__wbg_ptr);return b(e)}get_index(){let e=r.table_get_index(this.__wbg_ptr);return b(e)}get_limit(){let e=r.table_get_limit(this.__wbg_ptr);return b(e)}get_name(){let e=r.table_get_name(this.__wbg_ptr);return b(e)}make_port(){let e=r.table_make_port(this.__wbg_ptr);return b(e)}on_delete(e){let n=r.table_on_delete(this.__wbg_ptr,a(e));return b(n)}remove(e,n){let _=r.table_remove(this.__wbg_ptr,a(e),d(n)?0:a(n));return b(_)}remove_delete(e){let n=r.table_remove_delete(this.__wbg_ptr,e);return b(n)}replace(e,n){let _=r.table_replace(this.__wbg_ptr,a(e),d(n)?0:a(n));return b(_)}schema(){let e=r.table_schema(this.__wbg_ptr);return b(e)}size(){let e=r.table_size(this.__wbg_ptr);return b(e)}update(e,n){let _=r.table_update(this.__wbg_ptr,a(e),d(n)?0:a(n));return b(_)}validate_expressions(e){let n=r.table_validate_expressions(this.__wbg_ptr,a(e));return b(n)}view(e){let n=r.table_view(this.__wbg_ptr,d(e)?0:a(e));return b(n)}};Symbol.dispose&&(z.prototype[Symbol.dispose]=z.prototype.free);var R=class L{static __wrap(e){e=e>>>0;let n=Object.create(L.prototype);return n.__wbg_ptr=e,X.register(n,n.__wbg_ptr,n),n}static __unwrap(e){return e instanceof L?e.__destroy_into_raw():0}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,X.unregister(this),e}free(){let e=this.__destroy_into_raw();r.__wbg_view_free(e,0)}__get_model(){let e=r.view___get_model(this.__wbg_ptr);return L.__wrap(e)}collapse(e){let n=r.view_collapse(this.__wbg_ptr,e);return b(n)}column_paths(e){let n=r.view_column_paths(this.__wbg_ptr,d(e)?0:a(e));return b(n)}delete(){let e=this.__destroy_into_raw(),n=r.view_delete(e);return b(n)}dimensions(){let e=r.view_dimensions(this.__wbg_ptr);return b(e)}expand(e){let n=r.view_expand(this.__wbg_ptr,e);return b(n)}expression_schema(){let e=r.view_expression_schema(this.__wbg_ptr);return b(e)}get_config(){let e=r.view_get_config(this.__wbg_ptr);return b(e)}get_min_max(e){let n=p(e,r.__wbindgen_export,r.__wbindgen_export2),_=f,i=r.view_get_min_max(this.__wbg_ptr,n,_);return b(i)}num_columns(){let e=r.view_num_columns(this.__wbg_ptr);return b(e)}num_rows(){let e=r.view_num_rows(this.__wbg_ptr);return b(e)}on_delete(e){let n=r.view_on_delete(this.__wbg_ptr,a(e));return b(n)}on_update(e,n){let _=r.view_on_update(this.__wbg_ptr,a(e),d(n)?0:a(n));return b(_)}remove_delete(e){let n=r.view_remove_delete(this.__wbg_ptr,e);return b(n)}remove_update(e){let n=r.view_remove_update(this.__wbg_ptr,e);return b(n)}schema(){let e=r.view_schema(this.__wbg_ptr);return b(e)}set_depth(e){let n=r.view_set_depth(this.__wbg_ptr,e);return b(n)}to_arrow(e){let n=r.view_to_arrow(this.__wbg_ptr,d(e)?0:a(e));return b(n)}to_columns(e){let n=r.view_to_columns(this.__wbg_ptr,d(e)?0:a(e));return b(n)}to_columns_string(e){let n=r.view_to_columns_string(this.__wbg_ptr,d(e)?0:a(e));return b(n)}to_csv(e){let n=r.view_to_csv(this.__wbg_ptr,d(e)?0:a(e));return b(n)}to_json(e){let n=r.view_to_json(this.__wbg_ptr,d(e)?0:a(e));return b(n)}to_json_string(e){let n=r.view_to_json_string(this.__wbg_ptr,d(e)?0:a(e));return b(n)}to_ndjson(e){let n=r.view_to_ndjson(this.__wbg_ptr,d(e)?0:a(e));return b(n)}};Symbol.dispose&&(R.prototype[Symbol.dispose]=R.prototype.free);var N=class ae{static __wrap(e){e=e>>>0;let n=Object.create(ae.prototype);return n.__wbg_ptr=e,H.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),e}free(){let e=this.__destroy_into_raw();r.__wbg_virtualdataslice_free(e,0)}fromArrowIpc(e){try{let i=r.__wbindgen_add_to_stack_pointer(-16);r.virtualdataslice_fromArrowIpc(i,this.__wbg_ptr,a(e));var n=c().getInt32(i+0,!0),_=c().getInt32(i+4,!0);if(_)throw b(n)}finally{r.__wbindgen_add_to_stack_pointer(16)}}constructor(e){let n=r.virtualdataslice_new(a(e));return this.__wbg_ptr=n>>>0,H.register(this,this.__wbg_ptr,this),this}setBooleanCol(e,n,_,i){try{let u=r.__wbindgen_add_to_stack_pointer(-16),g=p(e,r.__wbindgen_export,r.__wbindgen_export2),w=f;r.virtualdataslice_setBooleanCol(u,this.__wbg_ptr,g,w,n,a(_),d(i)?4294967297:i>>>0);var l=c().getInt32(u+0,!0),s=c().getInt32(u+4,!0);if(s)throw b(l)}finally{r.__wbindgen_add_to_stack_pointer(16)}}setCol(e,n,_,i,l){try{let g=r.__wbindgen_add_to_stack_pointer(-16),w=p(e,r.__wbindgen_export,r.__wbindgen_export2),y=f,m=p(n,r.__wbindgen_export,r.__wbindgen_export2),x=f;r.virtualdataslice_setCol(g,this.__wbg_ptr,w,y,m,x,_,a(i),d(l)?4294967297:l>>>0);var s=c().getInt32(g+0,!0),u=c().getInt32(g+4,!0);if(u)throw b(s)}finally{r.__wbindgen_add_to_stack_pointer(16)}}setDatetimeCol(e,n,_,i){try{let u=r.__wbindgen_add_to_stack_pointer(-16),g=p(e,r.__wbindgen_export,r.__wbindgen_export2),w=f;r.virtualdataslice_setDatetimeCol(u,this.__wbg_ptr,g,w,n,a(_),d(i)?4294967297:i>>>0);var l=c().getInt32(u+0,!0),s=c().getInt32(u+4,!0);if(s)throw b(l)}finally{r.__wbindgen_add_to_stack_pointer(16)}}setFloatCol(e,n,_,i){try{let u=r.__wbindgen_add_to_stack_pointer(-16),g=p(e,r.__wbindgen_export,r.__wbindgen_export2),w=f;r.virtualdataslice_setFloatCol(u,this.__wbg_ptr,g,w,n,a(_),d(i)?4294967297:i>>>0);var l=c().getInt32(u+0,!0),s=c().getInt32(u+4,!0);if(s)throw b(l)}finally{r.__wbindgen_add_to_stack_pointer(16)}}setIntegerCol(e,n,_,i){try{let u=r.__wbindgen_add_to_stack_pointer(-16),g=p(e,r.__wbindgen_export,r.__wbindgen_export2),w=f;r.virtualdataslice_setIntegerCol(u,this.__wbg_ptr,g,w,n,a(_),d(i)?4294967297:i>>>0);var l=c().getInt32(u+0,!0),s=c().getInt32(u+4,!0);if(s)throw b(l)}finally{r.__wbindgen_add_to_stack_pointer(16)}}setStringCol(e,n,_,i){try{let u=r.__wbindgen_add_to_stack_pointer(-16),g=p(e,r.__wbindgen_export,r.__wbindgen_export2),w=f;r.virtualdataslice_setStringCol(u,this.__wbg_ptr,g,w,n,a(_),d(i)?4294967297:i>>>0);var l=c().getInt32(u+0,!0),s=c().getInt32(u+4,!0);if(s)throw b(l)}finally{r.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(N.prototype[Symbol.dispose]=N.prototype.free);var F=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,Y.unregister(this),t}free(){let t=this.__destroy_into_raw();r.__wbg_virtualserver_free(t,0)}handleRequest(t){let e=Ee(t,r.__wbindgen_export),n=f,_=r.virtualserver_handleRequest(this.__wbg_ptr,e,n);return b(_)}constructor(t){try{let i=r.__wbindgen_add_to_stack_pointer(-16);r.virtualserver_new(i,a(t));var e=c().getInt32(i+0,!0),n=c().getInt32(i+4,!0),_=c().getInt32(i+8,!0);if(_)throw b(n);return this.__wbg_ptr=e>>>0,Y.register(this,this.__wbg_ptr,this),this}finally{r.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(F.prototype[Symbol.dispose]=F.prototype.free);function le(){r.init()}function ce(){return{__proto__:null,"./perspective-js.wasm_bg.js":{__proto__:null,__wbg_Error_8c4e43fe74559d73:function(t,e){var n=h(t,e);let _=Error(n);return a(_)},__wbg_Number_04624de7d0e8332d:function(t){return Number(o(t))},__wbg_String_8f0eb39a4a4c2f66:function(t,e){let n=String(o(e)),_=p(n,r.__wbindgen_export,r.__wbindgen_export2),i=f;c().setInt32(t+4,i,!0),c().setInt32(t+0,_,!0)},__wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2:function(t,e){let n=o(e),_=typeof n=="bigint"?n:void 0;c().setBigInt64(t+8,d(_)?BigInt(0):_,!0),c().setInt32(t+0,!d(_),!0)},__wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25:function(t){let e=o(t),n=typeof e=="boolean"?e:void 0;return d(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_0bc8482c6e3508ae:function(t,e){let n=$(o(e)),_=p(n,r.__wbindgen_export,r.__wbindgen_export2),i=f;c().setInt32(t+4,i,!0),c().setInt32(t+0,_,!0)},__wbg___wbindgen_in_47fa6863be6f2f25:function(t,e){return o(t)in o(e)},__wbg___wbindgen_is_bigint_31b12575b56f32fc:function(t){return typeof o(t)=="bigint"},__wbg___wbindgen_is_function_0095a73b8b156f76:function(t){return typeof o(t)=="function"},__wbg___wbindgen_is_null_ac34f5003991759a:function(t){return o(t)===null},__wbg___wbindgen_is_object_5ae8e5880f2c1fbd:function(t){let e=o(t);return typeof e=="object"&&e!==null},__wbg___wbindgen_is_string_cd444516edc5b180:function(t){return typeof o(t)=="string"},__wbg___wbindgen_is_undefined_9e4d92534c42d778:function(t){return o(t)===void 0},__wbg___wbindgen_jsval_eq_11888390b0186270:function(t,e){return o(t)===o(e)},__wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811:function(t,e){return o(t)==o(e)},__wbg___wbindgen_number_get_8ff4255516ccad3e:function(t,e){let n=o(e),_=typeof n=="number"?n:void 0;c().setFloat64(t+8,d(_)?0:_,!0),c().setInt32(t+0,!d(_),!0)},__wbg___wbindgen_string_get_72fb696202c56729:function(t,e){let n=o(e),_=typeof n=="string"?n:void 0;var i=d(_)?0:p(_,r.__wbindgen_export,r.__wbindgen_export2),l=f;c().setInt32(t+4,l,!0),c().setInt32(t+0,i,!0)},__wbg___wbindgen_throw_be289d5034ed271b:function(t,e){var n=h(t,e);throw new Error(n)},__wbg__wbg_cb_unref_d9b87ff7982e3b21:function(t){o(t)._wbg_cb_unref()},__wbg_apply_ada2ee1a60ac7b3c:function(){return v(function(t,e,n){let _=o(t).apply(o(e),o(n));return a(_)},arguments)},__wbg_at_dfc235641cc0e40c:function(t,e){let n=o(t).at(e);return a(n)},__wbg_buffer_26d0910f3a5bc899:function(t){let e=o(t).buffer;return a(e)},__wbg_call_389efe28435a9388:function(){return v(function(t,e){let n=o(t).call(o(e));return a(n)},arguments)},__wbg_call_4708e0c13bdc8e95:function(){return v(function(t,e,n){let _=o(t).call(o(e),o(n));return a(_)},arguments)},__wbg_call_812d25f1510c13c8:function(){return v(function(t,e,n,_){let i=o(t).call(o(e),o(n),o(_));return a(i)},arguments)},__wbg_client_new:function(t){let e=U.__wrap(t);return a(e)},__wbg_debug_46a93995fc6f8820:function(t,e,n,_){console.debug(o(t),o(e),o(n),o(_))},__wbg_debug_a4099fa12db6cd61:function(t){console.debug(o(t))},__wbg_done_57b39ecd9addfe81:function(t){return o(t).done},__wbg_entries_58c7934c745daac7:function(t){let e=Object.entries(o(t));return a(e)},__wbg_error_794d0ffc9d00d5c3:function(t,e,n,_){console.error(o(t),o(e),o(n),o(_))},__wbg_error_9a7fe3f932034cde:function(t){console.error(o(t))},__wbg_error_f852e41c69b0bd84:function(t,e){console.error(o(t),o(e))},__wbg_from_bddd64e7d5ff6941:function(t){let e=Array.from(o(t));return a(e)},__wbg_getEntriesByName_02488cff0bc7581c:function(t,e,n,_,i){var l=h(e,n),s=h(_,i);let u=o(t).getEntriesByName(l,s);return a(u)},__wbg_getRandomValues_1c61fac11405ffdc:function(){return v(function(t,e){globalThis.crypto.getRandomValues(j(t,e))},arguments)},__wbg_getTime_1e3cd1391c5c3995:function(t){return o(t).getTime()},__wbg_get_76e04509d1922a04:function(t,e,n){var _=h(e,n);let i=o(t)[_];return d(i)?0:a(i)},__wbg_get_9b94d73e6221f75c:function(t,e){let n=o(t)[e>>>0];return a(n)},__wbg_get_b3ed3ad4be2bc8ac:function(){return v(function(t,e){let n=Reflect.get(o(t),o(e));return a(n)},arguments)},__wbg_get_with_ref_key_1dc361bd10053bfe:function(t,e){let n=o(t)[o(e)];return a(n)},__wbg_has_d4e53238966c12b6:function(){return v(function(t,e){return Reflect.has(o(t),o(e))},arguments)},__wbg_info_148d043840582012:function(t){console.info(o(t))},__wbg_info_9e602cf10c5c690b:function(t,e,n,_){console.info(o(t),o(e),o(n),o(_))},__wbg_instanceof_ArrayBuffer_c367199e2fa2aa04:function(t){let e;try{e=o(t)instanceof ArrayBuffer}catch{e=!1}return e},__wbg_instanceof_Array_d9eac779cd191cbc:function(t){let e;try{e=o(t)instanceof Array}catch{e=!1}return e},__wbg_instanceof_Date_1b9f15b87f10aa4c:function(t){let e;try{e=o(t)instanceof Date}catch{e=!1}return e},__wbg_instanceof_Error_8573fe0b0b480f46:function(t){let e;try{e=o(t)instanceof Error}catch{e=!1}return e},__wbg_instanceof_Map_53af74335dec57f4:function(t){let e;try{e=o(t)instanceof Map}catch{e=!1}return e},__wbg_instanceof_Object_1c6af87502b733ed:function(t){let e;try{e=o(t)instanceof Object}catch{e=!1}return e},__wbg_instanceof_Promise_0094681e3519d6ec:function(t){let e;try{e=o(t)instanceof Promise}catch{e=!1}return e},__wbg_instanceof_Uint8Array_9b9075935c74707c:function(t){let e;try{e=o(t)instanceof Uint8Array}catch{e=!1}return e},__wbg_instanceof_Window_ed49b2db8df90359:function(t){let e;try{e=o(t)instanceof Window}catch{e=!1}return e},__wbg_isArray_d314bb98fcf08331:function(t){return Array.isArray(o(t))},__wbg_isSafeInteger_bfbc7332a9768d2a:function(t){return Number.isSafeInteger(o(t))},__wbg_iterator_6ff6560ca1568e55:function(){return a(Symbol.iterator)},__wbg_keys_b50a709a76add04e:function(t){let e=Object.keys(o(t));return a(e)},__wbg_length_32ed9a279acd054c:function(t){return o(t).length},__wbg_length_35a7bace40f36eac:function(t){return o(t).length},__wbg_mark_3b530a64b09ba08a:function(){return v(function(t,e,n){var _=h(e,n);o(t).mark(_)},arguments)},__wbg_measure_288b48c082eae0fe:function(){return v(function(t,e,n,_,i){var l=h(e,n),s=h(_,i);o(t).measure(l,s)},arguments)},__wbg_message_9ddc4b9a62a7c379:function(t){let e=o(t).message;return a(e)},__wbg_new_361308b2356cecd0:function(){let t=new Object;return a(t)},__wbg_new_3eb36ae241fe6f44:function(){let t=new Array;return a(t)},__wbg_new_72b49615380db768:function(t,e){var n=h(t,e);let _=new Error(n);return a(_)},__wbg_new_b5d9e2fb389fef91:function(t,e){try{var n={a:t,b:e},_=(l,s)=>{let u=n.a;n.a=0;try{return me(u,n.b,l,s)}finally{n.a=u}};let i=new Promise(_);return a(i)}finally{n.a=n.b=0}},__wbg_new_dca287b076112a51:function(){return a(new Map)},__wbg_new_dd2b680c8bf6ae29:function(t){let e=new Uint8Array(o(t));return a(e)},__wbg_new_from_slice_a3d2629dc1826784:function(t,e){let n=new Uint8Array(j(t,e));return a(n)},__wbg_new_no_args_1c7c842f08d00ebb:function(t,e){var n=h(t,e);let _=new Function(n);return a(_)},__wbg_next_3482f54c49e8af19:function(){return v(function(t){let e=o(t).next();return a(e)},arguments)},__wbg_next_418f80d8f5303233:function(t){let e=o(t).next;return a(e)},__wbg_now_ebffdf7e580f210d:function(t){return o(t).now()},__wbg_parse_708461a1feddfb38:function(){return v(function(t,e){var n=h(t,e);let _=JSON.parse(n);return a(_)},arguments)},__wbg_performance_06f12ba62483475d:function(t){let e=o(t).performance;return d(e)?0:a(e)},__wbg_prototypesetcall_bdcdcc5842e4d77d:function(t,e,n){Uint8Array.prototype.set.call(j(t,e),o(n))},__wbg_push_8ffdcb2063340ba5:function(t,e){return o(t).push(o(e))},__wbg_queueMicrotask_0aa0a927f78f5d98:function(t){let e=o(t).queueMicrotask;return a(e)},__wbg_queueMicrotask_5bb536982f78a56f:function(t){queueMicrotask(o(t))},__wbg_reject_a2176de7f1212be5:function(t){let e=Promise.reject(o(t));return a(e)},__wbg_resolve_002c4b7d9d8f6b64:function(t){let e=Promise.resolve(o(t));return a(e)},__wbg_set_1eb0999cf5d27fc8:function(t,e,n){let _=o(t).set(o(e),o(n));return a(_)},__wbg_set_3f1d0b984ed272ed:function(t,e,n){o(t)[b(e)]=b(n)},__wbg_set_f43e577aea94465b:function(t,e,n){o(t)[e>>>0]=b(n)},__wbg_startTime_248495bfbcb427d3:function(t){return o(t).startTime},__wbg_static_accessor_GLOBAL_12837167ad935116:function(){let t=typeof window>"u"?null:window;return d(t)?0:a(t)},__wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f:function(){let t=typeof globalThis>"u"?null:globalThis;return d(t)?0:a(t)},__wbg_static_accessor_SELF_a621d3dfbb60d0ce:function(){let t=typeof self>"u"?null:self;return d(t)?0:a(t)},__wbg_static_accessor_WINDOW_f8727f0cf888e0bd:function(){let t=typeof window>"u"?null:window;return d(t)?0:a(t)},__wbg_stringify_8d1cc6ff383e8bae:function(){return v(function(t){let e=JSON.stringify(o(t));return a(e)},arguments)},__wbg_table_new:function(t){let e=z.__wrap(t);return a(e)},__wbg_then_0d9fe2c7b1857d32:function(t,e,n){let _=o(t).then(o(e),o(n));return a(_)},__wbg_then_b9e7b3b5f1a9e1b5:function(t,e){let n=o(t).then(o(e));return a(n)},__wbg_toString_964ff7fe6eca8362:function(t){let e=o(t).toString();return a(e)},__wbg_trace_9007714a6fbee374:function(t){console.trace(o(t))},__wbg_trace_bd16b570941b54fb:function(t,e,n,_){console.trace(o(t),o(e),o(n),o(_))},__wbg_value_0546255b415e96c1:function(t){let e=o(t).value;return a(e)},__wbg_values_5da93bc719d272cf:function(t){let e=Object.values(o(t));return a(e)},__wbg_view_new:function(t){let e=R.__wrap(t);return a(e)},__wbg_view_unwrap:function(t){return R.__unwrap(o(t))},__wbg_virtualdataslice_new:function(t){let e=N.__wrap(t);return a(e)},__wbg_warn_a40b971467b219c7:function(t,e,n,_){console.warn(o(t),o(e),o(n),o(_))},__wbg_warn_f7ae1b2e66ccb930:function(t){console.warn(o(t))},__wbindgen_cast_0000000000000001:function(t,e){let n=Se(t,e,r.__wasm_bindgen_func_elem_842,he);return a(n)},__wbindgen_cast_0000000000000002:function(t,e){let n=Ae(t,e,r.__wasm_bindgen_func_elem_3911,ye);return a(n)},__wbindgen_cast_0000000000000003:function(t){return a(t)},__wbindgen_cast_0000000000000004:function(t){return a(t)},__wbindgen_cast_0000000000000005:function(t,e){var n=h(t,e);return a(n)},__wbindgen_cast_0000000000000006:function(t,e){let n=j(t,e);return a(n)},__wbindgen_cast_0000000000000007:function(t){let e=BigInt.asUintN(64,t);return a(e)},__wbindgen_cast_0000000000000008:function(t,e){var n=xe(t,e).slice();return r.__wbindgen_export4(t,e*4,4),a(n)},__wbindgen_cast_0000000000000009:function(t,e){var n=j(t,e).slice();return r.__wbindgen_export4(t,e*1,1),a(n)},__wbindgen_object_clone_ref:function(t){let e=o(t);return a(e)},__wbindgen_object_drop_ref:function(t){b(t)}}}}function he(t,e){let n=r.__wasm_bindgen_func_elem_1727(t,e);return b(n)}function ye(t,e,n){r.__wasm_bindgen_func_elem_3928(t,e,a(n))}function me(t,e,n,_){r.__wasm_bindgen_func_elem_10788(t,e,a(n),a(_))}var D=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_client_free(t>>>0,1)),Q=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_genericsqlvirtualservermodel_free(t>>>0,1)),V=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_proxysession_free(t>>>0,1)),K=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_table_free(t>>>0,1)),X=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_view_free(t>>>0,1)),H=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_virtualdataslice_free(t>>>0,1)),Y=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_virtualserver_free(t>>>0,1));function a(t){q===I.length&&I.push(I.length+1);let e=q;return q=I[e],I[e]=t,e}function ve(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`)}function ue(t){if(M==1)throw new Error("out of js stack");return I[--M]=t,M}var T=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>t.dtor(t.a,t.b));function $(t){let e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){let i=t.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=t.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(t)){let i=t.length,l="[";i>0&&(l+=$(t[0]));for(let s=1;s<i;s++)l+=", "+$(t[s]);return l+="]",l}let n=/\[object ([^\]]+)\]/.exec(toString.call(t)),_;if(n&&n.length>1)_=n[1];else return toString.call(t);if(_=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message}
${t.stack}`:_}function Ie(t){t<132||(I[t]=q,q=t)}function xe(t,e){t=t>>>0;let n=c(),_=[];for(let i=t;i<t+4*e;i+=4)_.push(b(n.getUint32(i,!0)));return _}function j(t,e){return t=t>>>0,A().subarray(t/1,t/1+e)}function h(t,e){return t===0?o(e):ke(t,e)}var S=null;function c(){return(S===null||S.buffer.detached===!0||S.buffer.detached===void 0&&S.buffer!==r.memory.buffer)&&(S=new DataView(r.memory.buffer)),S}function ke(t,e){return t=t>>>0,je(t,e)}var W=null;function A(){return(W===null||W.byteLength===0)&&(W=new Uint8Array(r.memory.buffer)),W}function o(t){return I[t]}function v(t,e){try{return t.apply(this,e)}catch(n){r.__wbindgen_export3(a(n))}}var I=new Array(128).fill(void 0);I.push(void 0,null,!0,!1);var q=I.length;function d(t){return t==null}function Se(t,e,n,_){let i={a:t,b:e,cnt:1,dtor:n},l=(...s)=>{i.cnt++;try{return _(i.a,i.b,...s)}finally{l._wbg_cb_unref()}};return l._wbg_cb_unref=()=>{--i.cnt===0&&(i.dtor(i.a,i.b),i.a=0,T.unregister(i))},T.register(l,i,i),l}function Ae(t,e,n,_){let i={a:t,b:e,cnt:1,dtor:n},l=(...s)=>{i.cnt++;let u=i.a;i.a=0;try{return _(u,i.b,...s)}finally{i.a=u,l._wbg_cb_unref()}};return l._wbg_cb_unref=()=>{--i.cnt===0&&(i.dtor(i.a,i.b),i.a=0,T.unregister(i))},T.register(l,i,i),l}function Ee(t,e){let n=e(t.length*1,1)>>>0;return A().set(t,n/1),f=t.length,n}function p(t,e,n){if(n===void 0){let u=Z.encode(t),g=e(u.length,1)>>>0;return A().subarray(g,g+u.length).set(u),f=u.length,g}let _=t.length,i=e(_,1)>>>0,l=A(),s=0;for(;s<_;s++){let u=t.charCodeAt(s);if(u>127)break;l[i+s]=u}if(s!==_){s!==0&&(t=t.slice(s)),i=n(i,_,_=s+t.length*3,1)>>>0;let u=A().subarray(i+s,i+_),g=Z.encodeInto(t,u);s+=g.written,i=n(i,_,s,1)>>>0}return f=s,i}var M=128;function b(t){let e=o(t);return Ie(t),e}var B=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});B.decode();var Oe=2146435072,G=0;function je(t,e){return G+=e,G>=Oe&&(B=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),B.decode(),G=e),B.decode(A().subarray(t,t+e))}var Z=new TextEncoder,f=0,We,r;function be(t,e){return r=t.exports,We=e,S=null,W=null,r}async function qe(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(i){if(t.ok&&n(t.type)&&t.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}let _=await t.arrayBuffer();return await WebAssembly.instantiate(_,e)}else{let _=await WebAssembly.instantiate(t,e);return _ instanceof WebAssembly.Instance?{instance:_,module:t}:_}function n(_){switch(_){case"basic":case"cors":case"default":return!0}return!1}}function Me(t){if(r!==void 0)return r;t!==void 0&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=ce();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let n=new WebAssembly.Instance(t,e);return be(n,t)}async function ge(t){if(r!==void 0)return r;t!==void 0&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead"));let e=ce();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:n,module:_}=await qe(await t,e);return be(n,_)}function Ue(){let t,e,n=new Promise((_,i)=>{t=_,e=i});return[t,n,e]}async function Re(t,e,n,_){let i,l;async function s(){if(l?.readyState===t.CONNECTING||l?.readyState===t.OPEN){console.warn(`Already connected ${l.readyState}`);return}let[w,y,m]=Ue();l=new t(n,_),l.onopen=w,l.binaryType="arraybuffer",l.onerror=x=>{let O=x.message||"Generic Websocket Error";i.handle_error(O,s),m(O)},l.onclose=x=>{let O=`WebSocket closed ${x.code}`;i.handle_error(O,s),m(O)},l.onmessage=x=>{i.handle_response(x.data)},await y}async function u(w){if(l.readyState===t.CLOSING||l.readyState===t.CLOSED){let y=`WebSocket transport error (${l.readyState})`;throw i.handle_error(y,s),new Error(y)}else if(l.readyState===t.CONNECTING){let y=`WebSocket message dropped (${l.readyState})`;throw new Error(y)}else{let y=w.slice().buffer;l.send(y)}}async function g(){console.debug("Closing WebSocket"),l.close()}return i=new e(u,g),await s(),i}function Ne(){let t,e,n=new Promise((_,i)=>{t=_,e=i});return[t,n,e]}async function Le(t,e){let[n,_]=Ne();t.addEventListener("message",function i(l){t.removeEventListener("message",i),n(null)}),t.onmessage=function(i){t.onmessage=function(){},n(null)},t.onmessageerror=console.error,t.postMessage({cmd:"init",args:[e]},{transfer:e===void 0||e instanceof WebAssembly.Module?[]:[e]}),await _}async function Be(t,e,n){let[_,i]=await Promise.all([e,n]),{Client:l}=await t,s;typeof SharedWorker<"u"&&i instanceof SharedWorker?s=i.port:s=i;let u=new l(async g=>{let w=g.slice().buffer;s.postMessage(w,{transfer:[w]})},async()=>{console.debug("Closing WebWorker"),s.close(),i instanceof Worker&&i.terminate()});return await Le(s,_),s.addEventListener("message",g=>{u.handle_response(g.data)}),u}async function Ce(t,e){let{Client:n}=await t;return await Re(WebSocket,n,e)}async function Pe(t){let e;typeof t?.then=="function"&&(t=await t),t instanceof Response?e=await WebAssembly.instantiateStreaming(t):typeof t=="string"?e=await WebAssembly.instantiateStreaming(fetch(t)):t instanceof ArrayBuffer?e=await WebAssembly.instantiate(t):t instanceof Uint8Array?e=await WebAssembly.instantiate(t.buffer):e=t;let n=e.instance.exports,[_]=WebAssembly.Module.customSections(e.module,"psp-runtime"),[i]=WebAssembly.Module.customSections(e.module,"psp-len"),l=new DataView(i).getUint32(0,!0),s=n.resize(_.byteLength);new Uint8Array(n.memory.buffer).set(new Uint8Array(_),s);let u=n.compile(_.byteLength,l);return new Uint8Array(n.memory.buffer).slice(u,l+u)}if(typeof WebAssembly>"u")throw new Error("WebAssembly not supported.");async function de(t){t instanceof Function&&(t=await t());try{return await Pe(t)}catch{return console.warn("Stage 0 wasm loading failed, skipping"),new Uint8Array(t)}}var ee='"use strict";(()=>{var B=Object.defineProperty;var H=(s,e,r)=>e in s?B(s,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[e]=r;var m=(s,e,r)=>H(s,typeof e!="symbol"?e+"":e,r);var v=class{constructor(e){m(this,"poll_handle");m(this,"server");this.server=e}set_poll_handle(){return this.poll_handle=new Promise((e,r)=>setTimeout(()=>this.server.poll().then(e).catch(r).finally(()=>{this.poll_handle=void 0}))),this.poll_handle}async on_poll_request(){this.poll_handle?await this.poll_handle.then(()=>{if(!this.poll_handle)return this.set_poll_handle()}):await this.set_poll_handle()}},h=class{constructor(e,r){m(this,"clients");m(this,"server");m(this,"module");m(this,"on_poll_request");this.clients=new Map,this.module=e,this.on_poll_request=r?.on_poll_request,this.server=e._psp_new_server(r?.on_poll_request?1:0)}make_session(e){let r=this.module._psp_new_session(this.server);return this.clients.set(r,e),new P(this.module,this.server,r,this.clients,this.on_poll_request&&(()=>this.on_poll_request(this)))}async poll(){let e=this.module._psp_poll(this.server);await A(this.module,e,async r=>{await this.clients.get(r.client_id)(r.data)})}delete(){this.module._psp_delete_server(this.server)}},P=class{constructor(e,r,i,o,_){this.mod=e;this.server=r;this.client_id=i;this.client_map=o;this.on_poll_request=_}async handle_request(e){let r=await N(this.mod,e,async i=>this.mod._psp_handle_request(this.server,this.client_id,i,this.mod._psp_is_memory64()?BigInt(e.byteLength):e.byteLength));await A(this.mod,r,async i=>{await this.client_map.get(i.client_id)(i.data)}),this.on_poll_request?await this.on_poll_request():await this.poll()}async poll(){let e=this.mod._psp_poll(this.server);await A(this.mod,e,async r=>{r.client_id===0?await this.client_map.get(this.client_id)(r.data):await this.client_map.get(r.client_id)(r.data)})}close(){this.mod._psp_close_session(this.server,this.client_id)}};async function N(s,e,r){let i=s._psp_alloc(s._psp_is_memory64()?BigInt(e.byteLength):e.byteLength);s.HEAPU8.set(e,Number(i));let o=await r(i);return s._psp_free(i),o}async function A(s,e,r){let i=s._psp_is_memory64(),o=new DataView(s.HEAPU8.buffer,Number(e),i?12:8),_=o.getUint32(0,!0),d=i?o.getBigInt64(4,!0):o.getUint32(4,!0),t=new DataView(s.HEAPU8.buffer,Number(d),_*(i?16:12));try{for(let n=0;n<_;n++){let[a,l,f]=i?[t.getBigInt64(n*16,!0),t.getInt32(n*16+8,!0),t.getInt32(n*16+12,!0)]:[t.getInt32(n*12,!0),t.getInt32(n*12+4,!0),t.getInt32(n*12+8,!0)],c=new Uint8Array(s.HEAPU8.buffer,Number(a),l);await r({client_id:f,data:c})}}finally{for(let n=0;n<_;n++){let a=i?t.getBigInt64(n*16,!0):t.getInt32(n*12,!0);s._psp_free(a)}s._psp_free(i?BigInt(t.byteOffset):t.byteOffset),s._psp_free(i?BigInt(o.byteOffset):o.byteOffset)}}var q=console.log.bind(console),L=console.error.bind(console),O=new TextDecoder("utf8"),R=[null,[],[]];function W(s,e=0,r=NaN){for(var i=e+r,o=e;s[o]&&!(o>=i);)++o;return O.decode(s instanceof Uint8Array?s.subarray(e,o):new Uint8Array(s.slice(e,o)))}function M(s,e){var r=R[s];e===0||e===10?((s===1?q:L)(W(r,0)),r.length=0):r.push(e)}async function U(s){let e,r=!1,i,o={HaveOffsetConverter(){console.error("HaveOffsetConverter")},__syscall_ftruncate64(...t){console.error("__syscall_frtuncate64",t)},__syscall_getdents64(...t){console.error("__syscall_frtuncate64",t)},__syscall_unlinkat(...t){console.error("__syscall_frtuncate64",t)},__throw_exception_with_stack_trace(t){let n=new WebAssembly.Exception(e.__cpp_exception,[t],{traceStack:!0});throw n.message="Unexpected internal error",n},clock_time_get(t,n,a){if(r){if(a=a,a=Number(a),!(t==0||t==1||t==2||t==3))return 28;var l;t===0?l=Date.now():l=performance.now();let c=Math.round(l*1e3*1e3),p=new BigInt64Array(i.buffer);return p[a/8]=BigInt(c),0}else{if(a=a,a>>>=0,!(t==0||t==1||t==2||t==3))return 28;var l;t===0?l=Date.now():l=performance.now();var f=Math.round(l*1e6);let p=new BigInt64Array(i.buffer);return p[a>>>3]=BigInt(f),0}},emscripten_asm_const_int(...t){return 0},emscripten_notify_memory_growth(t){r?t=Number(t):(t=t,t>>>=0),t!=0&&console.error("abort")},environ_get(...t){return 0},environ_sizes_get(...t){return 0},fd_close(...t){return console.error("fd_close",t),0},fd_read(...t){return console.error("fd_read",t),0},fd_seek(...t){return console.error("fs_seek",t),0},fd_write(t,n,a,l){let f=new Uint8Array(i.buffer);if(r){n=Number(n),a=Number(a),l=Number(l);let c=0,p=new BigUint64Array(i.buffer);for(let y=0;y<a;y++){let w=Number(p[n/8]),b=Number(p[(n+8)/8]);n+=16;for(let u=0;u<b;u++)M(t,f[w+u]);c+=b}return p[l/8]=BigInt(c),0}else{n=n,a=a,l=l,n>>>=0,a>>>=0,l>>>=0;let c=0,p=new Uint32Array(i.buffer);for(let y=0;y<a;y++){let w=p[n>>>2>>>0],b=p[n+4>>>2>>>0];n+=8;for(let u=0;u<b;u++)M(t,f[w+u>>>0]);c+=b}return p[l>>>2>>>0]=c,0}},proc_exit(t){return console.error("proc_exit",t),0}},_=await s.instantiateWasm({env:o,wasi_snapshot_preview1:o},t=>{e=t.exports,r=!!e.psp_is_memory64(),i=t.exports.memory,e._initialize()}),d={};for(let[t,n]of Object.entries(_))d[`_${t}`]=n;return{..._,...d,get HEAPU8(){return new Uint8Array(i.buffer)}}}async function S(s){let e=await U({locateFile(r){return r},instantiateWasm:async(r,i)=>{r.env={...r.env,psp_stack_trace(){let _=Error().stack||"",t=new TextEncoder().encode(_),n=e._psp_alloc(e._psp_is_memory64()?BigInt(t.byteLength+1):t.byteLength+1);return e.HEAPU8.set(t,Number(n)),e.HEAPU8[Number(n)+t.byteLength]=0,n},psp_heap_size(){return e._psp_is_memory64()?BigInt(e.HEAPU8.buffer.byteLength):e.HEAPU8.buffer.byteLength}};let o=await WebAssembly.instantiate(s,r);return i(o.instance),o.instance.exports}});return e}var g,x,E;async function I(s){if(s.data.cmd==="init"){let e=s.data.id;if(!g){let r=await S(s.data.args[0]);g=new h(r,{on_poll_request:()=>x.on_poll_request()}),x=new v(g)}E=g.make_session(async r=>{let i=r.slice().buffer;this.postMessage(i,{transfer:[i]})}),this.postMessage({id:e})}else if(E)await E?.handle_request(new Uint8Array(s.data));else throw new Error("No session")}function T(s){let e=s.ports[0];e.addEventListener("message",I.bind(e)),e.start()}self.addEventListener("connect",T);self.addEventListener("message",I.bind(self));})();\n';function te(t,e){function n(l,s){l==="message"&&t.push(s)}function _(l){let s=t.indexOf(l);s>-1&&t.splice(s,1)}function i(l,s){for(let u of e)u({data:l,ports:s})}return{addEventListener:n,removeEventListener:_,postMessage:i,location:{href:""}}}function ze(t){console.error("Running perspective in single-threaded mode");let e=Function("const self = arguments[0];"+t),n=[],_=[];return e(te(n,_)),te(_,n)}var Fe=async function(){try{if(window.location.protocol.startsWith("file"))return console.warn("file:// protocol does not support Web Workers"),ze(ee);{let t=new Blob([ee],{type:"application/javascript"}),e=URL.createObjectURL(t);return new Worker(e,{type:"module"})}}catch(t){console.error("Error instantiating engine",t)}},Te=Fe,k;async function De(t){return pe(await J(),t)}function Ve(t,e=!1){t instanceof Uint8Array?k=Promise.resolve(t.buffer):t instanceof Response?k=Promise.resolve(t):t instanceof Promise?k=t:k=Promise.resolve(t),e||(k=k.then(n=>de(n).then(_=>_.buffer)))}var E;async function ne(t,e=!1){let n=e?t:await de(t);return await ge({module_or_path:n}),await le(),_e}function He(t,e=!1){t instanceof Uint8Array?E=ne(t.buffer,e):t instanceof ArrayBuffer||t instanceof Response||t instanceof Promise?E=ne(t,e):t instanceof Object&&(E=Promise.resolve(t))}function J(){let t=customElements.get("perspective-viewer");if(t)E=Promise.resolve(t.__wasm_module__);else if(E===void 0)throw new Error("Missing perspective-client.wasm");return E}function Ge(){if(k===void 0)throw new Error("Missing perspective-server.wasm");return k.then(t=>t instanceof WebAssembly.Module?t:t.slice(0))}var re;function $e(){return re===void 0?Te():re()}async function Je(t){return await Ce(J(),t)}async function Qe(t){return typeof t>"u"&&(t=$e()),await Be(J(),Ge(),t)}var Ke={websocket:Je,worker:Qe,init_client:He,init_server:Ve,createMessageHandler:De,GenericSQLVirtualServerModel:C,VirtualDataSlice:N,VirtualServer:F};export{C as GenericSQLVirtualServerModel,N as VirtualDataSlice,F as VirtualServer,De as createMessageHandler,Ke as default,He as init_client,Ve as init_server,Je as websocket,Qe as worker};
//# sourceMappingURL=perspective-TSKH3D5G.js.map