remotepy 1.0.9 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -1
- package/dist/RemotePyClient.d.ts +100 -0
- package/dist/RemotePyClient.js +1 -0
- package/package.json +81 -69
- package/build/remotepy.minobs.js +0 -1
- package/dist/RemotePyClient.common.js +0 -1
package/README.md
CHANGED
|
@@ -2,7 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
Remote Py allows you to write python functions and run it on a server. It also provides you interfaces in multiple languages including JavaScript, CSharp and Python to call the remote python functions.
|
|
4
4
|
|
|
5
|
-
It is a RPC mechanism built on top of Web Sockets allowing you to communicate both ways.
|
|
5
|
+
It is a RPC mechanism built on top of Web Sockets allowing you to communicate both ways.
|
|
6
|
+
|
|
7
|
+
## What's new in 1.3.0
|
|
8
|
+
|
|
9
|
+
- **Callback API and generated proxies are now callId-correlated.** Every request
|
|
10
|
+
(including `remotepy.MyServer.fn(arg, cb)` proxies) carries a `callId`; the reply is
|
|
11
|
+
delivered to the callbacks of the request that made it. Overlapping calls to the same
|
|
12
|
+
function no longer cross-wire. Needs a server that echoes `callId` (remotepy >= 0.3);
|
|
13
|
+
against older servers replies are still routed by function name as before.
|
|
14
|
+
- **Callback calls fail fast instead of hanging**: a call made while disconnected, or in
|
|
15
|
+
flight when the connection closes, receives an `Error` through its error callback
|
|
16
|
+
(`(ok, error)` -> `error`; `(start, row, end, error)` -> `error`; a single callback gets
|
|
17
|
+
the `Error` as its first argument). `defaultTimeout` now applies to callback calls too.
|
|
18
|
+
- **Logging is off by default.** The client no longer prints request arguments or replies
|
|
19
|
+
(they carry tokens and secrets). `{ log: true }` logs lifecycle events only;
|
|
20
|
+
`{ debug: true }` additionally logs payloads, for local debugging.
|
|
21
|
+
- Replies for requests the client no longer waits for (timed out, connection dropped)
|
|
22
|
+
are discarded rather than handed to the next caller of the same function.
|
|
23
|
+
|
|
24
|
+
## What's new in 1.1.0
|
|
25
|
+
|
|
26
|
+
Fully backward compatible — all existing callback APIs work unchanged. New:
|
|
27
|
+
|
|
28
|
+
- **Promise-based API with `callId` correlation** — concurrent calls to the same function are
|
|
29
|
+
now safe (legacy callbacks were keyed by function name and clobbered each other):
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
const sum = await client.call('MyServer.add', { a: 2, b: 3 });
|
|
33
|
+
|
|
34
|
+
const rows = await client.callStream('MyServer.report', { n: 100 }, {
|
|
35
|
+
onRow: (index, item, total) => render(item),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
await client.callBinary('MyServer.upload', { name: 'f.bin' }, arrayBufferOrBlob);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- **Per-call timeouts**: `client.call(fn, args, { timeout: 5000 })` or a
|
|
42
|
+
`defaultTimeout` constructor option. Server errors reject the promise (with `.traceback`).
|
|
43
|
+
- **Pending calls are rejected when the connection closes** (previously they hung forever).
|
|
44
|
+
- **Auto-reconnect** (opt-in): `new RemotePyClient(url, page, { autoReconnect: true })`
|
|
45
|
+
with exponential backoff; `client.close()` closes deliberately.
|
|
46
|
+
- **Node.js support**: `new RemotePyClient(url, page, { WebSocket: require('ws') })`.
|
|
47
|
+
- **Session helpers**: `client.setSessionId(id)` / `getSessionId()` (works outside browsers).
|
|
48
|
+
- **TypeScript definitions** shipped (`dist/RemotePyClient.d.ts`).
|
|
49
|
+
- **Bug fixes**: binary sends silently no-oped (`this` binding in FileReader callbacks);
|
|
50
|
+
4-callback streaming error handler indexed out of range; errors thrown inside `onmessage`
|
|
51
|
+
no longer abort post-message processing (route them to `client.onerror`); `{ log: false }`
|
|
52
|
+
silences console chatter.
|
|
6
53
|
|
|
7
54
|
####Requirements
|
|
8
55
|
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export interface RemotePyClientOptions {
|
|
2
|
+
/** WebSocket implementation (required under Node, e.g. `require('ws')`). */
|
|
3
|
+
WebSocket?: any;
|
|
4
|
+
/** Milliseconds before a promise-based call rejects. 0 = never (default). */
|
|
5
|
+
defaultTimeout?: number;
|
|
6
|
+
/** Reconnect with exponential backoff after an unexpected close. Default false. */
|
|
7
|
+
autoReconnect?: boolean;
|
|
8
|
+
reconnectDelayMs?: number;
|
|
9
|
+
reconnectMaxDelayMs?: number;
|
|
10
|
+
reconnectMaxAttempts?: number;
|
|
11
|
+
/** Log lifecycle events (connecting/connected/closed). Default false since 1.3.0. */
|
|
12
|
+
log?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Also log every request's arguments and every reply. Payloads routinely
|
|
15
|
+
* carry tokens and secrets: explicit opt-in for local debugging only. Default false.
|
|
16
|
+
*/
|
|
17
|
+
debug?: boolean;
|
|
18
|
+
/** After a reconnect, re-activate the stored session id automatically. */
|
|
19
|
+
sessionResume?: boolean;
|
|
20
|
+
/** RPC used for session resume. Default "SessionServer.startSessionIfNotStarted". */
|
|
21
|
+
sessionResumeFunc?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Promise returned by callStream, with server-side cancellation support. */
|
|
25
|
+
export interface StreamPromise<T> extends Promise<T[]> {
|
|
26
|
+
callId: string | null;
|
|
27
|
+
/** Ask the server to stop the stream; the promise resolves with rows so far. */
|
|
28
|
+
cancel(): void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface CallOptions {
|
|
32
|
+
/** Per-call timeout in ms; overrides `defaultTimeout`. */
|
|
33
|
+
timeout?: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface StreamHandlers {
|
|
37
|
+
onStart?: (returnValue: any, streamId: string) => void;
|
|
38
|
+
onRow?: (index: number, item: any, total?: number) => void;
|
|
39
|
+
onEnd?: (streamEmpty: boolean, cancelled: boolean) => void;
|
|
40
|
+
onError?: (error: Error) => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export class RemotePyClient {
|
|
44
|
+
constructor(serverName?: string, clientPageId?: string, options?: RemotePyClientOptions);
|
|
45
|
+
|
|
46
|
+
serverName: string;
|
|
47
|
+
clientPageId: string;
|
|
48
|
+
isOpen: boolean;
|
|
49
|
+
PythonFunctions: Record<string, any>;
|
|
50
|
+
PythonFunctionsHelp: Record<string, string>;
|
|
51
|
+
|
|
52
|
+
/** User-assignable lifecycle hooks. */
|
|
53
|
+
oninit?: () => void;
|
|
54
|
+
onopen?: () => void;
|
|
55
|
+
onclose?: (event: any) => void;
|
|
56
|
+
onerror?: (error: unknown) => void;
|
|
57
|
+
onmessagereceived?: (event: any) => void;
|
|
58
|
+
onmessageprocessed?: () => void;
|
|
59
|
+
|
|
60
|
+
connect(): void;
|
|
61
|
+
/** Close deliberately; suppresses auto-reconnect. */
|
|
62
|
+
close(): void;
|
|
63
|
+
|
|
64
|
+
// ── Promise-based API (callId-correlated; safe for concurrent calls) ──
|
|
65
|
+
call<T = any>(funcName: string, args?: Record<string, any>, options?: CallOptions): Promise<T>;
|
|
66
|
+
callStream<T = any>(funcName: string, args: Record<string, any> | undefined,
|
|
67
|
+
handlers?: StreamHandlers, options?: CallOptions): StreamPromise<T>;
|
|
68
|
+
/** Ask the server to stop an in-progress stream (by callId). */
|
|
69
|
+
cancelStream(callId: string): void;
|
|
70
|
+
callBinary<T = any>(funcName: string, args: Record<string, any> | undefined,
|
|
71
|
+
data: ArrayBuffer | ArrayBufferView | Blob, options?: CallOptions): Promise<T>;
|
|
72
|
+
|
|
73
|
+
getSessionId(): string | null;
|
|
74
|
+
setSessionId(sessionId: string): void;
|
|
75
|
+
|
|
76
|
+
// ── Callback API (and the generated proxy functions from getServerAPI()) ──
|
|
77
|
+
// Since 1.3.0 each request carries a callId and replies are matched to the
|
|
78
|
+
// request that made them, so concurrent calls to one function are safe when
|
|
79
|
+
// the server echoes callId (remotepy >= 0.3). Calls made while disconnected,
|
|
80
|
+
// and calls in flight when the connection closes, receive an Error through
|
|
81
|
+
// their error callback ((ok, error) -> error; (start, row, end, error) ->
|
|
82
|
+
// error; a single callback receives it as its first argument).
|
|
83
|
+
callPythonFunction(funcName: string, args?: Record<string, any>, ...callbacks: Function[]): void;
|
|
84
|
+
callMultipleCallbackPythonFunction(funcName: string, ...args: any[]): void;
|
|
85
|
+
callFunc(funcName: string, args?: Record<string, any>, callback?: Function): void;
|
|
86
|
+
callPythonFunctionBinary(funcName: string, args: Record<string, any> | undefined,
|
|
87
|
+
file: Blob, callback?: Function): void;
|
|
88
|
+
registerJSFunctionToBeCalledByPython(funcName: string, func: Function): void;
|
|
89
|
+
registerCallbackToPythonFunction(funcName: string, callback: Function): void;
|
|
90
|
+
registerMultipleCallbackPythonFunction(funcName: string, ...callbacks: Function[]): void;
|
|
91
|
+
getServerAPI(): Record<string, any>;
|
|
92
|
+
getService(name: string): any;
|
|
93
|
+
|
|
94
|
+
addPreOpenEventHandler(func: Function): void;
|
|
95
|
+
addPreCloseEventHandler(func: Function): void;
|
|
96
|
+
addPreMessageEventHandler(func: Function): void;
|
|
97
|
+
addPostOpenEventHandler(func: Function): void;
|
|
98
|
+
addPostCloseEventHandler(func: Function): void;
|
|
99
|
+
addPostMessageEventHandler(func: Function): void;
|
|
100
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a0_0x14e3(_0x2b3de8,_0x4ce21d){var _0x531a51=a0_0x531a();return a0_0x14e3=function(_0x14e37a,_0x4e7663){_0x14e37a=_0x14e37a-0xe5;var _0x56616c=_0x531a51[_0x14e37a];return _0x56616c;},a0_0x14e3(_0x2b3de8,_0x4ce21d);}(function(_0x1b8859,_0x2be9a5){var _0x35f707=a0_0x14e3,_0x34eeca=_0x1b8859();while(!![]){try{var _0x59a2d0=-parseInt(_0x35f707(0x19e))/0x1+parseInt(_0x35f707(0x115))/0x2+parseInt(_0x35f707(0x135))/0x3*(parseInt(_0x35f707(0x170))/0x4)+-parseInt(_0x35f707(0x16a))/0x5+-parseInt(_0x35f707(0x167))/0x6+parseInt(_0x35f707(0x112))/0x7*(-parseInt(_0x35f707(0x1a5))/0x8)+parseInt(_0x35f707(0x14d))/0x9*(parseInt(_0x35f707(0x199))/0xa);if(_0x59a2d0===_0x2be9a5)break;else _0x34eeca['push'](_0x34eeca['shift']());}catch(_0x4e72bd){_0x34eeca['push'](_0x34eeca['shift']());}}}(a0_0x531a,0x70b40));import*as a0_0x452d58 from'msgpack-lite';function RemotePyClient(_0x16f826,_0xe8ba67,_0x251f1d){var _0x308d75=a0_0x14e3;if(_0x16f826===undefined)this[_0x308d75(0x15a)]='ws://localhost:80';else this['serverName']=_0x16f826;if(_0xe8ba67===undefined)this[_0x308d75(0x198)]=_0x308d75(0x148);else this[_0x308d75(0x198)]=_0xe8ba67;_0x251f1d=_0x251f1d||{},this[_0x308d75(0xee)]=_0x251f1d;var _0x18f111=function(){};this[_0x308d75(0x17d)]=_0x251f1d['log']===!![]||_0x251f1d['debug']===!![]?console[_0x308d75(0x125)][_0x308d75(0xf8)](console):_0x18f111,this[_0x308d75(0x197)]=_0x251f1d[_0x308d75(0x16d)]===!![]?console['log'][_0x308d75(0xf8)](console):_0x18f111,this[_0x308d75(0x134)]=_0x251f1d['WebSocket']||(typeof WebSocket!==_0x308d75(0x138)?WebSocket:typeof globalThis!==_0x308d75(0x138)?globalThis[_0x308d75(0x1a4)]:undefined),this['_defaultTimeout']=_0x251f1d['defaultTimeout']||0x0,this[_0x308d75(0x14b)]=!!_0x251f1d[_0x308d75(0x159)],this[_0x308d75(0x183)]=_0x251f1d['reconnectDelayMs']||0x1f4,this[_0x308d75(0x156)]=_0x251f1d[_0x308d75(0x15d)]||0x7530,this['_reconnectMaxAttempts']=_0x251f1d['reconnectMaxAttempts']||Infinity,this[_0x308d75(0xf7)]=0x0,this[_0x308d75(0x16e)]=null,this['_closedByUser']=![],this[_0x308d75(0x13d)]=new Map(),this[_0x308d75(0x13c)]=new Map(),this[_0x308d75(0x142)]=0x0,this[_0x308d75(0x1a7)]=null,this[_0x308d75(0xef)]=![],this[_0x308d75(0xe5)]=[],this['pythonCallbackDict']=[],this[_0x308d75(0x175)]=[],this[_0x308d75(0x137)]={},this[_0x308d75(0x17b)]=null,this[_0x308d75(0xea)]={},this['pythonMultipleCallbackDict']={},this[_0x308d75(0x18f)]={},this['JS2Py']={};let _0x54f2f2=null;this[_0x308d75(0x179)]=[],this[_0x308d75(0x185)]=[],this['PreMessageEventHandlers']=[],this[_0x308d75(0xe8)]=[],this[_0x308d75(0x104)]=[],this[_0x308d75(0x128)]=[],this[_0x308d75(0x144)]=_0x4fd09b=>this['PreOpenEventHandlers']['push'](_0x4fd09b),this['addPreCloseEventHandler']=_0x23f942=>this['PreCloseEventHandlers'][_0x308d75(0x18e)](_0x23f942),this['addPreMessageEventHandler']=_0x227e36=>this[_0x308d75(0xfb)][_0x308d75(0x18e)](_0x227e36),this['addPostOpenEventHandler']=_0x32948c=>this[_0x308d75(0xe8)][_0x308d75(0x18e)](_0x32948c),this[_0x308d75(0x133)]=_0x4dece9=>this[_0x308d75(0x104)]['push'](_0x4dece9),this['addPostMessageEventHandler']=_0x5df2b4=>this[_0x308d75(0x128)][_0x308d75(0x18e)](_0x5df2b4),this[_0x308d75(0x17c)]=function(){var _0x174274=_0x308d75;return this['serverName']+'/'+this[_0x174274(0x198)];},this[_0x308d75(0x1a2)]=function(_0x227455,..._0x4a8e34){var _0x259af8=_0x308d75;for(var _0x2901e3=_0x4a8e34[_0x259af8(0x12f)]-0x1;_0x2901e3>=0x0;--_0x2901e3){if(typeof _0x4a8e34[_0x2901e3]!==_0x259af8(0xe7))break;}var _0xb2bf5e=_0x4a8e34[_0x259af8(0x132)](0x0,_0x2901e3+0x1),_0x11a20b=_0x4a8e34[_0x259af8(0x132)](_0x2901e3+0x1);return[_0x227455,_0xb2bf5e,_0x11a20b];},this['registerMultipleCallbackPythonFunction']=function(_0x455ba6,..._0x3195c4){this['pythonMultipleCallbackDict'][_0x455ba6]=_0x3195c4;},this['callMultipleCallbackPythonFunction']=function(_0x11a7f3,..._0x34f574){var _0x30e241=this['readCallbackArguments'](_0x11a7f3,..._0x34f574);this['_callLegacy'](_0x30e241[0x0],_0x30e241[0x1][0x0],_0x30e241[0x2],![]);},this[_0x308d75(0x172)]=function(_0x53747f,_0xc50d7b,_0x3fc05a,_0x120d09){var _0x4c94e9=_0x308d75,_0x4a3dc5=_0x3fc05a[_0x4c94e9(0x12f)]>0x0;_0x4a3dc5&&this['registerMultipleCallbackPythonFunction'](_0x53747f,..._0x3fc05a);if(!this['isOpen']){this[_0x4c94e9(0x17d)](_0x4c94e9(0x121));_0x4a3dc5&&!_0x120d09&&this[_0x4c94e9(0x152)](_0x3fc05a,new Error('Connection\x20not\x20open.'));return;}var _0x4ac23a=this[_0x4c94e9(0x11a)]();if(_0x4a3dc5){var _0x11e762={'funcName':_0x53747f,'callbacks':_0x3fc05a,'timer':null,'internal':!!_0x120d09};if(this['_defaultTimeout']>0x0&&!_0x120d09){var _0x4e8cab=this;_0x11e762[_0x4c94e9(0x102)]=setTimeout(function(){var _0x173d32=_0x4c94e9;_0x4e8cab[_0x173d32(0x13c)][_0x173d32(0x126)](_0x4ac23a),_0x4e8cab[_0x173d32(0x19c)](_0x3fc05a,new Error(_0x173d32(0x154)+_0x4e8cab[_0x173d32(0x157)]+_0x173d32(0xff)+_0x53747f));},this[_0x4c94e9(0x157)]);}this[_0x4c94e9(0x13c)][_0x4c94e9(0x14c)](_0x4ac23a,_0x11e762);}this[_0x4c94e9(0x17b)][_0x4c94e9(0x191)](JSON[_0x4c94e9(0x16c)]({'funcName':_0x53747f,'args':_0xc50d7b,'session_id':this[_0x4c94e9(0x124)](),'callId':_0x4ac23a})),this[_0x4c94e9(0x197)](_0x4c94e9(0x129)+_0x53747f+_0x4c94e9(0x13b),_0xc50d7b);},this['_legacyErrorCallbackIndex']=function(_0x100f8b){var _0x1c68ff=_0x308d75;if(_0x100f8b[_0x1c68ff(0x12f)]===0x2)return 0x1;if(_0x100f8b[_0x1c68ff(0x12f)]===0x4)return 0x3;return 0x0;},this[_0x308d75(0x19c)]=function(_0xc6de57,_0x5065a3){var _0x6c19ea=_0x308d75;try{_0xc6de57[this[_0x6c19ea(0x166)](_0xc6de57)](_0x5065a3,![]);}catch(_0x41eb1b){this[_0x6c19ea(0x16f)](_0x41eb1b);}},this[_0x308d75(0x152)]=function(_0x46ba76,_0x10d1e2){var _0x35ecd4=this;setTimeout(function(){_0x35ecd4['_invokeLegacyError'](_0x46ba76,_0x10d1e2);},0x0);},this[_0x308d75(0x10c)]=function(_0x4a9e24){var _0x53cf4f=_0x308d75;if(!(_0x53cf4f(0xf2)in _0x4a9e24))return!![];return _0x53cf4f(0xfe)in _0x4a9e24||_0x4a9e24['streaming']=='end';},this['_dispatchLegacyReply']=function(_0x17aa80,_0x2f917a){var _0x2b5896=_0x308d75;if('streaming'in _0x2f917a){switch(_0x17aa80[_0x2b5896(0x12f)]){case 0x0:break;case 0x1:if('error'in _0x2f917a)_0x17aa80[0x0](_0x2f917a[_0x2b5896(0xfe)],![]);if('return'in _0x2f917a)_0x17aa80[0x0](_0x2f917a[_0x2b5896(0xf2)],_0x2f917a[_0x2b5896(0x18d)],![]);break;case 0x2:if(_0x2b5896(0xfe)in _0x2f917a)_0x17aa80[0x0](_0x2f917a[_0x2b5896(0xfe)],![]);if('return'in _0x2f917a)_0x17aa80[0x0](_0x2f917a[_0x2b5896(0xf2)],_0x2f917a[_0x2b5896(0x18d)],![]);if(_0x2f917a[_0x2b5896(0xf2)]==_0x2b5896(0x122))_0x17aa80[0x1](_0x2f917a[_0x2b5896(0x162)],_0x2f917a['stream_item'],![]);break;case 0x3:if(_0x2b5896(0xfe)in _0x2f917a)_0x17aa80[0x0](_0x2f917a[_0x2b5896(0xfe)],![]);if(_0x2f917a[_0x2b5896(0xf2)]==_0x2b5896(0x182))_0x17aa80[0x0](_0x2f917a['return'],![]);if(_0x2f917a[_0x2b5896(0xf2)]==_0x2b5896(0x122))_0x17aa80[0x1](_0x2f917a[_0x2b5896(0x162)],_0x2f917a['stream_item'],![]);if(_0x2f917a[_0x2b5896(0xf2)]==_0x2b5896(0x196))_0x17aa80[0x2](_0x2f917a[_0x2b5896(0x184)],![]);break;case 0x4:if(_0x2b5896(0xfe)in _0x2f917a)_0x17aa80[0x3](_0x2f917a[_0x2b5896(0xfe)],![]);if(_0x2f917a[_0x2b5896(0xf2)]==_0x2b5896(0x182))_0x17aa80[0x0](_0x2f917a[_0x2b5896(0x18d)],![]);if(_0x2f917a['streaming']==_0x2b5896(0x122))_0x17aa80[0x1](_0x2f917a['stream_index'],_0x2f917a['stream_item'],![]);if(_0x2f917a[_0x2b5896(0xf2)]==_0x2b5896(0x196))_0x17aa80[0x2](_0x2f917a[_0x2b5896(0x184)],![]);break;default:throw _0x2b5896(0x15e)+_0x2f917a[_0x2b5896(0x174)];}return;}switch(_0x17aa80[_0x2b5896(0x12f)]){case 0x0:break;case 0x1:if(_0x2b5896(0xfe)in _0x2f917a)_0x17aa80[0x0](_0x2f917a[_0x2b5896(0xfe)],![]);if(_0x2b5896(0x18d)in _0x2f917a)_0x17aa80[0x0](_0x2f917a[_0x2b5896(0x18d)],![]);break;case 0x2:if(_0x2b5896(0xfe)in _0x2f917a)_0x17aa80[0x1](_0x2f917a['error'],![]);if(_0x2b5896(0x18d)in _0x2f917a)_0x17aa80[0x0](_0x2f917a['return'],![]);break;case 0x3:if('error'in _0x2f917a)_0x17aa80[0x0](_0x2f917a[_0x2b5896(0xfe)],![]);if(_0x2b5896(0x18d)in _0x2f917a)_0x17aa80[0x0](_0x2f917a[_0x2b5896(0x18d)],![]);break;default:throw _0x2b5896(0x15e)+_0x2f917a[_0x2b5896(0x174)];}},this[_0x308d75(0x140)]=function(_0x8e1860){var _0x45155e=_0x308d75,_0x42be27=this;this[_0x45155e(0x13c)][_0x45155e(0x16b)](function(_0x76c9e5,_0x5b9cec){var _0x2fa43e=_0x45155e;if(_0x76c9e5[_0x2fa43e(0x174)]===_0x8e1860){if(_0x76c9e5['timer'])clearTimeout(_0x76c9e5[_0x2fa43e(0x102)]);_0x42be27[_0x2fa43e(0x13c)][_0x2fa43e(0x126)](_0x5b9cec);}});},this[_0x308d75(0xf6)]=function(_0x8bb0c9){var _0x1c8fcc=_0x308d75,_0x2417a9=new Error(_0x8bb0c9),_0x75dc2d=Array[_0x1c8fcc(0x120)](this[_0x1c8fcc(0x13c)][_0x1c8fcc(0x103)]());this[_0x1c8fcc(0x13c)][_0x1c8fcc(0x14e)]();for(var _0x318086=0x0;_0x318086<_0x75dc2d[_0x1c8fcc(0x12f)];_0x318086++){if(_0x75dc2d[_0x318086][_0x1c8fcc(0x102)])clearTimeout(_0x75dc2d[_0x318086][_0x1c8fcc(0x102)]);if(!_0x75dc2d[_0x318086][_0x1c8fcc(0x107)])this[_0x1c8fcc(0x19c)](_0x75dc2d[_0x318086][_0x1c8fcc(0x118)],_0x2417a9);}},this[_0x308d75(0x12b)]=function(_0x51523d,_0x30fb34){var _0x2640b4=_0x308d75,_0x293603=this[_0x2640b4(0x158)][_0x2640b4(0x131)](function(_0x4986f8){var _0x5287f4=_0x2640b4;return _0x4986f8[_0x5287f4(0x174)];})[_0x2640b4(0x169)](_0x51523d);_0x293603<0x0?this['pythonCallbackDict']['push']({'funcName':_0x51523d,'callback':_0x30fb34}):this[_0x2640b4(0x158)][_0x293603][_0x2640b4(0x15b)]=_0x30fb34;},this['getSessionId']=function(){var _0x268bc5=_0x308d75;if(this[_0x268bc5(0x1a7)]!==null)return this['_sessionId'];if(typeof sessionStorage!==_0x268bc5(0x138))return sessionStorage[_0x268bc5(0xf3)]('JS2PY_SESSION_ID');return null;},this[_0x308d75(0x11c)]=function(_0x36d01a){var _0x35d2db=_0x308d75;this[_0x35d2db(0x1a7)]=_0x36d01a;if(typeof sessionStorage!==_0x35d2db(0x138))try{sessionStorage[_0x35d2db(0x1a3)](_0x35d2db(0x12e),_0x36d01a);}catch(_0x3b8d93){}},this[_0x308d75(0x11a)]=function(){var _0x2a2c15=_0x308d75;return'c'+ ++this[_0x2a2c15(0x142)]+'-'+Math[_0x2a2c15(0x147)]()[_0x2a2c15(0x116)](0x24)['slice'](0x2,0xa);},this[_0x308d75(0x11d)]=function(_0x3053cc,_0x2bd33d,_0x7fa6f3){var _0x249902=_0x308d75;this[_0x249902(0x17b)]['send'](JSON[_0x249902(0x16c)]({'funcName':_0x3053cc,'args':_0x2bd33d||{},'session_id':this[_0x249902(0x124)](),'callId':_0x7fa6f3}));},this[_0x308d75(0xf0)]=function(_0xac082d,_0x519469,_0x5ef441,_0xd9b2e8,_0x1fed58,_0x3d3c33){var _0x6b81ba=_0x308d75,_0x1278a5={'funcName':_0xac082d,'resolve':_0x5ef441,'reject':_0xd9b2e8,'timer':null,'stream':_0x3d3c33||null,'rows':_0x3d3c33?undefined:undefined},_0x3ac41c=_0x1fed58===undefined?this[_0x6b81ba(0x157)]:_0x1fed58;if(_0x3ac41c>0x0){var _0x50b3de=this;_0x1278a5['timer']=setTimeout(function(){var _0x26c853=_0x6b81ba;_0x50b3de['_pendingCalls']['delete'](_0x519469),_0xd9b2e8(new Error(_0x26c853(0x154)+_0x3ac41c+'ms:\x20'+_0xac082d));},_0x3ac41c);}return this[_0x6b81ba(0x13d)][_0x6b81ba(0x14c)](_0x519469,_0x1278a5),_0x1278a5;},this[_0x308d75(0x13e)]=function(_0x348a40,_0x25d242,_0x8f06d){_0x8f06d=_0x8f06d||{};var _0x5f2511=this;return new Promise(function(_0x45dc3a,_0x4d18a8){var _0x469d9e=a0_0x14e3;if(!_0x5f2511[_0x469d9e(0xef)]){_0x4d18a8(new Error('Connection\x20not\x20open.'));return;}var _0x41a0cd=_0x5f2511[_0x469d9e(0x11a)]();_0x5f2511['_registerPending'](_0x348a40,_0x41a0cd,_0x45dc3a,_0x4d18a8,_0x8f06d[_0x469d9e(0xf4)],null),_0x5f2511[_0x469d9e(0x11d)](_0x348a40,_0x25d242,_0x41a0cd);});},this[_0x308d75(0xe9)]=function(_0x3bd973,_0x677125,_0x1efb75,_0x5aa6e3){var _0x28f8ff=_0x308d75;_0x1efb75=_0x1efb75||{},_0x5aa6e3=_0x5aa6e3||{};var _0x4a8d6e=this,_0x49c52d=null,_0x31bcc7=new Promise(function(_0x4021de,_0x2d9534){var _0x4372a5=a0_0x14e3;if(!_0x4a8d6e[_0x4372a5(0xef)]){_0x2d9534(new Error('Connection\x20not\x20open.'));return;}_0x49c52d=_0x4a8d6e[_0x4372a5(0x11a)]();var _0x751a45=_0x4a8d6e[_0x4372a5(0xf0)](_0x3bd973,_0x49c52d,_0x4021de,_0x2d9534,_0x5aa6e3[_0x4372a5(0xf4)],_0x1efb75);_0x751a45[_0x4372a5(0x109)]=[],_0x4a8d6e[_0x4372a5(0x11d)](_0x3bd973,_0x677125,_0x49c52d);});return _0x31bcc7['callId']=_0x49c52d,_0x31bcc7[_0x28f8ff(0x1a1)]=function(){var _0xbb82de=_0x28f8ff;if(_0x49c52d)_0x4a8d6e[_0xbb82de(0x130)](_0x49c52d);},_0x31bcc7;},this[_0x308d75(0x130)]=function(_0x34b55d){var _0x2e66d0=_0x308d75;if(!this[_0x2e66d0(0xef)]||!_0x34b55d)return;this[_0x2e66d0(0x17b)][_0x2e66d0(0x191)](JSON[_0x2e66d0(0x16c)]({'stream_cancel':!![],'callId':_0x34b55d}));},this[_0x308d75(0x146)]=function(_0x350d8f,_0x515a57,_0x261248,_0xa30f75){_0xa30f75=_0xa30f75||{};var _0x9631d6=this;return new Promise(function(_0x2f2cac,_0x4476c3){var _0x113ed8=a0_0x14e3;if(!_0x9631d6[_0x113ed8(0xef)]){_0x4476c3(new Error('Connection\x20not\x20open.'));return;}var _0x44d9f1=_0x9631d6[_0x113ed8(0x11a)]();_0x515a57=_0x515a57||{},_0x515a57['isBinary']=!![],_0x9631d6[_0x113ed8(0xf0)](_0x350d8f,_0x44d9f1,_0x2f2cac,_0x4476c3,_0xa30f75['timeout'],null),_0x9631d6[_0x113ed8(0x11d)](_0x350d8f,_0x515a57,_0x44d9f1),_0x9631d6[_0x113ed8(0x195)](_0x261248,_0x4476c3);});},this['_sendRawBinary']=function(_0x20fb57,_0x1902e0){var _0x5aa051=_0x308d75,_0x530882=this;if(typeof Blob!==_0x5aa051(0x138)&&_0x20fb57 instanceof Blob){var _0x4dd96a=new FileReader();_0x4dd96a[_0x5aa051(0xfc)]=function(_0x4e13f2){var _0x427dbd=_0x5aa051;if(_0x530882['socket']&&_0x530882[_0x427dbd(0x17b)][_0x427dbd(0x17f)]==0x1)_0x530882[_0x427dbd(0x17b)][_0x427dbd(0x191)](_0x4e13f2[_0x427dbd(0x17e)]['result']);},_0x4dd96a[_0x5aa051(0x180)]=function(_0x9c3f7a){if(_0x1902e0)_0x1902e0(new Error('FileReader\x20failed'));},_0x4dd96a[_0x5aa051(0x141)](_0x20fb57);}else _0x530882[_0x5aa051(0x17b)][_0x5aa051(0x191)](_0x20fb57);},this[_0x308d75(0x10a)]=function(_0x542758,_0x847ee0){var _0x394e4c=_0x308d75,_0x2e67fc=this['_pendingCalls']['get'](_0x542758);if(!_0x2e67fc)return![];var _0x1a2b3c=_0x394e4c(0xf2)in _0x847ee0;if(_0x1a2b3c){var _0x58c387=_0x847ee0[_0x394e4c(0xf2)];try{if(_0x58c387===_0x394e4c(0x182)){if(_0x2e67fc[_0x394e4c(0x109)]===undefined)_0x2e67fc[_0x394e4c(0x109)]=[];if(_0x2e67fc['stream']&&_0x2e67fc[_0x394e4c(0x143)]['onStart'])_0x2e67fc[_0x394e4c(0x143)][_0x394e4c(0x186)](_0x847ee0[_0x394e4c(0x18d)],_0x847ee0[_0x394e4c(0xeb)]);}else{if(_0x58c387===_0x394e4c(0x122)){if(_0x2e67fc[_0x394e4c(0x109)]!==undefined)_0x2e67fc[_0x394e4c(0x109)]['push'](_0x847ee0['stream_item']);if(_0x2e67fc[_0x394e4c(0x143)]&&_0x2e67fc['stream'][_0x394e4c(0x151)])_0x2e67fc[_0x394e4c(0x143)][_0x394e4c(0x151)](_0x847ee0[_0x394e4c(0x162)],_0x847ee0[_0x394e4c(0x150)],_0x847ee0[_0x394e4c(0x1a6)]);}else{if(_0x58c387==='end'){if(_0x2e67fc['stream']&&_0x2e67fc[_0x394e4c(0x143)][_0x394e4c(0x1a8)])_0x2e67fc[_0x394e4c(0x143)][_0x394e4c(0x1a8)](_0x847ee0[_0x394e4c(0x184)],_0x847ee0[_0x394e4c(0xf5)]===!![]);if(_0x2e67fc[_0x394e4c(0x102)])clearTimeout(_0x2e67fc[_0x394e4c(0x102)]);this[_0x394e4c(0x13d)]['delete'](_0x542758),_0x2e67fc[_0x394e4c(0x19f)](_0x2e67fc[_0x394e4c(0x109)]===undefined?[]:_0x2e67fc[_0x394e4c(0x109)]);}}}}catch(_0x31e6ed){this[_0x394e4c(0x16f)](_0x31e6ed);}return!![];}if(_0x2e67fc['timer'])clearTimeout(_0x2e67fc[_0x394e4c(0x102)]);this[_0x394e4c(0x13d)][_0x394e4c(0x126)](_0x542758);if(_0x394e4c(0xfe)in _0x847ee0){var _0x161c0a=new Error(_0x847ee0[_0x394e4c(0xfe)]);_0x161c0a[_0x394e4c(0x176)]=_0x847ee0[_0x394e4c(0x176)],_0x161c0a[_0x394e4c(0x174)]=_0x847ee0[_0x394e4c(0x174)];if(_0x2e67fc['stream']&&_0x2e67fc[_0x394e4c(0x143)][_0x394e4c(0xed)])try{_0x2e67fc['stream'][_0x394e4c(0xed)](_0x161c0a);}catch(_0x398f59){this[_0x394e4c(0x16f)](_0x398f59);}_0x2e67fc[_0x394e4c(0x117)](_0x161c0a);}else _0x2e67fc[_0x394e4c(0x19f)](_0x847ee0[_0x394e4c(0x18d)]);return!![];},this[_0x308d75(0x11f)]=function(_0x2f2218){var _0x4fafcb=_0x308d75,_0x4d93c6=new Error(_0x2f2218);this[_0x4fafcb(0x13d)][_0x4fafcb(0x16b)](function(_0x57e810){var _0x421196=_0x4fafcb;if(_0x57e810[_0x421196(0x102)])clearTimeout(_0x57e810[_0x421196(0x102)]);try{_0x57e810[_0x421196(0x117)](_0x4d93c6);}catch(_0x4160d6){}}),this[_0x4fafcb(0x13d)]['clear']();},this[_0x308d75(0x16f)]=function(_0x32ba4d){var _0x470169=_0x308d75;if(this[_0x470169(0x180)]!==undefined)try{this[_0x470169(0x180)](_0x32ba4d);return;}catch(_0x420d6e){}console['error'](_0x470169(0x119),_0x32ba4d);},this['close']=function(){var _0x400bc3=_0x308d75;this[_0x400bc3(0x101)]=!![];this[_0x400bc3(0x16e)]&&(clearTimeout(this[_0x400bc3(0x16e)]),this[_0x400bc3(0x16e)]=null);if(this[_0x400bc3(0x17b)])this[_0x400bc3(0x17b)]['close']();},this[_0x308d75(0x161)]=function(_0x25c436,_0x1588d0){var _0x2e1d94=_0x308d75;this['jsFunctionDict'][_0x2e1d94(0x18e)]({'funcName':_0x25c436,'func':_0x1588d0});},this[_0x308d75(0x190)]=function(_0x24363c,_0x3c86d7,_0x5e05cf){var _0x2a1624=_0x308d75;this[_0x2a1624(0xef)]?(this[_0x2a1624(0x17b)]['send'](JSON[_0x2a1624(0x16c)]({'funcName':_0x24363c,'args':_0x3c86d7,'session_id':this[_0x2a1624(0x124)]()})),this['_debug'](_0x2a1624(0x129)+_0x24363c+'\x20called\x20with\x20arguments:\x20',_0x3c86d7)):this[_0x2a1624(0x17d)](_0x2a1624(0x121));if(_0x5e05cf===undefined){}else this['registerCallbackToPythonFunction'](_0x24363c,_0x5e05cf);},this[_0x308d75(0x12c)]=function(_0x5c5dfb,_0x535de0,..._0x4ed733){this['callMultipleCallbackPythonFunction'](_0x5c5dfb,_0x535de0,..._0x4ed733);},this['callPythonFunctionBinary']=function(_0x16207a,_0x12bb62,_0x32dbbf,_0x1132dc){var _0x4e9036=_0x308d75;_0x12bb62===undefined&&(_0x12bb62={});_0x12bb62[_0x4e9036(0x12a)]=!![],this[_0x4e9036(0x190)](_0x16207a,_0x12bb62);if(this['isOpen']){this[_0x4e9036(0x11e)](_0x32dbbf);if(_0x1132dc===undefined){}else this[_0x4e9036(0x12b)](_0x16207a,_0x1132dc);}else this[_0x4e9036(0x17d)](_0x4e9036(0x121));},this[_0x308d75(0x11e)]=function(_0xb110aa){var _0x45a213=_0x308d75,_0x533c88=this,_0x56e92d=new FileReader();_0x56e92d['onload']=function(_0x33fe2c){var _0x84405a=a0_0x14e3,_0xda0158=_0x33fe2c['target'][_0x84405a(0x178)];if(_0x533c88[_0x84405a(0x17b)]&&_0x533c88[_0x84405a(0x17b)][_0x84405a(0x17f)]==0x1)_0x533c88[_0x84405a(0x17b)]['send'](_0xda0158);},_0x56e92d[_0x45a213(0x141)](_0xb110aa);},this[_0x308d75(0x177)]=function(_0x53aae6){var _0x399612=_0x308d75;if(_0x53aae6[_0x399612(0xe6)][_0x399612(0x136)](/image.*/)){this[_0x399612(0x17d)]('The\x20dropped\x20file\x20is\x20an\x20image:\x20',_0x53aae6['type']);return;}var _0x293282=this,_0x2124a4=new FileReader();_0x2124a4[_0x399612(0xfc)]=function(_0x4075f7){var _0x44d3ce=_0x399612,_0xe325ef=_0x4075f7['target']['result'];if(_0x293282[_0x44d3ce(0x17b)]&&_0x293282[_0x44d3ce(0x17b)]['readyState']==0x1)_0x293282[_0x44d3ce(0x17b)]['send'](_0xe325ef);},_0x2124a4[_0x399612(0x141)](_0x53aae6);},this[_0x308d75(0x123)]=function(_0x10d843){var _0x223684=_0x308d75;if(!_0x10d843[_0x223684(0xe6)][_0x223684(0x136)](/image.*/)){this['_log']('The\x20dropped\x20file\x20is\x20not\x20an\x20image:\x20',_0x10d843['type']);return;}var _0x5e2715=this,_0x12361d=new FileReader();_0x12361d[_0x223684(0xfc)]=function(_0x1fe0e5){var _0x437ef4=_0x223684,_0xc41485=_0x1fe0e5[_0x437ef4(0x17e)]['result'];if(_0x5e2715[_0x437ef4(0x17b)]&&_0x5e2715[_0x437ef4(0x17b)]['readyState']==0x1)_0x5e2715[_0x437ef4(0x17b)][_0x437ef4(0x191)](_0xc41485);},_0x12361d[_0x223684(0x141)](_0x10d843);},this[_0x308d75(0x193)]=function(_0x45e725){var _0x229099=_0x308d75;for(var _0x251596 in this['PythonFunctionsArgs']){var _0x3e5c9b=this['PythonFunctionsArgs'][_0x251596];_0x3e5c9b[_0x229099(0x18e)]('...func');var _0x565835=_0x229099(0x188)+_0x251596+'\x27].slice(0,\x20-1);\x0a'+_0x229099(0x106)+_0x251596+_0x229099(0x14f);_0x3e5c9b[_0x229099(0x18e)](_0x565835),_0x54f2f2=this;if(_0x251596[_0x229099(0x169)]('.')>=0x0){var _0x4b00f7=_0x251596[_0x229099(0x111)]('.'),_0x18beaf=this[_0x229099(0x137)];for(var _0x41d4c2=0x0;_0x41d4c2<_0x4b00f7['length']-0x1;_0x41d4c2++){!(_0x4b00f7[_0x41d4c2]in _0x18beaf)&&(_0x18beaf[_0x4b00f7[_0x41d4c2]]={}),_0x18beaf=_0x18beaf[_0x4b00f7[_0x41d4c2]];}_0x18beaf[_0x4b00f7[_0x4b00f7['length']-0x1]]=Function[_0x229099(0x15c)](null,_0x3e5c9b)[_0x229099(0xf8)](this);}else this[_0x229099(0x137)][_0x251596]=Function[_0x229099(0x15c)](null,_0x3e5c9b)['bind'](this);}},this[_0x308d75(0x192)]=function(){var _0x3b73e4=_0x308d75;this[_0x3b73e4(0x18b)]!==undefined&&this[_0x3b73e4(0x18b)]();var _0x56fbef=this[_0x3b73e4(0x17c)](),_0x179900=this[_0x3b73e4(0x134)];if(_0x179900===undefined)throw new Error(_0x3b73e4(0x114)+'new\x20RemotePyClient(server,\x20page,\x20{\x20WebSocket:\x20require(\x27ws\x27)\x20}).');this[_0x3b73e4(0x101)]=![],this[_0x3b73e4(0x17d)](_0x3b73e4(0x10d)+_0x56fbef+_0x3b73e4(0xfa)),this[_0x3b73e4(0x17b)]=new _0x179900(_0x56fbef),this[_0x3b73e4(0x17b)]['binaryType']=_0x3b73e4(0x17a),_0x54f2f2=this,this[_0x3b73e4(0x17b)][_0x3b73e4(0x10b)]=function(){var _0x360c2d=_0x3b73e4;_0x54f2f2[_0x360c2d(0x17d)]('Connected\x20to\x20Server\x20:'+_0x56fbef),_0x54f2f2[_0x360c2d(0x179)][_0x360c2d(0x16b)](_0x32bc3f=>_0x32bc3f()),_0x54f2f2['isOpen']=!![];var _0x3f74fe=_0x54f2f2[_0x360c2d(0xf7)]>0x0;_0x54f2f2[_0x360c2d(0xf7)]=0x0;if(_0x3f74fe&&_0x54f2f2['options'][_0x360c2d(0x163)]&&_0x54f2f2[_0x360c2d(0x124)]()){var _0x19153f=_0x54f2f2[_0x360c2d(0xee)]['sessionResumeFunc']||'SessionServer.startSessionIfNotStarted';_0x54f2f2[_0x360c2d(0x13e)](_0x19153f,{'sessionid':_0x54f2f2[_0x360c2d(0x124)]()})[_0x360c2d(0x187)](function(_0x535073){_0x54f2f2['_emitError'](_0x535073);});}_0x54f2f2[_0x360c2d(0x10b)]!==undefined&&(_0x54f2f2['_callLegacy'](_0x360c2d(0x19a),{},[function(_0x2e418b){var _0x292cf7=_0x360c2d;_0x54f2f2[_0x292cf7(0x18f)]={};for(var _0x24ffd6 in _0x2e418b){_0x2e418b[_0x24ffd6][_0x292cf7(0x18c)](),_0x2e418b[_0x24ffd6][0x0]=='session_id'&&_0x2e418b[_0x24ffd6]['shift'](),_0x54f2f2[_0x292cf7(0x18f)][_0x24ffd6]=_0x2e418b[_0x24ffd6];}_0x54f2f2[_0x292cf7(0x193)](''),_0x54f2f2[_0x292cf7(0x10b)]();}],!![]),_0x54f2f2[_0x360c2d(0x172)]('getPythonFunctionLibraryHelp',{},[function(_0x263581){var _0x349b0f=_0x360c2d;_0x54f2f2[_0x349b0f(0xea)]=_0x263581;}],!![])),_0x54f2f2[_0x360c2d(0xe8)]['forEach'](_0x277a6e=>_0x277a6e());},this[_0x3b73e4(0x17b)][_0x3b73e4(0x160)]=function(_0x2fadea){var _0x1c287b=_0x3b73e4;_0x54f2f2[_0x1c287b(0xfb)][_0x1c287b(0x16b)](_0x25bcca=>_0x25bcca());_0x54f2f2[_0x1c287b(0x1a0)]!==undefined&&_0x54f2f2['onmessagereceived'](_0x2fadea);let _0x4de806=null;if(_0x2fadea[_0x1c287b(0x13f)]instanceof ArrayBuffer)try{const _0x4f822c=a0_0x452d58['decode'](new Uint8Array(_0x2fadea[_0x1c287b(0x13f)]));_0x4de806=_0x4f822c;}catch(_0x161670){_0x4de806=null;}else typeof _0x2fadea[_0x1c287b(0x13f)]=='string'&&(_0x4de806=JSON[_0x1c287b(0x155)](_0x2fadea[_0x1c287b(0x13f)]));if(_0x4de806!==null){_0x54f2f2[_0x1c287b(0x197)](_0x1c287b(0x127),_0x4de806);var _0x225c12=_0x4de806[_0x1c287b(0x194)];if(_0x225c12!==undefined&&_0x225c12!==null&&!(_0x1c287b(0x18a)in _0x4de806)){var _0x17f0f8=![];if(_0x54f2f2[_0x1c287b(0x13d)][_0x1c287b(0x110)](_0x225c12))_0x54f2f2['_settlePending'](_0x225c12,_0x4de806),_0x17f0f8=!![];else{if(_0x54f2f2[_0x1c287b(0x13c)][_0x1c287b(0x110)](_0x225c12)){var _0x2fc4b5=_0x54f2f2['_pendingLegacy'][_0x1c287b(0x173)](_0x225c12);if(_0x54f2f2[_0x1c287b(0x10c)](_0x4de806)){if(_0x2fc4b5[_0x1c287b(0x102)])clearTimeout(_0x2fc4b5[_0x1c287b(0x102)]);_0x54f2f2[_0x1c287b(0x13c)][_0x1c287b(0x126)](_0x225c12);}try{_0x54f2f2[_0x1c287b(0x171)](_0x2fc4b5['callbacks'],_0x4de806);}catch(_0x2aaa6e){_0x54f2f2[_0x1c287b(0x16f)](_0x2aaa6e);}_0x17f0f8=!![];}else _0x54f2f2[_0x1c287b(0x197)](_0x1c287b(0x13a)+_0x225c12+'\x20('+_0x4de806[_0x1c287b(0x174)]+')'),_0x17f0f8=!![];}if(_0x17f0f8){_0x54f2f2[_0x1c287b(0xfd)]!==undefined&&_0x54f2f2[_0x1c287b(0xfd)]();_0x54f2f2[_0x1c287b(0x128)][_0x1c287b(0x16b)](_0x5b8f2e=>_0x5b8f2e());return;}}try{if(_0x1c287b(0x18a)in _0x4de806){var _0x1c7baa=_0x54f2f2['jsFunctionDict'][_0x1c287b(0x131)](function(_0x5c0554){var _0xd4862b=_0x1c287b;return _0x5c0554[_0xd4862b(0x174)];})[_0x1c287b(0x169)](_0x4de806['funcName']);if(_0x1c7baa>=0x0){var _0x11404c=_0x54f2f2[_0x1c287b(0xe5)][_0x1c7baa];_0x1c287b(0x12a)in _0x4de806[_0x1c287b(0x18a)]?_0x54f2f2[_0x1c287b(0x175)][_0x1c287b(0x18e)]({'funcName':_0x4de806[_0x1c287b(0x174)],'callback':_0x11404c[_0x1c287b(0x105)],'args':_0x4de806['args']}):_0x11404c[_0x1c287b(0x105)](_0x4de806[_0x1c287b(0x18a)]);}else{if(_0x4de806['funcName']==='getPythonFunctionLibrary')return;else throw _0x1c287b(0xf1)+_0x4de806[_0x1c287b(0x174)];}}else{if('streaming'in _0x4de806){if(_0x4de806['funcName']in _0x54f2f2[_0x1c287b(0x11b)]){var _0x3bfbf7=_0x54f2f2[_0x1c287b(0x11b)][_0x4de806[_0x1c287b(0x174)]];if(_0x54f2f2[_0x1c287b(0x10c)](_0x4de806))_0x54f2f2[_0x1c287b(0x140)](_0x4de806['funcName']);_0x54f2f2[_0x1c287b(0x171)](_0x3bfbf7,_0x4de806);}else throw _0x1c287b(0x153)+_0x4de806['funcName'];}else{if(_0x4de806[_0x1c287b(0x174)]in _0x54f2f2[_0x1c287b(0x11b)]){var _0x3bfbf7=_0x54f2f2[_0x1c287b(0x11b)][_0x4de806[_0x1c287b(0x174)]];_0x54f2f2['_forgetLegacyByName'](_0x4de806[_0x1c287b(0x174)]),_0x54f2f2['_dispatchLegacyReply'](_0x3bfbf7,_0x4de806);}else{var _0x1c7baa=_0x54f2f2[_0x1c287b(0x158)][_0x1c287b(0x131)](function(_0x247ff5){var _0x251fae=_0x1c287b;return _0x247ff5[_0x251fae(0x174)];})[_0x1c287b(0x169)](_0x4de806[_0x1c287b(0x174)]);if(_0x1c7baa>=0x0){var _0x11404c=_0x54f2f2[_0x1c287b(0x158)][_0x1c7baa];_0x4de806['return']===undefined?_0x4de806[_0x1c287b(0xfe)]!==undefined&&_0x11404c[_0x1c287b(0x15b)](_0x4de806[_0x1c287b(0xfe)],![]):_0x11404c[_0x1c287b(0x15b)](_0x4de806[_0x1c287b(0x18d)],!![]);}else throw'No\x20function\x20defined\x20for\x20'+_0x4de806[_0x1c287b(0x174)];}}}}catch(_0x570531){_0x54f2f2[_0x1c287b(0x16f)](_0x570531);}}else{_0x54f2f2[_0x1c287b(0x17d)]('No\x20msgpack\x20library\x20loaded');var _0x5c5264=new Uint8Array(_0x2fadea['data']),_0x3d30f8='\x20';for(var _0x7733e4=0x0;_0x7733e4<_0x5c5264['length'];_0x7733e4++){_0x3d30f8+=(_0x1c287b(0x164)+_0x5c5264[_0x7733e4][_0x1c287b(0x116)](0x10))['substr'](-0x2);}var _0x29d265=_0x2fadea[_0x1c287b(0x13f)],_0x14a208=new Uint8Array(_0x29d265),_0x2e474f=new Blob([_0x14a208['buffer']]);if(_0x54f2f2[_0x1c287b(0x175)][_0x1c287b(0x12f)]>0x0){var _0x224d51=_0x54f2f2[_0x1c287b(0x175)][_0x1c287b(0x18c)]();_0x224d51[_0x1c287b(0x18a)][_0x1c287b(0xec)]=_0x2e474f,_0x224d51[_0x1c287b(0x15b)](_0x224d51[_0x1c287b(0x18a)]);}else{if(typeof document!==_0x1c287b(0x138)){var _0x17b54b=new FileReader();_0x17b54b[_0x1c287b(0xfc)]=function(_0x59f992){var _0x28f480=_0x1c287b,_0x1c937c=document['createElement']('img');_0x1c937c[_0x28f480(0x108)]=_0x59f992[_0x28f480(0x17e)][_0x28f480(0x178)],document[_0x28f480(0x139)][_0x28f480(0x19b)](_0x1c937c);},_0x17b54b[_0x1c287b(0x168)](_0x2e474f);var _0xbc2167=document[_0x1c287b(0x10e)](_0x1c287b(0x15f));if(_0xbc2167)_0xbc2167[_0x1c287b(0x10f)]=_0x1c287b(0x189);}}_0x54f2f2[_0x1c287b(0x197)](_0x1c287b(0x113),_0x3d30f8);}_0x54f2f2['onmessageprocessed']!==undefined&&_0x54f2f2['onmessageprocessed'](),_0x54f2f2[_0x1c287b(0x128)][_0x1c287b(0x16b)](_0x32bf5d=>_0x32bf5d());},this[_0x3b73e4(0x17b)]['onclose']=function(_0x2eacbf){var _0x2dbb5d=_0x3b73e4;_0x54f2f2[_0x2dbb5d(0x17d)](_0x2dbb5d(0x149)+_0x56fbef+_0x2dbb5d(0x1a9)),_0x54f2f2[_0x2dbb5d(0x185)][_0x2dbb5d(0x16b)](_0x1a9218=>_0x1a9218(_0x2eacbf)),_0x54f2f2[_0x2dbb5d(0xef)]=![],_0x54f2f2[_0x2dbb5d(0x17b)]=null,_0x54f2f2['_rejectAllPending']('Connection\x20closed'),_0x54f2f2[_0x2dbb5d(0xf6)](_0x2dbb5d(0x12d));_0x54f2f2[_0x2dbb5d(0x181)]!==undefined&&_0x54f2f2[_0x2dbb5d(0x181)](_0x2eacbf);_0x54f2f2[_0x2dbb5d(0x104)]['forEach'](_0x389cdb=>_0x389cdb(_0x2eacbf));if(_0x54f2f2[_0x2dbb5d(0x14b)]&&!_0x54f2f2[_0x2dbb5d(0x101)]&&_0x54f2f2[_0x2dbb5d(0xf7)]<_0x54f2f2[_0x2dbb5d(0x19d)]){var _0x1da688=Math[_0x2dbb5d(0xf9)](_0x54f2f2[_0x2dbb5d(0x183)]*Math[_0x2dbb5d(0x100)](0x2,_0x54f2f2['_reconnectAttempts']),_0x54f2f2[_0x2dbb5d(0x156)]);_0x54f2f2[_0x2dbb5d(0xf7)]+=0x1,_0x54f2f2[_0x2dbb5d(0x17d)](_0x2dbb5d(0x145)+_0x1da688+'ms\x20(attempt\x20'+_0x54f2f2[_0x2dbb5d(0xf7)]+')'),_0x54f2f2['_reconnectTimer']=setTimeout(function(){var _0x4959a3=_0x2dbb5d;_0x54f2f2[_0x4959a3(0x16e)]=null,_0x54f2f2[_0x4959a3(0x192)]();},_0x1da688);}};},this[_0x308d75(0x165)]=function(){var _0x33b257=_0x308d75;return this[_0x33b257(0x137)];},this[_0x308d75(0x14a)]=function(_0x1a961a){var _0x33e983=_0x308d75;return this[_0x33e983(0x137)][_0x1a961a];};}export{RemotePyClient};function a0_0x531a(){var _0x509b37=['10649tKDDIZ','resolve','onmessagereceived','cancel','readCallbackArguments','setItem','WebSocket','288248PbAeYp','stream_total','_sessionId','onEnd','\x20closed.','jsFunctionDict','type','function','PostOpenEventHandlers','callStream','PythonFunctionsHelp','stream_id','blob','onError','options','isOpen','_registerPending','No\x20function\x20defined\x20for\x20','streaming','getItem','timeout','stream_cancelled','_failAllLegacyPending','_reconnectAttempts','bind','min','\x20...','PreMessageEventHandlers','onload','onmessageprocessed','error','ms:\x20','pow','_closedByUser','timer','values','PostCloseEventHandlers','func','var\x20args\x20=\x20Array.prototype.slice.call(arguments);\x20var\x20inputObject\x20=\x20{};\x20for(var\x20i\x20in\x20paramNames)\x20{\x20var\x20paramName\x20=\x20paramNames[i];\x20if(paramName\x20!=\x20\x27...func\x27)\x20{\x20inputObject[paramName]\x20=\x20args[i];}\x20}\x20return\x20this.callMultipleCallbackPythonFunction(\x27','internal','src','rows','_settlePending','onopen','_legacyReplyEnds','Connecting\x20to\x20:\x20','getElementById','innerHTML','has','split','175tRJBoO','message(b)\x20received\x20:\x20','No\x20WebSocket\x20implementation\x20available.\x20In\x20Node,\x20pass\x20one\x20via\x20','1462772EfLLht','toString','reject','callbacks','RemotePyClient\x20error:','_makeCallId','pythonMultipleCallbackDict','setSessionId','_sendCall','sendBinary','_rejectAllPending','from','Connection\x20not\x20open.','row','sendImageBinary','getSessionId','log','delete','Message\x20received:\x20','PostMessageEventHandlers','Function\x20:\x20','isBinary','registerCallbackToPythonFunction','callPythonFunction','Connection\x20closed','JS2PY_SESSION_ID','length','cancelStream','map','slice','addPostCloseEventHandler','_WebSocketImpl','3TbFJNO','match','PythonFunctions','undefined','body','Dropping\x20reply\x20for\x20unknown\x20callId\x20','\x20called\x20with\x20arguments:\x20','_pendingLegacy','_pendingCalls','call','data','_forgetLegacyByName','readAsArrayBuffer','_callSeq','stream','addPreOpenEventHandler','Reconnecting\x20in\x20','callBinary','random','wss','Connection\x20to\x20','getService','_autoReconnect','set','13918077wOVXEg','clear','\x27,\x20inputObject,\x20...func);','stream_item','onRow','_failLegacyLater','No\x20function\x20callback\x20defined\x20for\x20','RPC\x20timeout\x20after\x20','parse','_reconnectMaxDelayMs','_defaultTimeout','pythonCallbackDict','autoReconnect','serverName','callback','apply','reconnectMaxDelayMs','Too\x20many\x20callbacks\x20for\x20','StatusBar','onmessage','registerJSFunctionToBeCalledByPython','stream_index','sessionResume','00\x20','getServerAPI','_legacyErrorCallbackIndex','3611082YSIKWK','readAsDataURL','indexOf','3313415pSFjIs','forEach','stringify','debug','_reconnectTimer','_emitError','1438988QWZfGI','_dispatchLegacyReply','_callLegacy','get','funcName','binaryFunctionQueue','traceback','sendNonImageBinary','result','PreOpenEventHandlers','arraybuffer','socket','getServerString','_log','target','readyState','onerror','onclose','start','_reconnectDelayMs','stream_empty','PreCloseEventHandlers','onStart','catch','var\x20paramNames\x20=\x20this.PythonFunctionsArgs[\x27','Chart\x20Loading\x20Completed\x20...','args','oninit','shift','return','push','PythonFunctionsArgs','callFunc','send','connect','createJSProxyFunctions','callId','_sendRawBinary','end','_debug','clientPageId','10xKwlHN','getPythonFunctionLibrary','appendChild','_invokeLegacyError','_reconnectMaxAttempts'];a0_0x531a=function(){return _0x509b37;};return a0_0x531a();}
|
package/package.json
CHANGED
|
@@ -1,69 +1,81 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "remotepy",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "JavaScript library to connect to RemotePy server. Allows you to call python functions on server from JavaScript.",
|
|
5
|
-
"main": "dist/RemotePyClient.
|
|
6
|
-
"module": "dist/RemotePyClient.
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
"build": "
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"remote",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "remotepy",
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "JavaScript library to connect to RemotePy server. Allows you to call python functions on server from JavaScript.",
|
|
5
|
+
"main": "dist/RemotePyClient.js",
|
|
6
|
+
"module": "dist/RemotePyClient.js",
|
|
7
|
+
"types": "dist/RemotePyClient.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev-build": "mkdirp dist && cp-cli src/RemotePyClient.js dist/RemotePyClient.dev.js",
|
|
10
|
+
"prod-build": "mkdirp dist && npx uglify-js src/RemotePyClient.js --compress --mangle --output dist/RemotePyClient.min.js && npx javascript-obfuscator dist/RemotePyClient.min.js --output dist/RemotePyClient.obfuscated.js && cp-cli dist/RemotePyClient.obfuscated.js dist/RemotePyClient.common.js && echo export default RemotePyClient; >> dist/RemotePyClient.common.js && npx rename-cli dist/RemotePyClient.common.js dist/RemotePyClient.esm.js",
|
|
11
|
+
"build": "npm run dev-build && npm run process && npm run types-copy",
|
|
12
|
+
"types-copy": "cp-cli src/RemotePyClient.d.ts dist/RemotePyClient.d.ts",
|
|
13
|
+
"test:live": "node test/live_test.mjs",
|
|
14
|
+
"test:live:obfuscated": "cp-cli dist/RemotePyClient.esm.js test/RemotePyClient_obfuscated.mjs && node test/live_test_obfuscated.mjs",
|
|
15
|
+
"process": "mkdirp dist && npm run minify && npm run obfuscate",
|
|
16
|
+
"minify": "terser src/RemotePyClient.js -o dist/RemotePyClient.min.js",
|
|
17
|
+
"obfuscate": "javascript-obfuscator dist/RemotePyClient.min.js --output dist/RemotePyClient.obfuscated.js && cp-cli dist/RemotePyClient.obfuscated.js dist/RemotePyClient.esm.js",
|
|
18
|
+
"update-file": "echo export default RemotePyClient; >> RemotePyClient.common.js",
|
|
19
|
+
"rename-file": "rename RemotePyClient.common.js RemotePyClient.esm.js || mv RemotePyClient.common.js RemotePyClient.esm.js",
|
|
20
|
+
"pretest": "cp-cli src/RemotePyClient.js test/RemotePyClient_under_test.mjs",
|
|
21
|
+
"test": "cross-env NODE_ENV=test mocha --timeout 10000 test/RemotePyClient.test.mjs",
|
|
22
|
+
"publish_to_npm": "npm run build && cp-cli dist/RemotePyClient.esm.js dist/RemotePyClient.js && npm publish"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/alpharithmic/remotepy_jsclient.git"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"remotepy",
|
|
30
|
+
"remote",
|
|
31
|
+
"websocket",
|
|
32
|
+
"python",
|
|
33
|
+
"javascript",
|
|
34
|
+
"rpc",
|
|
35
|
+
"remote",
|
|
36
|
+
"procedure",
|
|
37
|
+
"call"
|
|
38
|
+
],
|
|
39
|
+
"author": "Neelofar Farukh Tamboli",
|
|
40
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/alpharithmic/remotepy_jsclient/issues"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://github.com/alpharithmic/remotepy_jsclient#readme",
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@babel/core": "^7.25.2",
|
|
47
|
+
"@babel/preset-env": "^7.25.3",
|
|
48
|
+
"assert": "^2.0.0",
|
|
49
|
+
"babel-loader": "^9.1.3",
|
|
50
|
+
"cp-cli": "^1.0.2",
|
|
51
|
+
"cpy-cli": "^5.0.0",
|
|
52
|
+
"cross-env": "^7.0.3",
|
|
53
|
+
"javascript-obfuscator": "^4.1.1",
|
|
54
|
+
"mkdirp": "^3.0.1",
|
|
55
|
+
"mocha": "^10.0.0",
|
|
56
|
+
"rename-cli": "^7.0.2",
|
|
57
|
+
"terser": "^5.19.2",
|
|
58
|
+
"uglify-js": "^3.19.1",
|
|
59
|
+
"webpack": "^5.93.0",
|
|
60
|
+
"webpack-cli": "^5.1.4",
|
|
61
|
+
"ws": "^8.13.0"
|
|
62
|
+
},
|
|
63
|
+
"files": [
|
|
64
|
+
"dist/RemotePyClient.js",
|
|
65
|
+
"dist/RemotePyClient.d.ts"
|
|
66
|
+
],
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"msgpack-lite": "^0.1.26"
|
|
69
|
+
},
|
|
70
|
+
"peerDependencies": {
|
|
71
|
+
"ws": ">=8"
|
|
72
|
+
},
|
|
73
|
+
"peerDependenciesMeta": {
|
|
74
|
+
"ws": {
|
|
75
|
+
"optional": true
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"directories": {
|
|
79
|
+
"test": "test"
|
|
80
|
+
}
|
|
81
|
+
}
|
package/build/remotepy.minobs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(_0x2db585,_0x41f4ea){var _0x33db29=a0_0x37d9,_0x333bf1=_0x2db585();while(!![]){try{var _0x4d69e8=-parseInt(_0x33db29(0x1c1))/0x1+parseInt(_0x33db29(0x1c6))/0x2*(parseInt(_0x33db29(0x1cd))/0x3)+-parseInt(_0x33db29(0x198))/0x4+-parseInt(_0x33db29(0x1cf))/0x5+parseInt(_0x33db29(0x1d9))/0x6*(-parseInt(_0x33db29(0x1da))/0x7)+-parseInt(_0x33db29(0x1ce))/0x8*(parseInt(_0x33db29(0x19b))/0x9)+-parseInt(_0x33db29(0x176))/0xa*(-parseInt(_0x33db29(0x1b3))/0xb);if(_0x4d69e8===_0x41f4ea)break;else _0x333bf1['push'](_0x333bf1['shift']());}catch(_0xcdd6db){_0x333bf1['push'](_0x333bf1['shift']());}}}(a0_0x5a1c,0x9d7fc));function a0_0x37d9(_0x541d0f,_0x4caf62){var _0x5a1c1e=a0_0x5a1c();return a0_0x37d9=function(_0x37d9dd,_0x5c2375){_0x37d9dd=_0x37d9dd-0x16e;var _0xd05bf3=_0x5a1c1e[_0x37d9dd];return _0xd05bf3;},a0_0x37d9(_0x541d0f,_0x4caf62);}import*as a0_0x12a9f0 from'https://cdn.jsdelivr.net/npm/msgpack-lite@0.1.26';function a0_0x5a1c(){var _0x10fdf4=['data','connect','start','apply','socket','row','function','isBinary','\x27,\x20inputObject,\x20...func);','The\x20dropped\x20file\x20is\x20an\x20image:\x20','Too\x20many\x20callbacks\x20for\x20','createElement','763920yHajst','target','args','169407FbNXuO','wss','No\x20function\x20callback\x20defined\x20for\x20','stream_empty','result','PythonFunctionsHelp','PostOpenEventHandlers','buffer','Function\x20:\x20','...func','callPythonFunctionBinary','arraybuffer','slice','end','readAsArrayBuffer','Connecting\x20to\x20:\x20','error','No\x20function\x20defined\x20for\x20','\x20closed.','getService','JS2PY_SESSION_ID','registerCallbackToPythonFunction','stream_item','getSessionId','29194KgmKtS','getElementById','callPythonFunction','indexOf','createJSProxyFunctions','\x27].slice(0,\x20-1);\x0a','substr','PreOpenEventHandlers','readyState','onload','length','isOpen','\x20...','getPythonFunctionLibraryHelp','1203964UhUEGa','No\x20msgpack\x20library\x20loaded','decode','match','split','91928GzMsfm','callback','streaming','onmessageprocessed','map','getPythonFunctionLibrary','Connected\x20to\x20Server\x20:','3kVQXua','120uRxxiz','3422400kWEVEh','pythonCallbackDict','addPostOpenEventHandler','forEach','\x20called\x20with\x20arguments:\x20','shift','registerMultipleCallbackPythonFunction','binaryFunctionQueue','sendNonImageBinary','Connection\x20not\x20open.','186qcrTqO','250117NosjeJ','var\x20args\x20=\x20Array.prototype.slice.call(arguments);\x20var\x20inputObject\x20=\x20{};\x20for(var\x20i\x20in\x20paramNames)\x20{\x20var\x20paramName\x20=\x20paramNames[i];\x20if(paramName\x20!=\x20\x27...func\x27)\x20{\x20inputObject[paramName]\x20=\x20args[i];}\x20}\x20return\x20this.callMultipleCallbackPythonFunction(\x27','body','addPreCloseEventHandler','onmessagereceived','stringify','stream_index','innerHTML','toString','PostCloseEventHandlers','addPostCloseEventHandler','blob','img','return','funcName','Chart\x20Loading\x20Completed\x20...','clientPageId','serverName','log','callFunc','JS2Py','type','func','push','string','callMultipleCallbackPythonFunction','PythonFunctions','getItem','sendBinary','15330yJBfzB','onmessage','sendImageBinary','session_id','readAsDataURL','oninit','onopen','message(b)\x20received\x20:\x20','Connection\x20to\x20','getServerString','00\x20','registerJSFunctionToBeCalledByPython','onclose','PythonFunctionsArgs','PostMessageEventHandlers','PreMessageEventHandlers','parse','bind','StatusBar','pythonMultipleCallbackDict','jsFunctionDict','send'];a0_0x5a1c=function(){return _0x10fdf4;};return a0_0x5a1c();}function RemotePyClient(_0x49230f,_0x2c3688){var _0x5a344f=a0_0x37d9;if(_0x49230f===undefined)this[_0x5a344f(0x1eb)]='ws://localhost:80';else this[_0x5a344f(0x1eb)]=_0x49230f;if(_0x2c3688===undefined)this[_0x5a344f(0x1ea)]=_0x5a344f(0x19c);else this[_0x5a344f(0x1ea)]=_0x2c3688;this[_0x5a344f(0x1be)]=![],this[_0x5a344f(0x18a)]=[],this[_0x5a344f(0x1d0)]=[],this[_0x5a344f(0x1d6)]=[],this[_0x5a344f(0x173)]={},this['socket']=null,this[_0x5a344f(0x1a0)]={},this[_0x5a344f(0x189)]={},this[_0x5a344f(0x183)]={},this[_0x5a344f(0x1ee)]={};let _0x59759b=null;this[_0x5a344f(0x1ba)]=[],this['PreCloseEventHandlers']=[],this['PreMessageEventHandlers']=[],this[_0x5a344f(0x1a1)]=[],this[_0x5a344f(0x1e3)]=[],this[_0x5a344f(0x184)]=[],this['addPreOpenEventHandler']=_0x103b7f=>this[_0x5a344f(0x1ba)][_0x5a344f(0x170)](_0x103b7f),this[_0x5a344f(0x1dd)]=_0x3e2e70=>this['PreCloseEventHandlers'][_0x5a344f(0x170)](_0x3e2e70),this['addPreMessageEventHandler']=_0xd95a5a=>this[_0x5a344f(0x185)][_0x5a344f(0x170)](_0xd95a5a),this[_0x5a344f(0x1d1)]=_0x3266fa=>this['PostOpenEventHandlers'][_0x5a344f(0x170)](_0x3266fa),this[_0x5a344f(0x1e4)]=_0xbfbe77=>this[_0x5a344f(0x1e3)][_0x5a344f(0x170)](_0xbfbe77),this['addPostMessageEventHandler']=_0x3b210c=>this[_0x5a344f(0x184)][_0x5a344f(0x170)](_0x3b210c),this[_0x5a344f(0x17f)]=function(){var _0xad675b=_0x5a344f;return this[_0xad675b(0x1eb)]+'/'+this['clientPageId'];},this['readCallbackArguments']=function(_0x5b7233,..._0x40692f){var _0x17b7b5=_0x5a344f;for(var _0x43a33a=_0x40692f[_0x17b7b5(0x1bd)]-0x1;_0x43a33a>=0x0;--_0x43a33a){if(typeof _0x40692f[_0x43a33a]!==_0x17b7b5(0x192))break;}var _0x4b8311=_0x40692f[_0x17b7b5(0x1a7)](0x0,_0x43a33a+0x1),_0x86f8da=_0x40692f['slice'](_0x43a33a+0x1);return[_0x5b7233,_0x4b8311,_0x86f8da];},this[_0x5a344f(0x1d5)]=function(_0x2f00e3,..._0x4d0393){var _0x5dccda=_0x5a344f;this[_0x5dccda(0x189)][_0x2f00e3]=_0x4d0393;},this[_0x5a344f(0x172)]=function(_0x28b487,..._0x4684b9){var _0x303aa3=_0x5a344f,_0x120b9e=this['readCallbackArguments'](_0x28b487,..._0x4684b9);_0x28b487=_0x120b9e[0x0];let _0x11dafd=_0x120b9e[0x1][0x0],_0x46d71b=_0x120b9e[0x2];this[_0x303aa3(0x1be)]?(this[_0x303aa3(0x190)][_0x303aa3(0x18b)](JSON['stringify']({'funcName':_0x28b487,'args':_0x11dafd,'session_id':this[_0x303aa3(0x1b2)]()})),console[_0x303aa3(0x1ec)](_0x303aa3(0x1a3)+_0x28b487+_0x303aa3(0x1d3),_0x11dafd)):console[_0x303aa3(0x1ec)](_0x303aa3(0x1d8)),_0x46d71b[_0x303aa3(0x1bd)]>0x0&&this[_0x303aa3(0x1d5)](_0x28b487,..._0x46d71b);},this[_0x5a344f(0x1b0)]=function(_0x22a613,_0x23097f){var _0x220431=_0x5a344f,_0x1452c9=this[_0x220431(0x1d0)][_0x220431(0x1ca)](function(_0x5a1585){var _0x3653c4=_0x220431;return _0x5a1585[_0x3653c4(0x1e8)];})[_0x220431(0x1b6)](_0x22a613);_0x1452c9<0x0?this[_0x220431(0x1d0)][_0x220431(0x170)]({'funcName':_0x22a613,'callback':_0x23097f}):this[_0x220431(0x1d0)][_0x1452c9][_0x220431(0x1c7)]=_0x23097f;},this[_0x5a344f(0x1b2)]=function(){var _0x2c6d40=_0x5a344f;return sessionStorage[_0x2c6d40(0x174)](_0x2c6d40(0x1af));},this[_0x5a344f(0x181)]=function(_0x3b1bcf,_0x544939){var _0xd32484=_0x5a344f;this['jsFunctionDict'][_0xd32484(0x170)]({'funcName':_0x3b1bcf,'func':_0x544939});},this[_0x5a344f(0x1ed)]=function(_0x406bff,_0x11f731,_0x22db6a){var _0x5c60ff=_0x5a344f;this[_0x5c60ff(0x1be)]?(this[_0x5c60ff(0x190)][_0x5c60ff(0x18b)](JSON[_0x5c60ff(0x1df)]({'funcName':_0x406bff,'args':_0x11f731,'session_id':this[_0x5c60ff(0x1b2)]()})),console[_0x5c60ff(0x1ec)](_0x5c60ff(0x1a3)+_0x406bff+_0x5c60ff(0x1d3),_0x11f731)):console['log'](_0x5c60ff(0x1d8));if(_0x22db6a===undefined){}else this[_0x5c60ff(0x1b0)](_0x406bff,_0x22db6a);},this[_0x5a344f(0x1b5)]=function(_0x57aabb,_0x2ef030,..._0x1eb21f){this['callMultipleCallbackPythonFunction'](_0x57aabb,_0x2ef030,..._0x1eb21f);},this[_0x5a344f(0x1a5)]=function(_0x3d52d4,_0x1893e7,_0x5b6104,_0x21a9af){var _0x3830e2=_0x5a344f;_0x1893e7===undefined&&(_0x1893e7={});_0x1893e7[_0x3830e2(0x193)]=!![],this['callFunc'](_0x3d52d4,_0x1893e7);if(this[_0x3830e2(0x1be)]){this[_0x3830e2(0x175)](_0x5b6104);if(_0x21a9af===undefined){}else this[_0x3830e2(0x1b0)](_0x3d52d4,_0x21a9af);}else console['log'](_0x3830e2(0x1d8));},this[_0x5a344f(0x175)]=function(_0x524f33){var _0x18a123=_0x5a344f,_0x58d93d=new FileReader();_0x58d93d[_0x18a123(0x1bc)]=function(_0x2cdf99){var _0x24d763=_0x18a123,_0x572eca=_0x2cdf99[_0x24d763(0x199)][_0x24d763(0x19f)];if(this['socket']&&this[_0x24d763(0x190)][_0x24d763(0x1bb)]==0x1)this['socket'][_0x24d763(0x18b)](_0x572eca);},_0x58d93d[_0x18a123(0x1a9)](_0x524f33);},this[_0x5a344f(0x1d7)]=function(_0x391367){var _0x414ca7=_0x5a344f;if(_0x391367[_0x414ca7(0x16e)][_0x414ca7(0x1c4)](/image.*/)){console[_0x414ca7(0x1ec)](_0x414ca7(0x195),_0x391367[_0x414ca7(0x16e)]);return;}var _0x39bc48=new FileReader();_0x39bc48['onload']=function(_0x5265b0){var _0x4a43a0=_0x414ca7,_0x21a09f=_0x5265b0[_0x4a43a0(0x199)]['result'];if(this[_0x4a43a0(0x190)]&&this[_0x4a43a0(0x190)][_0x4a43a0(0x1bb)]==0x1)this[_0x4a43a0(0x190)]['send'](_0x21a09f);},_0x39bc48['readAsArrayBuffer'](_0x391367);},this[_0x5a344f(0x178)]=function(_0x38f936){var _0x3219b2=_0x5a344f;if(!_0x38f936['type'][_0x3219b2(0x1c4)](/image.*/)){console[_0x3219b2(0x1ec)]('The\x20dropped\x20file\x20is\x20not\x20an\x20image:\x20',_0x38f936[_0x3219b2(0x16e)]);return;}var _0x3b0e0d=new FileReader();_0x3b0e0d['onload']=function(_0x540738){var _0x5e274a=_0x3219b2,_0x39895e=_0x540738[_0x5e274a(0x199)][_0x5e274a(0x19f)];if(this[_0x5e274a(0x190)]&&this[_0x5e274a(0x190)][_0x5e274a(0x1bb)]==0x1)this[_0x5e274a(0x190)][_0x5e274a(0x18b)](_0x39895e);},_0x3b0e0d[_0x3219b2(0x1a9)](_0x38f936);},this[_0x5a344f(0x1b7)]=function(_0x59a8e1){var _0x53a03b=_0x5a344f;for(var _0x3b4d5d in this[_0x53a03b(0x183)]){var _0x3c066a=this[_0x53a03b(0x183)][_0x3b4d5d];_0x3c066a[_0x53a03b(0x170)](_0x53a03b(0x1a4));var _0x5315f1='var\x20paramNames\x20=\x20this.PythonFunctionsArgs[\x27'+_0x3b4d5d+_0x53a03b(0x1b8)+_0x53a03b(0x1db)+_0x3b4d5d+_0x53a03b(0x194);_0x3c066a[_0x53a03b(0x170)](_0x5315f1),_0x59759b=this;if(_0x3b4d5d[_0x53a03b(0x1b6)]('.')>=0x0){var _0x3cf7da=_0x3b4d5d[_0x53a03b(0x1c5)]('.'),_0x1110e8=this[_0x53a03b(0x173)];for(var _0x156d45=0x0;_0x156d45<_0x3cf7da[_0x53a03b(0x1bd)]-0x1;_0x156d45++){!(_0x3cf7da[_0x156d45]in _0x1110e8)&&(_0x1110e8[_0x3cf7da[_0x156d45]]={}),_0x1110e8=_0x1110e8[_0x3cf7da[_0x156d45]];}_0x1110e8[_0x3cf7da[_0x3cf7da[_0x53a03b(0x1bd)]-0x1]]=Function[_0x53a03b(0x18f)](null,_0x3c066a)[_0x53a03b(0x187)](this);}else this['PythonFunctions'][_0x3b4d5d]=Function[_0x53a03b(0x18f)](null,_0x3c066a)[_0x53a03b(0x187)](this);}},this[_0x5a344f(0x18d)]=function(){var _0xef2a5=_0x5a344f;this[_0xef2a5(0x17b)]!==undefined&&this['oninit']();var _0x5db62b=this[_0xef2a5(0x17f)]();console['log'](_0xef2a5(0x1aa)+_0x5db62b+_0xef2a5(0x1bf)),this[_0xef2a5(0x190)]=new WebSocket(_0x5db62b),this[_0xef2a5(0x190)]['binaryType']=_0xef2a5(0x1a6),_0x59759b=this,this[_0xef2a5(0x190)][_0xef2a5(0x17c)]=function(){var _0x4b53b2=_0xef2a5;console[_0x4b53b2(0x1ec)](_0x4b53b2(0x1cc)+_0x5db62b),_0x59759b[_0x4b53b2(0x1ba)]['forEach'](_0x364d32=>_0x364d32()),_0x59759b['isOpen']=!![],_0x59759b['onopen']!==undefined&&(_0x59759b[_0x4b53b2(0x172)]('getPythonFunctionLibrary',{},function(_0x16313a){var _0x105775=_0x4b53b2;_0x59759b[_0x105775(0x183)]={};for(var _0xec3b1 in _0x16313a){_0x16313a[_0xec3b1][_0x105775(0x1d4)](),_0x16313a[_0xec3b1][0x0]==_0x105775(0x179)&&_0x16313a[_0xec3b1][_0x105775(0x1d4)](),_0x59759b[_0x105775(0x183)][_0xec3b1]=_0x16313a[_0xec3b1];}_0x59759b['createJSProxyFunctions'](''),_0x59759b[_0x105775(0x17c)]();}),_0x59759b[_0x4b53b2(0x172)](_0x4b53b2(0x1c0),{},function(_0x518806){var _0x283994=_0x4b53b2;_0x59759b[_0x283994(0x1a0)]=_0x518806;})),_0x59759b[_0x4b53b2(0x1a1)][_0x4b53b2(0x1d2)](_0x4368da=>_0x4368da());},this['socket'][_0xef2a5(0x177)]=function(_0x3ffc9b){var _0x1173ec=_0xef2a5;_0x59759b['PreMessageEventHandlers'][_0x1173ec(0x1d2)](_0x620a3c=>_0x620a3c());_0x59759b[_0x1173ec(0x1de)]!==undefined&&_0x59759b[_0x1173ec(0x1de)](_0x3ffc9b);let _0x17009c=null;if(_0x3ffc9b['data']instanceof ArrayBuffer)try{const _0x11cd78=a0_0x12a9f0[_0x1173ec(0x1c3)](new Uint8Array(_0x3ffc9b[_0x1173ec(0x18c)]));_0x17009c=_0x11cd78;}catch(_0x53c66e){_0x17009c=null;}else typeof _0x3ffc9b['data']==_0x1173ec(0x171)&&(_0x17009c=JSON[_0x1173ec(0x186)](_0x3ffc9b[_0x1173ec(0x18c)]));if(_0x17009c!==null){console[_0x1173ec(0x1ec)]('Message\x20received:\x20',_0x17009c);if('args'in _0x17009c){var _0x5caa34=_0x59759b[_0x1173ec(0x18a)][_0x1173ec(0x1ca)](function(_0x4f1e67){var _0x364c63=_0x1173ec;return _0x4f1e67[_0x364c63(0x1e8)];})[_0x1173ec(0x1b6)](_0x17009c[_0x1173ec(0x1e8)]);if(_0x5caa34>=0x0){var _0x2cc6e9=_0x59759b[_0x1173ec(0x18a)][_0x5caa34];_0x1173ec(0x193)in _0x17009c[_0x1173ec(0x19a)]?_0x59759b[_0x1173ec(0x1d6)][_0x1173ec(0x170)]({'funcName':_0x17009c[_0x1173ec(0x1e8)],'callback':_0x2cc6e9[_0x1173ec(0x16f)],'args':_0x17009c[_0x1173ec(0x19a)]}):_0x2cc6e9[_0x1173ec(0x16f)](_0x17009c[_0x1173ec(0x19a)]);}else{if(_0x17009c['funcName']===_0x1173ec(0x1cb))return;else throw _0x1173ec(0x1ac)+_0x17009c[_0x1173ec(0x1e8)];}}else{if(_0x1173ec(0x1c8)in _0x17009c){if(_0x17009c[_0x1173ec(0x1e8)]in _0x59759b[_0x1173ec(0x189)]){var _0x47c297=_0x59759b[_0x1173ec(0x189)][_0x17009c[_0x1173ec(0x1e8)]];switch(_0x47c297[_0x1173ec(0x1bd)]){case 0x0:break;case 0x1:if(_0x1173ec(0x1ab)in _0x17009c)_0x47c297[0x0](_0x17009c[_0x1173ec(0x1ab)],![]);if(_0x1173ec(0x1e7)in _0x17009c)_0x47c297[0x0](_0x17009c[_0x1173ec(0x1c8)],_0x17009c[_0x1173ec(0x1e7)],![]);break;case 0x2:if(_0x1173ec(0x1ab)in _0x17009c)_0x47c297[0x0](_0x17009c[_0x1173ec(0x1ab)],![]);if('return'in _0x17009c)_0x47c297[0x0](_0x17009c[_0x1173ec(0x1c8)],_0x17009c[_0x1173ec(0x1e7)],![]);if(_0x17009c[_0x1173ec(0x1c8)]=='row')_0x47c297[0x1](_0x17009c['stream_index'],_0x17009c[_0x1173ec(0x1b1)],![]);break;case 0x3:if(_0x1173ec(0x1ab)in _0x17009c)_0x47c297[0x0](_0x17009c[_0x1173ec(0x1ab)],![]);if(_0x17009c[_0x1173ec(0x1c8)]==_0x1173ec(0x18e))_0x47c297[0x0](_0x17009c[_0x1173ec(0x1e7)],![]);if(_0x17009c[_0x1173ec(0x1c8)]==_0x1173ec(0x191))_0x47c297[0x1](_0x17009c['stream_index'],_0x17009c[_0x1173ec(0x1b1)],![]);if(_0x17009c[_0x1173ec(0x1c8)]==_0x1173ec(0x1a8))_0x47c297[0x2](_0x17009c[_0x1173ec(0x19e)],![]);break;case 0x4:if(_0x1173ec(0x1ab)in _0x17009c)_0x47c297[0x4](_0x17009c[_0x1173ec(0x1ab)],![]);if(_0x17009c[_0x1173ec(0x1c8)]==_0x1173ec(0x18e))_0x47c297[0x0](_0x17009c[_0x1173ec(0x1e7)],![]);if(_0x17009c[_0x1173ec(0x1c8)]==_0x1173ec(0x191))_0x47c297[0x1](_0x17009c[_0x1173ec(0x1e0)],_0x17009c[_0x1173ec(0x1b1)],![]);if(_0x17009c[_0x1173ec(0x1c8)]==_0x1173ec(0x1a8))_0x47c297[0x2](_0x17009c[_0x1173ec(0x19e)],![]);break;default:throw _0x1173ec(0x196)+_0x17009c[_0x1173ec(0x1e8)];}}else throw _0x1173ec(0x19d)+_0x17009c['funcName'];}else{if(_0x17009c[_0x1173ec(0x1e8)]in _0x59759b[_0x1173ec(0x189)]){var _0x47c297=_0x59759b[_0x1173ec(0x189)][_0x17009c[_0x1173ec(0x1e8)]];switch(_0x47c297[_0x1173ec(0x1bd)]){case 0x0:break;case 0x1:if(_0x1173ec(0x1ab)in _0x17009c)_0x47c297[0x0](_0x17009c['error'],![]);if(_0x1173ec(0x1e7)in _0x17009c)_0x47c297[0x0](_0x17009c[_0x1173ec(0x1e7)],![]);break;case 0x2:if(_0x1173ec(0x1ab)in _0x17009c)_0x47c297[0x1](_0x17009c[_0x1173ec(0x1ab)],![]);if('return'in _0x17009c)_0x47c297[0x0](_0x17009c[_0x1173ec(0x1e7)],![]);break;case 0x3:if(_0x1173ec(0x1ab)in _0x17009c)_0x47c297[0x0](_0x17009c[_0x1173ec(0x1ab)],![]);if(_0x1173ec(0x1e7)in _0x17009c)_0x47c297[0x0](_0x17009c['return'],![]);break;default:throw _0x1173ec(0x196)+_0x17009c[_0x1173ec(0x1e8)];}}else{var _0x5caa34=_0x59759b[_0x1173ec(0x1d0)][_0x1173ec(0x1ca)](function(_0x37e9f6){return _0x37e9f6['funcName'];})[_0x1173ec(0x1b6)](_0x17009c['funcName']);if(_0x5caa34>=0x0){var _0x2cc6e9=_0x59759b['pythonCallbackDict'][_0x5caa34];_0x17009c[_0x1173ec(0x1e7)]===undefined?_0x17009c['error']!==undefined&&_0x2cc6e9[_0x1173ec(0x1c7)](_0x17009c[_0x1173ec(0x1ab)],![]):_0x2cc6e9[_0x1173ec(0x1c7)](_0x17009c[_0x1173ec(0x1e7)],!![]);}else throw _0x1173ec(0x1ac)+_0x17009c[_0x1173ec(0x1e8)];}}}}else{console[_0x1173ec(0x1ec)](_0x1173ec(0x1c2));var _0x6ab46d=new Uint8Array(_0x3ffc9b[_0x1173ec(0x18c)]),_0x5e1d0d='\x20';for(var _0x4f47ca=0x0;_0x4f47ca<_0x6ab46d[_0x1173ec(0x1bd)];_0x4f47ca++){_0x5e1d0d+=(_0x1173ec(0x180)+_0x6ab46d[_0x4f47ca][_0x1173ec(0x1e2)](0x10))[_0x1173ec(0x1b9)](-0x2);}var _0x5bf4a5=_0x3ffc9b[_0x1173ec(0x18c)],_0x92c89a=new Uint8Array(_0x5bf4a5),_0x7b8a8c=new Blob([_0x92c89a[_0x1173ec(0x1a2)]]);if(_0x59759b[_0x1173ec(0x1d6)][_0x1173ec(0x1bd)]>0x0){var _0x4124c9=_0x59759b['binaryFunctionQueue'][_0x1173ec(0x1d4)]();_0x4124c9[_0x1173ec(0x19a)][_0x1173ec(0x1e5)]=_0x7b8a8c,_0x4124c9[_0x1173ec(0x1c7)](_0x4124c9[_0x1173ec(0x19a)]);}else{var _0x1910e5=new FileReader();_0x1910e5[_0x1173ec(0x1bc)]=function(_0x4e4bda){var _0x500d82=_0x1173ec,_0x42c979=document[_0x500d82(0x197)](_0x500d82(0x1e6));_0x42c979['src']=_0x4e4bda[_0x500d82(0x199)][_0x500d82(0x19f)],document[_0x500d82(0x1dc)]['appendChild'](_0x42c979);},_0x1910e5[_0x1173ec(0x17a)](_0x7b8a8c),document[_0x1173ec(0x1b4)](_0x1173ec(0x188))[_0x1173ec(0x1e1)]=_0x1173ec(0x1e9);}console[_0x1173ec(0x1ec)](_0x1173ec(0x17d),_0x5e1d0d);}_0x59759b['onmessageprocessed']!==undefined&&_0x59759b[_0x1173ec(0x1c9)](),_0x59759b['PostMessageEventHandlers'][_0x1173ec(0x1d2)](_0x5f076c=>_0x5f076c());},this['socket'][_0xef2a5(0x182)]=function(_0x30c9f6){var _0x8e3ba7=_0xef2a5;console[_0x8e3ba7(0x1ec)](_0x8e3ba7(0x17e)+_0x5db62b+_0x8e3ba7(0x1ad)),_0x59759b['PreCloseEventHandlers'][_0x8e3ba7(0x1d2)](_0x1a39db=>_0x1a39db(_0x30c9f6)),_0x59759b[_0x8e3ba7(0x1be)]=![],this[_0x8e3ba7(0x190)]=null,_0x59759b[_0x8e3ba7(0x182)]!==undefined&&_0x59759b[_0x8e3ba7(0x182)](_0x30c9f6),_0x59759b[_0x8e3ba7(0x1e3)][_0x8e3ba7(0x1d2)](_0x42d88a=>_0x42d88a(_0x30c9f6));};},this['getServerAPI']=function(){var _0x57e0bf=_0x5a344f;return this[_0x57e0bf(0x173)];},this[_0x5a344f(0x1ae)]=function(_0x1cecfc){var _0x34f8cc=_0x5a344f;return this[_0x34f8cc(0x173)][_0x1cecfc];};}export{RemotePyClient as RemotePy};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function a0_0x3c5b(_0x3e61b8,_0x3b21ee){var _0x141f5e=a0_0x141f();return a0_0x3c5b=function(_0x3c5bab,_0x5423e3){_0x3c5bab=_0x3c5bab-0x1df;var _0x2fcad3=_0x141f5e[_0x3c5bab];return _0x2fcad3;},a0_0x3c5b(_0x3e61b8,_0x3b21ee);}(function(_0x38269f,_0x1fc73a){var _0x2e8159=a0_0x3c5b,_0x3ded4c=_0x38269f();while(!![]){try{var _0x2394e0=parseInt(_0x2e8159(0x24f))/0x1+-parseInt(_0x2e8159(0x1e4))/0x2+parseInt(_0x2e8159(0x1ff))/0x3+-parseInt(_0x2e8159(0x22a))/0x4*(-parseInt(_0x2e8159(0x216))/0x5)+parseInt(_0x2e8159(0x25a))/0x6*(-parseInt(_0x2e8159(0x1f4))/0x7)+-parseInt(_0x2e8159(0x21a))/0x8*(parseInt(_0x2e8159(0x1e9))/0x9)+-parseInt(_0x2e8159(0x222))/0xa;if(_0x2394e0===_0x1fc73a)break;else _0x3ded4c['push'](_0x3ded4c['shift']());}catch(_0x51aad6){_0x3ded4c['push'](_0x3ded4c['shift']());}}}(a0_0x141f,0x953e4));import*as a0_0x349d04 from'msgpack-lite';function a0_0x141f(){var _0xa42263=['type','onload','registerCallbackToPythonFunction','decode','1964bylaoN','\x20closed.','\x20called\x20with\x20arguments:\x20','Connected\x20to\x20Server\x20:','indexOf','Message\x20received:\x20','split','connect','PreMessageEventHandlers','No\x20function\x20defined\x20for\x20','getServerString','\x27,\x20inputObject,\x20...func);','No\x20msgpack\x20library\x20loaded','PreOpenEventHandlers','pythonCallbackDict','onmessageprocessed','socket','JS2PY_SESSION_ID','message(b)\x20received\x20:\x20','substr','shift','binaryType','push','stream_empty','getService','innerHTML','data','end','jsFunctionDict','session_id','Connection\x20not\x20open.','log','parse','pythonMultipleCallbackDict','callFunc','stream_item','return','766105iOyGbo','row','isBinary','sendNonImageBinary','getItem','arraybuffer','\x20...','getPythonFunctionLibraryHelp','result','PostOpenEventHandlers','readyState','6PVMfgs','onmessagereceived','ws://localhost:80','sendImageBinary','PythonFunctions','forEach','slice','PythonFunctionsArgs','Connecting\x20to\x20:\x20','797876mYMMNr','\x27].slice(0,\x20-1);\x0a','onopen','PostCloseEventHandlers','readAsArrayBuffer','603DXIkyH','args','createElement','sendBinary','addPreOpenEventHandler','getPythonFunctionLibrary','JS2Py','registerMultipleCallbackPythonFunction','wss','body','error','8450813vHlHXF','length','registerJSFunctionToBeCalledByPython','Too\x20many\x20callbacks\x20for\x20','readCallbackArguments','getSessionId','blob','string','function','addPostMessageEventHandler','isOpen','2030583zwXIal','onclose','appendChild','callback','streaming','target','The\x20dropped\x20file\x20is\x20not\x20an\x20image:\x20','img','start','Chart\x20Loading\x20Completed\x20...','addPostOpenEventHandler','src','PostMessageEventHandlers','apply','getServerAPI','addPreMessageEventHandler','serverName','bind','func','binaryFunctionQueue','readAsDataURL','stream_index','stringify','11595rsDtzQ','callMultipleCallbackPythonFunction','funcName','00\x20','40408fXKbao','createJSProxyFunctions','PreCloseEventHandlers','oninit','send','addPostCloseEventHandler','clientPageId','map','256810PhNJGc','Function\x20:\x20','var\x20args\x20=\x20Array.prototype.slice.call(arguments);\x20var\x20inputObject\x20=\x20{};\x20for(var\x20i\x20in\x20paramNames)\x20{\x20var\x20paramName\x20=\x20paramNames[i];\x20if(paramName\x20!=\x20\x27...func\x27)\x20{\x20inputObject[paramName]\x20=\x20args[i];}\x20}\x20return\x20this.callMultipleCallbackPythonFunction(\x27','The\x20dropped\x20file\x20is\x20an\x20image:\x20'];a0_0x141f=function(){return _0xa42263;};return a0_0x141f();}function RemotePyClient(_0x33b0db,_0x104dbb){var _0x522c79=a0_0x3c5b;if(_0x33b0db===undefined)this['serverName']=_0x522c79(0x25c);else this['serverName']=_0x33b0db;if(_0x104dbb===undefined)this['clientPageId']=_0x522c79(0x1f1);else this[_0x522c79(0x220)]=_0x104dbb;this[_0x522c79(0x1fe)]=![],this[_0x522c79(0x246)]=[],this[_0x522c79(0x238)]=[],this[_0x522c79(0x212)]=[],this[_0x522c79(0x1df)]={},this['socket']=null,this['PythonFunctionsHelp']={},this[_0x522c79(0x24b)]={},this[_0x522c79(0x1e2)]={},this[_0x522c79(0x1ef)]={};let _0x445793=null;this[_0x522c79(0x237)]=[],this[_0x522c79(0x21c)]=[],this['PreMessageEventHandlers']=[],this[_0x522c79(0x258)]=[],this[_0x522c79(0x1e7)]=[],this[_0x522c79(0x20b)]=[],this[_0x522c79(0x1ed)]=_0x2b05a8=>this['PreOpenEventHandlers'][_0x522c79(0x240)](_0x2b05a8),this['addPreCloseEventHandler']=_0x1d618f=>this[_0x522c79(0x21c)]['push'](_0x1d618f),this[_0x522c79(0x20e)]=_0x5e9522=>this[_0x522c79(0x232)]['push'](_0x5e9522),this[_0x522c79(0x209)]=_0x46cc07=>this[_0x522c79(0x258)][_0x522c79(0x240)](_0x46cc07),this[_0x522c79(0x21f)]=_0x322d43=>this[_0x522c79(0x1e7)][_0x522c79(0x240)](_0x322d43),this[_0x522c79(0x1fd)]=_0x492b0e=>this[_0x522c79(0x20b)]['push'](_0x492b0e),this[_0x522c79(0x234)]=function(){var _0x14fece=_0x522c79;return this[_0x14fece(0x20f)]+'/'+this[_0x14fece(0x220)];},this['readCallbackArguments']=function(_0x1f1683,..._0x45d2e5){var _0x2cde40=_0x522c79;for(var _0x33e9d6=_0x45d2e5['length']-0x1;_0x33e9d6>=0x0;--_0x33e9d6){if(typeof _0x45d2e5[_0x33e9d6]!==_0x2cde40(0x1fc))break;}var _0x44c797=_0x45d2e5[_0x2cde40(0x1e1)](0x0,_0x33e9d6+0x1),_0x737fd5=_0x45d2e5[_0x2cde40(0x1e1)](_0x33e9d6+0x1);return[_0x1f1683,_0x44c797,_0x737fd5];},this[_0x522c79(0x1f0)]=function(_0x1a34d4,..._0x4fda02){this['pythonMultipleCallbackDict'][_0x1a34d4]=_0x4fda02;},this['callMultipleCallbackPythonFunction']=function(_0x22ee37,..._0x3390c1){var _0x12702d=_0x522c79,_0x40fe5f=this[_0x12702d(0x1f8)](_0x22ee37,..._0x3390c1);_0x22ee37=_0x40fe5f[0x0];let _0x483567=_0x40fe5f[0x1][0x0],_0x1de85c=_0x40fe5f[0x2];this[_0x12702d(0x1fe)]?(this[_0x12702d(0x23a)][_0x12702d(0x21e)](JSON[_0x12702d(0x215)]({'funcName':_0x22ee37,'args':_0x483567,'session_id':this[_0x12702d(0x1f9)]()})),console['log'](_0x12702d(0x223)+_0x22ee37+_0x12702d(0x22c),_0x483567)):console[_0x12702d(0x249)](_0x12702d(0x248)),_0x1de85c['length']>0x0&&this['registerMultipleCallbackPythonFunction'](_0x22ee37,..._0x1de85c);},this[_0x522c79(0x228)]=function(_0x3f1eb3,_0x6ef1f1){var _0x357125=_0x522c79,_0x42bbdd=this[_0x357125(0x238)][_0x357125(0x221)](function(_0x4b5ea){var _0x470b40=_0x357125;return _0x4b5ea[_0x470b40(0x218)];})[_0x357125(0x22e)](_0x3f1eb3);_0x42bbdd<0x0?this['pythonCallbackDict'][_0x357125(0x240)]({'funcName':_0x3f1eb3,'callback':_0x6ef1f1}):this[_0x357125(0x238)][_0x42bbdd]['callback']=_0x6ef1f1;},this['getSessionId']=function(){var _0x1b6b68=_0x522c79;return sessionStorage[_0x1b6b68(0x253)](_0x1b6b68(0x23b));},this[_0x522c79(0x1f6)]=function(_0x3927b7,_0x3a7da6){var _0x512de7=_0x522c79;this[_0x512de7(0x246)][_0x512de7(0x240)]({'funcName':_0x3927b7,'func':_0x3a7da6});},this['callFunc']=function(_0x4030b4,_0x1c21f8,_0x106df9){var _0x4be295=_0x522c79;this['isOpen']?(this[_0x4be295(0x23a)][_0x4be295(0x21e)](JSON[_0x4be295(0x215)]({'funcName':_0x4030b4,'args':_0x1c21f8,'session_id':this[_0x4be295(0x1f9)]()})),console['log'](_0x4be295(0x223)+_0x4030b4+_0x4be295(0x22c),_0x1c21f8)):console['log'](_0x4be295(0x248));if(_0x106df9===undefined){}else this['registerCallbackToPythonFunction'](_0x4030b4,_0x106df9);},this['callPythonFunction']=function(_0x2672fa,_0x6f245b,..._0x13f8b){this['callMultipleCallbackPythonFunction'](_0x2672fa,_0x6f245b,..._0x13f8b);},this['callPythonFunctionBinary']=function(_0x2a3a11,_0x30c792,_0x585746,_0x2d8570){var _0x56ebb1=_0x522c79;_0x30c792===undefined&&(_0x30c792={});_0x30c792[_0x56ebb1(0x251)]=!![],this[_0x56ebb1(0x24c)](_0x2a3a11,_0x30c792);if(this[_0x56ebb1(0x1fe)]){this[_0x56ebb1(0x1ec)](_0x585746);if(_0x2d8570===undefined){}else this[_0x56ebb1(0x228)](_0x2a3a11,_0x2d8570);}else console['log'](_0x56ebb1(0x248));},this[_0x522c79(0x1ec)]=function(_0x2b8faf){var _0x2bdfb9=_0x522c79,_0x408922=new FileReader();_0x408922[_0x2bdfb9(0x227)]=function(_0x490171){var _0x8204fe=_0x2bdfb9,_0x3f6ad6=_0x490171[_0x8204fe(0x204)][_0x8204fe(0x257)];if(this[_0x8204fe(0x23a)]&&this[_0x8204fe(0x23a)][_0x8204fe(0x259)]==0x1)this[_0x8204fe(0x23a)][_0x8204fe(0x21e)](_0x3f6ad6);},_0x408922[_0x2bdfb9(0x1e8)](_0x2b8faf);},this[_0x522c79(0x252)]=function(_0x13e516){var _0x3a07fc=_0x522c79;if(_0x13e516['type']['match'](/image.*/)){console[_0x3a07fc(0x249)](_0x3a07fc(0x225),_0x13e516['type']);return;}var _0x53f2f8=new FileReader();_0x53f2f8[_0x3a07fc(0x227)]=function(_0x69435a){var _0x5736be=_0x3a07fc,_0x25c778=_0x69435a[_0x5736be(0x204)][_0x5736be(0x257)];if(this['socket']&&this['socket'][_0x5736be(0x259)]==0x1)this[_0x5736be(0x23a)][_0x5736be(0x21e)](_0x25c778);},_0x53f2f8[_0x3a07fc(0x1e8)](_0x13e516);},this[_0x522c79(0x25d)]=function(_0x39569e){var _0x48d500=_0x522c79;if(!_0x39569e[_0x48d500(0x226)]['match'](/image.*/)){console[_0x48d500(0x249)](_0x48d500(0x205),_0x39569e[_0x48d500(0x226)]);return;}var _0x4984d7=new FileReader();_0x4984d7[_0x48d500(0x227)]=function(_0x5d5ea1){var _0x3c5513=_0x48d500,_0x47b09e=_0x5d5ea1[_0x3c5513(0x204)][_0x3c5513(0x257)];if(this[_0x3c5513(0x23a)]&&this[_0x3c5513(0x23a)][_0x3c5513(0x259)]==0x1)this[_0x3c5513(0x23a)]['send'](_0x47b09e);},_0x4984d7[_0x48d500(0x1e8)](_0x39569e);},this['createJSProxyFunctions']=function(_0x275cef){var _0x13af02=_0x522c79;for(var _0xc5c01d in this['PythonFunctionsArgs']){var _0x144996=this[_0x13af02(0x1e2)][_0xc5c01d];_0x144996[_0x13af02(0x240)]('...func');var _0x18cff1='var\x20paramNames\x20=\x20this.PythonFunctionsArgs[\x27'+_0xc5c01d+_0x13af02(0x1e5)+_0x13af02(0x224)+_0xc5c01d+_0x13af02(0x235);_0x144996['push'](_0x18cff1),_0x445793=this;if(_0xc5c01d[_0x13af02(0x22e)]('.')>=0x0){var _0x267ccd=_0xc5c01d[_0x13af02(0x230)]('.'),_0x567f80=this[_0x13af02(0x1df)];for(var _0x4b6947=0x0;_0x4b6947<_0x267ccd[_0x13af02(0x1f5)]-0x1;_0x4b6947++){!(_0x267ccd[_0x4b6947]in _0x567f80)&&(_0x567f80[_0x267ccd[_0x4b6947]]={}),_0x567f80=_0x567f80[_0x267ccd[_0x4b6947]];}_0x567f80[_0x267ccd[_0x267ccd['length']-0x1]]=Function[_0x13af02(0x20c)](null,_0x144996)[_0x13af02(0x210)](this);}else this[_0x13af02(0x1df)][_0xc5c01d]=Function['apply'](null,_0x144996)['bind'](this);}},this[_0x522c79(0x231)]=function(){var _0x8f44ca=_0x522c79;this[_0x8f44ca(0x21d)]!==undefined&&this[_0x8f44ca(0x21d)]();var _0x408158=this[_0x8f44ca(0x234)]();console[_0x8f44ca(0x249)](_0x8f44ca(0x1e3)+_0x408158+_0x8f44ca(0x255)),this['socket']=new WebSocket(_0x408158),this[_0x8f44ca(0x23a)][_0x8f44ca(0x23f)]=_0x8f44ca(0x254),_0x445793=this,this['socket'][_0x8f44ca(0x1e6)]=function(){var _0x52d078=_0x8f44ca;console[_0x52d078(0x249)](_0x52d078(0x22d)+_0x408158),_0x445793[_0x52d078(0x237)][_0x52d078(0x1e0)](_0x33d8fd=>_0x33d8fd()),_0x445793[_0x52d078(0x1fe)]=!![],_0x445793[_0x52d078(0x1e6)]!==undefined&&(_0x445793[_0x52d078(0x217)](_0x52d078(0x1ee),{},function(_0x47e434){var _0x553413=_0x52d078;_0x445793[_0x553413(0x1e2)]={};for(var _0x2e9ea6 in _0x47e434){_0x47e434[_0x2e9ea6][_0x553413(0x23e)](),_0x47e434[_0x2e9ea6][0x0]==_0x553413(0x247)&&_0x47e434[_0x2e9ea6][_0x553413(0x23e)](),_0x445793['PythonFunctionsArgs'][_0x2e9ea6]=_0x47e434[_0x2e9ea6];}_0x445793[_0x553413(0x21b)](''),_0x445793[_0x553413(0x1e6)]();}),_0x445793[_0x52d078(0x217)](_0x52d078(0x256),{},function(_0x1e8e11){_0x445793['PythonFunctionsHelp']=_0x1e8e11;})),_0x445793['PostOpenEventHandlers']['forEach'](_0xf3a2e6=>_0xf3a2e6());},this[_0x8f44ca(0x23a)]['onmessage']=function(_0x3d8757){var _0x3ec709=_0x8f44ca;_0x445793['PreMessageEventHandlers'][_0x3ec709(0x1e0)](_0x3bb064=>_0x3bb064());_0x445793[_0x3ec709(0x25b)]!==undefined&&_0x445793[_0x3ec709(0x25b)](_0x3d8757);let _0x431a56=null;if(_0x3d8757[_0x3ec709(0x244)]instanceof ArrayBuffer)try{const _0x4623fa=a0_0x349d04[_0x3ec709(0x229)](new Uint8Array(_0x3d8757[_0x3ec709(0x244)]));_0x431a56=_0x4623fa;}catch(_0x2f16f4){_0x431a56=null;}else typeof _0x3d8757[_0x3ec709(0x244)]==_0x3ec709(0x1fb)&&(_0x431a56=JSON[_0x3ec709(0x24a)](_0x3d8757['data']));if(_0x431a56!==null){console[_0x3ec709(0x249)](_0x3ec709(0x22f),_0x431a56);if('args'in _0x431a56){var _0x3f05c0=_0x445793[_0x3ec709(0x246)]['map'](function(_0x384c09){var _0x43b294=_0x3ec709;return _0x384c09[_0x43b294(0x218)];})['indexOf'](_0x431a56[_0x3ec709(0x218)]);if(_0x3f05c0>=0x0){var _0x2473a4=_0x445793['jsFunctionDict'][_0x3f05c0];'isBinary'in _0x431a56[_0x3ec709(0x1ea)]?_0x445793['binaryFunctionQueue']['push']({'funcName':_0x431a56[_0x3ec709(0x218)],'callback':_0x2473a4[_0x3ec709(0x211)],'args':_0x431a56[_0x3ec709(0x1ea)]}):_0x2473a4[_0x3ec709(0x211)](_0x431a56[_0x3ec709(0x1ea)]);}else{if(_0x431a56['funcName']==='getPythonFunctionLibrary')return;else throw _0x3ec709(0x233)+_0x431a56[_0x3ec709(0x218)];}}else{if(_0x3ec709(0x203)in _0x431a56){if(_0x431a56['funcName']in _0x445793['pythonMultipleCallbackDict']){var _0x210638=_0x445793['pythonMultipleCallbackDict'][_0x431a56[_0x3ec709(0x218)]];switch(_0x210638[_0x3ec709(0x1f5)]){case 0x0:break;case 0x1:if('error'in _0x431a56)_0x210638[0x0](_0x431a56[_0x3ec709(0x1f3)],![]);if('return'in _0x431a56)_0x210638[0x0](_0x431a56[_0x3ec709(0x203)],_0x431a56[_0x3ec709(0x24e)],![]);break;case 0x2:if(_0x3ec709(0x1f3)in _0x431a56)_0x210638[0x0](_0x431a56['error'],![]);if(_0x3ec709(0x24e)in _0x431a56)_0x210638[0x0](_0x431a56['streaming'],_0x431a56[_0x3ec709(0x24e)],![]);if(_0x431a56[_0x3ec709(0x203)]==_0x3ec709(0x250))_0x210638[0x1](_0x431a56[_0x3ec709(0x214)],_0x431a56[_0x3ec709(0x24d)],![]);break;case 0x3:if('error'in _0x431a56)_0x210638[0x0](_0x431a56['error'],![]);if(_0x431a56[_0x3ec709(0x203)]==_0x3ec709(0x207))_0x210638[0x0](_0x431a56['return'],![]);if(_0x431a56[_0x3ec709(0x203)]=='row')_0x210638[0x1](_0x431a56['stream_index'],_0x431a56[_0x3ec709(0x24d)],![]);if(_0x431a56[_0x3ec709(0x203)]==_0x3ec709(0x245))_0x210638[0x2](_0x431a56[_0x3ec709(0x241)],![]);break;case 0x4:if(_0x3ec709(0x1f3)in _0x431a56)_0x210638[0x4](_0x431a56[_0x3ec709(0x1f3)],![]);if(_0x431a56[_0x3ec709(0x203)]==_0x3ec709(0x207))_0x210638[0x0](_0x431a56['return'],![]);if(_0x431a56[_0x3ec709(0x203)]==_0x3ec709(0x250))_0x210638[0x1](_0x431a56[_0x3ec709(0x214)],_0x431a56[_0x3ec709(0x24d)],![]);if(_0x431a56['streaming']=='end')_0x210638[0x2](_0x431a56['stream_empty'],![]);break;default:throw _0x3ec709(0x1f7)+_0x431a56[_0x3ec709(0x218)];}}else throw'No\x20function\x20callback\x20defined\x20for\x20'+_0x431a56['funcName'];}else{if(_0x431a56['funcName']in _0x445793[_0x3ec709(0x24b)]){var _0x210638=_0x445793['pythonMultipleCallbackDict'][_0x431a56['funcName']];switch(_0x210638[_0x3ec709(0x1f5)]){case 0x0:break;case 0x1:if(_0x3ec709(0x1f3)in _0x431a56)_0x210638[0x0](_0x431a56[_0x3ec709(0x1f3)],![]);if('return'in _0x431a56)_0x210638[0x0](_0x431a56['return'],![]);break;case 0x2:if(_0x3ec709(0x1f3)in _0x431a56)_0x210638[0x1](_0x431a56[_0x3ec709(0x1f3)],![]);if(_0x3ec709(0x24e)in _0x431a56)_0x210638[0x0](_0x431a56[_0x3ec709(0x24e)],![]);break;case 0x3:if(_0x3ec709(0x1f3)in _0x431a56)_0x210638[0x0](_0x431a56[_0x3ec709(0x1f3)],![]);if(_0x3ec709(0x24e)in _0x431a56)_0x210638[0x0](_0x431a56[_0x3ec709(0x24e)],![]);break;default:throw _0x3ec709(0x1f7)+_0x431a56[_0x3ec709(0x218)];}}else{var _0x3f05c0=_0x445793['pythonCallbackDict'][_0x3ec709(0x221)](function(_0x172817){var _0x37e98e=_0x3ec709;return _0x172817[_0x37e98e(0x218)];})[_0x3ec709(0x22e)](_0x431a56[_0x3ec709(0x218)]);if(_0x3f05c0>=0x0){var _0x2473a4=_0x445793[_0x3ec709(0x238)][_0x3f05c0];_0x431a56['return']===undefined?_0x431a56[_0x3ec709(0x1f3)]!==undefined&&_0x2473a4['callback'](_0x431a56[_0x3ec709(0x1f3)],![]):_0x2473a4[_0x3ec709(0x202)](_0x431a56[_0x3ec709(0x24e)],!![]);}else throw _0x3ec709(0x233)+_0x431a56[_0x3ec709(0x218)];}}}}else{console[_0x3ec709(0x249)](_0x3ec709(0x236));var _0x16d93e=new Uint8Array(_0x3d8757[_0x3ec709(0x244)]),_0x3638bf='\x20';for(var _0x2955e5=0x0;_0x2955e5<_0x16d93e[_0x3ec709(0x1f5)];_0x2955e5++){_0x3638bf+=(_0x3ec709(0x219)+_0x16d93e[_0x2955e5]['toString'](0x10))[_0x3ec709(0x23d)](-0x2);}var _0x2b459e=_0x3d8757[_0x3ec709(0x244)],_0x3b481=new Uint8Array(_0x2b459e),_0x2cee4a=new Blob([_0x3b481['buffer']]);if(_0x445793[_0x3ec709(0x212)][_0x3ec709(0x1f5)]>0x0){var _0x20819b=_0x445793[_0x3ec709(0x212)][_0x3ec709(0x23e)]();_0x20819b[_0x3ec709(0x1ea)][_0x3ec709(0x1fa)]=_0x2cee4a,_0x20819b[_0x3ec709(0x202)](_0x20819b[_0x3ec709(0x1ea)]);}else{var _0x18effa=new FileReader();_0x18effa['onload']=function(_0x3e8338){var _0x177632=_0x3ec709,_0x5b0426=document[_0x177632(0x1eb)](_0x177632(0x206));_0x5b0426[_0x177632(0x20a)]=_0x3e8338['target'][_0x177632(0x257)],document[_0x177632(0x1f2)][_0x177632(0x201)](_0x5b0426);},_0x18effa[_0x3ec709(0x213)](_0x2cee4a),document['getElementById']('StatusBar')[_0x3ec709(0x243)]=_0x3ec709(0x208);}console['log'](_0x3ec709(0x23c),_0x3638bf);}_0x445793[_0x3ec709(0x239)]!==undefined&&_0x445793[_0x3ec709(0x239)](),_0x445793[_0x3ec709(0x20b)][_0x3ec709(0x1e0)](_0x1efa3f=>_0x1efa3f());},this[_0x8f44ca(0x23a)][_0x8f44ca(0x200)]=function(_0x51e1cf){var _0x51f485=_0x8f44ca;console[_0x51f485(0x249)]('Connection\x20to\x20'+_0x408158+_0x51f485(0x22b)),_0x445793['PreCloseEventHandlers'][_0x51f485(0x1e0)](_0x2d0ac1=>_0x2d0ac1(_0x51e1cf)),_0x445793['isOpen']=![],this[_0x51f485(0x23a)]=null,_0x445793[_0x51f485(0x200)]!==undefined&&_0x445793[_0x51f485(0x200)](_0x51e1cf),_0x445793['PostCloseEventHandlers']['forEach'](_0x10c6ad=>_0x10c6ad(_0x51e1cf));};},this[_0x522c79(0x20d)]=function(){var _0x23dc5b=_0x522c79;return this[_0x23dc5b(0x1df)];},this[_0x522c79(0x242)]=function(_0x10051b){return this['PythonFunctions'][_0x10051b];};}module['exports']=RemotePyClient;
|