aes70 1.5.3 → 1.5.4

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.
@@ -0,0 +1,5 @@
1
+ *package.json
2
+ *package-lock.json
3
+ *node_modules
4
+ *Makefile
5
+ .git
package/.prettierrc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "singleQuote": true,
3
+ "jsxBracketSameLine": true
4
+ }
package/README.md CHANGED
@@ -9,11 +9,11 @@ be used to build AES70 devices.
9
9
 
10
10
  # Contents
11
11
 
12
- * [AES70](#aes70)
13
- * [Basics](#basics)
14
- * [Installation](#installation)
15
- * [Getting started](#getting-started)
16
- * [License](#license)
12
+ - [AES70](#aes70)
13
+ - [Basics](#basics)
14
+ - [Installation](#installation)
15
+ - [Getting started](#getting-started)
16
+ - [License](#license)
17
17
 
18
18
  # AES70
19
19
 
@@ -68,7 +68,7 @@ file `dist/AES70.es5.js`. To build this file run
68
68
  npm ci
69
69
  make dist/AES70.es5.js
70
70
 
71
- Alternatively, the version of AES70 published to NPM already contains the
71
+ Alternatively, the version of AES70 published to NPM already contains the
72
72
  generated source file. After installing `aes70` using NPM a version of AES70.js
73
73
  for the browser will be at `node_modules/aes70/dist/AES70.es5.js`.
74
74
 
@@ -163,7 +163,7 @@ A full working example:
163
163
 
164
164
  The tree returned by `RemoteDevice.get_device_tree` returns all objects of the
165
165
  device below the root block. They represent all objects defined inside of the
166
- AES70 device aside from the manager objects.
166
+ AES70 device aside from the manager objects.
167
167
 
168
168
  # Documentation
169
169
 
@@ -3,14 +3,56 @@
3
3
  import { argv, exit } from 'process';
4
4
  import { RemoteDevice } from '../src/controller/remote_device.js';
5
5
  import { TCPConnection } from '../src/controller/tcp_connection.js';
6
+ import { OcaBlock } from '../src/controller/ControlClasses/OcaBlock.js';
7
+ import { Arguments } from '../src/controller/arguments.js';
6
8
 
7
- if (argv.length < 4) {
8
- console.log('Usage: node print_tree.js <ip> <port>');
9
+ function badArguments() {
10
+ console.log('Usage: node print_tree.js [--json] <ip> <port>');
9
11
  exit(1);
10
12
  }
11
13
 
12
- const host = argv[2];
13
- const port = parseInt(argv[3]);
14
+ let jsonMode = false;
15
+ const rest = [];
16
+
17
+ argv.slice(2).forEach((option) => {
18
+ switch (option) {
19
+ case '--json':
20
+ jsonMode = true;
21
+ break;
22
+ case '-h':
23
+ case '--help':
24
+ badArguments();
25
+ break;
26
+ default:
27
+ rest.push(option);
28
+ break;
29
+ }
30
+ });
31
+
32
+ if (rest.length < 2) badArguments();
33
+
34
+ const host = rest[0];
35
+ const port = parseInt(rest[1]);
36
+
37
+ if (!(port > 0 && port <= 0xffff)) badArguments();
38
+
39
+ function formatPropertyValue(name, value) {
40
+ if (typeof value === 'object') {
41
+ if (value instanceof Arguments) {
42
+ return {
43
+ [name]: value.item(0),
44
+ ['min' + name]: value.item(1),
45
+ ['max' + name]: value.item(2),
46
+ };
47
+ } else if (value !== null && value.isEnum) {
48
+ value = value.name;
49
+ }
50
+ }
51
+
52
+ return {
53
+ [name]: value,
54
+ };
55
+ }
14
56
 
15
57
  TCPConnection.connect({
16
58
  host: host,
@@ -21,6 +63,42 @@ TCPConnection.connect({
21
63
  })
22
64
  .then(printDevice);
23
65
 
66
+ async function fetchObjectInfo(o) {
67
+ const info = {
68
+ type: o.ClassName,
69
+ };
70
+
71
+ const classIdentification = await o.GetClassIdentification();
72
+
73
+ Object.assign(info, classIdentification);
74
+
75
+ await Promise.all(
76
+ o.get_properties().forEach(async (p) => {
77
+ const { name } = p;
78
+ if (name === 'ClassID' || name === 'ClassVersion') return;
79
+ if (o instanceof OcaBlock && name === 'Members') return;
80
+ const getter = p.getter(o);
81
+ if (!getter) return;
82
+ try {
83
+ const currentValue = await getter();
84
+
85
+ Object.assign(info, formatPropertyValue(name, currentValue));
86
+ } catch (err) {
87
+ if (err.status != 8)
88
+ console.error(
89
+ 'Fetching property',
90
+ o.ClassName,
91
+ p.name,
92
+ 'failed:',
93
+ err
94
+ );
95
+ }
96
+ })
97
+ );
98
+
99
+ return info;
100
+ }
101
+
24
102
  async function printTree(objects, prefix) {
25
103
  if (!prefix) prefix = [];
26
104
 
@@ -40,25 +118,65 @@ async function printTree(objects, prefix) {
40
118
 
41
119
  lastPath = path;
42
120
 
43
- console.log('Path: %s', path.join(' / '));
121
+ console.log('Path: %s', path.join('/'));
44
122
 
45
- o.get_properties().forEach(async (p) => {
46
- if (p.name === 'Members') return;
47
- const getter = p.getter(o);
48
- if (!getter) return;
49
- try {
50
- const val = await getter();
51
- console.log(' %s: %O ', p.name, val);
52
- } catch (e) {
53
- console.log(' %s: n/a ', p.name);
123
+ const info = await fetchObjectInfo(o);
124
+
125
+ for (const name in info) {
126
+ console.log(' %s: %O ', name, info[name]);
127
+ }
128
+ }
129
+ }
130
+
131
+ async function managerExists(manager) {
132
+ try {
133
+ await manager.GetClassIdentification();
134
+ return true;
135
+ } catch (err) {
136
+ if (err.status != 5) {
137
+ throw err;
138
+ }
139
+
140
+ return false;
141
+ }
142
+ }
143
+
144
+ async function generateJson(objects) {
145
+ const result = [];
146
+
147
+ for (let i = 0; i < objects.length; i++) {
148
+ const o = objects[i];
149
+
150
+ if (Array.isArray(o)) {
151
+ await printTreeJson(o, lastPath);
152
+ continue;
153
+ }
154
+
155
+ const info = await fetchObjectInfo(o);
156
+
157
+ if (o instanceof OcaBlock) {
158
+ const members = objects[i + 1];
159
+ if (!Array.isArray(members)) {
160
+ throw new Error('Member missing for OcaBlock.');
54
161
  }
55
- });
162
+ info.Members = await generateJson(members);
163
+ i++;
164
+ }
165
+
166
+ result.push(info);
56
167
  }
168
+
169
+ return result;
170
+ }
171
+
172
+ async function printTreeJson(objects) {
173
+ console.log(JSON.stringify(await generateJson(objects), undefined, 2));
57
174
  }
58
175
 
59
176
  async function printDevice(device) {
177
+ const print = jsonMode ? printTreeJson : printTree;
60
178
  try {
61
- await printTree(await device.GetDeviceTree());
179
+ const objects = await device.GetDeviceTree();
62
180
  const managers = [
63
181
  device.DeviceManager,
64
182
  device.SecurityManager,
@@ -74,15 +192,12 @@ async function printDevice(device) {
74
192
  device.CodingManager,
75
193
  device.DiagnosticManager,
76
194
  ];
77
- for (let i = 0; i < managers.length; i++) {
78
- try {
79
- await printTree([managers[i]]);
80
- } catch (err) {
81
- if (err.status != 5) {
82
- throw err;
83
- }
84
- }
195
+
196
+ for (const manager of managers) {
197
+ if (await managerExists(manager)) objects.push(manager);
85
198
  }
199
+
200
+ await print(objects);
86
201
  exit(0);
87
202
  } catch (error) {
88
203
  if (error.status) {
package/dist/AES70.es5.js CHANGED
@@ -1 +1 @@
1
- !function(){"use strict";function e(...e){try{console.warn(...e)}catch(e){}}function t(...e){try{console.error(...e)}catch(e){}}class n{constructor(){this.event_handlers=new Map}emit(e){const t=this.event_handlers.get(e),n=Array.prototype.slice.call(arguments,1);t&&t.forEach(e=>{try{e.apply(this,n)}catch(t){console.warn("ERROR when calling %o: %o",e,t)}})}on(e,t){let n=this.event_handlers.get(e);n||this.event_handlers.set(e,n=new Set),n.add(t)}addEventListener(e,t){this.on(e,t)}removeEventListener(e,t){const n=this.event_handlers.get(e);if(!n||!n.has(t))throw new Error("removeEventListeners(): not installed.");n.delete(t)}removeAllEventListeners(){this.event_handlers.clear()}}class r{get messageType(){return this.constructor.messageType}}class o{get byteLength(){let e=this._byteLength;if(-1===e){const t=this.encoders,n=this.data;e=0;for(let r=0;r<t.length;r++)e+=t[r].encodedLength(n[r]);this._byteLength=e}return e}constructor(e,t){this.encoders=e,this.data=t,this._byteLength=-1}encodeTo(e,t){t|=0;const{encoders:n,data:r}=this;for(let o=0;o<n.length;o++)t=n[o].encodeTo(e,t,r[o]);return t}}class s extends r{constructor(e,t,n,r,o){super(),this.target=+e,this.method_level=0|t,this.method_index=0|n,this.param_count=0|r,this.parameters=o||null,this.handle=0}static get messageType(){return 0}encode_to(e,t){if(t|=0,e.setUint32(t,this.encoded_length()),t+=4,e.setUint32(t,this.handle),t+=4,e.setUint32(t,this.target),t+=4,e.setUint16(t,this.method_level),t+=2,e.setUint16(t,this.method_index),t+=2,e.setUint8(t,this.param_count),t++,this.param_count){const n=this.parameters;n instanceof o?t=n.encodeTo(e,t):(new Uint8Array(e.buffer).set(new Uint8Array(n),e.byteOffset+t),t+=n.byteLength)}return t}encoded_length(){return 17+(this.param_count?this.parameters.byteLength:0)}decode_from(e,t,n){let r=e.getUint32(t);if(t+=4,this.handle=e.getUint32(t),t+=4,this.target=e.getUint32(t),t+=4,this.method_level=e.getUint16(t),t+=2,this.method_index=e.getUint16(t),t+=2,this.param_count=e.getUint8(t),t++,r-=17,r<0)throw new Error("Bad Command Length.");if(r>0){if(!this.param_count)throw new Error("Expected no parameter bytes.");this.parameters=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r),t+=r}return t}response(e,t,n){return new Response(this.handle,e,t,n)}}class i extends s{static get messageType(){return 1}}function a(e){if(!e.isConstantLength)return e;const t=e.encodedLength(),n=e.decode,r=e.encodeTo;return{isConstantLength:!0,encodedLength:e.encodedLength,encodeTo:r,decode:n,decodeFrom:function(e,r){const o=n(e,r);return[r+t,o]},decodeLength:function(e,n){return n+t}}}const c=a({isConstantLength:!0,encodedLength:function(e){return 2},encodeTo:function(e,t,n){return e.setUint16(t,0|n,!1),t+2},decode:function(e,t){return e.getUint16(t,!1)}});function l(e,t){const n=Object.keys(e).length;return t||(t=class{constructor(...t){if(t.length===n){let n=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this[r]=t[n++])}else{if(1!==t.length||"object"!=typeof t[0])throw new TypeError("Unexpected arguments.");{const n=t[0];for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this[t]=n[t])}}}}),a({type:t,isConstantLength:!1,encodedLength:function(t){let n=0;for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;n+=e[r].encodedLength(t[r])}return n},encodeTo:function(t,n,r){for(const o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;n=e[o].encodeTo(t,n,r[o])}return n},decodeFrom:function(n,r){const o=new Array(e.length);let s=0;for(const t in e){if(!Object.prototype.hasOwnProperty.call(e,t))continue;const i=e[t];let a;[r,a]=i.decodeFrom(n,r),o[s++]=a}return[r,new t(...o)]},decodeLength:function(t,n){for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;n=e[r].decodeLength(t,n)}return n}})}class u{constructor(e,t){this.DefLevel=e,this.EventIndex=t}}const h=l({DefLevel:c,EventIndex:c},u),d=a({isConstantLength:!0,encodedLength:function(e){return 4},encodeTo:function(e,t,n){return e.setUint32(t,n,!1),t+4},decode:function(e,t){return e.getUint32(t,!1)}});class g{constructor(e,t){this.EmitterONo=e,this.EventID=t}}const f=l({EmitterONo:d,EventID:h},g);class p extends r{constructor(e,t,n,r,o,s,i){super(),this.target=e,this.method_level=0|t,this.method_index=0|n,this.context=r,this.event=o,this.param_count=0|s,this.parameters=i||null}static get messageType(){return 2}encode_to(e,t){e.setUint32(t,this.encoded_length()),t+=4,e.setUint32(t,this.target),t+=4,e.setUint16(t,this.method_level),t+=2,e.setUint16(t,this.method_index),t+=2,e.setUint8(t,this.param_count),t++;const n=this.context;if(n){const r=n.byteLength;e.setUint16(t,r),t+=2,r>0&&(new Uint8Array(e.buffer).set(new Uint8Array(this.context),e.byteOffset+t),t+=r)}else e.setUint16(t,0),t+=2;return e.setUint32(t,this.event.EmitterONo),t+=4,e.setUint16(t,this.event.EventID.DefLevel),t+=2,e.setUint16(t,this.event.EventID.EventIndex),t+=2,this.param_count>1&&(this.parameters instanceof o?t=this.parameters.encodeTo(e,t):(new Uint8Array(e.buffer).set(new Uint8Array(this.parameters),e.byteOffset+t),t+=this.parameters.byteLength)),t}encoded_length(){return 23+(this.param_count>1?this.parameters.byteLength:0)+(this.context?this.context.byteLength:0)}decode_from(e,t,n){let r=e.getUint32(t);t+=4,this.target=e.getUint32(t),t+=4,this.method_level=e.getUint16(t),t+=2,this.method_index=e.getUint16(t),t+=2,this.param_count=e.getUint8(t),t++;const o=e.getUint16(t);let s;if(t+=2,o?(this.context=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+o),t+=o):this.context=null,[t,s]=f.decodeFrom(e,t),this.event=s,r-=23+o,r<0)throw new Error("Bad Notification Length.");return r>0&&(this.parameters=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r),t+=r),t}}class S extends r{constructor(e,t,n,r){super(),this.handle=e,this.status_code=0|t,this.param_count=0|n,this.parameters=r||null}static get messageType(){return 3}encoded_length(){return 10+(this.param_count?this.parameters.byteLength:0)}decode_from(e,t,n){let r=e.getUint32(t);if(t+=4,this.handle=e.getUint32(t),t+=4,this.status_code=e.getUint8(t),t++,this.param_count=e.getUint8(t),t++,r-=10,r<0)throw new Error("Bad Response length.");if(r>0){if(!this.param_count)throw new Error("Decoding response with parameterCount=0 but %o bytes of parameters",r);this.parameters=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r),t+=r}return t}encode_to(e,t){return e.setUint32(t,this.encoded_length()),t+=4,e.setUint32(t,this.handle),t+=4,e.setUint8(t,this.status_code),t++,e.setUint8(t,this.param_count),t++,this.param_count&&(this.parameters instanceof o?t=this.parameters.encodeTo(e,t):(new Uint8Array(e.buffer).set(new Uint8Array(this.parameters),e.byteOffset+t),t+=this.parameters.byteLength)),t}}class m extends r{static get messageType(){return 4}constructor(e){super(),this.time=e||0}decode_from(e,t,n){if(4==n)this.time=e.getUint32(t),t+=4;else{if(2!=n)throw new Error("Bad keepalive timeout length.");this.time=1e3*e.getUint16(t),t+=2}return t}encode_to(e,t){return this.time%1e3?(e.setUint32(t,this.time),t+=4):(e.setUint16(t,this.time/1e3),t+=2),t}encoded_length(){return this.time%1e3?4:2}}const y=[s,i,p,S,m];function O(e,t,n){if(e.byteLength<e.byteOffset+t+10)return-1;if(t|=0,59!=e.getUint8(t))throw new Error("Bad sync value.");t++,t+=2;const r=e.getUint32(t);t+=4;const o=e.getUint8(t);t++;const s=e.getUint16(t);t+=2;const i=e.byteOffset+t-9+r;if(i>e.byteLength)return-1;n.length=s;const a=y[o];if(void 0===a)throw new Error("Bad Message Type");if(a===m&&1!==s)throw new Error("Bad KeepAlive message count.");for(let r=0;r<s;r++)n[r]=new a,t=n[r].decode_from(e,t,i-e.byteOffset-t);if(t!=i)throw new Error("Decode error: "+t+" vs "+i);return t}function b(e,t,n,r,o){r||(r=0),o||(o=n.length);if(!(o-r<=65535))throw new Error("Too many PDUs.");e.setUint8(t,59);const s=t+=1;e.setUint16(t,1);const i=t+=2;t+=4,e.setUint8(t,n[r].messageType),t++,e.setUint16(t,o-r),t+=2;for(let s=r;s<o;s++)t=n[s].encode_to(e,t);return e.setUint32(i,t-s),t}function w(e){Array.isArray(e)||(e=[e]);const t=function(e){let t=10;const n=e[0].messageType;for(let r=0;r<e.length;r++){const o=e[r];if(o.messageType!=n)throw new Error("Cannot combine different types in one message.");t+=o.encoded_length()}return t}(e),n=new ArrayBuffer(t);if(b(new DataView(n),0,e,0,e.length)!=t)throw new Error("Message length mismatch.");return n}class C{constructor(e,t){if(!(e<=4294967295))throw new TypeError("Invalid batch size.");this._pdus=[],this._batchSize=e,this._resultCallback=t,this._currentSize=0,this._currentCount=0,this._lastMessageType=-1,this._flushScheduled=!1,this._flushCb=()=>{this._flushScheduled=!1,null!==this._pdus&&this.flush()}}add(e){const t=this._currentSize,n=e.encoded_length(),r=e.messageType,o=this._lastMessageType===r&&4!==r&&this._currentCount<65535;let s=n;o||(s+=10),t&&t+s>this._batchSize&&(this.flush(),s=n+10),this._pdus.push(e),this._currentSize+=s,o?this._currentCount++:this._currentCount=1,this._lastMessageType=r,this._currentSize>this._batchSize?this.flush():1===this._pdus.length&&this.scheduleFlush()}scheduleFlush(){this._flushScheduled||(this._flushScheduled=!0,Promise.resolve().then(this._flushCb).catch(e=>{console.error(e)}))}flush(){if(!this._currentSize)return;const e=this._pdus,t=new ArrayBuffer(this._currentSize),n=new DataView(t),r=e.length;for(let t=0,o=0,s=0;t<r;t++){const i=e[t].messageType;t!==r-1&&t+1-o!=65535&&4!==i&&i===e[t+1].messageType||(s=b(n,s,e,o,t+1),o=t+1)}this._currentSize=0,this._lastMessageType=-1,this._currentCount=0,this._pdus.length=0,this._resultCallback(t)}dispose(){this._pdus=null}}class _ extends n{constructor(e){e||(e={}),super();const t=this._now();this.options=e;const n=e.batch>=0?e.batch:65536;this._message_generator=new C(n,e=>this.write(e)),this.inbuf=null,this.inpos=0,this.last_rx_time=t,this.last_tx_time=t,this.rx_bytes=0,this.tx_bytes=0,this.keepalive_interval=-1,this._keepalive_interval_id=null;const r=()=>{this.removeEventListener("close",r),this.removeEventListener("error",r),this.cleanup()};this.on("close",r),this.on("error",r)}get is_reliable(){return!0}send(e){if(this.is_closed())throw new Error("Connection is closed.");this._message_generator.add(e)}tx_idle_time(){return this._now()-this.last_tx_time}rx_idle_time(){return this._now()-this.last_rx_time}read(e){if(this.rx_bytes+=e.byteLength,this.last_rx_time=this._now(),this.inbuf){const t=this.inbuf.byteLength-this.inpos,n=new Uint8Array(new ArrayBuffer(t+e.byteLength));n.set(new Uint8Array(this.inbuf,this.inpos)),n.set(new Uint8Array(e),t),this.inbuf=null,this.inpos=0,e=n.buffer}let t=0;const n=new DataView(e);try{do{const r=[],o=O(n,t,r);if(-1==o){this.inbuf=e,this.inpos=t;break}t=o,this.incoming(r)}while(t<e.byteLength)}catch(e){if(this.is_reliable)return void this.emit("error",e);console.error(e)}this._check_keepalive()}incoming(e){}write(e){this.last_tx_time=this._now(),this.tx_bytes+=e.byteLength}is_closed(){return null===this._message_generator}close(){this.is_closed()||this.emit("close")}error(e){this.is_closed()||this.emit("error",e)}cleanup(){if(this.is_closed())throw new Error("cleanup() called twice.");this.set_keepalive_interval(0),this._message_generator.dispose(),this._message_generator=null,this.removeAllEventListeners()}_check_keepalive(){if(!(this.keepalive_interval>0))return;const e=this.keepalive_interval;this.rx_idle_time()>3*e?(this.emit("timeout"),this.error(new Error("Keepalive timeout."))):this.tx_idle_time()>.75*e&&(this.flush(),this.tx_idle_time()>.75*e&&this.send(new m(e)))}flush(){this._message_generator.flush()}set_keepalive_interval(e){const t=1e3*e;null!==this._keepalive_interval_id&&(clearInterval(this._keepalive_interval_id),this._keepalive_interval_id=null),this.keepalive_interval=t,this.is_closed()||(this.send(new m(t)),t>0&&(this._keepalive_interval_id=setInterval(()=>{this._check_keepalive()},t/2)))}}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function G(e){let t=null;function n(n){if(null===t){t=new Map;for(const n in e)P(e,n)&&t.set(e[n],n)}return t.get(n)}let r=null;const o=class{constructor(t){if("string"==typeof t){if(!P(e,t))throw new Error("No such enum value.");return this.constructor[t]}if(null!==r&&r.has(t))return r.get(t);this.value=t,function(e,t){null===r&&(r=new Map),r.set(e,t)}(t,this)}get name(){return n(this.value)}valueOf(){return this.value}toString(){return this.name}static getName(e){const t=n(e);if(void 0===t)throw new Error("No such enum value.");return t}static getValue(t){const n=function(t){if(P(e,t))return e[t]}(t);if(void 0===n)throw new Error("No such enum value.");return n}static values(){return e}};for(const t in e)P(e,t)&&Object.defineProperty(o,t,{get:function(){return new this(e[t])},enumerable:!1,configurable:!0});return o}class v extends(G({OK:0,ProtocolVersionError:1,DeviceError:2,Locked:3,BadFormat:4,BadONo:5,ParameterError:6,ParameterOutOfRange:7,NotImplemented:8,InvalidRequest:9,ProcessingFailed:10,BadMethod:11,PartiallySucceeded:12,Timeout:13,BufferOverflow:14})){}class T{constructor(e,t){this.status=new v(e),this.cmd=t}static check_status(e,t){return e instanceof this&&e.status===t}toString(){return"RemoteError("+this.status+")"}}class D{constructor(e){this.values=e}item(e){return this.values[e]}get length(){return this.values.length}}class I{get handle(){return this.command.handle}constructor(e,t,n,r){this.resolve=e,this.reject=t,this.returnTypes=n,this.command=r,this.lastSent=0,this.retries=0}response(e){const{resolve:t,reject:n,returnTypes:r,command:o}=this;if(0!==e.status_code)n(new T(e.status_code,o));else if(r)try{const n=Math.min(e.param_count,r.length);if(0===n)t();else{const o=new Array(n),s=new DataView(e.parameters);for(let e=0,t=0;e<n;e++){let n;[t,n]=r[e].decodeFrom(s,t),o[e]=n}t(1===n?o[0]:new D(o))}}catch(e){n(e)}else t(e)}}function M(e){const t=e.EmitterONo,n=e.EventID;return[t,n.DefLevel,n.EventIndex].join(",")}class L extends _{constructor(e){super(e),this._pendingCommands=new Map,this._nextCommandHandle=0,this._subscribers=new Map}cleanup(){super.cleanup(),this._subscribers=null;const e=this._pendingCommands;this._pendingCommands=null;const t=new Error("closed");e.forEach((e,n)=>{e.reject(t)})}_addSubscriber(e,t){const n=M(e),r=this._subscribers;if(r.has(n))throw new Error("Subscriber already exists.");r.set(n,t)}_removeSubscriber(e){const t=M(e),n=this._subscribers;if(!n.has(t))throw new Error("Unknown subscriber.");n.delete(t)}_getNextCommandHandle(){let e;const t=this._pendingCommands;if(null===t)throw new Error("Connection not open.");do{e=this._nextCommandHandle,this._nextCommandHandle=e+1|0}while(t.has(e));return e}_estimate_next_tx_time(){return this._now()}send_command(e,t,n){const r=(n,r)=>{const o=this._getNextCommandHandle();e.handle=o;const s=new I(n,r,t,e);this._pendingCommands.set(o,s),s.lastSent=this._estimate_next_tx_time(),this.send(e)};if(!n)return new Promise(r);r(e=>n(!0,e),e=>n(!1,e))}_removePendingCommand(e){const t=this._pendingCommands,n=t.get(e);return n?(t.delete(e),n):null}incoming(e){for(let t=0;t<e.length;t++){if(null===this._pendingCommands)return;const n=e[t];if(n instanceof S){const e=this._removePendingCommand(n.handle);if(null===e){if(this.is_reliable)return void this.error(new Error("Unknown handle."));continue}e.response(n)}else if(n instanceof p){const e=this._subscribers,t=M(n.event),r=e.get(t);if(!r)continue;r(n)}else{if(!(n instanceof m))throw new Error("Unexpected PDU");if(!(n.time>0))throw new Error("Bad keepalive timeout.")}}}}const A=a({isConstantLength:!1,encodedLength:function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(Array.isArray(e)||e instanceof Uint8Array))throw new TypeError("Expected Array or Uint8Array");const t=e.length;if(t>65535)throw new Error("Array too long for OcaBlob OCP.1 encoding.");return 2+t},encodeTo:function(e,t,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));const r=n.length;e.setUint16(t,r),t+=2;return new Uint8Array(e.buffer,e.byteOffset).set(n,t),t+r},decodeFrom:function(e,t){const n=e.getUint16(t);return[(t+=2)+n,new Uint8Array(e.buffer,e.byteOffset+t,n)]},decodeLength:function(e,t){return t+2+e.getUint16(t)}});function E(e){return a({isConstantLength:!0,encodedLength:function(t){return e},encodeTo:function(t,n,r){if(!(Array.isArray(r)||r instanceof Uint8Array))throw new TypeError("Expected Array or Uint8Array");if(r.length!==e)throw new Error("Length mismatch.");return new Uint8Array(t.buffer,t.byteOffset).set(r,n),n+e},decode:function(t,n){return new Uint8Array(t.buffer,t.byteOffset+n,e)}})}const k=a({isConstantLength:!0,encodedLength:function(e){return 1},encodeTo:function(e,t,n){return e.setUint8(t,n?1:0),t+1},decode:function(e,t){return 0!==e.getUint8(t)}}),x=c,U=x;function N(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function R(e){return e.isConstantLength?function(e){const t=e.encodedLength(void 0),n=e.encodeTo,r=e.decode;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!N(e))throw new TypeError("Expected array.");const n=e.length;if(n>65535)throw new Error("Array too long for OcaList OCP.1 encoding");return 2+n*t},encodeTo:function(e,t,r){const o=r.length;e.setUint16(t,o),t+=2;for(let s=0;s<o;s++)t=n(e,t,r[s]);return t},decodeFrom:function(e,n){const o=e.getUint16(n);n+=2;const s=new Array(o);for(let i=0;i<o;i++)s[i]=r(e,n),n+=t;return[n,s]},decodeLength:function(e,n){return n+(2+e.getUint16(n)*t)}})}(e):function(e){const t=e.encodedLength,n=e.encodeTo,r=e.decodeFrom,o=e.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!N(e))throw new TypeError("Expected array.");const n=e.length;if(n>65535)throw new Error("Array too long for OcaList OCP.1 encoding");let r=2;for(let o=0;o<n;o++)r+=t(e[o]);return r},encodeTo:function(e,t,r){const o=r.length;e.setUint16(t,o),t+=2;for(let s=0;s<o;s++)t=n(e,t,r[s]);return t},decodeFrom:function(e,t){const n=e.getUint16(t);t+=2;const o=new Array(n);for(let s=0;s<n;s++){let n;[t,n]=r(e,t),o[s]=n}return[t,o]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;for(let r=0;r<n;r++)t=o(e,t);return t}})}(e)}const F=new TextEncoder,B=new TextDecoder;function j(e){return F.encode(e)}function V(e,t,n){const r=t;for(;n--;){const n=e.getUint8(t);if(t++,!(n<=127)){if(n<194)throw new Error("Invalid UTF8 sequence.");if(t++,!(n<=223||(t++,n<=239||(t++,n<=244))))throw new Error("Invalid UTF8 sequence.")}}return t-r}const z=a({isConstantLength:!1,encodedLength:function(e){if("string"!=typeof e)throw new TypeError("Expected string.");return 2+j(e).byteLength},encodeTo:function(e,t,n){const r=function(e){let t=0;for(let n=0;n<e.length;n++,t++){const t=e.charCodeAt(n);if(t>=55296&&t<=56319){n++;const t=e.charCodeAt(n);if(t<56320||t>57343)throw new TypeError("Expected valid unicode string.")}}return t}(n);if(r>65535)throw new Error("String too long for OcaString OCP.1 encoding.");e.setUint16(t,r),t+=2;const o=new Uint8Array(j(n));return new Uint8Array(e.buffer,e.byteOffset).set(o,t),t+o.length},decodeFrom:function(e,t){const n=e.getUint16(t),r=V(e,t+=2,n),o=new Uint8Array(e.buffer,e.byteOffset+t,r);return[t+r,(s=o,B.decode(s))];var s},decodeLength:function(e,t){const n=e.getUint16(t);return(t+=2)+V(e,t,n)}}),q=a({isConstantLength:!1,encodedLength:function(e){if("string"!=typeof e)throw new TypeError("Expected string.");const t=e.length;if(t>65535)throw new Error("Array too long for String16 OCP.1 encoding.");return 2+2*t},encodeTo:function(e,t,n){const r=n.length;e.setUint16(t,r,!1),t+=2;for(let o=0;o<r;o++,t+=2)e.setUint16(t,n.charCodeAt(o),!1);return t},decodeFrom:function(e,t){const n=e.getUint16(t,!1);t+=2;const r=new Array(n);for(let o=0;o<n;o++,t+=2)r[o]=e.getUint16(t,!1);return[t,String.fromCharCode.apply(String,r)]},decodeLength:function(e,t){return t+2+2*e.getUint16(t)}});class H{constructor(e,t,n,r){this.ObjectNumber=e,this.Name=t,this.ClassID=n,this.ClassVersion=r}}const W=l({ObjectNumber:d,Name:z,ClassID:q,ClassVersion:c},H);class K{constructor(e,t,n){this.Manufacturer=e,this.Name=t,this.Version=n}}const X=l({Manufacturer:z,Name:z,Version:z},K);class Y{constructor(e,t,n){this.Reserved=e,this.MfrCode=t,this.ModelCode=n}}const Q=l({Reserved:E(1),MfrCode:E(3),ModelCode:E(4)},Y),J=a({isConstantLength:!0,encodedLength:function(e){return 1},encodeTo:function(e,t,n){return e.setUint8(t,0|n),t+1},decode:function(e,t){return e.getUint8(t)}});function Z(e,t){const n=t.encodeTo,r=t.decode,o=a({isConstantLength:!0,encodedLength:t.encodedLength,encodeTo:function(t,r,o){if("object"==typeof o&&o instanceof e)o=o.value;else if("string"==typeof o)o=e.getValue(o);else{if("number"!=typeof o)throw new TypeError("Unsupported type.");e.getName(o)}return n(t,r,o)},decode:function(t,n){const o=r(t,n);return new e(o)}});for(const t in e.values())Object.defineProperty(o,t,{get:function(){return e[t]},enumerable:!1,configurable:!0});return o}function $(e){return Z(e,J)}class ee extends(G({PowerOn:0,InternalError:1,Upgrade:2,ExternalRequest:3})){}const te=$(ee);class ne{constructor(e,t,n){this.object=e,this.id=t,this.handlers=new Set,this.result=null,this.argumentTypes=n}GetOcaEvent(){return new g(this.object.ObjectNumber,this.id)}do_subscribe(){}do_unsubscribe(){}subscribe(e){return this.handlers.add(e),1===this.handlers.size?this.result=this.do_subscribe().then(()=>(this.result=null,!0)):null!==this.result?this.result:Promise.resolve(!0)}unsubscribe(e){return this.handlers.delete(e),this.handlers.size||this.do_unsubscribe().catch((function(){})),Promise.resolve(!0)}Dipose(){this.handlers.clear(),this.handlers.size&&this.do_unsubscribe().catch((function(){}))}}const re=new ArrayBuffer;class oe extends ne{constructor(e,n,r){super(e,n,r),this.callback=e=>{if(!this.handlers.size)return;const n=new Array(r.length),o=new DataView(e.parameters||re);for(let e=0,t=0;t<r.length;t++){let s;[e,s]=r[t].decodeFrom(o,e),n[t]=s}const s=this.object;this.handlers.forEach((function(e){try{e.apply(s,n)}catch(e){t(e)}}))}}do_subscribe(){return this.object.device.add_subscription(this.GetOcaEvent(),this.callback)}do_unsubscribe(e){return this.object.device.remove_subscription(this.GetOcaEvent(),this.callback)}}class se extends ne{constructor(e,n,r){super(e,n,r),this.callback=([n,o,s])=>{if(n.DefLevel!==this.id.DefLevel||n.PropertyIndex!==this.id.PropertyIndex)return;const i=r[0].decodeFrom(o,0)[1];this.handlers.forEach((function(r){try{r.call(e,i,s,n)}catch(e){t(e)}}))}}do_subscribe(){return this.object.OnPropertyChanged.subscribe(this.callback)}do_unsubscribe(e){return this.object.OnPropertyChanged.unsubscribe(this.callback)}}class ie extends(G({CurrentChanged:1,MinChanged:2,MaxChanged:3,ItemAdded:4,ItemChanged:5,ItemDeleted:6})){}class ae{init(e){this.o=e,this.values=[],this.synchronized=!1,this.subscriptions=[]}sync(){if(this.synchronized)return Promise.resolve();let e=0;const t=[];return this.o.get_properties().forEach(n=>{const r=n.getter(this.o);if(!r)return;const o=n.event(this.o);if(o){const n=function(e,t,n){n===ie.CurrentChanged&&(this.values[e]=t)}.bind(this,e);this.subscriptions.push(o.unsubscribe.bind(o,n)),t.push(o.subscribe(n).catch((function(){})))}t.push(r().then(function(e,t){t instanceof D&&(t=t.item(0)),this.values[e]=t}.bind(this,e),(function(){}))),e++}),Promise.all(t)}forEach(e,t){let n=0;t||(t=this),this.o.get_properties().forEach(r=>{r.getter(this.o)&&(e.call(t,this.values[n],r.name),n++)})}Dispose(){this.o=null,this.subscriptions.forEach(e=>e()),this.subscriptions=null}}class ce{constructor(e,t){this.DefLevel=e,this.PropertyIndex=t}}class le{constructor(e,t,n){const r=new Map,o=[];this.by_name=r,this.parent=n,this.properties=o,this.level=t;for(let t=0;t<e.length;t++){const n=e[t];if(r.set(n.name,n),o[n.index]=n,n.aliases){const e=n.aliases;for(let t=0;t<e.length;t++)r.set(e[t],n)}}}find_property(e){if(e instanceof ce){if(e.DefLevel==this.level)return this.properties[e.PropertyIndex];if(this.parent)return this.parent.find_property(e)}else{if("string"!=typeof e)throw new Error("Expected PropertyID");{const t=this.by_name.get(e);if(t)return t;if(this.parent)return this.parent.find_property(e)}}}find_name(e){const t=this.find_property(e);if(t)return t.name}forEach(e,t){const n=this.parent?this.parent.forEach(e,t):[],r=this.properties;for(let o=0;o<r.length;o++){const s=r[o];void 0!==s&&n.push(e.call(t,s))}return n}}class ue{constructor(e,t,n,r,o,s,i){this.name=e,this.type=t,this.level=n,this.index=r,this.readonly=o,this.static=s,this.aliases=i}GetPropertyID(){return new ce(this.level,this.index)}GetName(){return this.name}getter(e,t){let n=this.name,r=0;const o=this.aliases;if(this.static){const t=e.constructor[n];if(void 0!==t)return function(){return Promise.resolve(t)}}else{const r=e["Get"+n];if(r)return t?r:r.bind(e)}return o&&r<o.length&&(n=o[r++]),null}setter(e,t){if(this.readonly||this.static)return null;let n=this.name,r=0;const o=this.aliases;{const s=e["Set"+n];if(s)return t?s:s.bind(e);o&&r<o.length&&(n=o[r++])}return null}event(e){let t=this.name,n=0;const r=this.aliases;{const o=e["On"+t+"Changed"];if(o)return o;r&&n<r.length&&(t=r[n++])}return null}subscribe(e,n){const r=this.event(e),o=this.getter(e);return r&&r.subscribe(n).catch(t),o&&o().then(n,t),r||!!o}}function he(e,t){if(!t||!t.length)return;const[n,r,s,a,c]=t;e.prototype[n]=function(...e){const t=a.length;let n=null;t<e.length&&t+1===e.length&&"function"==typeof e[t]&&(n=e[t],e.length=t);const l=new i(this.ono,r,s,t,new o(a,e));return this.device.send_command(l,c,n)}}function de(e,t){const[n,r,o,s]=t;Object.defineProperty(e.prototype,"On"+n,{get:function(){const e="_On"+n,t=this[e];return t||(this[e]=new oe(this,new u(r,o),s))}})}function ge(e,t){t.static||"ObjectNumber"!==t.name&&Object.defineProperty(e.prototype,"On"+t.name+"Changed",{get:function(){const e="_On"+t.name+"Changed",n=this[e];return n||(this[e]=new se(this,new ce(t.level,t.index),t.type))}})}function fe(e){if("object"==typeof e&&e instanceof ue)return e;if(Array.isArray(e))return"object"!=typeof e[1]&&(e[1]=function(e){throw new Error("Not implemented.")}(e[1])),new ue(...e);throw new Error("Bad property.")}function pe(e,t,n,r,o,s,i,a){let c=null,l=null;i=i.map(e=>fe(e));const u=class extends o{static get ClassID(){return n}static get ClassVersion(){return r}static get ClassName(){return e}static get_properties(){return null===l&&(l=new le(i,t,o.get_properties())),l}static GetPropertySync(){return null===c&&(c=function(e){const t=Object.create(ae.prototype),n=Object.create(e.prototype);let r=0;e.get_properties().forEach(e=>{const o=!!e.setter(n,!0);if(!e.getter(n,!0))return;const s={enumerable:!0,get:(i=r,function(){return this.values[i]})};var i,a;o&&(s.set=(a=e.setter(n,!0),function(e){return a.call(this.o,e),e})),Object.defineProperty(t,e.name,s),r++});const o=function(e){this.init(e)};return o.prototype=t,o}(this)),c}constructor(e,t){super(e,t);for(let e=0;e<i.length;e++){this["_On"+i[e].name+"Changed"]=null}for(let e=0;e<a.length;e++){this["_On"+a[e][0]]=null}}Dispose(){super.Dispose();for(let e=0;e<i.length;e++){const t=this["_On"+i[e].name+"Changed"];t&&t.Dispose()}for(let e=0;e<a.length;e++){const t=this["_On"+a[e][0]];t&&t.Dispose()}}};for(let e=0;e<s.length;e++)he(u,s[e]);for(let e=0;e<i.length;e++)ge(u,i[e]);for(let e=0;e<a.length;e++)de(u,a[e]);return u}class Se{constructor(e,t){this.ClassID=e,this.ClassVersion=t}}const me=l({ClassID:q,ClassVersion:c},Se),ye=l({DefLevel:c,PropertyIndex:c},ce),Oe=$(ie);function be(...e){const t=e.length;return a({isConstantLength:!1,encodedLength:function(n){if(!Array.isArray(n)&&!N(n))throw new TypeError("Expected array.");if(n.length!==t)throw new Error("Length mismatch.");let r=0;for(let o=0;o<t;o++)r+=e[o].encodedLength(n[o]);return r},encodeTo:function(n,r,o){for(let s=0;s<t;s++)r=e[s].encodeTo(n,r,o[s]);return r},decodeFrom:function(n,r){const o=new Array(t);for(let s=0;s<t;s++){let t;[r,t]=e[s].decodeFrom(n,r),o[s]=t}return[r,o]},decodeLength:function(n,r){for(let o=0;o<t;o++)r=e[o].decodeLength(n,r);return r}})}const we=be(ye,(Ce=1,a({isConstantLength:!1,encodedLength:function(e){if(!("object"==typeof e&&e instanceof DataView))throw new TypeError("Expected DataView.");return e.byteLength-Ce},encodeTo:function(e,t,n){const r=n.byteLength,o=new Uint8Array(n.buffer,n.byteOffset,r);return new Uint8Array(e.buffer,e.byteOffset+t).set(o),t+r},decodeFrom:function(e,t){const n=e.byteLength-t-Ce;return[t+n,new DataView(e.buffer,e.byteOffset+t,n)]},decodeLength:function(e,t){return t+(e.byteLength-t-Ce)}})),Oe);var Ce;const _e=pe("OcaRoot",1,"",2,class{constructor(e,t){this.ono=e,this.device=t}get ObjectNumber(){return this.ono}get ClassVersion(){return this.constructor.ClassVersion}get ClassID(){return this.constructor.ClassID}get ClassName(){return this.constructor.ClassName}sendCommandRrq(e,t,n,r,o){const s=new i(this.ono,e,t,n,r);return this.device.send_command(s,o)}GetPropertyName(e){return this.get_properties().find_name(e)}GetPropertyID(e){const t=this.get_properties().find_property(e);if(t)return t.GetPropertyID()}static get_properties(){return null}get_properties(){return this.constructor.get_properties()}get __oca_properties__(){return this.get_properties()}GetPropertySync(){return new(this.constructor.GetPropertySync())(this)}Dispose(){}},[["GetClassIdentification",1,1,[],[me]],["GetLockable",1,2,[],[k]],["LockTotal",1,3,[],[]],["Unlock",1,4,[],[]],["GetRole",1,5,[],[z]],["LockReadonly",1,6,[],[]]],[["ClassID",[q],1,1,!0,!0,null],["ClassVersion",[c],1,2,!0,!0,null],["ObjectNumber",[d],1,3,!0,!1,null],["Lockable",[k],1,4,!0,!1,null],["Role",[z],1,5,!0,!1,null]],[["PropertyChanged",1,1,[we]]]),Pe=pe("OcaManager",2,"",2,_e,[],[],[]),Ge=pe("OcaDeviceManager",3,"",2,Pe,[["GetOcaVersion",3,1,[],[c]],["GetModelGUID",3,2,[],[Q]],["GetSerialNumber",3,3,[],[z]],["GetDeviceName",3,4,[],[z]],["SetDeviceName",3,5,[z],[]],["GetModelDescription",3,6,[],[X]],["GetDeviceRole",3,7,[],[z]],["SetDeviceRole",3,8,[z],[]],["GetUserInventoryCode",3,9,[],[z]],["SetUserInventoryCode",3,10,[z],[]],["GetEnabled",3,11,[],[k]],["SetEnabled",3,12,[k],[]],["GetState",3,13,[],[U]],["SetResetKey",3,14,[E(16),A],[]],["GetResetCause",3,15,[],[te]],["ClearResetCause",3,16,[],[]],["GetMessage",3,17,[],[z]],["SetMessage",3,18,[z],[]],["GetManagers",3,19,[],[R(W)]],["GetDeviceRevisionID",3,20,[],[z]]],[["ModelGUID",[Q],3,1,!1,!1,null],["SerialNumber",[z],3,2,!1,!1,null],["ModelDescription",[X],3,3,!1,!1,null],["DeviceName",[z],3,4,!1,!1,null],["OcaVersion",[c],3,5,!1,!1,null],["DeviceRole",[z],3,6,!1,!1,null],["UserInventoryCode",[z],3,7,!1,!1,null],["Enabled",[k],3,8,!1,!1,null],["State",[U],3,9,!1,!1,null],["Busy",[k],3,10,!1,!1,null],["ResetCause",[te],3,11,!1,!1,null],["Message",[z],3,12,!1,!1,null],["Managers",[R(W)],3,13,!1,!1,null],["DeviceRevisionID",[z],3,14,!0,!1,null]],[]),ve=pe("OcaSecurityManager",3,"",2,Pe,[["AddPreSharedKey",3,4,[z,A],[]],["ChangePreSharedKey",3,3,[z,A],[]],["DeletePreSharedKey",3,5,[z],[]],["DisableControlSecurity",3,2,[],[]],["EnableControlSecurity",3,1,[],[]]],[["secureControlData",[k],3,1,!1,!1,null]],[]);class Te extends(G({BootLoader:0})){}const De=Z(Te,c);class Ie{constructor(e,t,n,r){this.Major=e,this.Minor=t,this.Build=n,this.Component=r}}const Me=l({Major:d,Minor:d,Build:d,Component:De},Ie),Le=pe("OcaFirmwareManager",3,"",2,Pe,[["GetComponentVersions",3,1,[],[R(Me)]],["StartUpdateProcess",3,2,[],[]],["BeginActiveImageUpdate",3,3,[De],[]],["AddImageData",3,4,[d,A],[]],["VerifyImage",3,5,[A],[]],["EndActiveImageUpdate",3,6,[],[]],["BeginPassiveComponentUpdate",3,7,[De,A,z],[]],["EndUpdateProcess",3,8,[],[]]],[["ComponentVersions",[R(Me)],3,1,!1,!1,null]],[]);class Ae{constructor(e,t){this.DefLevel=e,this.MethodIndex=t}}const Ee=l({DefLevel:c,MethodIndex:c},Ae);class ke{constructor(e,t){this.ONo=e,this.MethodID=t}}const xe=l({ONo:d,MethodID:Ee},ke);class Ue extends(G({Reliable:1,Fast:2})){}const Ne=$(Ue);class Re{constructor(e){this.objectList=e}}const Fe=l({objectList:R(d)},Re);class Be extends(G({Normal:1,EventsDisabled:2})){}const je=$(Be),Ve=pe("OcaSubscriptionManager",3,"",2,Pe,[["RemoveSubscription",3,2,[f,xe],[]],["AddSubscription",3,1,[f,xe,A,Ne,A],[]],["DisableNotifications",3,3,[],[]],["ReEnableNotifications",3,4,[],[]],["AddPropertyChangeSubscription",3,5,[d,ye,xe,A,Ne,A],[]],["RemovePropertyChangeSubscription",3,6,[d,ye,xe],[]],["GetMaximumSubscriberContextLength",3,7,[],[c]]],[["State",[je],3,1,!1,!1,null]],[["NotificationsDisabled",3,1,[]],["SynchronizeState",3,2,[Fe]]]);class ze extends(G({None:0,Working:1,Standby:2,Off:3})){}const qe=$(ze),He=pe("OcaPowerManager",3,"",2,Pe,[["GetState",3,1,[],[qe]],["SetState",3,2,[qe],[]],["GetPowerSupplies",3,3,[],[R(d)]],["GetActivePowerSupplies",3,4,[],[R(d)]],["ExchangePowerSupply",3,5,[d,d,k],[]],["GetAutoState",3,6,[],[k]]],[["State",[qe],3,1,!1,!1,null],["PowerSupplies",[R(d)],3,2,!1,!1,null],["ActivePowerSupplies",[R(d)],3,3,!1,!1,null],["AutoState",[k],3,4,!1,!1,null],["TargetState",[qe],3,5,!1,!1,null]],[]),We=pe("OcaNetworkManager",3,"",2,Pe,[["GetNetworks",3,1,[],[R(d)]],["GetStreamNetworks",3,2,[],[R(d)]],["GetControlNetworks",3,3,[],[R(d)]],["GetMediaTransportNetworks",3,4,[],[R(d)]]],[["Networks",[R(d)],3,1,!1,!1,null],["StreamNetworks",[R(d)],3,2,!1,!1,null],["ControlNetworks",[R(d)],3,3,!1,!1,null],["MediaTransportNetworks",[R(d)],3,4,!1,!1,null]],[]);class Ke extends(G({None:0,Internal:1,Network:2,External:3})){}const Xe=$(Ke),Ye=pe("OcaMediaClockManager",3,"",2,Pe,[["GetClocks",3,1,[],[R(d)]],["GetMediaClockTypesSupported",3,2,[],[R(Xe)]],["GetClock3s",3,3,[],[R(d)]]],[["ClockSourceTypesSupported",[R(Xe)],3,1,!1,!1,["MediaClockTypesSupported"]],["Clocks",[R(d)],3,2,!1,!1,null],["Clock3s",[R(d)],3,3,!1,!1,null]],[]);class Qe{constructor(e,t){this.Library=e,this.ID=t}}const Je=l({Library:d,ID:d},Qe);class Ze{constructor(e,t){this.Authority=e,this.ID=t}}const $e=l({Authority:E(3),ID:d},Ze);class et{constructor(e,t){this.Type=e,this.ONo=t}}const tt=l({Type:$e,ONo:d},et),nt=pe("OcaLibraryManager",3,"\b",2,Pe,[["AddLibrary",3,1,[$e],[tt]],["DeleteLibrary",3,2,[d],[]],["GetLibraryCount",3,3,[$e],[c]],["GetLibraryList",3,4,[$e],[R(tt)]],["GetCurrentPatch",3,5,[],[Je]],["ApplyPatch",3,6,[Je],[]]],[["Libraries",[R(tt)],3,1,!1,!1,null],["CurrentPatch",[Je],3,2,!1,!1,null]],[]),rt=pe("OcaAudioProcessingManager",3,"\t",2,Pe,[],[],[]),ot="undefined"!=typeof BigInt,st=ot&&(BigInt(1)<<BigInt(64))-BigInt(1),it=ot&&st>>BigInt(1),at=ot&&-it-BigInt(1),ct=ot&&(BigInt(1)<<BigInt(55))-BigInt(1);ot&&BigInt(1);function lt(){if(!ot)throw new Error("Missing BigInt support")}const ut=a({isConstantLength:!0,encodedLength:function(e){return 8},encodeTo:function(e,t,n){if(lt(),!(n<=st&&n>=0))throw new TypeError("Uint64 out of range.");return e.setBigUint64(t,BigInt(n),!1),t+8},decode:function(e,t){lt();const n=e.getBigUint64(t,!1);return n<=Number.MAX_SAFE_INTEGER?Number(n):n}});class ht{constructor(e,t,n){this.Negative=e,this.Seconds=t,this.Nanoseconds=n}}const dt=l({Negative:k,Seconds:ut,Nanoseconds:d},ht),gt=pe("OcaDeviceTimeManager",3,"\n",2,Pe,[["GetDeviceTimeNTP",3,1,[],[ut]],["SetDeviceTimeNTP",3,2,[ut],[]],["GetTimeSources",3,3,[],[R(d)]],["GetCurrentDeviceTimeSource",3,4,[],[d]],["SetCurrentDeviceTimeSource",3,5,[d],[]],["GetDeviceTimePTP",3,6,[],[dt]],["SetDeviceTimePTP",3,7,[dt],[]]],[["TimeSources",[R(d)],3,1,!1,!1,null],["CurrentDeviceTimeSource",[d],3,2,!1,!1,null]],[]);function ft(e,t){const n=e.encodedLength,r=e.encodeTo,o=e.decodeFrom,s=e.decodeLength,i=t.encodedLength,c=t.encodeTo,l=t.decodeFrom,u=t.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!(e instanceof Map||e instanceof WeakMap))throw new TypeError("Expected Map or WeakMap");let t=2;return e.forEach((e,r)=>{t+=n(r),t+=i(e)}),t},encodeTo:function(e,t,n){return e.setUint16(t,n.size),t+=2,n.forEach((n,o)=>{t=r(e,t,o),t=c(e,t,n)}),t},decodeFrom:function(e,t){const n=new Map,r=e.getUint16(t);t+=2;for(let s=0;s<r;s++){let r,s;[t,r]=o(e,t),[t,s]=l(e,t),n.set(r,s)}if(n.size!==r)throw new Error("Key appeared twice in decoded Map.");return[t,n]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;for(let r=0;r<n;r++)t=s(e,t),t=u(e,t);return t}})}class pt extends(G({Absolute:1,Relative:2})){}const St=$(pt);class mt{constructor(e,t,n,r,o,s,i,a,c){this.ID=e,this.Label=t,this.ProgramID=n,this.GroupID=r,this.TimeMode=o,this.TimeSourceONo=s,this.StartTime=i,this.Duration=a,this.ApplicationSpecificParameters=c}}const yt=l({ID:d,Label:z,ProgramID:Je,GroupID:c,TimeMode:St,TimeSourceONo:d,StartTime:dt,Duration:dt,ApplicationSpecificParameters:A},mt);class Ot extends(G({None:0,Prepare:1,Enable:2,Start:3,Stop:4,Abort:5,Disable:6,Clear:7})){}const bt=$(Ot);class wt extends(G({None:0,Enabled:1,Disabled:2})){}const Ct=$(wt);class _t extends(G({None:0,NotPrepared:1,Disabled:2,Enabled:3,Running:4,Completed:5,Failed:6,Stopped:7,Aborted:8})){}const Pt=$(_t);class Gt{constructor(e,t,n){this.ID=e,this.State=t,this.ErrorCode=n}}const vt=l({ID:d,State:Pt,ErrorCode:c},Gt);class Tt{constructor(e,t,n){this.TaskID=e,this.ProgramID=t,this.Status=n}}const Dt=l({TaskID:d,ProgramID:Je,Status:vt},Tt),It=pe("OcaTaskManager",3,"\v",1,Pe,[["Enable",3,1,[k],[]],["ControlAllTasks",3,2,[bt,A],[]],["ControlTaskGroup",3,3,[c,bt,A],[]],["ControlTask",3,4,[d,bt,A],[]],["GetState",3,5,[],[Ct]],["GetTaskStatuses",3,6,[],[vt]],["GetTaskStatus",3,7,[d],[vt]],["AddTask",3,8,[yt],[yt]],["GetTasks",3,9,[],[ft(d,yt)]],["GetTask",3,10,[d],[yt]],["SetTask",3,11,[d,yt],[]],["DeleteTask",3,12,[d],[]]],[["State",[Ct],3,1,!1,!1,null],["Tasks",[ft(d,yt)],3,2,!1,!1,null]],[["TaskStateChanged",3,1,[Dt]]]),Mt=pe("OcaCodingManager",3,"\f",1,Pe,[["GetAvailableEncodingSchemes",3,1,[],[ft(c,z)]],["GetAvailableDecodingSchemes",3,2,[],[ft(c,z)]]],[["AvailableEncodingSchemes",[ft(c,z)],3,1,!1,!1,null],["AvailableDecodingSchemes",[ft(c,z)],3,2,!1,!1,null]],[]),Lt=pe("OcaDiagnosticManager",3,"\r",1,Pe,[["GetLockStatus",3,1,[d],[z]]],[],[]);class At{constructor(e,t){this.ONo=e,this.ClassIdentification=t}}const Et=l({ONo:d,ClassIdentification:me},At);class kt{constructor(e,t){this.MemberObjectIdentification=e,this.ContainerObjectNumber=t}}const xt=l({MemberObjectIdentification:Et,ContainerObjectNumber:d},kt);class Ut{constructor(e,t){this.Authority=e,this.ID=t}}const Nt=l({Authority:E(3),ID:d},Ut);class Rt{constructor(e,t){this.TargetBlockType=e,this.ParData=t}}const Ft=l({TargetBlockType:d,ParData:A},Rt);class Bt{constructor(e,t,n,r,o){this.ONo=e,this.ClassIdentification=t,this.ContainerPath=n,this.Role=r,this.Label=o}}const jt=l({ONo:d,ClassIdentification:me,ContainerPath:R(d),Role:z,Label:z},Bt),Vt=x;class zt extends(G({Input:1,Output:2})){}const qt=$(zt);class Ht{constructor(e,t){this.Mode=e,this.Index=t}}const Wt=l({Mode:qt,Index:c},Ht);class Kt{constructor(e,t,n){this.Owner=e,this.ID=t,this.Name=n}}const Xt=l({Owner:d,ID:Wt,Name:z},Kt);class Yt{constructor(e,t){this.SourcePort=e,this.SinkPort=t}}const Qt=l({SourcePort:Xt,SinkPort:Xt},Yt);class Jt extends(G({Exact:0,Substring:1,Contains:2,ExactCaseInsensitive:3,SubstringCaseInsensitive:4,ContainsCaseInsensitive:5})){}const Zt=$(Jt),$t=a({isConstantLength:!0,encodedLength:function(e){return 4},encodeTo:function(e,t,n){return e.setFloat32(t,+n,!1),t+4},decode:function(e,t){return e.getFloat32(t,!1)}}),en=pe("OcaWorker",2,"",2,_e,[["GetEnabled",2,1,[],[k]],["SetEnabled",2,2,[k],[]],["AddPort",2,3,[z,qt],[Wt]],["DeletePort",2,4,[Wt],[]],["GetPorts",2,5,[],[R(Xt)]],["GetPortName",2,6,[Wt],[z]],["SetPortName",2,7,[Wt,z],[]],["GetLabel",2,8,[],[z]],["SetLabel",2,9,[z],[]],["GetOwner",2,10,[],[d]],["GetLatency",2,11,[],[$t]],["SetLatency",2,12,[$t],[]],["GetPath",2,13,[],[R(z),R(d)]]],[["Enabled",[k],2,1,!1,!1,null],["Ports",[R(Xt)],2,2,!1,!1,null],["Label",[z],2,3,!1,!1,null],["Owner",[d],2,4,!1,!1,null],["Latency",[$t],2,5,!1,!1,null]],[]),tn=pe("OcaBlock",3,"",2,en,[["GetType",3,1,[],[d]],["ConstructMemberUsingFactory",3,3,[d],[d]],["DeleteMember",3,4,[d],[]],["GetMembers",3,5,[],[R(Et)]],["GetMembersRecursive",3,6,[],[R(xt)]],["AddSignalPath",3,7,[Qt],[c]],["DeleteSignalPath",3,8,[c],[]],["GetSignalPaths",3,9,[],[ft(c,Qt)]],["GetSignalPathsRecursive",3,10,[],[ft(c,Qt)]],["GetMostRecentParamSetIdentifier",3,11,[],[Je]],["ApplyParamSet",3,12,[],[Je]],["GetCurrentParamSetData",3,13,[],[Ft]],["StoreCurrentParamSetData",3,14,[Je],[]],["GetGlobalType",3,15,[],[Nt]],["GetONoMap",3,16,[],[ft(d,d)]],["FindObjectsByRole",3,17,[z,Zt,q,Vt],[R(jt)]],["FindObjectsByRoleRecursive",3,18,[z,Zt,q,Vt],[R(jt)]],["FindObjectsByPath",3,20,[R(z),Vt],[R(jt)]],["FindObjectsByLabelRecursive",3,19,[z,Zt,q,Vt],[R(jt)]]],[["Type",[d],3,1,!0,!1,null],["Members",[R(Et)],3,2,!1,!1,null],["SignalPaths",[ft(c,Qt)],3,3,!1,!1,null],["MostRecentParamSetIdentifier",[Je],3,4,!1,!1,null],["GlobalType",[Nt],3,5,!0,!1,null],["ONoMap",[ft(d,d)],3,6,!0,!1,null]],[]);const nn=pe("OcaActuator",3,"",2,en,[],[],[]);class rn extends(G({Muted:1,Unmuted:2})){}const on=$(rn),sn=pe("OcaMute",4,"",2,nn,[["GetState",4,1,[],[on]],["SetState",4,2,[on],[]]],[["State",[on],4,1,!1,!1,null]],[]);class an extends(G({NonInverted:1,Inverted:2})){}const cn=$(an),ln=pe("OcaPolarity",4,"",2,nn,[["GetState",4,1,[],[cn]],["SetState",4,2,[cn],[]]],[["State",[cn],4,1,!1,!1,null]],[]),un=pe("OcaSwitch",4,"",2,nn,[["GetPosition",4,1,[],[c,c,c]],["SetPosition",4,2,[c],[]],["GetPositionName",4,3,[c],[z]],["SetPositionName",4,4,[c,z],[]],["GetPositionNames",4,5,[],[R(z)]],["SetPositionNames",4,6,[R(z)],[]],["GetPositionEnabled",4,7,[c],[k]],["SetPositionEnabled",4,8,[c,k],[]],["GetPositionEnableds",4,9,[],[R(k)]],["SetPositionEnableds",4,10,[R(k)],[]]],[["Position",[c],4,1,!1,!1,null],["PositionNames",[R(z)],4,2,!1,!1,null],["PositionEnableds",[R(k)],4,3,!1,!1,null]],[]),hn=pe("OcaGain",4,"",2,nn,[["GetGain",4,1,[],[$t,$t,$t]],["SetGain",4,2,[$t],[]]],[["Gain",[$t],4,1,!1,!1,null]],[]),dn=pe("OcaPanBalance",4,"",2,nn,[["GetPosition",4,1,[],[$t,$t,$t]],["SetPosition",4,2,[$t],[]],["GetMidpointGain",4,3,[],[$t,$t,$t]],["SetMidpointGain",4,4,[$t],[]]],[["Position",[$t],4,1,!1,!1,null],["MidpointGain",[$t],4,2,!1,!1,null]],[]),gn=pe("OcaDelay",4,"",2,nn,[["GetDelayTime",4,1,[],[$t,$t,$t]],["SetDelayTime",4,2,[$t],[]]],[["DelayTime",[$t],4,1,!1,!1,null]],[]);class fn extends(G({Time:1,Distance:2,Samples:3,Microseconds:4,Milliseconds:5,Centimeters:6,Inches:7,Feet:8})){}const pn=$(fn);class Sn{constructor(e,t){this.DelayValue=e,this.DelayUnit=t}}const mn=l({DelayValue:$t,DelayUnit:pn},Sn),yn=pe("OcaDelayExtended",5,"",2,gn,[["GetDelayValue",5,1,[],[mn,mn,mn]],["SetDelayValue",5,2,[mn],[]],["GetDelayValueConverted",5,3,[pn],[mn]]],[["DelayValue",[mn],5,1,!1,!1,null]],[]),On=pe("OcaFrequencyActuator",4,"\b",2,nn,[["GetFrequency",4,1,[],[$t,$t,$t]],["SetFrequency",4,2,[$t],[]]],[["Frequency",[$t],4,1,!1,!1,null]],[]);class bn extends(G({Butterworth:1,Bessel:2,Chebyshev:3,LinkwitzRiley:4})){}const wn=$(bn);class Cn extends(G({HiPass:1,LowPass:2,BandPass:3,BandReject:4,AllPass:5})){}const _n=$(Cn),Pn=x,Gn=pe("OcaFilterClassical",4,"\t",2,nn,[["GetFrequency",4,1,[],[$t,$t,$t]],["SetFrequency",4,2,[$t],[]],["GetPassband",4,3,[],[_n]],["SetPassband",4,4,[_n],[]],["GetShape",4,5,[],[wn]],["SetShape",4,6,[wn],[]],["GetOrder",4,7,[],[c,c,c]],["SetOrder",4,8,[c],[]],["GetParameter",4,9,[],[$t,$t,$t]],["SetParameter",4,10,[$t],[]],["SetMultiple",4,11,[Pn,$t,_n,wn,c,$t],[]]],[["Frequency",[$t],4,1,!1,!1,null],["Passband",[_n],4,2,!1,!1,null],["Shape",[wn],4,3,!1,!1,null],["Order",[c],4,4,!1,!1,null],["Parameter",[$t],4,5,!1,!1,null]],[]);class vn extends(G({None:0,PEQ:1,LowShelv:2,HighShelv:3,LowPass:4,HighPass:5,BandPass:6,AllPass:7,Notch:8,ToneControlLowFixed:9,ToneControlLowSliding:10,ToneControlHighFixed:11,ToneControlHighSliding:12})){}const Tn=$(vn),Dn=pe("OcaFilterParametric",4,"\n",2,nn,[["GetFrequency",4,1,[],[$t,$t,$t]],["SetFrequency",4,2,[$t],[]],["GetShape",4,3,[],[Tn]],["SetShape",4,4,[Tn],[]],["GetWidthParameter",4,5,[],[$t,$t,$t]],["SetWidthParameter",4,6,[$t],[]],["GetInbandGain",4,7,[],[$t,$t,$t]],["SetInbandGain",4,8,[$t],[]],["GetShapeParameter",4,9,[],[$t,$t,$t]],["SetShapeParameter",4,10,[$t],[]],["SetMultiple",4,11,[Pn,$t,Tn,$t,$t,$t],[]]],[["Frequency",[$t],4,1,!1,!1,null],["Shape",[Tn],4,2,!1,!1,null],["WidthParameter",[$t],4,3,!1,!1,["Q"]],["InbandGain",[$t],4,4,!1,!1,null],["ShapeParameter",[$t],4,5,!1,!1,null]],[]),In=pe("OcaFilterPolynomial",4,"\v",2,nn,[["GetCoefficients",4,1,[],[R($t),R($t)]],["SetCoefficients",4,2,[R($t),R($t)],[]],["GetSampleRate",4,3,[],[$t,$t,$t]],["SetSampleRate",4,4,[$t],[]],["GetMaxOrder",4,5,[],[J]]],[["A",[R($t)],4,1,!1,!1,null],["B",[R($t)],4,2,!1,!1,null],["SampleRate",[$t],4,3,!1,!1,null],["MaxOrder",[J],4,4,!0,!1,null]],[]),Mn=pe("OcaFilterFIR",4,"\f",2,nn,[["GetLength",4,1,[],[d,d,d]],["GetCoefficients",4,2,[],[R($t)]],["SetCoefficients",4,3,[R($t)],[]],["GetSampleRate",4,4,[],[$t,$t,$t]],["SetSampleRate",4,5,[$t],[]]],[["Length",[d],4,1,!1,!1,null],["Coefficients",[R($t)],4,2,!1,!1,null],["SampleRate",[$t],4,3,!1,!1,null]],[]);class Ln{constructor(e,t,n){this.Frequency=e,this.Amplitude=t,this.Phase=n}}const An=l({Frequency:R($t),Amplitude:R($t),Phase:R($t)},Ln),En=pe("OcaFilterArbitraryCurve",4,"\r",2,nn,[["GetTransferFunction",4,1,[],[An]],["SetTransferFunction",4,2,[An],[]],["GetSampleRate",4,3,[],[$t,$t,$t]],["SetSampleRate",4,4,[$t],[]],["GetTFMinLength",4,5,[],[c]],["GetTFMaxLength",4,6,[],[c]]],[["TransferFunction",[An],4,1,!1,!1,null],["SampleRate",[$t],4,2,!1,!1,null],["TFMinLength",[c],4,3,!1,!1,null],["TFMaxLength",[c],4,4,!1,!1,null]],[]);class kn{constructor(e,t){this.Value=e,this.Ref=t}}const xn=l({Value:$t,Ref:$t},kn);class Un extends(G({None:0,Compress:1,Limit:2,Expand:3,Gate:4})){}const Nn=$(Un);class Rn extends(G({None:0,RMS:1,Peak:2})){}const Fn=$(Rn);class Bn extends(G({dBu:0,dBV:1,V:2})){}const jn=$(Bn),Vn=pe("OcaDynamics",4,"",2,nn,[["GetTriggered",4,1,[],[k]],["GetDynamicGain",4,2,[],[$t]],["GetFunction",4,3,[],[Nn]],["SetFunction",4,4,[Nn],[]],["GetRatio",4,5,[],[$t,$t,$t]],["SetRatio",4,6,[$t],[]],["GetThreshold",4,7,[],[xn,$t,$t]],["SetThreshold",4,8,[xn],[]],["GetThresholdPresentationUnits",4,9,[],[jn]],["SetThresholdPresentationUnits",4,10,[jn],[]],["GetDetectorLaw",4,11,[],[Fn]],["SetDetectorLaw",4,12,[Fn],[]],["GetAttackTime",4,13,[],[$t,$t,$t]],["SetAttackTime",4,14,[$t],[]],["GetReleaseTime",4,15,[],[$t,$t,$t]],["SetReleaseTime",4,16,[$t],[]],["GetHoldTime",4,17,[],[$t,$t,$t]],["SetHoldTime",4,18,[$t],[]],["GetDynamicGainFloor",4,19,[],[$t,$t,$t]],["SetDynamicGainFloor",4,20,[$t],[]],["GetDynamicGainCeiling",4,21,[],[$t,$t,$t]],["SetDynamicGainCeiling",4,22,[$t],[]],["GetKneeParameter",4,23,[],[$t,$t,$t]],["SetKneeParameter",4,24,[$t],[]],["GetSlope",4,25,[],[$t,$t,$t]],["SetSlope",4,26,[$t],[]],["SetMultiple",4,27,[Pn,Nn,xn,jn,Fn,$t,$t,$t,$t,$t,$t,$t],[]]],[["Triggered",[k],4,1,!1,!1,null],["DynamicGain",[$t],4,2,!1,!1,null],["Function",[Nn],4,3,!1,!1,null],["Ratio",[$t],4,4,!1,!1,null],["Threshold",[xn],4,5,!1,!1,null],["ThresholdPresentationUnits",[jn],4,6,!1,!1,null],["DetectorLaw",[Fn],4,7,!1,!1,null],["AttackTime",[$t],4,8,!1,!1,null],["ReleaseTime",[$t],4,9,!1,!1,null],["HoldTime",[$t],4,10,!1,!1,null],["DynamicGainCeiling",[$t],4,11,!1,!1,null],["DynamicGainFloor",[$t],4,12,!1,!1,null],["KneeParameter",[$t],4,13,!1,!1,null],["Slope",[$t],4,14,!1,!1,null]],[]),zn=pe("OcaDynamicsDetector",4,"",2,nn,[["GetLaw",4,1,[],[Fn]],["SetLaw",4,2,[Fn],[]],["GetAttackTime",4,3,[],[$t,$t,$t]],["SetAttackTime",4,4,[$t],[]],["GetReleaseTime",4,5,[],[$t,$t,$t]],["SetReleaseTime",4,6,[$t],[]],["GetHoldTime",4,7,[],[$t,$t,$t]],["SetHoldTime",4,8,[$t],[]],["SetMultiple",4,9,[Pn,Fn,$t,$t,$t],[]]],[["Law",[Fn],4,1,!1,!1,null],["AttackTime",[$t],4,2,!1,!1,null],["ReleaseTime",[$t],4,3,!1,!1,null],["HoldTime",[$t],4,4,!1,!1,null]],[]),qn=pe("OcaDynamicsCurve",4,"",2,nn,[["GetNSegments",4,1,[],[J,J,J]],["SetNSegments",4,2,[J],[]],["GetThreshold",4,3,[],[R(xn),$t,$t]],["SetThreshold",4,4,[R(xn)],[]],["GetSlope",4,5,[],[R($t),R($t),R($t)]],["SetSlope",4,6,[R($t)],[]],["GetKneeParameter",4,7,[],[R($t),R($t),R($t)]],["SetKneeParameter",4,8,[R($t)],[]],["GetDynamicGainCeiling",4,9,[],[$t,$t,$t]],["SetDynamicGainCeiling",4,10,[$t],[]],["GetDynamicGainFloor",4,11,[],[$t,$t,$t]],["SetDynamicGainFloor",4,12,[$t],[]],["SetMultiple",4,13,[Pn,J,R(xn),R($t),R($t),$t,$t],[]]],[["NSegments",[J],4,1,!1,!1,null],["Threshold",[R(xn)],4,2,!1,!1,null],["Slope",[R($t)],4,3,!1,!1,null],["KneeParameter",[R($t)],4,4,!1,!1,null],["DynamicGainFloor",[$t],4,5,!1,!1,null],["DynamicGainCeiling",[$t],4,6,!1,!1,null]],[]);class Hn extends(G({Linear:1,Logarithmic:2,None:0})){}const Wn=$(Hn);class Kn extends(G({None:0,DC:1,Sine:2,Square:3,Impulse:4,NoisePink:5,NoiseWhite:6,PolarityTest:7})){}const Xn=$(Kn),Yn=pe("OcaSignalGenerator",4,"",2,nn,[["GetFrequency1",4,1,[],[$t,$t,$t]],["SetFrequency1",4,2,[$t],[]],["GetFrequency2",4,3,[],[$t,$t,$t]],["SetFrequency2",4,4,[$t],[]],["GetLevel",4,5,[],[$t,$t,$t]],["SetLevel",4,6,[$t],[]],["GetWaveform",4,7,[],[Xn]],["SetWaveform",4,8,[Xn],[]],["GetSweepType",4,9,[],[Wn]],["SetSweepType",4,10,[Wn],[]],["GetSweepTime",4,11,[],[$t,$t,$t]],["SetSweepTime",4,12,[$t],[]],["GetSweepRepeat",4,13,[],[k]],["SetSweepRepeat",4,14,[k],[]],["GetGenerating",4,15,[],[k]],["Start",4,16,[],[]],["Stop",4,17,[],[]],["SetMultiple",4,18,[Pn,$t,$t,$t,Xn,Wn,$t,k],[]]],[["Frequency1",[$t],4,1,!1,!1,null],["Frequency2",[$t],4,2,!1,!1,null],["Level",[$t],4,3,!1,!1,null],["Waveform",[Xn],4,4,!1,!1,null],["SweepType",[Wn],4,5,!1,!1,null],["SweepTime",[$t],4,6,!1,!1,null],["SweepRepeat",[k],4,7,!1,!1,null],["Generating",[k],4,8,!1,!1,null]],[]),Qn=pe("OcaSignalInput",4,"",2,nn,[],[],[]),Jn=pe("OcaSignalOutput",4,"",2,nn,[],[],[]),Zn=pe("OcaTemperatureActuator",4,"",2,nn,[["GetTemperature",4,1,[],[$t,$t,$t]],["SetTemperature",4,2,[$t],[]]],[["Temperature",[$t],4,1,!1,!1,null]],[]),$n=pe("OcaIdentificationActuator",4,"",2,nn,[["GetActive",4,1,[],[k]],["SetActive",4,2,[k],[]]],[["Active",[k],4,1,!1,!1,null]],[]),er=pe("OcaSummingPoint",4,"",1,nn,[],[],[]),tr=pe("OcaBasicActuator",4,"",2,nn,[],[],[]),nr=pe("OcaBooleanActuator",5,"",2,tr,[["GetSetting",5,1,[],[k]],["SetSetting",5,2,[k],[]]],[["Setting",[k],5,1,!1,!1,null]],[]),rr=a({isConstantLength:!0,encodedLength:function(e){return 1},encodeTo:function(e,t,n){return e.setInt8(t,0|n),t+1},decode:function(e,t){return e.getInt8(t)}}),or=pe("OcaInt8Actuator",5,"",2,tr,[["GetSetting",5,1,[],[rr,rr,rr]],["SetSetting",5,2,[rr],[]]],[["Setting",[rr],5,1,!1,!1,null]],[]),sr=a({isConstantLength:!0,encodedLength:function(e){return 2},encodeTo:function(e,t,n){return e.setInt16(t,0|n,!1),t+2},decode:function(e,t){return e.getInt16(t,!1)}}),ir=pe("OcaInt16Actuator",5,"",2,tr,[["GetSetting",5,1,[],[sr,sr,sr]],["SetSetting",5,2,[sr],[]]],[["Setting",[sr],5,1,!1,!1,null]],[]),ar=a({isConstantLength:!0,encodedLength:function(e){return 4},encodeTo:function(e,t,n){return e.setInt32(t,0|n,!1),t+4},decode:function(e,t){return e.getInt32(t,!1)}}),cr=pe("OcaInt32Actuator",5,"",2,tr,[["GetSetting",5,1,[],[ar,ar,ar]],["SetSetting",5,2,[ar],[]]],[["Setting",[ar],5,1,!1,!1,null]],[]);function lr(){if(!ot)throw new Error("Missing BigInt support")}const ur=a({isConstantLength:!0,encodedLength:function(e){return 8},encodeTo:function(e,t,n){if(lr(),!(n>=at&&n<=it))throw new TypeError("Int64 out of range.");return e.setBigInt64(t,BigInt(n),!1),t+8},decode:function(e,t){lr();const n=e.getBigInt64(t,!1);return n>=Number.MIN_SAFE_INTEGER&&n<=Number.MAX_SAFE_INTEGER?Number(n):n}}),hr=pe("OcaInt64Actuator",5,"",2,tr,[["GetSetting",5,1,[],[ur,ur,ur]],["SetSetting",5,2,[ur],[]]],[["Setting",[ur],5,1,!1,!1,null]],[]),dr=pe("OcaUint8Actuator",5,"",2,tr,[["GetSetting",5,1,[],[J,J,J]],["SetSetting",5,2,[J],[]]],[["Setting",[J],5,1,!1,!1,null]],[]),gr=pe("OcaUint16Actuator",5,"",2,tr,[["GetSetting",5,1,[],[c,c,c]],["SetSetting",5,2,[c],[]]],[["Setting",[c],5,1,!1,!1,null]],[]),fr=pe("OcaUint32Actuator",5,"\b",2,tr,[["GetSetting",5,1,[],[d,d,d]],["SetSetting",5,2,[d],[]]],[["Setting",[d],5,1,!1,!1,null]],[]),pr=pe("OcaUint64Actuator",5,"\t",2,tr,[["GetSetting",5,1,[],[ut,ut,ut]],["SetSetting",5,2,[ut],[]]],[["Setting",[ut],5,1,!1,!1,null]],[]),Sr=pe("OcaFloat32Actuator",5,"\n",2,tr,[["GetSetting",5,1,[],[$t,$t,$t]],["SetSetting",5,2,[$t],[]]],[["Setting",[$t],5,1,!1,!1,null]],[]),mr=a({isConstantLength:!0,encodedLength:function(e){return 8},encodeTo:function(e,t,n){return e.setFloat64(t,+n,!1),t+8},decode:function(e,t){return e.getFloat64(t,!1)}}),yr=pe("OcaFloat64Actuator",5,"\v",2,tr,[["GetSetting",5,1,[],[mr,mr,mr]],["SetSetting",5,2,[mr],[]]],[["Setting",[mr],5,1,!1,!1,null]],[]),Or=pe("OcaStringActuator",5,"\f",2,tr,[["GetSetting",5,1,[],[z]],["SetSetting",5,2,[z],[]],["GetMaxLen",5,3,[],[c]]],[["Setting",[z],5,1,!1,!1,null],["MaxLen",[c],5,2,!0,!1,null]],[]);function br(e){return e+7>>3}function wr(e,t,n){const r=new Array(n),o=br(n),s=new Uint8Array(e.buffer,e.byteOffset+t,o);for(let e=0;e<n;e++)r[e]=!!(s[e>>3]&128>>(7&e));return r}const Cr=a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e))throw new TypeError("Expected Array.");const t=e.length;if(t>65535)throw new Error("Array too long for OcaBlob OCP.1 encoding.");return 2+(t+7>>3)},encodeTo:function(e,t,n){const r=n.length;return e.setUint16(t,r),function(e,t,n){const r=n.length,o=br(r),s=new Uint8Array(e.buffer,e.byteOffset+t,o);for(let e=0,t=0;t<o;t++){let o=0;for(let t=0;t<8&&e<r;t++,e++)n[e]&&(o|=128>>t);s[t]=o}return t+o}(e,t+=2,n)},decodeFrom:function(e,t){const n=e.getUint16(t);return[(t+=2)+br(n),wr(e,t,n)]},decodeLength:function(e,t){return t+2+br(e.getUint16(t))}}),_r=pe("OcaBitstringActuator",5,"\r",2,tr,[["GetNrBits",5,1,[],[c]],["GetBit",5,2,[c],[k]],["SetBit",5,3,[c,k],[]],["GetBitstring",5,4,[],[Cr]],["SetBitstring",5,5,[Cr],[]]],[["Bitstring",[Cr],5,1,!1,!1,null]],[]);class Pr extends(G({Unknown:0,Valid:1,Underrange:2,Overrange:3,Error:4})){}const Gr=$(Pr),vr=pe("OcaSensor",3,"",2,en,[["GetReadingState",3,1,[],[Gr]]],[["ReadingState",[Gr],3,1,!1,!1,null]],[]),Tr=pe("OcaLevelSensor",4,"",2,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]);class Dr extends(G({VU:1,StandardVU:2,PPM1:3,PPM2:4,LKFS:5,RMS:6,Peak:7,ProprietaryValueBase:128})){}const Ir=$(Dr),Mr=pe("OcaAudioLevelSensor",5,"",2,Tr,[["GetLaw",5,1,[],[Ir]],["SetLaw",5,2,[Ir],[]]],[["Law",[Ir],5,1,!1,!1,null]],[]),Lr=pe("OcaTimeIntervalSensor",4,"",2,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]),Ar=pe("OcaFrequencySensor",4,"",2,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]),Er=pe("OcaTemperatureSensor",4,"",2,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]),kr=pe("OcaIdentificationSensor",4,"",2,vr,[],[],[["Identify",4,1,[]]]),xr=pe("OcaVoltageSensor",4,"",1,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]),Ur=pe("OcaCurrentSensor",4,"\b",1,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]);class Nr{constructor(e,t){this.Magnitude=e,this.Phase=t}}const Rr=l({Magnitude:$t,Phase:$t},Nr),Fr=pe("OcaImpedanceSensor",4,"\t",1,vr,[["GetReading",4,1,[],[Rr,Rr,Rr]]],[["Reading",[Rr],4,1,!1,!1,null]],[]),Br=pe("OcaGainSensor",4,"\n",1,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]),jr=pe("OcaBasicSensor",4,"",2,vr,[],[],[]),Vr=pe("OcaBooleanSensor",5,"",2,jr,[["GetReading",5,1,[],[k]]],[["Reading",[k],5,1,!1,!1,null]],[]),zr=pe("OcaInt8Sensor",5,"",2,jr,[["GetReading",5,1,[],[rr,rr,rr]]],[["Reading",[rr],5,1,!1,!1,null]],[]),qr=pe("OcaInt16Sensor",5,"",2,jr,[["GetReading",5,1,[],[sr,sr,sr]]],[["Reading",[sr],5,1,!1,!1,null]],[]),Hr=pe("OcaInt32Sensor",5,"",2,jr,[["GetReading",5,1,[],[ar,ar,ar]]],[["Reading",[ar],5,1,!1,!1,null]],[]),Wr=pe("OcaInt64Sensor",5,"",2,jr,[["GetReading",5,1,[],[ur,ur,ur]]],[["Reading",[ur],5,1,!1,!1,null]],[]),Kr=pe("OcaUint8Sensor",5,"",2,jr,[["GetReading",5,1,[],[J,J,J]]],[["Reading",[J],5,1,!1,!1,null]],[]),Xr=pe("OcaUint16Sensor",5,"",2,jr,[["GetReading",5,1,[],[c,c,c]]],[["Reading",[c],5,1,!1,!1,null]],[]),Yr=pe("OcaUint32Sensor",5,"\b",2,jr,[["GetReading",5,1,[],[d,d,d]]],[["Reading",[d],5,1,!1,!1,null]],[]),Qr=pe("OcaFloat32Sensor",5,"\n",2,jr,[["GetReading",5,1,[],[$t,$t,$t]]],[["Reading",[$t],5,1,!1,!1,null]],[]),Jr=pe("OcaFloat64Sensor",5,"\v",2,jr,[["GetReading",5,1,[],[mr,mr,mr]]],[["Reading",[mr],5,1,!1,!1,null]],[]),Zr=pe("OcaStringSensor",5,"\f",2,jr,[["GetString",5,1,[],[z]],["GetMaxLen",5,2,[],[c]],["SetMaxLen",5,3,[c],[]]],[["String",[z],5,1,!1,!1,null],["MaxLen",[c],5,2,!1,!1,null]],[]),$r=pe("OcaBitstringSensor",5,"\r",2,jr,[["GetNrBits",5,1,[],[c]],["GetBit",5,2,[c],[J]],["GetBitString",5,3,[],[Cr]]],[["BitString",[Cr],5,1,!1,!1,null]],[]),eo=pe("OcaUint64Sensor",5,"\t",2,jr,[["GetReading",5,1,[],[ut,ut,ut]]],[["Reading",[ut],5,1,!1,!1,null]],[]);class to{constructor(e,t){this.POno=e,this.ClassIdentification=t}}const no=l({POno:d,ClassIdentification:me},to);class ro{constructor(e,t){this.Mode=e,this.Index=t}}const oo=l({Mode:qt,Index:c},ro);class so{constructor(e,t,n){this.Owner=e,this.ProtoID=t,this.Name=n}}const io=l({Owner:d,ProtoID:oo,Name:z},so);class ao{constructor(e,t){this.SourceProtoPort=e,this.SinkProtoPort=t}}const co=l({SourceProtoPort:io,SinkProtoPort:io},ao),lo=pe("OcaBlockFactory",3,"",2,en,[["DefineProtoPort",3,1,[z,qt],[oo]],["UndefineProtoPort",3,2,[oo],[]],["GetProtoPorts",3,3,[],[R(io)]],["DefineProtoMemberUsingFactory",3,5,[d],[d]],["UndefineProtoMember",3,6,[d],[]],["GetProtoMembers",3,7,[],[R(no)]],["DefineProtoSignalPath",3,8,[co],[c]],["UndefineProtoSignalPath",3,9,[],[c]],["GetProtoSignalPaths",3,10,[],[ft(c,co)]],["GetGlobalType",3,11,[],[Nt]],["SetGlobalType",3,12,[Nt],[]]],[["ProtoPorts",[R(io)],3,1,!1,!1,null],["ProtoMembers",[R(no)],3,2,!1,!1,null],["ProtoSignalPaths",[ft(c,co)],3,3,!1,!1,null],["GlobalType",[Nt],3,4,!1,!1,null]],[]);function uo(e){return e.isConstantLength?function(e){const t=e.encodedLength(void 0),n=e.encodeTo,r=e.decode;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!N(e))throw new TypeError("Expected array.");const n=e.length;if(0===n)return 4;if(!Array.isArray(e[0])&&!N(e[0]))throw new TypeError("Expected array.");const r=e[0].length;if(n>65535||r>65535)throw new Error("Array too long for OcaList2D OCP.1 encoding");return 4+n*r*t},encodeTo:function(e,t,r){const o=r.length,s=0===o?0:r[0].length;e.setUint16(t,o),t+=2,e.setUint16(t,s),t+=2;for(let i=0;i<o;i++){const o=r[i];for(let r=0;r<s;r++)t=n(e,t,o[r])}return t},decodeFrom:function(e,n){const o=e.getUint16(n);n+=2;const s=e.getUint16(n);n+=2;const i=new Array(o).fill().map(()=>new Array(s));for(let a=0;a<o;a++){const o=i[a];for(let i=0;i<s;i++)o[i]=r(e,n),n+=t}return[n,i]},decodeLength:function(e,n){const r=e.getUint16(n);n+=2;const o=e.getUint16(n);return(n+=2)+r*o*t}})}(e):function(e){const t=e.encodedLength,n=e.encodeTo,r=e.decodeFrom,o=e.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!N(e))throw new TypeError("Expected array.");const n=e.length;if(0===n)return 4;if(!Array.isArray(e[0])&&!N(e[0]))throw new TypeError("Expected array.");const r=e[0].length;if(n>65535||r>65535)throw new Error("Array too long for OcaList2D OCP.1 encoding");let o=4;for(let s=0;s<n;s++){const n=e[s];for(let e=0;e<r;e++)o+=t(n[e])}return o},encodeTo:function(e,t,r){const o=r.length,s=0===o?0:r[0].length;e.setUint16(t,o),t+=2,e.setUint16(t,s),t+=2;for(let i=0;i<o;i++){const o=r[i];for(let r=0;r<s;r++)t=n(e,t,o[r])}return t},decodeFrom:function(e,t){const n=e.getUint16(t);t+=2;const o=e.getUint16(t);t+=2;const s=new Array(n).fill().map(()=>new Array(o));for(let i=0;i<n;i++){const n=s[i];for(let s=0;s<o;s++){let o;[t,o]=r(e,t),n[s]=o}}return[t,s]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;const r=e.getUint16(t);t+=2;for(let s=0;s<n;s++)for(let n=0;n<r;n++)t=o(e,t);return t}})}(e)}const ho=pe("OcaMatrix",3,"",2,en,[["GetCurrentXY",3,1,[],[c,c]],["SetCurrentXY",3,2,[c,c],[]],["GetSize",3,3,[],[c,c,c,c,c,c]],["SetSize",3,4,[c,c],[]],["GetMembers",3,5,[],[uo(d)]],["SetMembers",3,6,[uo(d)],[]],["GetMember",3,7,[c,c],[d]],["SetMember",3,8,[c,c,d],[]],["GetProxy",3,9,[],[d]],["SetProxy",3,10,[d],[]],["GetPortsPerRow",3,11,[],[J]],["SetPortsPerRow",3,12,[J],[]],["GetPortsPerColumn",3,13,[],[J]],["SetPortsPerColumn",3,14,[J],[]],["SetCurrentXYLock",3,15,[c,c],[]],["UnlockCurrent",3,16,[],[]]],[["X",[c],3,1,!1,!1,null],["Y",[c],3,2,!1,!1,null],["xSize",[c],3,3,!1,!1,null],["ySize",[c],3,4,!1,!1,null],["Members",[uo(d)],3,5,!1,!1,null],["Proxy",[d],3,6,!1,!1,null],["PortsPerRow",[J],3,7,!1,!1,null],["PortsPerColumn",[J],3,8,!1,!1,null]],[]),go=pe("OcaAgent",2,"",2,_e,[["GetLabel",2,1,[],[z]],["SetLabel",2,2,[z],[]],["GetOwner",2,3,[],[d]],["GetPath",2,4,[],[R(z),R(d)]]],[["Label",[z],2,1,!1,!1,null],["Owner",[d],2,2,!1,!1,null]],[]);class fo{constructor(e,t){this.HostID=e,this.ONo=t}}const po=l({HostID:A,ONo:d},fo);class So{constructor(e,t,n){this.Index=e,this.ObjectPath=t,this.Online=n}}const mo=l({Index:c,ObjectPath:po,Online:k},So);class yo{constructor(e,t){this.GroupIndex=e,this.CitizenIndex=t}}const Oo=l({GroupIndex:c,CitizenIndex:c},yo);class bo{constructor(e,t,n){this.Index=e,this.Name=t,this.ProxyONo=n}}const wo=l({Index:c,Name:z,ProxyONo:d},bo);class Co extends(G({MasterSlave:1,PeerToPeer:2})){}const _o=$(Co);class Po extends(G({citizenAdded:1,citizenDeleted:2,citizenConnectionLost:3,citizenConnectionReEstablished:4,citizenError:5,enrollment:6,unEnrollment:7})){}const Go=$(Po);class vo{constructor(e,t,n){this.groupIndex=e,this.citizenIndex=t,this.changeType=n}}const To=l({groupIndex:c,citizenIndex:c,changeType:Go},vo),Do=pe("OcaGrouper",3,"",2,go,[["AddGroup",3,1,[z],[c,d]],["DeleteGroup",3,2,[c],[]],["GetGroupCount",3,3,[],[c]],["GetGroupList",3,4,[],[R(wo)]],["AddCitizen",3,5,[mo],[c]],["DeleteCitizen",3,6,[c],[]],["GetCitizenCount",3,7,[],[c]],["GetCitizenList",3,8,[],[R(mo)]],["GetEnrollment",3,9,[Oo],[k]],["SetEnrollment",3,10,[Oo,k],[]],["GetGroupMemberList",3,11,[c],[R(mo)]],["GetActuatorOrSensor",3,12,[],[k]],["SetActuatorOrSensor",3,13,[k],[]],["GetMode",3,14,[],[_o]],["SetMode",3,15,[_o],[]]],[["ActuatorOrSensor",[k],3,1,!1,!1,null],["Groups",[R(wo)],3,2,!1,!1,["GroupList"]],["Citizens",[R(mo)],3,3,!1,!1,["CitizenList"]],["Enrollments",[R(Oo)],3,4,!1,!1,["EnrollmentList"]],["Mode",[_o],3,5,!1,!1,null]],[["StatusChange",3,1,[To]]]);class Io extends(G({None:0,OcaBoolean:1,OcaInt8:2,OcaInt16:3,OcaInt32:4,OcaInt64:5,OcaUint8:6,OcaUint16:7,OcaUint32:8,OcaUint64:9,OcaFloat32:10,OcaFloat64:11,OcaString:12,OcaBitstring:13,OcaBlob:14,OcaBlobFixedLen:15,OcaBit:16})){}const Mo=$(Io);class Lo{constructor(e,t,n,r){this.PropertyID=e,this.BaseDataType=t,this.GetterMethodID=n,this.SetterMethodID=r}}const Ao=l({PropertyID:ye,BaseDataType:Mo,GetterMethodID:Ee,SetterMethodID:Ee},Lo);class Eo{constructor(e,t){this.ONo=e,this.Descriptor=t}}const ko=l({ONo:d,Descriptor:Ao},Eo);class xo extends(G({Enable:1,Start:2,Halt:3})){}const Uo=$(xo);class No extends(G({Linear:1,ReverseLinear:2,Sine:3,Exponential:4})){}const Ro=$(No);class Fo extends(G({NotInitialized:1,Iniitialized:2,Scheduled:3,Enabled:4,Ramping:5})){}const Bo=$(Fo),jo=pe("OcaRamper",3,"",2,go,[["Control",3,1,[Uo],[]],["GetState",3,2,[],[Bo]],["GetRampedProperty",3,3,[],[ko]],["SetRampedProperty",3,4,[ko],[]],["GetTimeMode",3,5,[],[St]],["SetTimeMode",3,6,[St],[]],["GetStartTime",3,7,[],[ut]],["SetStartTime",3,8,[ut],[]],["GetDuration",3,9,[],[$t,$t,$t]],["SetDuration",3,10,[$t],[]],["GetInterpolationLaw",3,11,[],[Ro]],["SetInterpolationLaw",3,12,[Ro],[]],["GetGoal",3,13,[],[mr]],["SetGoal",3,14,[mr],[]]],[["State",[Bo],3,1,!1,!1,null],["RampedProperty",[ko],3,2,!1,!1,null],["TimeMode",[St],3,3,!1,!1,null],["StartTime",[ut],3,4,!1,!1,null],["Duration",[$t],3,5,!1,!1,null],["InterpolationLaw",[Ro],3,6,!1,!1,null],["Goal",[mr],3,7,!1,!1,null]],[]);class Vo{constructor(e){this.Reading=e}}const zo=l({Reading:mr},Vo);class qo extends(G({NotTriggered:0,Triggered:1})){}const Ho=$(qo);class Wo extends(G({None:0,Equality:1,Inequality:2,GreaterThan:3,GreaterThanOrEqual:4,LessThan:5,LessThanOrEqual:6})){}const Ko=$(Wo),Xo=pe("OcaNumericObserver",3,"",2,go,[["GetLastObservation",3,1,[],[mr]],["GetState",3,2,[],[Ho]],["GetObservedProperty",3,3,[],[ko]],["SetObservedProperty",3,4,[ko],[]],["GetThreshold",3,5,[],[mr]],["SetThreshold",3,6,[mr],[]],["GetOperator",3,7,[],[Ko]],["SetOperator",3,8,[Ko],[]],["GetTwoWay",3,9,[],[k]],["SetTwoWay",3,10,[k],[]],["GetHysteresis",3,11,[],[mr]],["SetHysteresis",3,12,[mr],[]],["GetPeriod",3,13,[],[$t]],["SetPeriod",3,14,[$t],[]]],[["State",[Ho],3,1,!1,!1,null],["ObservedProperty",[ko],3,2,!1,!1,null],["Threshold",[mr],3,3,!1,!1,null],["Operator",[Ko],3,4,!1,!1,null],["TwoWay",[k],3,5,!1,!1,null],["Hysteresis",[mr],3,6,!1,!1,null],["Period",[$t],3,7,!1,!1,null]],[["Observation",3,1,[zo]]]);class Yo extends(G({None:0,ReadOnly:1,ReadExpand:2,Full:3})){}const Qo=$(Yo);class Jo{constructor(e,t,n,r,o,s){this.Name=e,this.VolType=t,this.Access=n,this.Version=r,this.Creator=o,this.UpDate=s}}const Zo=l({Name:z,VolType:$e,Access:Qo,Version:d,Creator:z,UpDate:dt},Jo);class $o{constructor(e,t){this.Metadata=e,this.Data=t}}const es=l({Metadata:Zo,Data:A},$o);class ts{constructor(e,t){this.VolumeID=e,this.ChangeType=t}}const ns=l({VolumeID:d,ChangeType:Oe},ts),rs=pe("OcaLibrary",3,"",2,go,[["AddVolume",3,1,[es],[d]],["ReplaceVolume",3,2,[d,es],[]],["DeleteVolume",3,3,[d],[]],["GetVolume",3,4,[d],[es]],["GetVolumeCount",3,5,[],[c]],["GetVolumes",3,6,[],[ft(d,es)]],["GetAccess",3,7,[],[Qo]],["SetAccess",3,8,[Qo],[]]],[["VolumeType",[$e],3,1,!1,!1,null],["Access",[Qo],3,2,!1,!1,null],["Volumes",[ft(d,es)],3,3,!1,!1,null]],[["OcaLibVolChanged",3,1,[ns]]]);class os extends(G({Unspecified:1,Internal:2,External:3})){}const ss=$(os);class is extends(G({Off:0,Unavailable:1,Available:2,Active:3})){}const as=$(is);class cs extends(G({None:0,Mains:1,Battery:2,Phantom:3,Solar:4})){}const ls=$(cs),us=pe("OcaPowerSupply",3,"",3,go,[["GetType",3,1,[],[ls]],["GetModelInfo",3,2,[],[z]],["GetState",3,3,[],[as]],["SetState",3,4,[as],[]],["GetCharging",3,5,[],[k]],["GetLoadFractionAvailable",3,6,[],[$t]],["GetStorageFractionAvailable",3,7,[],[$t]],["GetLocation",3,8,[],[ss]]],[["Type",[ls],3,1,!1,!1,null],["ModelInfo",[z],3,2,!1,!1,null],["State",[as],3,3,!1,!1,null],["Charging",[k],3,4,!1,!1,null],["LoadFractionAvailable",[$t],3,5,!1,!1,null],["StorageFractionAvailable",[$t],3,6,!1,!1,null],["Location",[ss],3,7,!0,!1,null]],[]),hs=pe("OcaEventHandler",3,"\b",2,go,[["OnEvent",3,1,[A,f],[]]],[],[]);class ds{constructor(e){this.Reading=e}}const gs=l({Reading:R(mr)},ds),fs=pe("OcaNumericObserverList",3,"\t",2,go,[["GetLastObservation",3,1,[],[R(mr)]],["GetState",3,2,[],[Ho]],["GetObservedProperties",3,3,[],[R(ko)]],["SetObservedProperties",3,4,[R(ko)],[]],["GetThreshold",3,5,[],[mr]],["SetThreshold",3,6,[mr],[]],["GetOperator",3,7,[],[Ko]],["SetOperator",3,8,[Ko],[]],["GetTwoWay",3,9,[],[k]],["SetTwoWay",3,10,[k],[]],["GetHysteresis",3,11,[],[mr]],["SetHysteresis",3,12,[mr],[]],["GetPeriod",3,13,[],[$t]],["SetPeriod",3,14,[$t],[]]],[["State",[Ho],3,1,!1,!1,null],["ObservedProperties",[R(ko)],3,2,!1,!1,null],["Threshold",[mr],3,3,!1,!1,null],["Operator",[Ko],3,4,!1,!1,null],["TwoWay",[k],3,5,!1,!1,null],["Hysteresis",[mr],3,6,!1,!1,null],["Period",[$t],3,7,!1,!1,null]],[["Observation",3,1,[gs]]]);class ps extends(G({Unavailable:0,Available:1})){}const Ss=$(ps);class ms{constructor(e,t,n,r){this.NominalRate=e,this.PullRange=t,this.Accuracy=n,this.JitterMax=r}}const ys=l({NominalRate:$t,PullRange:$t,Accuracy:$t,JitterMax:$t},ms),Os=pe("OcaMediaClock3",3,"",1,go,[["GetAvailability",3,1,[],[Ss]],["SetAvailability",3,2,[Ss],[]],["GetCurrentRate",3,3,[],[ys,d]],["SetCurrentRate",3,4,[ys,d],[]],["GetOffset",3,5,[],[dt]],["SetOffset",3,6,[dt],[]],["GetSupportedRates",3,7,[],[ft(d,R(ys))]]],[["Availability",[Ss],3,1,!1,!1,null],["TimeSourceONo",[d],3,2,!1,!1,null],["Offset",[dt],3,3,!1,!1,null],["CurrentRate",[ys],3,4,!1,!1,null],["SupportedRates",[ft(d,R(ys))],3,5,!1,!1,null]],[]);class bs extends(G({Undefined:0,None:1,Private:2,NTP:3,SNTP:4,IEEE1588_2002:5,IEEE1588_2008:6,IEEE_AVB:7,AES11:8,Genlock:9})){}const ws=$(bs);class Cs extends(G({Undefined:0,Local:1,Private:2,GPS:3,Galileo:4,GLONASS:5})){}const _s=$(Cs);class Ps extends(G({Unavailable:0,Available:1})){}const Gs=$(Ps);class vs extends(G({Undefined:0,Unsynchronized:1,Synchronizing:2,Synchronized:3})){}const Ts=$(vs),Ds=pe("OcaTimeSource",3,"",1,go,[["GetAvailability",3,1,[],[Gs]],["GetProtocol",3,2,[],[ws]],["SetProtocol",3,3,[ws],[]],["GetParameters",3,4,[],[z]],["SetParameters",3,5,[z],[]],["GetReferenceType",3,6,[],[_s]],["SetReferenceType",3,7,[_s],[]],["GetReferenceID",3,8,[],[z]],["SetReferenceID",3,9,[z],[]],["GetSyncStatus",3,10,[],[Ts]],["Reset",3,11,[],[]]],[["Availability",[Gs],3,1,!1,!1,null],["Protocol",[ws],3,2,!1,!1,null],["Parameters",[z],3,3,!1,!1,null],["ReferenceType",[_s],3,4,!1,!1,null],["ReferenceID",[z],3,5,!1,!1,null],["SyncStatus",[Ts],3,6,!1,!1,null]],[]);class Is extends(G({Robotic:1,ItuAudioObjectBasedPolar:2,ItuAudioObjectBasedCartesian:3,ItuAudioSceneBasedPolar:4,ItuAudioSceneBasedCartesian:5,NAV:6,ProprietaryBase:128})){}const Ms=$(Is);const Ls=x;class As{constructor(e,t,n){this.CoordinateSystem=e,this.FieldFlags=t,this.Values=n}}const Es=l({CoordinateSystem:Ms,FieldFlags:Ls,Values:(ks=$t,xs=6,be(...new Array(xs).fill(ks)))},As);var ks,xs;const Us=pe("OcaPhysicalPosition",3,"",1,go,[["GetCoordinateSystem",3,1,[],[Ms]],["GetPositionDescriptorFieldFlags",3,2,[],[Ls]],["GetPositionDescriptor",3,3,[],[Es,Es,Es]],["SetPositionDescriptor",3,4,[Es],[]]],[["CoordinateSystem",[Ms],3,1,!0,!1,null],["PositionDescriptorFieldFlags",[Ls],3,2,!0,!1,null],["PositionDescriptor",[Es],3,3,!1,!1,null]],[]);class Ns extends(G({None:0,Prepare:1,Start:2,Pause:3,Stop:4,Reset:5})){}const Rs=$(Ns);class Fs extends(G({Unknown:0,NotReady:1,Readying:2,Ready:3,Running:4,Paused:5,Stopping:6,Stopped:7,Fault:8})){}const Bs=$(Fs);class js{constructor(e,t){this.SystemInterfaceParameters=e,this.MyNetworkAddress=t}}const Vs=l({SystemInterfaceParameters:A,MyNetworkAddress:A},js),zs=pe("OcaApplicationNetwork",2,"",1,_e,[["GetLabel",2,1,[],[z]],["SetLabel",2,2,[z],[]],["GetOwner",2,3,[],[d]],["GetServiceID",2,4,[],[A]],["SetServiceID",2,5,[A],[]],["GetSystemInterfaces",2,6,[],[R(Vs)]],["SetSystemInterfaces",2,7,[R(Vs)],[]],["GetState",2,8,[],[Bs]],["GetErrorCode",2,9,[],[c]],["Control",2,10,[Rs],[]],["GetPath",2,11,[],[R(z),R(d)]]],[["Label",[z],2,1,!1,!0,null],["Owner",[d],2,2,!1,!0,null],["ServiceID",[A],2,3,!1,!1,null],["SystemInterfaces",[R(Vs)],2,4,!1,!1,null],["State",[Bs],2,5,!1,!1,null],["ErrorCode",[c],2,6,!1,!1,null]],[]);class qs extends(G({None:0,OCP01:1,OCP02:2,OCP03:3})){}const Hs=$(qs),Ws=pe("OcaControlNetwork",3,"",1,zs,[["GetControlProtocol",3,1,[],[Hs]]],[["Protocol",[Hs],3,1,!1,!1,["ControlProtocol"]]],[]);class Ks{constructor(e,t,n){this.CodingSchemeID=e,this.CodecParameters=t,this.ClockONo=n}}const Xs=l({CodingSchemeID:c,CodecParameters:z,ClockONo:d},Ks);class Ys extends(G({None:0,Unicast:1,Multicast:2})){}const Qs=$(Ys);class Js{constructor(e,t,n,r){this.Secure=e,this.StreamParameters=t,this.StreamCastMode=n,this.StreamChannelCount=r}}const Zs=l({Secure:k,StreamParameters:A,StreamCastMode:Qs,StreamChannelCount:c},Js);class $s extends(G({None:0,Start:1,Pause:2})){}const ei=$($s);class ti extends(G({Stopped:0,SettingUp:1,Running:2,Paused:3,Fault:4})){}const ni=$(ti);class ri{constructor(e,t,n){this.ConnectorID=e,this.State=t,this.ErrorCode=n}}const oi=l({ConnectorID:c,State:ni,ErrorCode:c},ri);class si{constructor(e){this.ConnectorStatus=e}}const ii=l({ConnectorStatus:oi},si);function ai(e,t){const n=e.encodedLength,r=e.encodeTo,o=e.decodeFrom,s=e.decodeLength,i=t.encodedLength,c=t.encodeTo,l=t.decodeFrom,u=t.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!(e instanceof Map||e instanceof WeakMap))throw new TypeError("Expected Map or WeakMap");let t=2;return e.forEach((e,r)=>{t+=n(r)*e.size,e.forEach(e=>{t+=i(e)})}),t},encodeTo:function(e,t,n){const o=t;let s=0;return t+=2,n.forEach((n,o)=>{s+=n.size,n.forEach(n=>{t=r(e,t,o),t=c(e,t,n)})}),e.setUint16(o,s),t},decodeFrom:function(e,t){const n=new Map,r=e.getUint16(t);t+=2;for(let s=0;s<r;s++){let r,s;[t,r]=o(e,t),[t,s]=l(e,t);let i=n.get(r);i||n.set(r,i=new Set),i.add(s)}return[t,n]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;for(let r=0;r<n;r++)t=s(e,t),t=u(e,t);return t}})}class ci{constructor(e,t,n,r,o,s,i,a,c){this.IDInternal=e,this.IDExternal=t,this.Connection=n,this.AvailableCodings=r,this.PinCount=o,this.ChannelPinMap=s,this.AlignmentLevel=i,this.AlignmentGain=a,this.CurrentCoding=c}}const li=l({IDInternal:c,IDExternal:z,Connection:Zs,AvailableCodings:R(Xs),PinCount:c,ChannelPinMap:ai(c,Wt),AlignmentLevel:$t,AlignmentGain:$t,CurrentCoding:Xs},ci),ui=x;class hi{constructor(e,t,n){this.SinkConnector=e,this.ChangeType=t,this.ChangedElement=n}}const di=l({SinkConnector:li,ChangeType:Oe,ChangedElement:ui},hi);class gi{constructor(e,t,n,r,o,s,i,a){this.IDInternal=e,this.IDExternal=t,this.Connection=n,this.AvailableCodings=r,this.PinCount=o,this.ChannelPinMap=s,this.AlignmentLevel=i,this.CurrentCoding=a}}const fi=l({IDInternal:c,IDExternal:z,Connection:Zs,AvailableCodings:R(Xs),PinCount:c,ChannelPinMap:ft(c,Wt),AlignmentLevel:$t,CurrentCoding:Xs},gi);class pi{constructor(e,t,n){this.SourceConnector=e,this.ChangeType=t,this.ChangedElement=n}}const Si=l({SourceConnector:fi,ChangeType:Oe,ChangedElement:ui},pi);class mi extends(G({None:0,AV3:1,AVBTP:2,Dante:3,Cobranet:4,AES67:5,SMPTEAudio:6,LiveWire:7,ExtensionPoint:65})){}const yi=$(mi),Oi=pe("OcaMediaTransportNetwork",3,"",1,zs,[["GetMediaProtocol",3,1,[],[yi]],["GetPorts",3,2,[],[R(Xt)]],["GetPortName",3,3,[Wt],[z]],["SetPortName",3,4,[Wt,z],[]],["GetMaxSourceConnectors",3,5,[],[c]],["GetMaxSinkConnectors",3,6,[],[c]],["GetMaxPinsPerConnector",3,7,[],[c]],["GetMaxPortsPerPin",3,8,[],[c]],["GetSourceConnectors",3,9,[],[R(fi)]],["GetSourceConnector",3,10,[c],[fi]],["GetSinkConnectors",3,11,[],[R(li)]],["GetSinkConnector",3,12,[c],[li]],["GetConnectorsStatuses",3,13,[],[R(oi)]],["GetConnectorStatus",3,14,[c],[oi]],["AddSourceConnector",3,15,[fi,ni],[fi]],["AddSinkConnector",3,16,[oi,li],[li]],["ControlConnector",3,17,[c,ei],[]],["SetSourceConnectorPinMap",3,18,[c,ft(c,Wt)],[]],["SetSinkConnectorPinMap",3,19,[c,ai(c,Wt)],[]],["SetConnectorConnection",3,20,[c,Zs],[]],["SetConnectorCoding",3,21,[c,Xs],[]],["SetConnectorAlignmentLevel",3,22,[c,$t],[]],["SetConnectorAlignmentGain",3,23,[c,$t],[]],["DeleteConnector",3,24,[c],[]],["GetAlignmentLevel",3,25,[],[$t,$t,$t]],["GetAlignmentGain",3,26,[],[$t,$t,$t]]],[["Protocol",[yi],3,1,!1,!1,["MediaProtocol"]],["Ports",[R(Xt)],3,2,!1,!1,null],["MaxSourceConnectors",[c],3,3,!1,!1,null],["MaxSinkConnectors",[c],3,4,!1,!1,null],["MaxPinsPerConnector",[c],3,5,!1,!1,null],["MaxPortsPerPin",[c],3,6,!1,!1,null],["AlignmentLevel",[$t],3,7,!1,!1,null],["AlignmentGain",[$t],3,8,!1,!1,null]],[["SourceConnectorChanged",3,1,[Si]],["SinkConnectorChanged",3,2,[di]],["ConnectorStatusChanged",3,3,[ii]]]);class bi extends(G({None:0,Source:1,Sink:2})){}const wi=$(bi);class Ci extends(G({NotConnected:0,Connected:1,Muted:2})){}const _i=$(Ci),Pi=pe("OcaNetworkSignalChannel",3,"",2,en,[["AddToConnector",3,6,[d,c],[]],["GetConnectorPins",3,5,[],[ft(d,c)]],["GetIDAdvertised",3,1,[],[A]],["GetNetwork",3,3,[],[d]],["GetRemoteChannelID",3,8,[],[A]],["GetSourceOrSink",3,10,[],[wi]],["GetStatus",3,11,[],[_i]],["RemoveFromConnector",3,7,[d],[]],["SetIDAdvertised",3,2,[A],[]],["SetNetwork",3,4,[d],[]],["SetRemoteChannelID",3,9,[A],[]]],[["ConnectorPins",[ft(d,c)],3,3,!1,!1,null],["IDAdvertised",[A],3,1,!1,!1,null],["Network",[d],3,2,!1,!1,null],["RemoteChannelID",[A],3,4,!1,!1,null],["SourceOrSink",[wi],3,5,!1,!1,null],["Status",[_i],3,6,!1,!1,null]],[]);class Gi extends(G({None:0,EthernetWired:1,EthernetWireless:2,USB:3,SerialP2P:4})){}const vi=$(Gi);class Ti{constructor(e,t){this.rxPacketErrors=e,this.txPacketErrors=t}}const Di=l({rxPacketErrors:d,txPacketErrors:d},Ti);class Ii extends(G({Unknown:0,Ready:1,StartingUp:2,Stopped:3})){}const Mi=$(Ii);class Li{constructor(e,t){this.SystemInterfaceHandle=e,this.MyNetworkAddress=t}}const Ai=l({SystemInterfaceHandle:A,MyNetworkAddress:A},Li),Ei=pe("OcaNetwork",3,"",2,go,[["GetLinkType",3,1,[],[vi]],["GetIDAdvertised",3,2,[],[A]],["SetIDAdvertised",3,3,[A],[]],["GetControlProtocol",3,4,[],[Hs]],["GetMediaProtocol",3,5,[],[yi]],["GetStatus",3,6,[],[Mi]],["GetStatistics",3,7,[],[Di]],["ResetStatistics",3,8,[],[]],["GetSystemInterfaces",3,9,[],[R(Ai)]],["SetSystemInterfaces",3,10,[R(Ai)],[]],["GetMediaPorts",3,11,[],[R(d)]],["Startup",3,12,[],[]],["Shutdown",3,13,[],[]]],[["LinkType",[vi],3,1,!0,!1,null],["IDAdvertised",[A],3,2,!1,!1,null],["ControlProtocol",[Hs],3,3,!1,!1,null],["MediaProtocol",[yi],3,4,!1,!1,null],["Status",[Mi],3,5,!1,!1,null],["SystemInterfaces",[R(Ai)],3,6,!1,!1,null],["MediaPorts",[R(d)],3,7,!1,!1,null],["Statistics",[Di],3,8,!1,!1,null]],[]);class ki extends(G({Undefined:0,Locked:1,Synchronizing:2,FreeRun:3,Stopped:4})){}const xi=$(ki),Ui=pe("OcaMediaClock",3,"",2,go,[["GetType",3,1,[],[Xe]],["SetType",3,2,[Xe],[]],["GetDomainID",3,3,[],[c]],["SetDomainID",3,4,[c],[]],["GetSupportedRates",3,5,[],[R(ys)]],["GetCurrentRate",3,6,[],[ys]],["SetCurrentRate",3,7,[ys],[]],["GetLockState",3,8,[],[xi]]],[["Type",[Xe],3,1,!1,!1,null],["DomainID",[c],3,2,!1,!1,null],["RatesSupported",[R(ys)],3,3,!1,!1,null],["CurrentRate",[ys],3,4,!1,!1,null],["LockState",[xi],3,5,!1,!1,null]],[]),Ni=pe("OcaStreamNetwork",3,"\n",2,go,[["GetLinkType",3,1,[],[vi]],["GetIDAdvertised",3,2,[],[A]],["SetIDAdvertised",3,3,[A],[]],["GetControlProtocol",3,4,[],[Hs]],["GetMediaProtocol",3,5,[],[yi]],["GetStatus",3,6,[],[Mi]],["GetStatistics",3,7,[],[Di]],["ResetStatistics",3,8,[],[]],["GetSystemInterfaces",3,9,[],[R(Ai)]],["SetSystemInterfaces",3,10,[R(Ai)],[]],["GetStreamConnectorsSource",3,11,[],[R(d)]],["SetStreamConnectorsSource",3,12,[R(d)],[]],["GetStreamConnectorsSink",3,13,[],[R(d)]],["SetStreamConnectorsSink",3,14,[R(d)],[]],["GetSignalChannelsSource",3,15,[],[R(d)]],["SetSignalChannelsSource",3,16,[R(d)],[]],["GetSignalChannelsSink",3,17,[],[R(d)]],["SetSignalChannelsSink",3,18,[R(d)],[]],["Startup",3,19,[],[]],["Shutdown",3,20,[],[]]],[["ControlProtocol",[Hs],3,3,!1,!1,null],["IDAdvertised",[A],3,2,!1,!1,null],["LinkType",[vi],3,1,!0,!1,null],["MediaProtocol",[yi],3,4,!1,!1,null],["SignalChannelsSink",[R(d)],3,10,!1,!1,null],["SignalChannelsSource",[R(d)],3,9,!1,!1,null],["Statistics",[Di],3,11,!1,!1,null],["Status",[Mi],3,5,!1,!1,null],["StreamConnectorsSink",[R(d)],3,8,!1,!1,null],["StreamConnectorsSource",[R(d)],3,7,!1,!1,null],["SystemInterfaces",[R(Ai)],3,6,!1,!1,null]],[]);class Ri{constructor(e,t,n,r){this.HostID=e,this.NetworkAddress=t,this.NodeID=n,this.StreamConnectorID=r}}const Fi=l({HostID:A,NetworkAddress:A,NodeID:A,StreamConnectorID:A},Ri);class Bi extends(G({NotConnected:0,Connected:1,Paused:2})){}const ji=$(Bi);class Vi extends(G({None:0,Unicast:1,Multicast:2})){}const zi=$(Vi);class qi{constructor(e,t,n,r,o,s,i,a,c,l,u){this.ErrorNumber=e,this.IDAdvertised=t,this.Index=n,this.Label=r,this.LocalConnectorONo=o,this.Priority=s,this.RemoteConnectorIdentification=i,this.Secure=a,this.Status=c,this.StreamParameters=l,this.StreamType=u}}const Hi=l({ErrorNumber:c,IDAdvertised:A,Index:c,Label:z,LocalConnectorONo:d,Priority:c,RemoteConnectorIdentification:Fi,Secure:k,Status:ji,StreamParameters:A,StreamType:zi},qi);class Wi extends(G({NotAvailable:0,Idle:1,Connected:2,Paused:3})){}const Ki=$(Wi),Xi=pe("OcaStreamConnector",3,"\v",2,go,[["ConnectStream",3,7,[Hi],[c]],["DisconnectStream",3,8,[c],[]],["GetIDAdvertised",3,3,[],[A]],["GetOwnerNetwork",3,1,[],[d]],["GetPins",3,10,[],[ft(c,d)]],["GetSourceOrSink",3,5,[],[wi]],["GetStatus",3,11,[],[Ki]],["GetStreams",3,9,[],[ft(c,Hi)]],["SetIDAdvertised",3,4,[A],[]],["SetOwnerNetwork",3,2,[d],[]],["SetSourceOrSink",3,6,[wi],[]]],[["IDAdvertised",[A],3,2,!1,!1,null],["OwnerNetwork",[d],3,1,!1,!1,null],["Pins",[ft(c,d)],3,5,!1,!1,null],["SourceOrSink",[wi],3,3,!1,!1,null],["Status",[Ki],3,6,!1,!1,null],["Streams",[ft(c,Hi)],3,4,!1,!1,null]],[]);var Yi=Object.freeze({__proto__:null,OcaRoot:_e,OcaWorker:en,OcaActuator:nn,OcaMute:sn,OcaPolarity:ln,OcaSwitch:un,OcaGain:hn,OcaPanBalance:dn,OcaDelay:gn,OcaDelayExtended:yn,OcaFrequencyActuator:On,OcaFilterClassical:Gn,OcaFilterParametric:Dn,OcaFilterPolynomial:In,OcaFilterFIR:Mn,OcaFilterArbitraryCurve:En,OcaDynamics:Vn,OcaDynamicsDetector:zn,OcaDynamicsCurve:qn,OcaSignalGenerator:Yn,OcaSignalInput:Qn,OcaSignalOutput:Jn,OcaTemperatureActuator:Zn,OcaIdentificationActuator:$n,OcaSummingPoint:er,OcaBasicActuator:tr,OcaBooleanActuator:nr,OcaInt8Actuator:or,OcaInt16Actuator:ir,OcaInt32Actuator:cr,OcaInt64Actuator:hr,OcaUint8Actuator:dr,OcaUint16Actuator:gr,OcaUint32Actuator:fr,OcaUint64Actuator:pr,OcaFloat32Actuator:Sr,OcaFloat64Actuator:yr,OcaStringActuator:Or,OcaBitstringActuator:_r,OcaSensor:vr,OcaLevelSensor:Tr,OcaAudioLevelSensor:Mr,OcaTimeIntervalSensor:Lr,OcaFrequencySensor:Ar,OcaTemperatureSensor:Er,OcaIdentificationSensor:kr,OcaVoltageSensor:xr,OcaCurrentSensor:Ur,OcaImpedanceSensor:Fr,OcaGainSensor:Br,OcaBasicSensor:jr,OcaBooleanSensor:Vr,OcaInt8Sensor:zr,OcaInt16Sensor:qr,OcaInt32Sensor:Hr,OcaInt64Sensor:Wr,OcaUint8Sensor:Kr,OcaUint16Sensor:Xr,OcaUint32Sensor:Yr,OcaFloat32Sensor:Qr,OcaFloat64Sensor:Jr,OcaStringSensor:Zr,OcaBitstringSensor:$r,OcaUint64Sensor:eo,OcaBlock:tn,OcaBlockFactory:lo,OcaMatrix:ho,OcaAgent:go,OcaGrouper:Do,OcaRamper:jo,OcaNumericObserver:Xo,OcaLibrary:rs,OcaPowerSupply:us,OcaEventHandler:hs,OcaNumericObserverList:fs,OcaMediaClock3:Os,OcaTimeSource:Ds,OcaPhysicalPosition:Us,OcaApplicationNetwork:zs,OcaControlNetwork:Ws,OcaMediaTransportNetwork:Oi,OcaManager:Pe,OcaDeviceManager:Ge,OcaSecurityManager:ve,OcaFirmwareManager:Le,OcaSubscriptionManager:Ve,OcaPowerManager:He,OcaNetworkManager:We,OcaMediaClockManager:Ye,OcaLibraryManager:nt,OcaAudioProcessingManager:rt,OcaDeviceTimeManager:gt,OcaTaskManager:It,OcaCodingManager:Mt,OcaDiagnosticManager:Lt,OcaNetworkSignalChannel:Pi,OcaNetwork:Ei,OcaMediaClock:Ui,OcaStreamNetwork:Ni,OcaStreamConnector:Xi});const Qi={DeviceManager:1,SecurityManager:2,FirmwareManager:3,SubscriptionManager:4,PowerManager:5,NetworkManager:6,MediaClockManager:7,LibraryManager:8,AudioProcessingManager:9,DeviceTimeManager:10,TaskManager:11,CodingManager:12,DiagnosticManager:13};function Ji(e){const t=e.EmitterONo,n=e.EventID;return[t,n.DefLevel,n.EventIndex].join(",")}const Zi={ONo:1055,MethodID:{DefLevel:1,MethodIndex:1}};const $i=Object.values(Yi);function ea(e){return new Promise(t=>setTimeout(t,e))}class ta extends(G({None:0,ParamSet:1,Patch:2,Program:3})){}class na extends(G({Ampere:4,DegreeCelsius:2,Hertz:1,None:0,Ohm:5,Volt:3})){}var ra=Object.freeze({__proto__:null,OcaApplicationNetworkCommand:Ns,OcaApplicationNetworkState:Fs,OcaBaseDataType:Io,OcaBlockMember:kt,OcaClassAuthorityID:class{constructor(e,t,n){this.Sentinel=e,this.Reserved=t,this.OrganizationID=n}},OcaClassIdentification:Se,OcaClassicalFilterShape:bn,OcaComponent:Te,OcaDBr:kn,OcaDelayUnit:fn,OcaDelayValue:Sn,OcaDeviceState:{Operational:1,Disabled:2,Error:4,Initializing:8,Updating:16},OcaDynamicsFunction:Un,OcaEnumItem:class{constructor(e){this.Value=e}},OcaEnumItem16:class{constructor(e){this.Value=e}},OcaEvent:g,OcaEventID:u,OcaFilterPassband:Cn,OcaGlobalTypeIdentifier:Ut,OcaGrouperCitizen:So,OcaGrouperEnrollment:yo,OcaGrouperGroup:bo,OcaGrouperMode:Co,OcaGrouperStatusChangeEventData:vo,OcaGrouperStatusChangeType:Po,OcaImpedance:Nr,OcaLevelDetectionLaw:Rn,OcaLevelMeterLaw:Dr,OcaLibAccess:Yo,OcaLibParamSetAssignment:class{constructor(e,t){this.ParamSetIdentifier=e,this.TargetBlockONo=t}},OcaLibVol:$o,OcaLibVolChangedEventData:ts,OcaLibVolData_ParamSet:Rt,OcaLibVolIdentifier:Qe,OcaLibVolMetadata:Jo,OcaLibVolStandardTypeID:ta,OcaLibVolType:Ze,OcaLibraryIdentifier:et,OcaManagerDefaultObjectNumbers:Qi,OcaManagerDescriptor:H,OcaMediaClockAvailability:ps,OcaMediaClockLockState:ki,OcaMediaClockRate:ms,OcaMediaClockType:Ke,OcaMediaCoding:Ks,OcaMediaConnection:Js,OcaMediaConnectorCommand:$s,OcaMediaConnectorElement:{PinMap:1,Connection:2,Coding:4,AlignmentLevel:8,AlignmentGain:16},OcaMediaConnectorState:ti,OcaMediaConnectorStatus:ri,OcaMediaConnectorStatusChangedEventData:si,OcaMediaSinkConnector:ci,OcaMediaSinkConnectorChangedEventData:hi,OcaMediaSourceConnector:gi,OcaMediaSourceConnectorChangedEventData:pi,OcaMediaStreamCastMode:Ys,OcaMethod:ke,OcaMethodID:Ae,OcaModelDescription:K,OcaModelGUID:Y,OcaMuteState:rn,OcaNetworkControlProtocol:qs,OcaNetworkLinkType:Gi,OcaNetworkMediaProtocol:mi,OcaNetworkMediaSourceOrSink:bi,OcaNetworkSignalChannelStatus:Ci,OcaNetworkStatistics:Ti,OcaNetworkStatus:Ii,OcaNetworkSystemInterfaceDescriptor:js,OcaNetworkSystemInterfaceID:Li,OcaNotificationDeliveryMode:Ue,OcaOPath:fo,OcaObjectIdentification:At,OcaObjectListEventData:Re,OcaObjectSearchResult:Bt,OcaObjectSearchResultFlags:{ONo:1,ClassIdentification:2,ContainerPath:4,Role:8,Label:16},OcaObservationEventData:Vo,OcaObservationListEventData:ds,OcaObserverState:qo,OcaParametricEQShape:vn,OcaPilotToneDetectorSpec:class{constructor(e,t,n){this.Threshold=e,this.Frequency=t,this.PollInterval=n}},OcaPolarityState:an,OcaPort:Kt,OcaPortID:Ht,OcaPortMode:zt,OcaPositionCoordinateSystem:Is,OcaPositionDescriptor:As,OcaPowerState:ze,OcaPowerSupplyLocation:os,OcaPowerSupplyState:is,OcaPowerSupplyType:cs,OcaPresentationUnit:Bn,OcaProperty:Eo,OcaPropertyChangeType:ie,OcaPropertyDescriptor:Lo,OcaPropertyID:ce,OcaProtoObjectIdentification:to,OcaProtoPort:so,OcaProtoPortID:ro,OcaProtoSignalPath:ao,OcaRamperCommand:xo,OcaRamperInterpolationLaw:No,OcaRamperState:Fo,OcaRelationalOperator:Wo,OcaResetCause:ee,OcaSensorReadingState:Pr,OcaSignalPath:Yt,OcaStatus:v,OcaStream:qi,OcaStreamConnectorIdentification:Ri,OcaStreamConnectorStatus:Wi,OcaStreamStatus:Bi,OcaStreamType:Vi,OcaStringComparisonType:Jt,OcaSubscriptionManagerState:Be,OcaSweepType:Hn,OcaTask:mt,OcaTaskCommand:Ot,OcaTaskManagerState:wt,OcaTaskState:_t,OcaTaskStateChangedEventData:Tt,OcaTaskStatus:Gt,OcaTimeMode:pt,OcaTimePTP:ht,OcaTimeProtocol:bs,OcaTimeReferenceType:Cs,OcaTimeSourceAvailability:Ps,OcaTimeSourceSyncStatus:vs,OcaTransferFunction:Ln,OcaUnitOfMeasure:na,OcaVersion:Ie,OcaWaveformType:Kn});class oa extends L{constructor(e,t){super(t),this.ws=e,this._onmessage=e=>{try{this.read(e.data)}catch(e){this.emit("error",e)}},this._onclose=()=>{this.emit("close")},this._onerror=e=>{this.emit("error",e)},e.binaryType="arraybuffer",e.addEventListener("message",this._onmessage),e.addEventListener("close",this._onclose),e.addEventListener("error",this._onerror)}write(e){this.ws.send(e),super.write(e)}static connect(e,t){return new Promise((n,r)=>{const o=new e(t.url),s=function(e){r(e)};o.addEventListener("open",()=>{o.removeEventListener("error",s),n(new this(o,t))}),o.addEventListener("error",s)})}cleanup(){super.cleanup();const e=this.ws;if(e){this.ws=null;try{e.removeEventListener("message",this._onmessage),e.removeEventListener("close",this._onclose),e.removeEventListener("error",this._onerror),e.close()}catch(e){}}}}var sa=Object.freeze({__proto__:null,warn:e,log:function(...e){try{console.log(...e)}catch(e){}},error:t,Connection:_,Command:s,CommandRrq:i,Response:S,Notification:p,KeepAlive:m,messageHeaderSize:10,encodeMessageTo:b,encodeMessage:w,decodeMessage:O,ClientConnection:L,RemoteDevice:class extends n{constructor(e,...t){super(),this.objects=new Map,this.connection=e,e.on("error",e=>{this.emit("error",e)}),e.on("close",e=>{this.emit("close",e)}),this.modules=[],this.add_control_classes(Object.values(Yi)),t.map(e=>this.add_control_classes(e)),this.DeviceManager=new Ge(Qi.DeviceManager,this),this.SecurityManager=new ve(Qi.SecurityManager,this),this.FirmwareManager=new Le(Qi.FirmwareManager,this),this.SubscriptionManager=new Ve(Qi.SubscriptionManager,this),this.PowerManager=new He(Qi.PowerManager,this),this.NetworkManager=new We(Qi.NetworkManager,this),this.MediaClockManager=new Ye(Qi.MediaClockManager,this),this.LibraryManager=new nt(Qi.LibraryManager,this),this.AudioProcessingManager=new rt(Qi.AudioProcessingManager,this),this.DeviceTimeManager=new gt(Qi.DeviceTimeManager,this),this.TaskManager=new It(Qi.TaskManager,this),this.CodingManager=new Mt(Qi.CodingManager,this),this.DiagnosticManager=new Lt(Qi.DiagnosticManager,this),this.Root=new tn(100,this),this.subscriptions=new Map}close(){this.connection.close()}send_command(e,t,n){return this.connection.send_command(e,t,n)}_doSubscribe(e){return this.SubscriptionManager.AddSubscription(e,Zi,new Uint8Array(0),Ue.Reliable,new Uint8Array(0))}async add_subscription(n,r){if(this.connection.is_closed())throw new Error("Connection was closed.");const o=Ji(n),s=this.subscriptions;{const e=s.get(o);if(e)return e.callbacks.add(r),!0}const i=n=>{const r=this.subscriptions.get(o);if(!r)return void e("Subscription lost.");r.callbacks.forEach((function(e){try{e(n)}catch(e){t(e)}}))};this.connection._addSubscriber(n,i);const a={callbacks:new Set([r]),callback:i};s.set(o,a);try{await this._doSubscribe(n)}catch(e){throw s.delete(o),e}}remove_subscription(e,t){const n=Ji(e),r=this.subscriptions.get(n);if(!r)return Promise.reject("Callback not registered.");const o=r.callbacks;return o.delete(t),o.size?Promise.resolve(!0):(this.connection._removeSubscriber(e),this.subscriptions.delete(n),this.SubscriptionManager.RemoveSubscription(e,Zi))}find_best_class(e){for("object"==typeof e&&e.ClassID&&(e=e.ClassID);e.length;){const t=this.find_class_by_id(e);if(t)return t;e=e.substr(0,e.length-1)}return null}add_control_classes(e){if(Array.isArray(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[r.ClassID]=r}e=t}else if("object"!=typeof e)throw new Error("Unsupported module.");this.modules.push(e)}find_class_by_id(e){"object"==typeof e&&e.ClassID&&(e=e.ClassID);const t=this.modules;for(let n=t.length-1;n>=0;n--){const r=t[n][e];if(r)return r}return null}allocate(e,t){"object"==typeof t&&(t=t.valueOf());const n=this.objects;return n.has(t)||n.set(t,new e(t,this)),n.get(t)}resolve_object(e){if("MemberObjectIdentification"in e)return this.resolve_object(e.MemberObjectIdentification);if("ONo"in e&&"ClassIdentification"in e){const t=e.ONo,n=e.ClassIdentification;return this.allocate(this.find_best_class(n),t)}throw new TypeError("Expected OcaObjectIdentification or OcaBlockMember")}GetDeviceTree(){const e=t=>t.GetMembers().then(t=>{const n=[];t=t.map(this.resolve_object,this);for(let r=0;r<t.length;r++)n.push(Promise.resolve(t[r])),t[r].ClassID.startsWith(tn.ClassID)&&n.push(e(t[r]));return Promise.all(n)});return e(this.Root)}get_device_tree(){return this.GetDeviceTree()}get_role_map(e){return this.get_device_tree().then((function(t){return function(e,t){const n=new Map;t||(t="/");const r=[],o=e=>{Array.isArray(e)?e.forEach(o):r.push(e.GetRole().then(t=>{n.set(e,t)}))};return e.forEach(o),Promise.all(r).then((function(){const r=new Map,o=(e,s)=>{const i=null!=s?s+t:"",a=new Map;e.forEach((function(e,t){if(Array.isArray(e))return;const r=n.get(e);if(a.has(r)){const t=a.get(r);Array.isArray(t)?t.push(e):a.set(r,[t,e])}else a.set(r,e)})),a.forEach((function(e,t){if(Array.isArray(e)){let n=1;for(let r=0;r<e.length;r++){let o;for(;a.has(o=t+n);)n++;a.set(o,e[r]),a.set(e[r],o)}a.delete(t)}else a.set(e,t)})),e.forEach((t,n)=>{if(Array.isArray(t))o(t,i+a.get(e[n-1]));else{const e=i+a.get(t);r.set(e,t)}})};return o(e,null),r}))}(t,e)}))}discover_all_fallback(){return this.GetDeviceTree().then(e=>{const t=[],n=function(e){for(let r=0;r<e.length;r++)Array.isArray(e[r])?n(e[r]):t.push(e[r])};return n(e),t})}discover_all(){return this.Root.GetMembersRecursive().then(e=>e.map(this.resolve_object,this)).catch(()=>this.discover_all_fallback())}set_keepalive_interval(e){this.connection.set_keepalive_interval(e)}},define_custom_class:function(e,t,n,r,o,s,i,a){if(n=String.fromCharCode.apply(String,n.split(".").map(e=>parseInt(e))),o){if("string"==typeof o)for(let e=0;e<$i.length;e++)if($i[e].ClassName===o){o=$i[e];break}}else{const e=n.substr(0,n.length-1);for(let t=0;t<$i.length;t++)if($i[t].ClassID===e){o=$i[t];break}}if("function"!=typeof o)throw new Error("Unknown parent class.");return pe(e,t,n,r,o,s,i,a)},AbstractUDPConnection:class extends L{constructor(e,t){t.batch>=0||(t.batch=128),super(t),this.socket=e,this.delay=t.delay>=0?t.delay:5,this.retry_interval=t.retry_interval>=0?t.retry_interval:250,this.retry_count=t.retry_count>=0?t.retry_count:3,this._write_out_id=-1,this._write_out_callback=()=>{this._write_out_id=-1,this._write_out()},this._retry_id=this.retry_interval>0?setInterval(()=>this._retryCommands(),this.retry_interval):-1,this.q=[],e.onmessage=e=>{try{this.read(e)}catch(e){console.warn("Failed to parse incoming AES70 packet: %o",e)}null!==this.inbuf&&this.close()},e.onerror=e=>this.error(e),this.set_keepalive_interval(1)}get is_reliable(){return!1}static async connect(e,t){const n=await e.connect(t.host,t.port,t.type);return await async function(e,t){const n=e.receiveMessage().then(e=>{const t=[],n=O(new DataView(e),0,t);if(1!==t.length)throw new Error("Expected keepalive response.");if(n!==e.byteLength)throw new Error("Trailing data in initial keepalive pdu.");return!0}),r=w(new m(1e3)),o=5*(t.retry_interval||250);for(let t=0;t<3;t++)if(e.send(r),await Promise.race([n,ea(o)]))return;throw new Error("Failed to connect.")}(n,t),new this(n,t)}write(e){this.q.push(e),this.tx_idle_time()>=this.delay?this._write_out():this._schedule_write_out()}flush(){super.flush(),this.tx_idle_time()>this.delay&&this._write_out()}cleanup(){super.cleanup(),this.socket&&(this.socket.close(),this.socket=null),-1!==this._write_out_id&&(clearTimeout(this._write_out_id),this._write_out_id=-1),-1!==this._retry_id&&(clearInterval(this._retry_id),this._retry_id=-1)}_estimate_next_tx_time(){return this._now()+(this.delay+2)*this.q.length}_write_out(){if(!this.socket)return;const e=this.q;if(!e.length)return;const t=e.shift();this.socket.send(t),super.write(t),e.length&&this._schedule_write_out()}_schedule_write_out(){const e=this.tx_idle_time(),t=this.delay;e>=t?this._write_out():-1===this._write_out_id&&(this._write_out_id=setTimeout(this._write_out_callback,t-e))}_retryCommands(){const e=this._now(),t=e-this.retry_interval,n=this.retry_interval/this.delay*5-this.q.length,r=this._pendingCommands,o=[],s=[];for(const e of r){const[,r]=e;if(r.lastSent>t)break;r.retries>=this.retry_count?s.push(e):o.length<n&&o.push(e)}if(s.length){const e=new Error("Timeout.");s.forEach(([t,n])=>{r.delete(t),n.reject(e)})}o.forEach(([t,n])=>{r.delete(t),r.set(t,n),this.send(n.command),n.lastSent=e,n.retries++})}},RemoteControlClasses:Yi,Types:ra,WebSocketConnection:class extends oa{static connect(e){return super.connect(WebSocket,e)}_now(){return performance.now()}}});window.OCA=sa}();
1
+ !function(){"use strict";function e(...e){try{console.warn(...e)}catch(e){}}function t(...e){try{console.error(...e)}catch(e){}}class n{constructor(){this.event_handlers=new Map}emit(e){const t=this.event_handlers.get(e),n=Array.prototype.slice.call(arguments,1);t&&t.forEach(e=>{try{e.apply(this,n)}catch(t){console.warn("ERROR when calling %o: %o",e,t)}})}on(e,t){let n=this.event_handlers.get(e);n||this.event_handlers.set(e,n=new Set),n.add(t)}addEventListener(e,t){this.on(e,t)}removeEventListener(e,t){const n=this.event_handlers.get(e);if(!n||!n.has(t))throw new Error("removeEventListeners(): not installed.");n.delete(t)}removeAllEventListeners(){this.event_handlers.clear()}}class r{get messageType(){return this.constructor.messageType}}class o{get byteLength(){let e=this._byteLength;if(-1===e){const t=this.encoders,n=this.data;e=0;for(let r=0;r<t.length;r++)e+=t[r].encodedLength(n[r]);this._byteLength=e}return e}constructor(e,t){this.encoders=e,this.data=t,this._byteLength=-1}encodeTo(e,t){t|=0;const{encoders:n,data:r}=this;for(let o=0;o<n.length;o++)t=n[o].encodeTo(e,t,r[o]);return t}}class s extends r{constructor(e,t,n,r,o){super(),this.target=+e,this.method_level=0|t,this.method_index=0|n,this.param_count=0|r,this.parameters=o||null,this.handle=0}static get messageType(){return 0}encode_to(e,t){if(t|=0,e.setUint32(t,this.encoded_length()),t+=4,e.setUint32(t,this.handle),t+=4,e.setUint32(t,this.target),t+=4,e.setUint16(t,this.method_level),t+=2,e.setUint16(t,this.method_index),t+=2,e.setUint8(t,this.param_count),t++,this.param_count){const n=this.parameters;n instanceof o?t=n.encodeTo(e,t):(new Uint8Array(e.buffer).set(new Uint8Array(n),e.byteOffset+t),t+=n.byteLength)}return t}encoded_length(){return 17+(this.param_count?this.parameters.byteLength:0)}decode_from(e,t,n){let r=e.getUint32(t);if(t+=4,this.handle=e.getUint32(t),t+=4,this.target=e.getUint32(t),t+=4,this.method_level=e.getUint16(t),t+=2,this.method_index=e.getUint16(t),t+=2,this.param_count=e.getUint8(t),t++,r-=17,r<0)throw new Error("Bad Command Length.");if(r>0){if(!this.param_count)throw new Error("Expected no parameter bytes.");this.parameters=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r),t+=r}return t}response(e,t,n){return new Response(this.handle,e,t,n)}}class i extends s{static get messageType(){return 1}}function a(e){if(!e.isConstantLength)return e;const t=e.encodedLength(),n=e.decode,r=e.encodeTo;return{isConstantLength:!0,encodedLength:e.encodedLength,encodeTo:r,decode:n,decodeFrom:function(e,r){const o=n(e,r);return[r+t,o]},decodeLength:function(e,n){return n+t}}}const c=a({isConstantLength:!0,encodedLength:function(e){return 2},encodeTo:function(e,t,n){return e.setUint16(t,0|n,!1),t+2},decode:function(e,t){return e.getUint16(t,!1)}});function l(e,t){const n=Object.keys(e).length;return t||(t=class{constructor(...t){if(t.length===n){let n=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this[r]=t[n++])}else{if(1!==t.length||"object"!=typeof t[0])throw new TypeError("Unexpected arguments.");{const n=t[0];for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this[t]=n[t])}}}}),a({type:t,isConstantLength:!1,encodedLength:function(t){let n=0;for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;n+=e[r].encodedLength(t[r])}return n},encodeTo:function(t,n,r){for(const o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;n=e[o].encodeTo(t,n,r[o])}return n},decodeFrom:function(n,r){const o=new Array(e.length);let s=0;for(const t in e){if(!Object.prototype.hasOwnProperty.call(e,t))continue;const i=e[t];let a;[r,a]=i.decodeFrom(n,r),o[s++]=a}return[r,new t(...o)]},decodeLength:function(t,n){for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;n=e[r].decodeLength(t,n)}return n}})}class u{constructor(e,t){this.DefLevel=e,this.EventIndex=t}}const h=l({DefLevel:c,EventIndex:c},u),d=a({isConstantLength:!0,encodedLength:function(e){return 4},encodeTo:function(e,t,n){return e.setUint32(t,n,!1),t+4},decode:function(e,t){return e.getUint32(t,!1)}});class g{constructor(e,t){this.EmitterONo=e,this.EventID=t}}const f=l({EmitterONo:d,EventID:h},g);class p extends r{constructor(e,t,n,r,o,s,i){super(),this.target=e,this.method_level=0|t,this.method_index=0|n,this.context=r,this.event=o,this.param_count=0|s,this.parameters=i||null}static get messageType(){return 2}encode_to(e,t){e.setUint32(t,this.encoded_length()),t+=4,e.setUint32(t,this.target),t+=4,e.setUint16(t,this.method_level),t+=2,e.setUint16(t,this.method_index),t+=2,e.setUint8(t,this.param_count),t++;const n=this.context;if(n){const r=n.byteLength;e.setUint16(t,r),t+=2,r>0&&(new Uint8Array(e.buffer).set(new Uint8Array(this.context),e.byteOffset+t),t+=r)}else e.setUint16(t,0),t+=2;return e.setUint32(t,this.event.EmitterONo),t+=4,e.setUint16(t,this.event.EventID.DefLevel),t+=2,e.setUint16(t,this.event.EventID.EventIndex),t+=2,this.param_count>1&&(this.parameters instanceof o?t=this.parameters.encodeTo(e,t):(new Uint8Array(e.buffer).set(new Uint8Array(this.parameters),e.byteOffset+t),t+=this.parameters.byteLength)),t}encoded_length(){return 23+(this.param_count>1?this.parameters.byteLength:0)+(this.context?this.context.byteLength:0)}decode_from(e,t,n){let r=e.getUint32(t);t+=4,this.target=e.getUint32(t),t+=4,this.method_level=e.getUint16(t),t+=2,this.method_index=e.getUint16(t),t+=2,this.param_count=e.getUint8(t),t++;const o=e.getUint16(t);let s;if(t+=2,o?(this.context=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+o),t+=o):this.context=null,[t,s]=f.decodeFrom(e,t),this.event=s,r-=23+o,r<0)throw new Error("Bad Notification Length.");return r>0&&(this.parameters=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r),t+=r),t}}class S extends r{constructor(e,t,n,r){super(),this.handle=e,this.status_code=0|t,this.param_count=0|n,this.parameters=r||null}static get messageType(){return 3}encoded_length(){return 10+(this.param_count?this.parameters.byteLength:0)}decode_from(e,t,n){let r=e.getUint32(t);if(t+=4,this.handle=e.getUint32(t),t+=4,this.status_code=e.getUint8(t),t++,this.param_count=e.getUint8(t),t++,r-=10,r<0)throw new Error("Bad Response length.");if(r>0){if(!this.param_count)throw new Error("Decoding response with parameterCount=0 but %o bytes of parameters",r);this.parameters=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r),t+=r}return t}encode_to(e,t){return e.setUint32(t,this.encoded_length()),t+=4,e.setUint32(t,this.handle),t+=4,e.setUint8(t,this.status_code),t++,e.setUint8(t,this.param_count),t++,this.param_count&&(this.parameters instanceof o?t=this.parameters.encodeTo(e,t):(new Uint8Array(e.buffer).set(new Uint8Array(this.parameters),e.byteOffset+t),t+=this.parameters.byteLength)),t}}class m extends r{static get messageType(){return 4}constructor(e){super(),this.time=e||0}decode_from(e,t,n){if(4==n)this.time=e.getUint32(t),t+=4;else{if(2!=n)throw new Error("Bad keepalive timeout length.");this.time=1e3*e.getUint16(t),t+=2}return t}encode_to(e,t){return this.time%1e3?(e.setUint32(t,this.time),t+=4):(e.setUint16(t,this.time/1e3),t+=2),t}encoded_length(){return this.time%1e3?4:2}}const y=[s,i,p,S,m];function O(e,t,n){if(e.byteLength<e.byteOffset+t+10)return-1;if(t|=0,59!=e.getUint8(t))throw new Error("Bad sync value.");t++,t+=2;const r=e.getUint32(t);t+=4;const o=e.getUint8(t);t++;const s=e.getUint16(t);t+=2;const i=e.byteOffset+t-9+r;if(i>e.byteLength)return-1;n.length=s;const a=y[o];if(void 0===a)throw new Error("Bad Message Type");if(a===m&&1!==s)throw new Error("Bad KeepAlive message count.");for(let r=0;r<s;r++)n[r]=new a,t=n[r].decode_from(e,t,i-e.byteOffset-t);if(t!=i)throw new Error("Decode error: "+t+" vs "+i);return t}function b(e,t,n,r,o){r||(r=0),o||(o=n.length);if(!(o-r<=65535))throw new Error("Too many PDUs.");e.setUint8(t,59);const s=t+=1;e.setUint16(t,1);const i=t+=2;t+=4,e.setUint8(t,n[r].messageType),t++,e.setUint16(t,o-r),t+=2;for(let s=r;s<o;s++)t=n[s].encode_to(e,t);return e.setUint32(i,t-s),t}function w(e){Array.isArray(e)||(e=[e]);const t=function(e){let t=10;const n=e[0].messageType;for(let r=0;r<e.length;r++){const o=e[r];if(o.messageType!=n)throw new Error("Cannot combine different types in one message.");t+=o.encoded_length()}return t}(e),n=new ArrayBuffer(t);if(b(new DataView(n),0,e,0,e.length)!=t)throw new Error("Message length mismatch.");return n}class C{constructor(e,t){if(!(e<=4294967295))throw new TypeError("Invalid batch size.");this._pdus=[],this._batchSize=e,this._resultCallback=t,this._currentSize=0,this._currentCount=0,this._lastMessageType=-1,this._flushScheduled=!1,this._flushCb=()=>{this._flushScheduled=!1,null!==this._pdus&&this.flush()}}add(e){const t=this._currentSize,n=e.encoded_length(),r=e.messageType,o=this._lastMessageType===r&&4!==r&&this._currentCount<65535;let s=n;o||(s+=10),t&&t+s>this._batchSize&&(this.flush(),s=n+10),this._pdus.push(e),this._currentSize+=s,o?this._currentCount++:this._currentCount=1,this._lastMessageType=r,this._currentSize>this._batchSize?this.flush():1===this._pdus.length&&this.scheduleFlush()}scheduleFlush(){this._flushScheduled||(this._flushScheduled=!0,Promise.resolve().then(this._flushCb).catch(e=>{console.error(e)}))}flush(){if(!this._currentSize)return;const e=this._pdus,t=new ArrayBuffer(this._currentSize),n=new DataView(t),r=e.length;for(let t=0,o=0,s=0;t<r;t++){const i=e[t].messageType;t!==r-1&&t+1-o!=65535&&4!==i&&i===e[t+1].messageType||(s=b(n,s,e,o,t+1),o=t+1)}this._currentSize=0,this._lastMessageType=-1,this._currentCount=0,this._pdus.length=0,this._resultCallback(t)}dispose(){this._pdus=null}}class _ extends n{constructor(e){e||(e={}),super();const t=this._now();this.options=e;const n=e.batch>=0?e.batch:65536;this._message_generator=new C(n,e=>this.write(e)),this.inbuf=null,this.inpos=0,this.last_rx_time=t,this.last_tx_time=t,this.rx_bytes=0,this.tx_bytes=0,this.keepalive_interval=-1,this._keepalive_interval_id=null;const r=()=>{this.removeEventListener("close",r),this.removeEventListener("error",r),this.cleanup()};this.on("close",r),this.on("error",r)}get is_reliable(){return!0}send(e){if(this.is_closed())throw new Error("Connection is closed.");this._message_generator.add(e)}tx_idle_time(){return this._now()-this.last_tx_time}rx_idle_time(){return this._now()-this.last_rx_time}read(e){if(this.rx_bytes+=e.byteLength,this.last_rx_time=this._now(),this.inbuf){const t=this.inbuf.byteLength-this.inpos,n=new Uint8Array(new ArrayBuffer(t+e.byteLength));n.set(new Uint8Array(this.inbuf,this.inpos)),n.set(new Uint8Array(e),t),this.inbuf=null,this.inpos=0,e=n.buffer}let t=0;const n=new DataView(e);try{do{const r=[],o=O(n,t,r);if(-1==o){this.inbuf=e,this.inpos=t;break}t=o,this.incoming(r)}while(t<e.byteLength)}catch(e){if(this.is_reliable)return void this.emit("error",e);console.error(e)}this._check_keepalive()}incoming(e){}write(e){this.last_tx_time=this._now(),this.tx_bytes+=e.byteLength}is_closed(){return null===this._message_generator}close(){this.is_closed()||this.emit("close")}error(e){this.is_closed()||this.emit("error",e)}cleanup(){if(this.is_closed())throw new Error("cleanup() called twice.");this.set_keepalive_interval(0),this._message_generator.dispose(),this._message_generator=null,this.removeAllEventListeners()}_check_keepalive(){if(!(this.keepalive_interval>0))return;const e=this.keepalive_interval;this.rx_idle_time()>3*e?(this.emit("timeout"),this.error(new Error("Keepalive timeout."))):this.tx_idle_time()>.75*e&&(this.flush(),this.tx_idle_time()>.75*e&&this.send(new m(e)))}flush(){this._message_generator.flush()}set_keepalive_interval(e){const t=1e3*e;null!==this._keepalive_interval_id&&(clearInterval(this._keepalive_interval_id),this._keepalive_interval_id=null),this.keepalive_interval=t,this.is_closed()||(this.send(new m(t)),t>0&&(this._keepalive_interval_id=setInterval(()=>{this._check_keepalive()},t/2)))}}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function G(e){let t=null;function n(n){if(null===t){t=new Map;for(const n in e)P(e,n)&&t.set(e[n],n)}return t.get(n)}let r=null;const o=class{get isEnum(){return!0}constructor(t){if("string"==typeof t){if(!P(e,t))throw new Error("No such enum value.");return this.constructor[t]}if(null!==r&&r.has(t))return r.get(t);this.value=t,function(e,t){null===r&&(r=new Map),r.set(e,t)}(t,this)}get name(){return n(this.value)}valueOf(){return this.value}toString(){return this.name}static getName(e){const t=n(e);if(void 0===t)throw new Error("No such enum value.");return t}static getValue(t){const n=function(t){if(P(e,t))return e[t]}(t);if(void 0===n)throw new Error("No such enum value.");return n}static values(){return e}};for(const t in e)P(e,t)&&Object.defineProperty(o,t,{get:function(){return new this(e[t])},enumerable:!1,configurable:!0});return o}class v extends(G({OK:0,ProtocolVersionError:1,DeviceError:2,Locked:3,BadFormat:4,BadONo:5,ParameterError:6,ParameterOutOfRange:7,NotImplemented:8,InvalidRequest:9,ProcessingFailed:10,BadMethod:11,PartiallySucceeded:12,Timeout:13,BufferOverflow:14})){}class T{constructor(e,t){this.status=new v(e),this.cmd=t}static check_status(e,t){return e instanceof this&&e.status===t}toString(){return"RemoteError("+this.status+")"}}class D{constructor(e){this.values=e}item(e){return this.values[e]}get length(){return this.values.length}}class I{get handle(){return this.command.handle}constructor(e,t,n,r){this.resolve=e,this.reject=t,this.returnTypes=n,this.command=r,this.lastSent=0,this.retries=0}response(e){const{resolve:t,reject:n,returnTypes:r,command:o}=this;if(0!==e.status_code)n(new T(e.status_code,o));else if(r)try{const n=Math.min(e.param_count,r.length);if(0===n)t();else{const o=new Array(n),s=new DataView(e.parameters);for(let e=0,t=0;e<n;e++){let n;[t,n]=r[e].decodeFrom(s,t),o[e]=n}t(1===n?o[0]:new D(o))}}catch(e){n(e)}else t(e)}}function M(e){const t=e.EmitterONo,n=e.EventID;return[t,n.DefLevel,n.EventIndex].join(",")}class L extends _{constructor(e){super(e),this._pendingCommands=new Map,this._nextCommandHandle=0,this._subscribers=new Map}cleanup(){super.cleanup(),this._subscribers=null;const e=this._pendingCommands;this._pendingCommands=null;const t=new Error("closed");e.forEach((e,n)=>{e.reject(t)})}_addSubscriber(e,t){const n=M(e),r=this._subscribers;if(r.has(n))throw new Error("Subscriber already exists.");r.set(n,t)}_removeSubscriber(e){const t=M(e),n=this._subscribers;if(!n.has(t))throw new Error("Unknown subscriber.");n.delete(t)}_getNextCommandHandle(){let e;const t=this._pendingCommands;if(null===t)throw new Error("Connection not open.");do{e=this._nextCommandHandle,this._nextCommandHandle=e+1|0}while(t.has(e));return e}_estimate_next_tx_time(){return this._now()}send_command(e,t,n){const r=(n,r)=>{const o=this._getNextCommandHandle();e.handle=o;const s=new I(n,r,t,e);this._pendingCommands.set(o,s),s.lastSent=this._estimate_next_tx_time(),this.send(e)};if(!n)return new Promise(r);r(e=>n(!0,e),e=>n(!1,e))}_removePendingCommand(e){const t=this._pendingCommands,n=t.get(e);return n?(t.delete(e),n):null}incoming(e){for(let t=0;t<e.length;t++){if(null===this._pendingCommands)return;const n=e[t];if(n instanceof S){const e=this._removePendingCommand(n.handle);if(null===e){if(this.is_reliable)return void this.error(new Error("Unknown handle."));continue}e.response(n)}else if(n instanceof p){const e=this._subscribers,t=M(n.event),r=e.get(t);if(!r)continue;r(n)}else{if(!(n instanceof m))throw new Error("Unexpected PDU");if(!(n.time>0))throw new Error("Bad keepalive timeout.")}}}}const A=a({isConstantLength:!1,encodedLength:function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(Array.isArray(e)||e instanceof Uint8Array))throw new TypeError("Expected Array or Uint8Array");const t=e.length;if(t>65535)throw new Error("Array too long for OcaBlob OCP.1 encoding.");return 2+t},encodeTo:function(e,t,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));const r=n.length;e.setUint16(t,r),t+=2;return new Uint8Array(e.buffer,e.byteOffset).set(n,t),t+r},decodeFrom:function(e,t){const n=e.getUint16(t);return[(t+=2)+n,new Uint8Array(e.buffer,e.byteOffset+t,n)]},decodeLength:function(e,t){return t+2+e.getUint16(t)}});function E(e){return a({isConstantLength:!0,encodedLength:function(t){return e},encodeTo:function(t,n,r){if(!(Array.isArray(r)||r instanceof Uint8Array))throw new TypeError("Expected Array or Uint8Array");if(r.length!==e)throw new Error("Length mismatch.");return new Uint8Array(t.buffer,t.byteOffset).set(r,n),n+e},decode:function(t,n){return new Uint8Array(t.buffer,t.byteOffset+n,e)}})}const k=a({isConstantLength:!0,encodedLength:function(e){return 1},encodeTo:function(e,t,n){return e.setUint8(t,n?1:0),t+1},decode:function(e,t){return 0!==e.getUint8(t)}}),x=c,U=x;function N(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function R(e){return e.isConstantLength?function(e){const t=e.encodedLength(void 0),n=e.encodeTo,r=e.decode;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!N(e))throw new TypeError("Expected array.");const n=e.length;if(n>65535)throw new Error("Array too long for OcaList OCP.1 encoding");return 2+n*t},encodeTo:function(e,t,r){const o=r.length;e.setUint16(t,o),t+=2;for(let s=0;s<o;s++)t=n(e,t,r[s]);return t},decodeFrom:function(e,n){const o=e.getUint16(n);n+=2;const s=new Array(o);for(let i=0;i<o;i++)s[i]=r(e,n),n+=t;return[n,s]},decodeLength:function(e,n){return n+(2+e.getUint16(n)*t)}})}(e):function(e){const t=e.encodedLength,n=e.encodeTo,r=e.decodeFrom,o=e.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!N(e))throw new TypeError("Expected array.");const n=e.length;if(n>65535)throw new Error("Array too long for OcaList OCP.1 encoding");let r=2;for(let o=0;o<n;o++)r+=t(e[o]);return r},encodeTo:function(e,t,r){const o=r.length;e.setUint16(t,o),t+=2;for(let s=0;s<o;s++)t=n(e,t,r[s]);return t},decodeFrom:function(e,t){const n=e.getUint16(t);t+=2;const o=new Array(n);for(let s=0;s<n;s++){let n;[t,n]=r(e,t),o[s]=n}return[t,o]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;for(let r=0;r<n;r++)t=o(e,t);return t}})}(e)}const F=new TextEncoder,B=new TextDecoder;function j(e){return F.encode(e)}function V(e,t,n){const r=t;for(;n--;){const n=e.getUint8(t);if(t++,!(n<=127)){if(n<194)throw new Error("Invalid UTF8 sequence.");if(t++,!(n<=223||(t++,n<=239||(t++,n<=244))))throw new Error("Invalid UTF8 sequence.")}}return t-r}const z=a({isConstantLength:!1,encodedLength:function(e){if("string"!=typeof e)throw new TypeError("Expected string.");return 2+j(e).byteLength},encodeTo:function(e,t,n){const r=function(e){let t=0;for(let n=0;n<e.length;n++,t++){const t=e.charCodeAt(n);if(t>=55296&&t<=56319){n++;const t=e.charCodeAt(n);if(t<56320||t>57343)throw new TypeError("Expected valid unicode string.")}}return t}(n);if(r>65535)throw new Error("String too long for OcaString OCP.1 encoding.");e.setUint16(t,r),t+=2;const o=new Uint8Array(j(n));return new Uint8Array(e.buffer,e.byteOffset).set(o,t),t+o.length},decodeFrom:function(e,t){const n=e.getUint16(t),r=V(e,t+=2,n),o=new Uint8Array(e.buffer,e.byteOffset+t,r);return[t+r,(s=o,B.decode(s))];var s},decodeLength:function(e,t){const n=e.getUint16(t);return(t+=2)+V(e,t,n)}}),q=a({isConstantLength:!1,encodedLength:function(e){if("string"!=typeof e)throw new TypeError("Expected string.");const t=e.length;if(t>65535)throw new Error("Array too long for String16 OCP.1 encoding.");return 2+2*t},encodeTo:function(e,t,n){const r=n.length;e.setUint16(t,r,!1),t+=2;for(let o=0;o<r;o++,t+=2)e.setUint16(t,n.charCodeAt(o),!1);return t},decodeFrom:function(e,t){const n=e.getUint16(t,!1);t+=2;const r=new Array(n);for(let o=0;o<n;o++,t+=2)r[o]=e.getUint16(t,!1);return[t,String.fromCharCode.apply(String,r)]},decodeLength:function(e,t){return t+2+2*e.getUint16(t)}});class H{constructor(e,t,n,r){this.ObjectNumber=e,this.Name=t,this.ClassID=n,this.ClassVersion=r}}const W=l({ObjectNumber:d,Name:z,ClassID:q,ClassVersion:c},H);class K{constructor(e,t,n){this.Manufacturer=e,this.Name=t,this.Version=n}}const X=l({Manufacturer:z,Name:z,Version:z},K);class Y{constructor(e,t,n){this.Reserved=e,this.MfrCode=t,this.ModelCode=n}}const Q=l({Reserved:E(1),MfrCode:E(3),ModelCode:E(4)},Y),J=a({isConstantLength:!0,encodedLength:function(e){return 1},encodeTo:function(e,t,n){return e.setUint8(t,0|n),t+1},decode:function(e,t){return e.getUint8(t)}});function Z(e,t){const n=t.encodeTo,r=t.decode,o=a({isConstantLength:!0,encodedLength:t.encodedLength,encodeTo:function(t,r,o){if("object"==typeof o&&o instanceof e)o=o.value;else if("string"==typeof o)o=e.getValue(o);else{if("number"!=typeof o)throw new TypeError("Unsupported type.");e.getName(o)}return n(t,r,o)},decode:function(t,n){const o=r(t,n);return new e(o)}});for(const t in e.values())Object.defineProperty(o,t,{get:function(){return e[t]},enumerable:!1,configurable:!0});return o}function $(e){return Z(e,J)}class ee extends(G({PowerOn:0,InternalError:1,Upgrade:2,ExternalRequest:3})){}const te=$(ee);class ne{constructor(e,t,n){this.object=e,this.id=t,this.handlers=new Set,this.result=null,this.argumentTypes=n}GetOcaEvent(){return new g(this.object.ObjectNumber,this.id)}do_subscribe(){}do_unsubscribe(){}subscribe(e){return this.handlers.add(e),1===this.handlers.size?this.result=this.do_subscribe().then(()=>(this.result=null,!0)):null!==this.result?this.result:Promise.resolve(!0)}unsubscribe(e){return this.handlers.delete(e),this.handlers.size||this.do_unsubscribe().catch((function(){})),Promise.resolve(!0)}Dipose(){this.handlers.clear(),this.handlers.size&&this.do_unsubscribe().catch((function(){}))}}const re=new ArrayBuffer;class oe extends ne{constructor(e,n,r){super(e,n,r),this.callback=e=>{if(!this.handlers.size)return;const n=new Array(r.length),o=new DataView(e.parameters||re);for(let e=0,t=0;t<r.length;t++){let s;[e,s]=r[t].decodeFrom(o,e),n[t]=s}const s=this.object;this.handlers.forEach((function(e){try{e.apply(s,n)}catch(e){t(e)}}))}}do_subscribe(){return this.object.device.add_subscription(this.GetOcaEvent(),this.callback)}do_unsubscribe(e){return this.object.device.remove_subscription(this.GetOcaEvent(),this.callback)}}class se extends ne{constructor(e,n,r){super(e,n,r),this.callback=([n,o,s])=>{if(n.DefLevel!==this.id.DefLevel||n.PropertyIndex!==this.id.PropertyIndex)return;const i=r[0].decodeFrom(o,0)[1];this.handlers.forEach((function(r){try{r.call(e,i,s,n)}catch(e){t(e)}}))}}do_subscribe(){return this.object.OnPropertyChanged.subscribe(this.callback)}do_unsubscribe(e){return this.object.OnPropertyChanged.unsubscribe(this.callback)}}class ie extends(G({CurrentChanged:1,MinChanged:2,MaxChanged:3,ItemAdded:4,ItemChanged:5,ItemDeleted:6})){}class ae{init(e){this.o=e,this.values=[],this.synchronized=!1,this.subscriptions=[]}sync(){if(this.synchronized)return Promise.resolve();let e=0;const t=[];return this.o.get_properties().forEach(n=>{const r=n.getter(this.o);if(!r)return;const o=n.event(this.o);if(o){const n=function(e,t,n){n===ie.CurrentChanged&&(this.values[e]=t)}.bind(this,e);this.subscriptions.push(o.unsubscribe.bind(o,n)),t.push(o.subscribe(n).catch((function(){})))}t.push(r().then(function(e,t){t instanceof D&&(t=t.item(0)),this.values[e]=t}.bind(this,e),(function(){}))),e++}),Promise.all(t)}forEach(e,t){let n=0;t||(t=this),this.o.get_properties().forEach(r=>{r.getter(this.o)&&(e.call(t,this.values[n],r.name),n++)})}Dispose(){this.o=null,this.subscriptions.forEach(e=>e()),this.subscriptions=null}}class ce{constructor(e,t){this.DefLevel=e,this.PropertyIndex=t}}class le{constructor(e,t,n){const r=new Map,o=[];this.by_name=r,this.parent=n,this.properties=o,this.level=t;for(let t=0;t<e.length;t++){const n=e[t];if(r.set(n.name,n),o[n.index]=n,n.aliases){const e=n.aliases;for(let t=0;t<e.length;t++)r.set(e[t],n)}}}find_property(e){if(e instanceof ce){if(e.DefLevel==this.level)return this.properties[e.PropertyIndex];if(this.parent)return this.parent.find_property(e)}else{if("string"!=typeof e)throw new Error("Expected PropertyID");{const t=this.by_name.get(e);if(t)return t;if(this.parent)return this.parent.find_property(e)}}}find_name(e){const t=this.find_property(e);if(t)return t.name}forEach(e,t){const n=this.parent?this.parent.forEach(e,t):[],r=this.properties;for(let o=0;o<r.length;o++){const s=r[o];void 0!==s&&n.push(e.call(t,s))}return n}}class ue{constructor(e,t,n,r,o,s,i){this.name=e,this.type=t,this.level=n,this.index=r,this.readonly=o,this.static=s,this.aliases=i}GetPropertyID(){return new ce(this.level,this.index)}GetName(){return this.name}getter(e,t){let n=this.name,r=0;const o=this.aliases;if(this.static){const t=e.constructor[n];if(void 0!==t)return function(){return Promise.resolve(t)}}else{const r=e["Get"+n];if(r)return t?r:r.bind(e)}return o&&r<o.length&&(n=o[r++]),null}setter(e,t){if(this.readonly||this.static)return null;let n=this.name,r=0;const o=this.aliases;{const s=e["Set"+n];if(s)return t?s:s.bind(e);o&&r<o.length&&(n=o[r++])}return null}event(e){let t=this.name,n=0;const r=this.aliases;{const o=e["On"+t+"Changed"];if(o)return o;r&&n<r.length&&(t=r[n++])}return null}subscribe(e,n){const r=this.event(e),o=this.getter(e);return r&&r.subscribe(n).catch(t),o&&o().then(n,t),r||!!o}}function he(e,t){if(!t||!t.length)return;const[n,r,s,a,c]=t;e.prototype[n]=function(...e){const t=a.length;let n=null;t<e.length&&t+1===e.length&&"function"==typeof e[t]&&(n=e[t],e.length=t);const l=new i(this.ono,r,s,t,new o(a,e));return this.device.send_command(l,c,n)}}function de(e,t){const[n,r,o,s]=t;Object.defineProperty(e.prototype,"On"+n,{get:function(){const e="_On"+n,t=this[e];return t||(this[e]=new oe(this,new u(r,o),s))}})}function ge(e,t){t.static||"ObjectNumber"!==t.name&&Object.defineProperty(e.prototype,"On"+t.name+"Changed",{get:function(){const e="_On"+t.name+"Changed",n=this[e];return n||(this[e]=new se(this,new ce(t.level,t.index),t.type))}})}function fe(e){if("object"==typeof e&&e instanceof ue)return e;if(Array.isArray(e))return"object"!=typeof e[1]&&(e[1]=function(e){throw new Error("Not implemented.")}(e[1])),new ue(...e);throw new Error("Bad property.")}function pe(e,t,n,r,o,s,i,a){let c=null,l=null;i=i.map(e=>fe(e));const u=class extends o{static get ClassID(){return n}static get ClassVersion(){return r}static get ClassName(){return e}static get_properties(){return null===l&&(l=new le(i,t,o.get_properties())),l}static GetPropertySync(){return null===c&&(c=function(e){const t=Object.create(ae.prototype),n=Object.create(e.prototype);let r=0;e.get_properties().forEach(e=>{const o=!!e.setter(n,!0);if(!e.getter(n,!0))return;const s={enumerable:!0,get:(i=r,function(){return this.values[i]})};var i,a;o&&(s.set=(a=e.setter(n,!0),function(e){return a.call(this.o,e),e})),Object.defineProperty(t,e.name,s),r++});const o=function(e){this.init(e)};return o.prototype=t,o}(this)),c}constructor(e,t){super(e,t);for(let e=0;e<i.length;e++){this["_On"+i[e].name+"Changed"]=null}for(let e=0;e<a.length;e++){this["_On"+a[e][0]]=null}}Dispose(){super.Dispose();for(let e=0;e<i.length;e++){const t=this["_On"+i[e].name+"Changed"];t&&t.Dispose()}for(let e=0;e<a.length;e++){const t=this["_On"+a[e][0]];t&&t.Dispose()}}};for(let e=0;e<s.length;e++)he(u,s[e]);for(let e=0;e<i.length;e++)ge(u,i[e]);for(let e=0;e<a.length;e++)de(u,a[e]);return u}class Se{constructor(e,t){this.ClassID=e,this.ClassVersion=t}}const me=l({ClassID:q,ClassVersion:c},Se),ye=l({DefLevel:c,PropertyIndex:c},ce),Oe=$(ie);function be(...e){const t=e.length;return a({isConstantLength:!1,encodedLength:function(n){if(!Array.isArray(n)&&!N(n))throw new TypeError("Expected array.");if(n.length!==t)throw new Error("Length mismatch.");let r=0;for(let o=0;o<t;o++)r+=e[o].encodedLength(n[o]);return r},encodeTo:function(n,r,o){for(let s=0;s<t;s++)r=e[s].encodeTo(n,r,o[s]);return r},decodeFrom:function(n,r){const o=new Array(t);for(let s=0;s<t;s++){let t;[r,t]=e[s].decodeFrom(n,r),o[s]=t}return[r,o]},decodeLength:function(n,r){for(let o=0;o<t;o++)r=e[o].decodeLength(n,r);return r}})}const we=be(ye,(Ce=1,a({isConstantLength:!1,encodedLength:function(e){if(!("object"==typeof e&&e instanceof DataView))throw new TypeError("Expected DataView.");return e.byteLength-Ce},encodeTo:function(e,t,n){const r=n.byteLength,o=new Uint8Array(n.buffer,n.byteOffset,r);return new Uint8Array(e.buffer,e.byteOffset+t).set(o),t+r},decodeFrom:function(e,t){const n=e.byteLength-t-Ce;return[t+n,new DataView(e.buffer,e.byteOffset+t,n)]},decodeLength:function(e,t){return t+(e.byteLength-t-Ce)}})),Oe);var Ce;const _e=pe("OcaRoot",1,"",2,class{constructor(e,t){this.ono=e,this.device=t}get ObjectNumber(){return this.ono}get ClassVersion(){return this.constructor.ClassVersion}get ClassID(){return this.constructor.ClassID}get ClassName(){return this.constructor.ClassName}sendCommandRrq(e,t,n,r,o){const s=new i(this.ono,e,t,n,r);return this.device.send_command(s,o)}GetPropertyName(e){return this.get_properties().find_name(e)}GetPropertyID(e){const t=this.get_properties().find_property(e);if(t)return t.GetPropertyID()}static get_properties(){return null}get_properties(){return this.constructor.get_properties()}get __oca_properties__(){return this.get_properties()}GetPropertySync(){return new(this.constructor.GetPropertySync())(this)}Dispose(){}},[["GetClassIdentification",1,1,[],[me]],["GetLockable",1,2,[],[k]],["LockTotal",1,3,[],[]],["Unlock",1,4,[],[]],["GetRole",1,5,[],[z]],["LockReadonly",1,6,[],[]]],[["ClassID",[q],1,1,!0,!0,null],["ClassVersion",[c],1,2,!0,!0,null],["ObjectNumber",[d],1,3,!0,!1,null],["Lockable",[k],1,4,!0,!1,null],["Role",[z],1,5,!0,!1,null]],[["PropertyChanged",1,1,[we]]]),Pe=pe("OcaManager",2,"",2,_e,[],[],[]),Ge=pe("OcaDeviceManager",3,"",2,Pe,[["GetOcaVersion",3,1,[],[c]],["GetModelGUID",3,2,[],[Q]],["GetSerialNumber",3,3,[],[z]],["GetDeviceName",3,4,[],[z]],["SetDeviceName",3,5,[z],[]],["GetModelDescription",3,6,[],[X]],["GetDeviceRole",3,7,[],[z]],["SetDeviceRole",3,8,[z],[]],["GetUserInventoryCode",3,9,[],[z]],["SetUserInventoryCode",3,10,[z],[]],["GetEnabled",3,11,[],[k]],["SetEnabled",3,12,[k],[]],["GetState",3,13,[],[U]],["SetResetKey",3,14,[E(16),A],[]],["GetResetCause",3,15,[],[te]],["ClearResetCause",3,16,[],[]],["GetMessage",3,17,[],[z]],["SetMessage",3,18,[z],[]],["GetManagers",3,19,[],[R(W)]],["GetDeviceRevisionID",3,20,[],[z]]],[["ModelGUID",[Q],3,1,!1,!1,null],["SerialNumber",[z],3,2,!1,!1,null],["ModelDescription",[X],3,3,!1,!1,null],["DeviceName",[z],3,4,!1,!1,null],["OcaVersion",[c],3,5,!1,!1,null],["DeviceRole",[z],3,6,!1,!1,null],["UserInventoryCode",[z],3,7,!1,!1,null],["Enabled",[k],3,8,!1,!1,null],["State",[U],3,9,!1,!1,null],["Busy",[k],3,10,!1,!1,null],["ResetCause",[te],3,11,!1,!1,null],["Message",[z],3,12,!1,!1,null],["Managers",[R(W)],3,13,!1,!1,null],["DeviceRevisionID",[z],3,14,!0,!1,null]],[]),ve=pe("OcaSecurityManager",3,"",2,Pe,[["AddPreSharedKey",3,4,[z,A],[]],["ChangePreSharedKey",3,3,[z,A],[]],["DeletePreSharedKey",3,5,[z],[]],["DisableControlSecurity",3,2,[],[]],["EnableControlSecurity",3,1,[],[]]],[["secureControlData",[k],3,1,!1,!1,null]],[]);class Te extends(G({BootLoader:0})){}const De=Z(Te,c);class Ie{constructor(e,t,n,r){this.Major=e,this.Minor=t,this.Build=n,this.Component=r}}const Me=l({Major:d,Minor:d,Build:d,Component:De},Ie),Le=pe("OcaFirmwareManager",3,"",2,Pe,[["GetComponentVersions",3,1,[],[R(Me)]],["StartUpdateProcess",3,2,[],[]],["BeginActiveImageUpdate",3,3,[De],[]],["AddImageData",3,4,[d,A],[]],["VerifyImage",3,5,[A],[]],["EndActiveImageUpdate",3,6,[],[]],["BeginPassiveComponentUpdate",3,7,[De,A,z],[]],["EndUpdateProcess",3,8,[],[]]],[["ComponentVersions",[R(Me)],3,1,!1,!1,null]],[]);class Ae{constructor(e,t){this.DefLevel=e,this.MethodIndex=t}}const Ee=l({DefLevel:c,MethodIndex:c},Ae);class ke{constructor(e,t){this.ONo=e,this.MethodID=t}}const xe=l({ONo:d,MethodID:Ee},ke);class Ue extends(G({Reliable:1,Fast:2})){}const Ne=$(Ue);class Re{constructor(e){this.objectList=e}}const Fe=l({objectList:R(d)},Re);class Be extends(G({Normal:1,EventsDisabled:2})){}const je=$(Be),Ve=pe("OcaSubscriptionManager",3,"",2,Pe,[["RemoveSubscription",3,2,[f,xe],[]],["AddSubscription",3,1,[f,xe,A,Ne,A],[]],["DisableNotifications",3,3,[],[]],["ReEnableNotifications",3,4,[],[]],["AddPropertyChangeSubscription",3,5,[d,ye,xe,A,Ne,A],[]],["RemovePropertyChangeSubscription",3,6,[d,ye,xe],[]],["GetMaximumSubscriberContextLength",3,7,[],[c]]],[["State",[je],3,1,!1,!1,null]],[["NotificationsDisabled",3,1,[]],["SynchronizeState",3,2,[Fe]]]);class ze extends(G({None:0,Working:1,Standby:2,Off:3})){}const qe=$(ze),He=pe("OcaPowerManager",3,"",2,Pe,[["GetState",3,1,[],[qe]],["SetState",3,2,[qe],[]],["GetPowerSupplies",3,3,[],[R(d)]],["GetActivePowerSupplies",3,4,[],[R(d)]],["ExchangePowerSupply",3,5,[d,d,k],[]],["GetAutoState",3,6,[],[k]]],[["State",[qe],3,1,!1,!1,null],["PowerSupplies",[R(d)],3,2,!1,!1,null],["ActivePowerSupplies",[R(d)],3,3,!1,!1,null],["AutoState",[k],3,4,!1,!1,null],["TargetState",[qe],3,5,!1,!1,null]],[]),We=pe("OcaNetworkManager",3,"",2,Pe,[["GetNetworks",3,1,[],[R(d)]],["GetStreamNetworks",3,2,[],[R(d)]],["GetControlNetworks",3,3,[],[R(d)]],["GetMediaTransportNetworks",3,4,[],[R(d)]]],[["Networks",[R(d)],3,1,!1,!1,null],["StreamNetworks",[R(d)],3,2,!1,!1,null],["ControlNetworks",[R(d)],3,3,!1,!1,null],["MediaTransportNetworks",[R(d)],3,4,!1,!1,null]],[]);class Ke extends(G({None:0,Internal:1,Network:2,External:3})){}const Xe=$(Ke),Ye=pe("OcaMediaClockManager",3,"",2,Pe,[["GetClocks",3,1,[],[R(d)]],["GetMediaClockTypesSupported",3,2,[],[R(Xe)]],["GetClock3s",3,3,[],[R(d)]]],[["ClockSourceTypesSupported",[R(Xe)],3,1,!1,!1,["MediaClockTypesSupported"]],["Clocks",[R(d)],3,2,!1,!1,null],["Clock3s",[R(d)],3,3,!1,!1,null]],[]);class Qe{constructor(e,t){this.Library=e,this.ID=t}}const Je=l({Library:d,ID:d},Qe);class Ze{constructor(e,t){this.Authority=e,this.ID=t}}const $e=l({Authority:E(3),ID:d},Ze);class et{constructor(e,t){this.Type=e,this.ONo=t}}const tt=l({Type:$e,ONo:d},et),nt=pe("OcaLibraryManager",3,"\b",2,Pe,[["AddLibrary",3,1,[$e],[tt]],["DeleteLibrary",3,2,[d],[]],["GetLibraryCount",3,3,[$e],[c]],["GetLibraryList",3,4,[$e],[R(tt)]],["GetCurrentPatch",3,5,[],[Je]],["ApplyPatch",3,6,[Je],[]]],[["Libraries",[R(tt)],3,1,!1,!1,null],["CurrentPatch",[Je],3,2,!1,!1,null]],[]),rt=pe("OcaAudioProcessingManager",3,"\t",2,Pe,[],[],[]),ot="undefined"!=typeof BigInt,st=ot&&(BigInt(1)<<BigInt(64))-BigInt(1),it=ot&&st>>BigInt(1),at=ot&&-it-BigInt(1),ct=ot&&(BigInt(1)<<BigInt(55))-BigInt(1);ot&&BigInt(1);function lt(){if(!ot)throw new Error("Missing BigInt support")}const ut=a({isConstantLength:!0,encodedLength:function(e){return 8},encodeTo:function(e,t,n){if(lt(),!(n<=st&&n>=0))throw new TypeError("Uint64 out of range.");return e.setBigUint64(t,BigInt(n),!1),t+8},decode:function(e,t){lt();const n=e.getBigUint64(t,!1);return n<=Number.MAX_SAFE_INTEGER?Number(n):n}});class ht{constructor(e,t,n){this.Negative=e,this.Seconds=t,this.Nanoseconds=n}}const dt=l({Negative:k,Seconds:ut,Nanoseconds:d},ht),gt=pe("OcaDeviceTimeManager",3,"\n",2,Pe,[["GetDeviceTimeNTP",3,1,[],[ut]],["SetDeviceTimeNTP",3,2,[ut],[]],["GetTimeSources",3,3,[],[R(d)]],["GetCurrentDeviceTimeSource",3,4,[],[d]],["SetCurrentDeviceTimeSource",3,5,[d],[]],["GetDeviceTimePTP",3,6,[],[dt]],["SetDeviceTimePTP",3,7,[dt],[]]],[["TimeSources",[R(d)],3,1,!1,!1,null],["CurrentDeviceTimeSource",[d],3,2,!1,!1,null]],[]);function ft(e,t){const n=e.encodedLength,r=e.encodeTo,o=e.decodeFrom,s=e.decodeLength,i=t.encodedLength,c=t.encodeTo,l=t.decodeFrom,u=t.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!(e instanceof Map||e instanceof WeakMap))throw new TypeError("Expected Map or WeakMap");let t=2;return e.forEach((e,r)=>{t+=n(r),t+=i(e)}),t},encodeTo:function(e,t,n){return e.setUint16(t,n.size),t+=2,n.forEach((n,o)=>{t=r(e,t,o),t=c(e,t,n)}),t},decodeFrom:function(e,t){const n=new Map,r=e.getUint16(t);t+=2;for(let s=0;s<r;s++){let r,s;[t,r]=o(e,t),[t,s]=l(e,t),n.set(r,s)}if(n.size!==r)throw new Error("Key appeared twice in decoded Map.");return[t,n]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;for(let r=0;r<n;r++)t=s(e,t),t=u(e,t);return t}})}class pt extends(G({Absolute:1,Relative:2})){}const St=$(pt);class mt{constructor(e,t,n,r,o,s,i,a,c){this.ID=e,this.Label=t,this.ProgramID=n,this.GroupID=r,this.TimeMode=o,this.TimeSourceONo=s,this.StartTime=i,this.Duration=a,this.ApplicationSpecificParameters=c}}const yt=l({ID:d,Label:z,ProgramID:Je,GroupID:c,TimeMode:St,TimeSourceONo:d,StartTime:dt,Duration:dt,ApplicationSpecificParameters:A},mt);class Ot extends(G({None:0,Prepare:1,Enable:2,Start:3,Stop:4,Abort:5,Disable:6,Clear:7})){}const bt=$(Ot);class wt extends(G({None:0,Enabled:1,Disabled:2})){}const Ct=$(wt);class _t extends(G({None:0,NotPrepared:1,Disabled:2,Enabled:3,Running:4,Completed:5,Failed:6,Stopped:7,Aborted:8})){}const Pt=$(_t);class Gt{constructor(e,t,n){this.ID=e,this.State=t,this.ErrorCode=n}}const vt=l({ID:d,State:Pt,ErrorCode:c},Gt);class Tt{constructor(e,t,n){this.TaskID=e,this.ProgramID=t,this.Status=n}}const Dt=l({TaskID:d,ProgramID:Je,Status:vt},Tt),It=pe("OcaTaskManager",3,"\v",1,Pe,[["Enable",3,1,[k],[]],["ControlAllTasks",3,2,[bt,A],[]],["ControlTaskGroup",3,3,[c,bt,A],[]],["ControlTask",3,4,[d,bt,A],[]],["GetState",3,5,[],[Ct]],["GetTaskStatuses",3,6,[],[vt]],["GetTaskStatus",3,7,[d],[vt]],["AddTask",3,8,[yt],[yt]],["GetTasks",3,9,[],[ft(d,yt)]],["GetTask",3,10,[d],[yt]],["SetTask",3,11,[d,yt],[]],["DeleteTask",3,12,[d],[]]],[["State",[Ct],3,1,!1,!1,null],["Tasks",[ft(d,yt)],3,2,!1,!1,null]],[["TaskStateChanged",3,1,[Dt]]]),Mt=pe("OcaCodingManager",3,"\f",1,Pe,[["GetAvailableEncodingSchemes",3,1,[],[ft(c,z)]],["GetAvailableDecodingSchemes",3,2,[],[ft(c,z)]]],[["AvailableEncodingSchemes",[ft(c,z)],3,1,!1,!1,null],["AvailableDecodingSchemes",[ft(c,z)],3,2,!1,!1,null]],[]),Lt=pe("OcaDiagnosticManager",3,"\r",1,Pe,[["GetLockStatus",3,1,[d],[z]]],[],[]);class At{constructor(e,t){this.ONo=e,this.ClassIdentification=t}}const Et=l({ONo:d,ClassIdentification:me},At);class kt{constructor(e,t){this.MemberObjectIdentification=e,this.ContainerObjectNumber=t}}const xt=l({MemberObjectIdentification:Et,ContainerObjectNumber:d},kt);class Ut{constructor(e,t){this.Authority=e,this.ID=t}}const Nt=l({Authority:E(3),ID:d},Ut);class Rt{constructor(e,t){this.TargetBlockType=e,this.ParData=t}}const Ft=l({TargetBlockType:d,ParData:A},Rt);class Bt{constructor(e,t,n,r,o){this.ONo=e,this.ClassIdentification=t,this.ContainerPath=n,this.Role=r,this.Label=o}}const jt=l({ONo:d,ClassIdentification:me,ContainerPath:R(d),Role:z,Label:z},Bt),Vt=x;class zt extends(G({Input:1,Output:2})){}const qt=$(zt);class Ht{constructor(e,t){this.Mode=e,this.Index=t}}const Wt=l({Mode:qt,Index:c},Ht);class Kt{constructor(e,t,n){this.Owner=e,this.ID=t,this.Name=n}}const Xt=l({Owner:d,ID:Wt,Name:z},Kt);class Yt{constructor(e,t){this.SourcePort=e,this.SinkPort=t}}const Qt=l({SourcePort:Xt,SinkPort:Xt},Yt);class Jt extends(G({Exact:0,Substring:1,Contains:2,ExactCaseInsensitive:3,SubstringCaseInsensitive:4,ContainsCaseInsensitive:5})){}const Zt=$(Jt),$t=a({isConstantLength:!0,encodedLength:function(e){return 4},encodeTo:function(e,t,n){return e.setFloat32(t,+n,!1),t+4},decode:function(e,t){return e.getFloat32(t,!1)}}),en=pe("OcaWorker",2,"",2,_e,[["GetEnabled",2,1,[],[k]],["SetEnabled",2,2,[k],[]],["AddPort",2,3,[z,qt],[Wt]],["DeletePort",2,4,[Wt],[]],["GetPorts",2,5,[],[R(Xt)]],["GetPortName",2,6,[Wt],[z]],["SetPortName",2,7,[Wt,z],[]],["GetLabel",2,8,[],[z]],["SetLabel",2,9,[z],[]],["GetOwner",2,10,[],[d]],["GetLatency",2,11,[],[$t]],["SetLatency",2,12,[$t],[]],["GetPath",2,13,[],[R(z),R(d)]]],[["Enabled",[k],2,1,!1,!1,null],["Ports",[R(Xt)],2,2,!1,!1,null],["Label",[z],2,3,!1,!1,null],["Owner",[d],2,4,!1,!1,null],["Latency",[$t],2,5,!1,!1,null]],[]),tn=pe("OcaBlock",3,"",2,en,[["GetType",3,1,[],[d]],["ConstructMemberUsingFactory",3,3,[d],[d]],["DeleteMember",3,4,[d],[]],["GetMembers",3,5,[],[R(Et)]],["GetMembersRecursive",3,6,[],[R(xt)]],["AddSignalPath",3,7,[Qt],[c]],["DeleteSignalPath",3,8,[c],[]],["GetSignalPaths",3,9,[],[ft(c,Qt)]],["GetSignalPathsRecursive",3,10,[],[ft(c,Qt)]],["GetMostRecentParamSetIdentifier",3,11,[],[Je]],["ApplyParamSet",3,12,[],[Je]],["GetCurrentParamSetData",3,13,[],[Ft]],["StoreCurrentParamSetData",3,14,[Je],[]],["GetGlobalType",3,15,[],[Nt]],["GetONoMap",3,16,[],[ft(d,d)]],["FindObjectsByRole",3,17,[z,Zt,q,Vt],[R(jt)]],["FindObjectsByRoleRecursive",3,18,[z,Zt,q,Vt],[R(jt)]],["FindObjectsByPath",3,20,[R(z),Vt],[R(jt)]],["FindObjectsByLabelRecursive",3,19,[z,Zt,q,Vt],[R(jt)]]],[["Type",[d],3,1,!0,!1,null],["Members",[R(Et)],3,2,!1,!1,null],["SignalPaths",[ft(c,Qt)],3,3,!1,!1,null],["MostRecentParamSetIdentifier",[Je],3,4,!1,!1,null],["GlobalType",[Nt],3,5,!0,!1,null],["ONoMap",[ft(d,d)],3,6,!0,!1,null]],[]);const nn=pe("OcaActuator",3,"",2,en,[],[],[]);class rn extends(G({Muted:1,Unmuted:2})){}const on=$(rn),sn=pe("OcaMute",4,"",2,nn,[["GetState",4,1,[],[on]],["SetState",4,2,[on],[]]],[["State",[on],4,1,!1,!1,null]],[]);class an extends(G({NonInverted:1,Inverted:2})){}const cn=$(an),ln=pe("OcaPolarity",4,"",2,nn,[["GetState",4,1,[],[cn]],["SetState",4,2,[cn],[]]],[["State",[cn],4,1,!1,!1,null]],[]),un=pe("OcaSwitch",4,"",2,nn,[["GetPosition",4,1,[],[c,c,c]],["SetPosition",4,2,[c],[]],["GetPositionName",4,3,[c],[z]],["SetPositionName",4,4,[c,z],[]],["GetPositionNames",4,5,[],[R(z)]],["SetPositionNames",4,6,[R(z)],[]],["GetPositionEnabled",4,7,[c],[k]],["SetPositionEnabled",4,8,[c,k],[]],["GetPositionEnableds",4,9,[],[R(k)]],["SetPositionEnableds",4,10,[R(k)],[]]],[["Position",[c],4,1,!1,!1,null],["PositionNames",[R(z)],4,2,!1,!1,null],["PositionEnableds",[R(k)],4,3,!1,!1,null]],[]),hn=pe("OcaGain",4,"",2,nn,[["GetGain",4,1,[],[$t,$t,$t]],["SetGain",4,2,[$t],[]]],[["Gain",[$t],4,1,!1,!1,null]],[]),dn=pe("OcaPanBalance",4,"",2,nn,[["GetPosition",4,1,[],[$t,$t,$t]],["SetPosition",4,2,[$t],[]],["GetMidpointGain",4,3,[],[$t,$t,$t]],["SetMidpointGain",4,4,[$t],[]]],[["Position",[$t],4,1,!1,!1,null],["MidpointGain",[$t],4,2,!1,!1,null]],[]),gn=pe("OcaDelay",4,"",2,nn,[["GetDelayTime",4,1,[],[$t,$t,$t]],["SetDelayTime",4,2,[$t],[]]],[["DelayTime",[$t],4,1,!1,!1,null]],[]);class fn extends(G({Time:1,Distance:2,Samples:3,Microseconds:4,Milliseconds:5,Centimeters:6,Inches:7,Feet:8})){}const pn=$(fn);class Sn{constructor(e,t){this.DelayValue=e,this.DelayUnit=t}}const mn=l({DelayValue:$t,DelayUnit:pn},Sn),yn=pe("OcaDelayExtended",5,"",2,gn,[["GetDelayValue",5,1,[],[mn,mn,mn]],["SetDelayValue",5,2,[mn],[]],["GetDelayValueConverted",5,3,[pn],[mn]]],[["DelayValue",[mn],5,1,!1,!1,null]],[]),On=pe("OcaFrequencyActuator",4,"\b",2,nn,[["GetFrequency",4,1,[],[$t,$t,$t]],["SetFrequency",4,2,[$t],[]]],[["Frequency",[$t],4,1,!1,!1,null]],[]);class bn extends(G({Butterworth:1,Bessel:2,Chebyshev:3,LinkwitzRiley:4})){}const wn=$(bn);class Cn extends(G({HiPass:1,LowPass:2,BandPass:3,BandReject:4,AllPass:5})){}const _n=$(Cn),Pn=x,Gn=pe("OcaFilterClassical",4,"\t",2,nn,[["GetFrequency",4,1,[],[$t,$t,$t]],["SetFrequency",4,2,[$t],[]],["GetPassband",4,3,[],[_n]],["SetPassband",4,4,[_n],[]],["GetShape",4,5,[],[wn]],["SetShape",4,6,[wn],[]],["GetOrder",4,7,[],[c,c,c]],["SetOrder",4,8,[c],[]],["GetParameter",4,9,[],[$t,$t,$t]],["SetParameter",4,10,[$t],[]],["SetMultiple",4,11,[Pn,$t,_n,wn,c,$t],[]]],[["Frequency",[$t],4,1,!1,!1,null],["Passband",[_n],4,2,!1,!1,null],["Shape",[wn],4,3,!1,!1,null],["Order",[c],4,4,!1,!1,null],["Parameter",[$t],4,5,!1,!1,null]],[]);class vn extends(G({None:0,PEQ:1,LowShelv:2,HighShelv:3,LowPass:4,HighPass:5,BandPass:6,AllPass:7,Notch:8,ToneControlLowFixed:9,ToneControlLowSliding:10,ToneControlHighFixed:11,ToneControlHighSliding:12})){}const Tn=$(vn),Dn=pe("OcaFilterParametric",4,"\n",2,nn,[["GetFrequency",4,1,[],[$t,$t,$t]],["SetFrequency",4,2,[$t],[]],["GetShape",4,3,[],[Tn]],["SetShape",4,4,[Tn],[]],["GetWidthParameter",4,5,[],[$t,$t,$t]],["SetWidthParameter",4,6,[$t],[]],["GetInbandGain",4,7,[],[$t,$t,$t]],["SetInbandGain",4,8,[$t],[]],["GetShapeParameter",4,9,[],[$t,$t,$t]],["SetShapeParameter",4,10,[$t],[]],["SetMultiple",4,11,[Pn,$t,Tn,$t,$t,$t],[]]],[["Frequency",[$t],4,1,!1,!1,null],["Shape",[Tn],4,2,!1,!1,null],["WidthParameter",[$t],4,3,!1,!1,["Q"]],["InbandGain",[$t],4,4,!1,!1,null],["ShapeParameter",[$t],4,5,!1,!1,null]],[]),In=pe("OcaFilterPolynomial",4,"\v",2,nn,[["GetCoefficients",4,1,[],[R($t),R($t)]],["SetCoefficients",4,2,[R($t),R($t)],[]],["GetSampleRate",4,3,[],[$t,$t,$t]],["SetSampleRate",4,4,[$t],[]],["GetMaxOrder",4,5,[],[J]]],[["A",[R($t)],4,1,!1,!1,null],["B",[R($t)],4,2,!1,!1,null],["SampleRate",[$t],4,3,!1,!1,null],["MaxOrder",[J],4,4,!0,!1,null]],[]),Mn=pe("OcaFilterFIR",4,"\f",2,nn,[["GetLength",4,1,[],[d,d,d]],["GetCoefficients",4,2,[],[R($t)]],["SetCoefficients",4,3,[R($t)],[]],["GetSampleRate",4,4,[],[$t,$t,$t]],["SetSampleRate",4,5,[$t],[]]],[["Length",[d],4,1,!1,!1,null],["Coefficients",[R($t)],4,2,!1,!1,null],["SampleRate",[$t],4,3,!1,!1,null]],[]);class Ln{constructor(e,t,n){this.Frequency=e,this.Amplitude=t,this.Phase=n}}const An=l({Frequency:R($t),Amplitude:R($t),Phase:R($t)},Ln),En=pe("OcaFilterArbitraryCurve",4,"\r",2,nn,[["GetTransferFunction",4,1,[],[An]],["SetTransferFunction",4,2,[An],[]],["GetSampleRate",4,3,[],[$t,$t,$t]],["SetSampleRate",4,4,[$t],[]],["GetTFMinLength",4,5,[],[c]],["GetTFMaxLength",4,6,[],[c]]],[["TransferFunction",[An],4,1,!1,!1,null],["SampleRate",[$t],4,2,!1,!1,null],["TFMinLength",[c],4,3,!1,!1,null],["TFMaxLength",[c],4,4,!1,!1,null]],[]);class kn{constructor(e,t){this.Value=e,this.Ref=t}}const xn=l({Value:$t,Ref:$t},kn);class Un extends(G({None:0,Compress:1,Limit:2,Expand:3,Gate:4})){}const Nn=$(Un);class Rn extends(G({None:0,RMS:1,Peak:2})){}const Fn=$(Rn);class Bn extends(G({dBu:0,dBV:1,V:2})){}const jn=$(Bn),Vn=pe("OcaDynamics",4,"",2,nn,[["GetTriggered",4,1,[],[k]],["GetDynamicGain",4,2,[],[$t]],["GetFunction",4,3,[],[Nn]],["SetFunction",4,4,[Nn],[]],["GetRatio",4,5,[],[$t,$t,$t]],["SetRatio",4,6,[$t],[]],["GetThreshold",4,7,[],[xn,$t,$t]],["SetThreshold",4,8,[xn],[]],["GetThresholdPresentationUnits",4,9,[],[jn]],["SetThresholdPresentationUnits",4,10,[jn],[]],["GetDetectorLaw",4,11,[],[Fn]],["SetDetectorLaw",4,12,[Fn],[]],["GetAttackTime",4,13,[],[$t,$t,$t]],["SetAttackTime",4,14,[$t],[]],["GetReleaseTime",4,15,[],[$t,$t,$t]],["SetReleaseTime",4,16,[$t],[]],["GetHoldTime",4,17,[],[$t,$t,$t]],["SetHoldTime",4,18,[$t],[]],["GetDynamicGainFloor",4,19,[],[$t,$t,$t]],["SetDynamicGainFloor",4,20,[$t],[]],["GetDynamicGainCeiling",4,21,[],[$t,$t,$t]],["SetDynamicGainCeiling",4,22,[$t],[]],["GetKneeParameter",4,23,[],[$t,$t,$t]],["SetKneeParameter",4,24,[$t],[]],["GetSlope",4,25,[],[$t,$t,$t]],["SetSlope",4,26,[$t],[]],["SetMultiple",4,27,[Pn,Nn,xn,jn,Fn,$t,$t,$t,$t,$t,$t,$t],[]]],[["Triggered",[k],4,1,!1,!1,null],["DynamicGain",[$t],4,2,!1,!1,null],["Function",[Nn],4,3,!1,!1,null],["Ratio",[$t],4,4,!1,!1,null],["Threshold",[xn],4,5,!1,!1,null],["ThresholdPresentationUnits",[jn],4,6,!1,!1,null],["DetectorLaw",[Fn],4,7,!1,!1,null],["AttackTime",[$t],4,8,!1,!1,null],["ReleaseTime",[$t],4,9,!1,!1,null],["HoldTime",[$t],4,10,!1,!1,null],["DynamicGainCeiling",[$t],4,11,!1,!1,null],["DynamicGainFloor",[$t],4,12,!1,!1,null],["KneeParameter",[$t],4,13,!1,!1,null],["Slope",[$t],4,14,!1,!1,null]],[]),zn=pe("OcaDynamicsDetector",4,"",2,nn,[["GetLaw",4,1,[],[Fn]],["SetLaw",4,2,[Fn],[]],["GetAttackTime",4,3,[],[$t,$t,$t]],["SetAttackTime",4,4,[$t],[]],["GetReleaseTime",4,5,[],[$t,$t,$t]],["SetReleaseTime",4,6,[$t],[]],["GetHoldTime",4,7,[],[$t,$t,$t]],["SetHoldTime",4,8,[$t],[]],["SetMultiple",4,9,[Pn,Fn,$t,$t,$t],[]]],[["Law",[Fn],4,1,!1,!1,null],["AttackTime",[$t],4,2,!1,!1,null],["ReleaseTime",[$t],4,3,!1,!1,null],["HoldTime",[$t],4,4,!1,!1,null]],[]),qn=pe("OcaDynamicsCurve",4,"",2,nn,[["GetNSegments",4,1,[],[J,J,J]],["SetNSegments",4,2,[J],[]],["GetThreshold",4,3,[],[R(xn),$t,$t]],["SetThreshold",4,4,[R(xn)],[]],["GetSlope",4,5,[],[R($t),R($t),R($t)]],["SetSlope",4,6,[R($t)],[]],["GetKneeParameter",4,7,[],[R($t),R($t),R($t)]],["SetKneeParameter",4,8,[R($t)],[]],["GetDynamicGainCeiling",4,9,[],[$t,$t,$t]],["SetDynamicGainCeiling",4,10,[$t],[]],["GetDynamicGainFloor",4,11,[],[$t,$t,$t]],["SetDynamicGainFloor",4,12,[$t],[]],["SetMultiple",4,13,[Pn,J,R(xn),R($t),R($t),$t,$t],[]]],[["NSegments",[J],4,1,!1,!1,null],["Threshold",[R(xn)],4,2,!1,!1,null],["Slope",[R($t)],4,3,!1,!1,null],["KneeParameter",[R($t)],4,4,!1,!1,null],["DynamicGainFloor",[$t],4,5,!1,!1,null],["DynamicGainCeiling",[$t],4,6,!1,!1,null]],[]);class Hn extends(G({Linear:1,Logarithmic:2,None:0})){}const Wn=$(Hn);class Kn extends(G({None:0,DC:1,Sine:2,Square:3,Impulse:4,NoisePink:5,NoiseWhite:6,PolarityTest:7})){}const Xn=$(Kn),Yn=pe("OcaSignalGenerator",4,"",2,nn,[["GetFrequency1",4,1,[],[$t,$t,$t]],["SetFrequency1",4,2,[$t],[]],["GetFrequency2",4,3,[],[$t,$t,$t]],["SetFrequency2",4,4,[$t],[]],["GetLevel",4,5,[],[$t,$t,$t]],["SetLevel",4,6,[$t],[]],["GetWaveform",4,7,[],[Xn]],["SetWaveform",4,8,[Xn],[]],["GetSweepType",4,9,[],[Wn]],["SetSweepType",4,10,[Wn],[]],["GetSweepTime",4,11,[],[$t,$t,$t]],["SetSweepTime",4,12,[$t],[]],["GetSweepRepeat",4,13,[],[k]],["SetSweepRepeat",4,14,[k],[]],["GetGenerating",4,15,[],[k]],["Start",4,16,[],[]],["Stop",4,17,[],[]],["SetMultiple",4,18,[Pn,$t,$t,$t,Xn,Wn,$t,k],[]]],[["Frequency1",[$t],4,1,!1,!1,null],["Frequency2",[$t],4,2,!1,!1,null],["Level",[$t],4,3,!1,!1,null],["Waveform",[Xn],4,4,!1,!1,null],["SweepType",[Wn],4,5,!1,!1,null],["SweepTime",[$t],4,6,!1,!1,null],["SweepRepeat",[k],4,7,!1,!1,null],["Generating",[k],4,8,!1,!1,null]],[]),Qn=pe("OcaSignalInput",4,"",2,nn,[],[],[]),Jn=pe("OcaSignalOutput",4,"",2,nn,[],[],[]),Zn=pe("OcaTemperatureActuator",4,"",2,nn,[["GetTemperature",4,1,[],[$t,$t,$t]],["SetTemperature",4,2,[$t],[]]],[["Temperature",[$t],4,1,!1,!1,null]],[]),$n=pe("OcaIdentificationActuator",4,"",2,nn,[["GetActive",4,1,[],[k]],["SetActive",4,2,[k],[]]],[["Active",[k],4,1,!1,!1,null]],[]),er=pe("OcaSummingPoint",4,"",1,nn,[],[],[]),tr=pe("OcaBasicActuator",4,"",2,nn,[],[],[]),nr=pe("OcaBooleanActuator",5,"",2,tr,[["GetSetting",5,1,[],[k]],["SetSetting",5,2,[k],[]]],[["Setting",[k],5,1,!1,!1,null]],[]),rr=a({isConstantLength:!0,encodedLength:function(e){return 1},encodeTo:function(e,t,n){return e.setInt8(t,0|n),t+1},decode:function(e,t){return e.getInt8(t)}}),or=pe("OcaInt8Actuator",5,"",2,tr,[["GetSetting",5,1,[],[rr,rr,rr]],["SetSetting",5,2,[rr],[]]],[["Setting",[rr],5,1,!1,!1,null]],[]),sr=a({isConstantLength:!0,encodedLength:function(e){return 2},encodeTo:function(e,t,n){return e.setInt16(t,0|n,!1),t+2},decode:function(e,t){return e.getInt16(t,!1)}}),ir=pe("OcaInt16Actuator",5,"",2,tr,[["GetSetting",5,1,[],[sr,sr,sr]],["SetSetting",5,2,[sr],[]]],[["Setting",[sr],5,1,!1,!1,null]],[]),ar=a({isConstantLength:!0,encodedLength:function(e){return 4},encodeTo:function(e,t,n){return e.setInt32(t,0|n,!1),t+4},decode:function(e,t){return e.getInt32(t,!1)}}),cr=pe("OcaInt32Actuator",5,"",2,tr,[["GetSetting",5,1,[],[ar,ar,ar]],["SetSetting",5,2,[ar],[]]],[["Setting",[ar],5,1,!1,!1,null]],[]);function lr(){if(!ot)throw new Error("Missing BigInt support")}const ur=a({isConstantLength:!0,encodedLength:function(e){return 8},encodeTo:function(e,t,n){if(lr(),!(n>=at&&n<=it))throw new TypeError("Int64 out of range.");return e.setBigInt64(t,BigInt(n),!1),t+8},decode:function(e,t){lr();const n=e.getBigInt64(t,!1);return n>=Number.MIN_SAFE_INTEGER&&n<=Number.MAX_SAFE_INTEGER?Number(n):n}}),hr=pe("OcaInt64Actuator",5,"",2,tr,[["GetSetting",5,1,[],[ur,ur,ur]],["SetSetting",5,2,[ur],[]]],[["Setting",[ur],5,1,!1,!1,null]],[]),dr=pe("OcaUint8Actuator",5,"",2,tr,[["GetSetting",5,1,[],[J,J,J]],["SetSetting",5,2,[J],[]]],[["Setting",[J],5,1,!1,!1,null]],[]),gr=pe("OcaUint16Actuator",5,"",2,tr,[["GetSetting",5,1,[],[c,c,c]],["SetSetting",5,2,[c],[]]],[["Setting",[c],5,1,!1,!1,null]],[]),fr=pe("OcaUint32Actuator",5,"\b",2,tr,[["GetSetting",5,1,[],[d,d,d]],["SetSetting",5,2,[d],[]]],[["Setting",[d],5,1,!1,!1,null]],[]),pr=pe("OcaUint64Actuator",5,"\t",2,tr,[["GetSetting",5,1,[],[ut,ut,ut]],["SetSetting",5,2,[ut],[]]],[["Setting",[ut],5,1,!1,!1,null]],[]),Sr=pe("OcaFloat32Actuator",5,"\n",2,tr,[["GetSetting",5,1,[],[$t,$t,$t]],["SetSetting",5,2,[$t],[]]],[["Setting",[$t],5,1,!1,!1,null]],[]),mr=a({isConstantLength:!0,encodedLength:function(e){return 8},encodeTo:function(e,t,n){return e.setFloat64(t,+n,!1),t+8},decode:function(e,t){return e.getFloat64(t,!1)}}),yr=pe("OcaFloat64Actuator",5,"\v",2,tr,[["GetSetting",5,1,[],[mr,mr,mr]],["SetSetting",5,2,[mr],[]]],[["Setting",[mr],5,1,!1,!1,null]],[]),Or=pe("OcaStringActuator",5,"\f",2,tr,[["GetSetting",5,1,[],[z]],["SetSetting",5,2,[z],[]],["GetMaxLen",5,3,[],[c]]],[["Setting",[z],5,1,!1,!1,null],["MaxLen",[c],5,2,!0,!1,null]],[]);function br(e){return e+7>>3}function wr(e,t,n){const r=new Array(n),o=br(n),s=new Uint8Array(e.buffer,e.byteOffset+t,o);for(let e=0;e<n;e++)r[e]=!!(s[e>>3]&128>>(7&e));return r}const Cr=a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e))throw new TypeError("Expected Array.");const t=e.length;if(t>65535)throw new Error("Array too long for OcaBlob OCP.1 encoding.");return 2+(t+7>>3)},encodeTo:function(e,t,n){const r=n.length;return e.setUint16(t,r),function(e,t,n){const r=n.length,o=br(r),s=new Uint8Array(e.buffer,e.byteOffset+t,o);for(let e=0,t=0;t<o;t++){let o=0;for(let t=0;t<8&&e<r;t++,e++)n[e]&&(o|=128>>t);s[t]=o}return t+o}(e,t+=2,n)},decodeFrom:function(e,t){const n=e.getUint16(t);return[(t+=2)+br(n),wr(e,t,n)]},decodeLength:function(e,t){return t+2+br(e.getUint16(t))}}),_r=pe("OcaBitstringActuator",5,"\r",2,tr,[["GetNrBits",5,1,[],[c]],["GetBit",5,2,[c],[k]],["SetBit",5,3,[c,k],[]],["GetBitstring",5,4,[],[Cr]],["SetBitstring",5,5,[Cr],[]]],[["Bitstring",[Cr],5,1,!1,!1,null]],[]);class Pr extends(G({Unknown:0,Valid:1,Underrange:2,Overrange:3,Error:4})){}const Gr=$(Pr),vr=pe("OcaSensor",3,"",2,en,[["GetReadingState",3,1,[],[Gr]]],[["ReadingState",[Gr],3,1,!1,!1,null]],[]),Tr=pe("OcaLevelSensor",4,"",2,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]);class Dr extends(G({VU:1,StandardVU:2,PPM1:3,PPM2:4,LKFS:5,RMS:6,Peak:7,ProprietaryValueBase:128})){}const Ir=$(Dr),Mr=pe("OcaAudioLevelSensor",5,"",2,Tr,[["GetLaw",5,1,[],[Ir]],["SetLaw",5,2,[Ir],[]]],[["Law",[Ir],5,1,!1,!1,null]],[]),Lr=pe("OcaTimeIntervalSensor",4,"",2,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]),Ar=pe("OcaFrequencySensor",4,"",2,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]),Er=pe("OcaTemperatureSensor",4,"",2,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]),kr=pe("OcaIdentificationSensor",4,"",2,vr,[],[],[["Identify",4,1,[]]]),xr=pe("OcaVoltageSensor",4,"",1,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]),Ur=pe("OcaCurrentSensor",4,"\b",1,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]);class Nr{constructor(e,t){this.Magnitude=e,this.Phase=t}}const Rr=l({Magnitude:$t,Phase:$t},Nr),Fr=pe("OcaImpedanceSensor",4,"\t",1,vr,[["GetReading",4,1,[],[Rr,Rr,Rr]]],[["Reading",[Rr],4,1,!1,!1,null]],[]),Br=pe("OcaGainSensor",4,"\n",1,vr,[["GetReading",4,1,[],[$t,$t,$t]]],[["Reading",[$t],4,1,!1,!1,null]],[]),jr=pe("OcaBasicSensor",4,"",2,vr,[],[],[]),Vr=pe("OcaBooleanSensor",5,"",2,jr,[["GetReading",5,1,[],[k]]],[["Reading",[k],5,1,!1,!1,null]],[]),zr=pe("OcaInt8Sensor",5,"",2,jr,[["GetReading",5,1,[],[rr,rr,rr]]],[["Reading",[rr],5,1,!1,!1,null]],[]),qr=pe("OcaInt16Sensor",5,"",2,jr,[["GetReading",5,1,[],[sr,sr,sr]]],[["Reading",[sr],5,1,!1,!1,null]],[]),Hr=pe("OcaInt32Sensor",5,"",2,jr,[["GetReading",5,1,[],[ar,ar,ar]]],[["Reading",[ar],5,1,!1,!1,null]],[]),Wr=pe("OcaInt64Sensor",5,"",2,jr,[["GetReading",5,1,[],[ur,ur,ur]]],[["Reading",[ur],5,1,!1,!1,null]],[]),Kr=pe("OcaUint8Sensor",5,"",2,jr,[["GetReading",5,1,[],[J,J,J]]],[["Reading",[J],5,1,!1,!1,null]],[]),Xr=pe("OcaUint16Sensor",5,"",2,jr,[["GetReading",5,1,[],[c,c,c]]],[["Reading",[c],5,1,!1,!1,null]],[]),Yr=pe("OcaUint32Sensor",5,"\b",2,jr,[["GetReading",5,1,[],[d,d,d]]],[["Reading",[d],5,1,!1,!1,null]],[]),Qr=pe("OcaFloat32Sensor",5,"\n",2,jr,[["GetReading",5,1,[],[$t,$t,$t]]],[["Reading",[$t],5,1,!1,!1,null]],[]),Jr=pe("OcaFloat64Sensor",5,"\v",2,jr,[["GetReading",5,1,[],[mr,mr,mr]]],[["Reading",[mr],5,1,!1,!1,null]],[]),Zr=pe("OcaStringSensor",5,"\f",2,jr,[["GetString",5,1,[],[z]],["GetMaxLen",5,2,[],[c]],["SetMaxLen",5,3,[c],[]]],[["String",[z],5,1,!1,!1,null],["MaxLen",[c],5,2,!1,!1,null]],[]),$r=pe("OcaBitstringSensor",5,"\r",2,jr,[["GetNrBits",5,1,[],[c]],["GetBit",5,2,[c],[J]],["GetBitString",5,3,[],[Cr]]],[["BitString",[Cr],5,1,!1,!1,null]],[]),eo=pe("OcaUint64Sensor",5,"\t",2,jr,[["GetReading",5,1,[],[ut,ut,ut]]],[["Reading",[ut],5,1,!1,!1,null]],[]);class to{constructor(e,t){this.POno=e,this.ClassIdentification=t}}const no=l({POno:d,ClassIdentification:me},to);class ro{constructor(e,t){this.Mode=e,this.Index=t}}const oo=l({Mode:qt,Index:c},ro);class so{constructor(e,t,n){this.Owner=e,this.ProtoID=t,this.Name=n}}const io=l({Owner:d,ProtoID:oo,Name:z},so);class ao{constructor(e,t){this.SourceProtoPort=e,this.SinkProtoPort=t}}const co=l({SourceProtoPort:io,SinkProtoPort:io},ao),lo=pe("OcaBlockFactory",3,"",2,en,[["DefineProtoPort",3,1,[z,qt],[oo]],["UndefineProtoPort",3,2,[oo],[]],["GetProtoPorts",3,3,[],[R(io)]],["DefineProtoMemberUsingFactory",3,5,[d],[d]],["UndefineProtoMember",3,6,[d],[]],["GetProtoMembers",3,7,[],[R(no)]],["DefineProtoSignalPath",3,8,[co],[c]],["UndefineProtoSignalPath",3,9,[],[c]],["GetProtoSignalPaths",3,10,[],[ft(c,co)]],["GetGlobalType",3,11,[],[Nt]],["SetGlobalType",3,12,[Nt],[]]],[["ProtoPorts",[R(io)],3,1,!1,!1,null],["ProtoMembers",[R(no)],3,2,!1,!1,null],["ProtoSignalPaths",[ft(c,co)],3,3,!1,!1,null],["GlobalType",[Nt],3,4,!1,!1,null]],[]);function uo(e){return e.isConstantLength?function(e){const t=e.encodedLength(void 0),n=e.encodeTo,r=e.decode;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!N(e))throw new TypeError("Expected array.");const n=e.length;if(0===n)return 4;if(!Array.isArray(e[0])&&!N(e[0]))throw new TypeError("Expected array.");const r=e[0].length;if(n>65535||r>65535)throw new Error("Array too long for OcaList2D OCP.1 encoding");return 4+n*r*t},encodeTo:function(e,t,r){const o=r.length,s=0===o?0:r[0].length;e.setUint16(t,o),t+=2,e.setUint16(t,s),t+=2;for(let i=0;i<o;i++){const o=r[i];for(let r=0;r<s;r++)t=n(e,t,o[r])}return t},decodeFrom:function(e,n){const o=e.getUint16(n);n+=2;const s=e.getUint16(n);n+=2;const i=new Array(o).fill().map(()=>new Array(s));for(let a=0;a<o;a++){const o=i[a];for(let i=0;i<s;i++)o[i]=r(e,n),n+=t}return[n,i]},decodeLength:function(e,n){const r=e.getUint16(n);n+=2;const o=e.getUint16(n);return(n+=2)+r*o*t}})}(e):function(e){const t=e.encodedLength,n=e.encodeTo,r=e.decodeFrom,o=e.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!N(e))throw new TypeError("Expected array.");const n=e.length;if(0===n)return 4;if(!Array.isArray(e[0])&&!N(e[0]))throw new TypeError("Expected array.");const r=e[0].length;if(n>65535||r>65535)throw new Error("Array too long for OcaList2D OCP.1 encoding");let o=4;for(let s=0;s<n;s++){const n=e[s];for(let e=0;e<r;e++)o+=t(n[e])}return o},encodeTo:function(e,t,r){const o=r.length,s=0===o?0:r[0].length;e.setUint16(t,o),t+=2,e.setUint16(t,s),t+=2;for(let i=0;i<o;i++){const o=r[i];for(let r=0;r<s;r++)t=n(e,t,o[r])}return t},decodeFrom:function(e,t){const n=e.getUint16(t);t+=2;const o=e.getUint16(t);t+=2;const s=new Array(n).fill().map(()=>new Array(o));for(let i=0;i<n;i++){const n=s[i];for(let s=0;s<o;s++){let o;[t,o]=r(e,t),n[s]=o}}return[t,s]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;const r=e.getUint16(t);t+=2;for(let s=0;s<n;s++)for(let n=0;n<r;n++)t=o(e,t);return t}})}(e)}const ho=pe("OcaMatrix",3,"",2,en,[["GetCurrentXY",3,1,[],[c,c]],["SetCurrentXY",3,2,[c,c],[]],["GetSize",3,3,[],[c,c,c,c,c,c]],["SetSize",3,4,[c,c],[]],["GetMembers",3,5,[],[uo(d)]],["SetMembers",3,6,[uo(d)],[]],["GetMember",3,7,[c,c],[d]],["SetMember",3,8,[c,c,d],[]],["GetProxy",3,9,[],[d]],["SetProxy",3,10,[d],[]],["GetPortsPerRow",3,11,[],[J]],["SetPortsPerRow",3,12,[J],[]],["GetPortsPerColumn",3,13,[],[J]],["SetPortsPerColumn",3,14,[J],[]],["SetCurrentXYLock",3,15,[c,c],[]],["UnlockCurrent",3,16,[],[]]],[["X",[c],3,1,!1,!1,null],["Y",[c],3,2,!1,!1,null],["xSize",[c],3,3,!1,!1,null],["ySize",[c],3,4,!1,!1,null],["Members",[uo(d)],3,5,!1,!1,null],["Proxy",[d],3,6,!1,!1,null],["PortsPerRow",[J],3,7,!1,!1,null],["PortsPerColumn",[J],3,8,!1,!1,null]],[]),go=pe("OcaAgent",2,"",2,_e,[["GetLabel",2,1,[],[z]],["SetLabel",2,2,[z],[]],["GetOwner",2,3,[],[d]],["GetPath",2,4,[],[R(z),R(d)]]],[["Label",[z],2,1,!1,!1,null],["Owner",[d],2,2,!1,!1,null]],[]);class fo{constructor(e,t){this.HostID=e,this.ONo=t}}const po=l({HostID:A,ONo:d},fo);class So{constructor(e,t,n){this.Index=e,this.ObjectPath=t,this.Online=n}}const mo=l({Index:c,ObjectPath:po,Online:k},So);class yo{constructor(e,t){this.GroupIndex=e,this.CitizenIndex=t}}const Oo=l({GroupIndex:c,CitizenIndex:c},yo);class bo{constructor(e,t,n){this.Index=e,this.Name=t,this.ProxyONo=n}}const wo=l({Index:c,Name:z,ProxyONo:d},bo);class Co extends(G({MasterSlave:1,PeerToPeer:2})){}const _o=$(Co);class Po extends(G({citizenAdded:1,citizenDeleted:2,citizenConnectionLost:3,citizenConnectionReEstablished:4,citizenError:5,enrollment:6,unEnrollment:7})){}const Go=$(Po);class vo{constructor(e,t,n){this.groupIndex=e,this.citizenIndex=t,this.changeType=n}}const To=l({groupIndex:c,citizenIndex:c,changeType:Go},vo),Do=pe("OcaGrouper",3,"",2,go,[["AddGroup",3,1,[z],[c,d]],["DeleteGroup",3,2,[c],[]],["GetGroupCount",3,3,[],[c]],["GetGroupList",3,4,[],[R(wo)]],["AddCitizen",3,5,[mo],[c]],["DeleteCitizen",3,6,[c],[]],["GetCitizenCount",3,7,[],[c]],["GetCitizenList",3,8,[],[R(mo)]],["GetEnrollment",3,9,[Oo],[k]],["SetEnrollment",3,10,[Oo,k],[]],["GetGroupMemberList",3,11,[c],[R(mo)]],["GetActuatorOrSensor",3,12,[],[k]],["SetActuatorOrSensor",3,13,[k],[]],["GetMode",3,14,[],[_o]],["SetMode",3,15,[_o],[]]],[["ActuatorOrSensor",[k],3,1,!1,!1,null],["Groups",[R(wo)],3,2,!1,!1,["GroupList"]],["Citizens",[R(mo)],3,3,!1,!1,["CitizenList"]],["Enrollments",[R(Oo)],3,4,!1,!1,["EnrollmentList"]],["Mode",[_o],3,5,!1,!1,null]],[["StatusChange",3,1,[To]]]);class Io extends(G({None:0,OcaBoolean:1,OcaInt8:2,OcaInt16:3,OcaInt32:4,OcaInt64:5,OcaUint8:6,OcaUint16:7,OcaUint32:8,OcaUint64:9,OcaFloat32:10,OcaFloat64:11,OcaString:12,OcaBitstring:13,OcaBlob:14,OcaBlobFixedLen:15,OcaBit:16})){}const Mo=$(Io);class Lo{constructor(e,t,n,r){this.PropertyID=e,this.BaseDataType=t,this.GetterMethodID=n,this.SetterMethodID=r}}const Ao=l({PropertyID:ye,BaseDataType:Mo,GetterMethodID:Ee,SetterMethodID:Ee},Lo);class Eo{constructor(e,t){this.ONo=e,this.Descriptor=t}}const ko=l({ONo:d,Descriptor:Ao},Eo);class xo extends(G({Enable:1,Start:2,Halt:3})){}const Uo=$(xo);class No extends(G({Linear:1,ReverseLinear:2,Sine:3,Exponential:4})){}const Ro=$(No);class Fo extends(G({NotInitialized:1,Iniitialized:2,Scheduled:3,Enabled:4,Ramping:5})){}const Bo=$(Fo),jo=pe("OcaRamper",3,"",2,go,[["Control",3,1,[Uo],[]],["GetState",3,2,[],[Bo]],["GetRampedProperty",3,3,[],[ko]],["SetRampedProperty",3,4,[ko],[]],["GetTimeMode",3,5,[],[St]],["SetTimeMode",3,6,[St],[]],["GetStartTime",3,7,[],[ut]],["SetStartTime",3,8,[ut],[]],["GetDuration",3,9,[],[$t,$t,$t]],["SetDuration",3,10,[$t],[]],["GetInterpolationLaw",3,11,[],[Ro]],["SetInterpolationLaw",3,12,[Ro],[]],["GetGoal",3,13,[],[mr]],["SetGoal",3,14,[mr],[]]],[["State",[Bo],3,1,!1,!1,null],["RampedProperty",[ko],3,2,!1,!1,null],["TimeMode",[St],3,3,!1,!1,null],["StartTime",[ut],3,4,!1,!1,null],["Duration",[$t],3,5,!1,!1,null],["InterpolationLaw",[Ro],3,6,!1,!1,null],["Goal",[mr],3,7,!1,!1,null]],[]);class Vo{constructor(e){this.Reading=e}}const zo=l({Reading:mr},Vo);class qo extends(G({NotTriggered:0,Triggered:1})){}const Ho=$(qo);class Wo extends(G({None:0,Equality:1,Inequality:2,GreaterThan:3,GreaterThanOrEqual:4,LessThan:5,LessThanOrEqual:6})){}const Ko=$(Wo),Xo=pe("OcaNumericObserver",3,"",2,go,[["GetLastObservation",3,1,[],[mr]],["GetState",3,2,[],[Ho]],["GetObservedProperty",3,3,[],[ko]],["SetObservedProperty",3,4,[ko],[]],["GetThreshold",3,5,[],[mr]],["SetThreshold",3,6,[mr],[]],["GetOperator",3,7,[],[Ko]],["SetOperator",3,8,[Ko],[]],["GetTwoWay",3,9,[],[k]],["SetTwoWay",3,10,[k],[]],["GetHysteresis",3,11,[],[mr]],["SetHysteresis",3,12,[mr],[]],["GetPeriod",3,13,[],[$t]],["SetPeriod",3,14,[$t],[]]],[["State",[Ho],3,1,!1,!1,null],["ObservedProperty",[ko],3,2,!1,!1,null],["Threshold",[mr],3,3,!1,!1,null],["Operator",[Ko],3,4,!1,!1,null],["TwoWay",[k],3,5,!1,!1,null],["Hysteresis",[mr],3,6,!1,!1,null],["Period",[$t],3,7,!1,!1,null]],[["Observation",3,1,[zo]]]);class Yo extends(G({None:0,ReadOnly:1,ReadExpand:2,Full:3})){}const Qo=$(Yo);class Jo{constructor(e,t,n,r,o,s){this.Name=e,this.VolType=t,this.Access=n,this.Version=r,this.Creator=o,this.UpDate=s}}const Zo=l({Name:z,VolType:$e,Access:Qo,Version:d,Creator:z,UpDate:dt},Jo);class $o{constructor(e,t){this.Metadata=e,this.Data=t}}const es=l({Metadata:Zo,Data:A},$o);class ts{constructor(e,t){this.VolumeID=e,this.ChangeType=t}}const ns=l({VolumeID:d,ChangeType:Oe},ts),rs=pe("OcaLibrary",3,"",2,go,[["AddVolume",3,1,[es],[d]],["ReplaceVolume",3,2,[d,es],[]],["DeleteVolume",3,3,[d],[]],["GetVolume",3,4,[d],[es]],["GetVolumeCount",3,5,[],[c]],["GetVolumes",3,6,[],[ft(d,es)]],["GetAccess",3,7,[],[Qo]],["SetAccess",3,8,[Qo],[]]],[["VolumeType",[$e],3,1,!1,!1,null],["Access",[Qo],3,2,!1,!1,null],["Volumes",[ft(d,es)],3,3,!1,!1,null]],[["OcaLibVolChanged",3,1,[ns]]]);class os extends(G({Unspecified:1,Internal:2,External:3})){}const ss=$(os);class is extends(G({Off:0,Unavailable:1,Available:2,Active:3})){}const as=$(is);class cs extends(G({None:0,Mains:1,Battery:2,Phantom:3,Solar:4})){}const ls=$(cs),us=pe("OcaPowerSupply",3,"",3,go,[["GetType",3,1,[],[ls]],["GetModelInfo",3,2,[],[z]],["GetState",3,3,[],[as]],["SetState",3,4,[as],[]],["GetCharging",3,5,[],[k]],["GetLoadFractionAvailable",3,6,[],[$t]],["GetStorageFractionAvailable",3,7,[],[$t]],["GetLocation",3,8,[],[ss]]],[["Type",[ls],3,1,!1,!1,null],["ModelInfo",[z],3,2,!1,!1,null],["State",[as],3,3,!1,!1,null],["Charging",[k],3,4,!1,!1,null],["LoadFractionAvailable",[$t],3,5,!1,!1,null],["StorageFractionAvailable",[$t],3,6,!1,!1,null],["Location",[ss],3,7,!0,!1,null]],[]),hs=pe("OcaEventHandler",3,"\b",2,go,[["OnEvent",3,1,[A,f],[]]],[],[]);class ds{constructor(e){this.Reading=e}}const gs=l({Reading:R(mr)},ds),fs=pe("OcaNumericObserverList",3,"\t",2,go,[["GetLastObservation",3,1,[],[R(mr)]],["GetState",3,2,[],[Ho]],["GetObservedProperties",3,3,[],[R(ko)]],["SetObservedProperties",3,4,[R(ko)],[]],["GetThreshold",3,5,[],[mr]],["SetThreshold",3,6,[mr],[]],["GetOperator",3,7,[],[Ko]],["SetOperator",3,8,[Ko],[]],["GetTwoWay",3,9,[],[k]],["SetTwoWay",3,10,[k],[]],["GetHysteresis",3,11,[],[mr]],["SetHysteresis",3,12,[mr],[]],["GetPeriod",3,13,[],[$t]],["SetPeriod",3,14,[$t],[]]],[["State",[Ho],3,1,!1,!1,null],["ObservedProperties",[R(ko)],3,2,!1,!1,null],["Threshold",[mr],3,3,!1,!1,null],["Operator",[Ko],3,4,!1,!1,null],["TwoWay",[k],3,5,!1,!1,null],["Hysteresis",[mr],3,6,!1,!1,null],["Period",[$t],3,7,!1,!1,null]],[["Observation",3,1,[gs]]]);class ps extends(G({Unavailable:0,Available:1})){}const Ss=$(ps);class ms{constructor(e,t,n,r){this.NominalRate=e,this.PullRange=t,this.Accuracy=n,this.JitterMax=r}}const ys=l({NominalRate:$t,PullRange:$t,Accuracy:$t,JitterMax:$t},ms),Os=pe("OcaMediaClock3",3,"",1,go,[["GetAvailability",3,1,[],[Ss]],["SetAvailability",3,2,[Ss],[]],["GetCurrentRate",3,3,[],[ys,d]],["SetCurrentRate",3,4,[ys,d],[]],["GetOffset",3,5,[],[dt]],["SetOffset",3,6,[dt],[]],["GetSupportedRates",3,7,[],[ft(d,R(ys))]]],[["Availability",[Ss],3,1,!1,!1,null],["TimeSourceONo",[d],3,2,!1,!1,null],["Offset",[dt],3,3,!1,!1,null],["CurrentRate",[ys],3,4,!1,!1,null],["SupportedRates",[ft(d,R(ys))],3,5,!1,!1,null]],[]);class bs extends(G({Undefined:0,None:1,Private:2,NTP:3,SNTP:4,IEEE1588_2002:5,IEEE1588_2008:6,IEEE_AVB:7,AES11:8,Genlock:9})){}const ws=$(bs);class Cs extends(G({Undefined:0,Local:1,Private:2,GPS:3,Galileo:4,GLONASS:5})){}const _s=$(Cs);class Ps extends(G({Unavailable:0,Available:1})){}const Gs=$(Ps);class vs extends(G({Undefined:0,Unsynchronized:1,Synchronizing:2,Synchronized:3})){}const Ts=$(vs),Ds=pe("OcaTimeSource",3,"",1,go,[["GetAvailability",3,1,[],[Gs]],["GetProtocol",3,2,[],[ws]],["SetProtocol",3,3,[ws],[]],["GetParameters",3,4,[],[z]],["SetParameters",3,5,[z],[]],["GetReferenceType",3,6,[],[_s]],["SetReferenceType",3,7,[_s],[]],["GetReferenceID",3,8,[],[z]],["SetReferenceID",3,9,[z],[]],["GetSyncStatus",3,10,[],[Ts]],["Reset",3,11,[],[]]],[["Availability",[Gs],3,1,!1,!1,null],["Protocol",[ws],3,2,!1,!1,null],["Parameters",[z],3,3,!1,!1,null],["ReferenceType",[_s],3,4,!1,!1,null],["ReferenceID",[z],3,5,!1,!1,null],["SyncStatus",[Ts],3,6,!1,!1,null]],[]);class Is extends(G({Robotic:1,ItuAudioObjectBasedPolar:2,ItuAudioObjectBasedCartesian:3,ItuAudioSceneBasedPolar:4,ItuAudioSceneBasedCartesian:5,NAV:6,ProprietaryBase:128})){}const Ms=$(Is);const Ls=x;class As{constructor(e,t,n){this.CoordinateSystem=e,this.FieldFlags=t,this.Values=n}}const Es=l({CoordinateSystem:Ms,FieldFlags:Ls,Values:(ks=$t,xs=6,be(...new Array(xs).fill(ks)))},As);var ks,xs;const Us=pe("OcaPhysicalPosition",3,"",1,go,[["GetCoordinateSystem",3,1,[],[Ms]],["GetPositionDescriptorFieldFlags",3,2,[],[Ls]],["GetPositionDescriptor",3,3,[],[Es,Es,Es]],["SetPositionDescriptor",3,4,[Es],[]]],[["CoordinateSystem",[Ms],3,1,!0,!1,null],["PositionDescriptorFieldFlags",[Ls],3,2,!0,!1,null],["PositionDescriptor",[Es],3,3,!1,!1,null]],[]);class Ns extends(G({None:0,Prepare:1,Start:2,Pause:3,Stop:4,Reset:5})){}const Rs=$(Ns);class Fs extends(G({Unknown:0,NotReady:1,Readying:2,Ready:3,Running:4,Paused:5,Stopping:6,Stopped:7,Fault:8})){}const Bs=$(Fs);class js{constructor(e,t){this.SystemInterfaceParameters=e,this.MyNetworkAddress=t}}const Vs=l({SystemInterfaceParameters:A,MyNetworkAddress:A},js),zs=pe("OcaApplicationNetwork",2,"",1,_e,[["GetLabel",2,1,[],[z]],["SetLabel",2,2,[z],[]],["GetOwner",2,3,[],[d]],["GetServiceID",2,4,[],[A]],["SetServiceID",2,5,[A],[]],["GetSystemInterfaces",2,6,[],[R(Vs)]],["SetSystemInterfaces",2,7,[R(Vs)],[]],["GetState",2,8,[],[Bs]],["GetErrorCode",2,9,[],[c]],["Control",2,10,[Rs],[]],["GetPath",2,11,[],[R(z),R(d)]]],[["Label",[z],2,1,!1,!0,null],["Owner",[d],2,2,!1,!0,null],["ServiceID",[A],2,3,!1,!1,null],["SystemInterfaces",[R(Vs)],2,4,!1,!1,null],["State",[Bs],2,5,!1,!1,null],["ErrorCode",[c],2,6,!1,!1,null]],[]);class qs extends(G({None:0,OCP01:1,OCP02:2,OCP03:3})){}const Hs=$(qs),Ws=pe("OcaControlNetwork",3,"",1,zs,[["GetControlProtocol",3,1,[],[Hs]]],[["Protocol",[Hs],3,1,!1,!1,["ControlProtocol"]]],[]);class Ks{constructor(e,t,n){this.CodingSchemeID=e,this.CodecParameters=t,this.ClockONo=n}}const Xs=l({CodingSchemeID:c,CodecParameters:z,ClockONo:d},Ks);class Ys extends(G({None:0,Unicast:1,Multicast:2})){}const Qs=$(Ys);class Js{constructor(e,t,n,r){this.Secure=e,this.StreamParameters=t,this.StreamCastMode=n,this.StreamChannelCount=r}}const Zs=l({Secure:k,StreamParameters:A,StreamCastMode:Qs,StreamChannelCount:c},Js);class $s extends(G({None:0,Start:1,Pause:2})){}const ei=$($s);class ti extends(G({Stopped:0,SettingUp:1,Running:2,Paused:3,Fault:4})){}const ni=$(ti);class ri{constructor(e,t,n){this.ConnectorID=e,this.State=t,this.ErrorCode=n}}const oi=l({ConnectorID:c,State:ni,ErrorCode:c},ri);class si{constructor(e){this.ConnectorStatus=e}}const ii=l({ConnectorStatus:oi},si);function ai(e,t){const n=e.encodedLength,r=e.encodeTo,o=e.decodeFrom,s=e.decodeLength,i=t.encodedLength,c=t.encodeTo,l=t.decodeFrom,u=t.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!(e instanceof Map||e instanceof WeakMap))throw new TypeError("Expected Map or WeakMap");let t=2;return e.forEach((e,r)=>{t+=n(r)*e.size,e.forEach(e=>{t+=i(e)})}),t},encodeTo:function(e,t,n){const o=t;let s=0;return t+=2,n.forEach((n,o)=>{s+=n.size,n.forEach(n=>{t=r(e,t,o),t=c(e,t,n)})}),e.setUint16(o,s),t},decodeFrom:function(e,t){const n=new Map,r=e.getUint16(t);t+=2;for(let s=0;s<r;s++){let r,s;[t,r]=o(e,t),[t,s]=l(e,t);let i=n.get(r);i||n.set(r,i=new Set),i.add(s)}return[t,n]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;for(let r=0;r<n;r++)t=s(e,t),t=u(e,t);return t}})}class ci{constructor(e,t,n,r,o,s,i,a,c){this.IDInternal=e,this.IDExternal=t,this.Connection=n,this.AvailableCodings=r,this.PinCount=o,this.ChannelPinMap=s,this.AlignmentLevel=i,this.AlignmentGain=a,this.CurrentCoding=c}}const li=l({IDInternal:c,IDExternal:z,Connection:Zs,AvailableCodings:R(Xs),PinCount:c,ChannelPinMap:ai(c,Wt),AlignmentLevel:$t,AlignmentGain:$t,CurrentCoding:Xs},ci),ui=x;class hi{constructor(e,t,n){this.SinkConnector=e,this.ChangeType=t,this.ChangedElement=n}}const di=l({SinkConnector:li,ChangeType:Oe,ChangedElement:ui},hi);class gi{constructor(e,t,n,r,o,s,i,a){this.IDInternal=e,this.IDExternal=t,this.Connection=n,this.AvailableCodings=r,this.PinCount=o,this.ChannelPinMap=s,this.AlignmentLevel=i,this.CurrentCoding=a}}const fi=l({IDInternal:c,IDExternal:z,Connection:Zs,AvailableCodings:R(Xs),PinCount:c,ChannelPinMap:ft(c,Wt),AlignmentLevel:$t,CurrentCoding:Xs},gi);class pi{constructor(e,t,n){this.SourceConnector=e,this.ChangeType=t,this.ChangedElement=n}}const Si=l({SourceConnector:fi,ChangeType:Oe,ChangedElement:ui},pi);class mi extends(G({None:0,AV3:1,AVBTP:2,Dante:3,Cobranet:4,AES67:5,SMPTEAudio:6,LiveWire:7,ExtensionPoint:65})){}const yi=$(mi),Oi=pe("OcaMediaTransportNetwork",3,"",1,zs,[["GetMediaProtocol",3,1,[],[yi]],["GetPorts",3,2,[],[R(Xt)]],["GetPortName",3,3,[Wt],[z]],["SetPortName",3,4,[Wt,z],[]],["GetMaxSourceConnectors",3,5,[],[c]],["GetMaxSinkConnectors",3,6,[],[c]],["GetMaxPinsPerConnector",3,7,[],[c]],["GetMaxPortsPerPin",3,8,[],[c]],["GetSourceConnectors",3,9,[],[R(fi)]],["GetSourceConnector",3,10,[c],[fi]],["GetSinkConnectors",3,11,[],[R(li)]],["GetSinkConnector",3,12,[c],[li]],["GetConnectorsStatuses",3,13,[],[R(oi)]],["GetConnectorStatus",3,14,[c],[oi]],["AddSourceConnector",3,15,[fi,ni],[fi]],["AddSinkConnector",3,16,[oi,li],[li]],["ControlConnector",3,17,[c,ei],[]],["SetSourceConnectorPinMap",3,18,[c,ft(c,Wt)],[]],["SetSinkConnectorPinMap",3,19,[c,ai(c,Wt)],[]],["SetConnectorConnection",3,20,[c,Zs],[]],["SetConnectorCoding",3,21,[c,Xs],[]],["SetConnectorAlignmentLevel",3,22,[c,$t],[]],["SetConnectorAlignmentGain",3,23,[c,$t],[]],["DeleteConnector",3,24,[c],[]],["GetAlignmentLevel",3,25,[],[$t,$t,$t]],["GetAlignmentGain",3,26,[],[$t,$t,$t]]],[["Protocol",[yi],3,1,!1,!1,["MediaProtocol"]],["Ports",[R(Xt)],3,2,!1,!1,null],["MaxSourceConnectors",[c],3,3,!1,!1,null],["MaxSinkConnectors",[c],3,4,!1,!1,null],["MaxPinsPerConnector",[c],3,5,!1,!1,null],["MaxPortsPerPin",[c],3,6,!1,!1,null],["AlignmentLevel",[$t],3,7,!1,!1,null],["AlignmentGain",[$t],3,8,!1,!1,null]],[["SourceConnectorChanged",3,1,[Si]],["SinkConnectorChanged",3,2,[di]],["ConnectorStatusChanged",3,3,[ii]]]);class bi extends(G({None:0,Source:1,Sink:2})){}const wi=$(bi);class Ci extends(G({NotConnected:0,Connected:1,Muted:2})){}const _i=$(Ci),Pi=pe("OcaNetworkSignalChannel",3,"",2,en,[["AddToConnector",3,6,[d,c],[]],["GetConnectorPins",3,5,[],[ft(d,c)]],["GetIDAdvertised",3,1,[],[A]],["GetNetwork",3,3,[],[d]],["GetRemoteChannelID",3,8,[],[A]],["GetSourceOrSink",3,10,[],[wi]],["GetStatus",3,11,[],[_i]],["RemoveFromConnector",3,7,[d],[]],["SetIDAdvertised",3,2,[A],[]],["SetNetwork",3,4,[d],[]],["SetRemoteChannelID",3,9,[A],[]]],[["ConnectorPins",[ft(d,c)],3,3,!1,!1,null],["IDAdvertised",[A],3,1,!1,!1,null],["Network",[d],3,2,!1,!1,null],["RemoteChannelID",[A],3,4,!1,!1,null],["SourceOrSink",[wi],3,5,!1,!1,null],["Status",[_i],3,6,!1,!1,null]],[]);class Gi extends(G({None:0,EthernetWired:1,EthernetWireless:2,USB:3,SerialP2P:4})){}const vi=$(Gi);class Ti{constructor(e,t){this.rxPacketErrors=e,this.txPacketErrors=t}}const Di=l({rxPacketErrors:d,txPacketErrors:d},Ti);class Ii extends(G({Unknown:0,Ready:1,StartingUp:2,Stopped:3})){}const Mi=$(Ii);class Li{constructor(e,t){this.SystemInterfaceHandle=e,this.MyNetworkAddress=t}}const Ai=l({SystemInterfaceHandle:A,MyNetworkAddress:A},Li),Ei=pe("OcaNetwork",3,"",2,go,[["GetLinkType",3,1,[],[vi]],["GetIDAdvertised",3,2,[],[A]],["SetIDAdvertised",3,3,[A],[]],["GetControlProtocol",3,4,[],[Hs]],["GetMediaProtocol",3,5,[],[yi]],["GetStatus",3,6,[],[Mi]],["GetStatistics",3,7,[],[Di]],["ResetStatistics",3,8,[],[]],["GetSystemInterfaces",3,9,[],[R(Ai)]],["SetSystemInterfaces",3,10,[R(Ai)],[]],["GetMediaPorts",3,11,[],[R(d)]],["Startup",3,12,[],[]],["Shutdown",3,13,[],[]]],[["LinkType",[vi],3,1,!0,!1,null],["IDAdvertised",[A],3,2,!1,!1,null],["ControlProtocol",[Hs],3,3,!1,!1,null],["MediaProtocol",[yi],3,4,!1,!1,null],["Status",[Mi],3,5,!1,!1,null],["SystemInterfaces",[R(Ai)],3,6,!1,!1,null],["MediaPorts",[R(d)],3,7,!1,!1,null],["Statistics",[Di],3,8,!1,!1,null]],[]);class ki extends(G({Undefined:0,Locked:1,Synchronizing:2,FreeRun:3,Stopped:4})){}const xi=$(ki),Ui=pe("OcaMediaClock",3,"",2,go,[["GetType",3,1,[],[Xe]],["SetType",3,2,[Xe],[]],["GetDomainID",3,3,[],[c]],["SetDomainID",3,4,[c],[]],["GetSupportedRates",3,5,[],[R(ys)]],["GetCurrentRate",3,6,[],[ys]],["SetCurrentRate",3,7,[ys],[]],["GetLockState",3,8,[],[xi]]],[["Type",[Xe],3,1,!1,!1,null],["DomainID",[c],3,2,!1,!1,null],["RatesSupported",[R(ys)],3,3,!1,!1,null],["CurrentRate",[ys],3,4,!1,!1,null],["LockState",[xi],3,5,!1,!1,null]],[]),Ni=pe("OcaStreamNetwork",3,"\n",2,go,[["GetLinkType",3,1,[],[vi]],["GetIDAdvertised",3,2,[],[A]],["SetIDAdvertised",3,3,[A],[]],["GetControlProtocol",3,4,[],[Hs]],["GetMediaProtocol",3,5,[],[yi]],["GetStatus",3,6,[],[Mi]],["GetStatistics",3,7,[],[Di]],["ResetStatistics",3,8,[],[]],["GetSystemInterfaces",3,9,[],[R(Ai)]],["SetSystemInterfaces",3,10,[R(Ai)],[]],["GetStreamConnectorsSource",3,11,[],[R(d)]],["SetStreamConnectorsSource",3,12,[R(d)],[]],["GetStreamConnectorsSink",3,13,[],[R(d)]],["SetStreamConnectorsSink",3,14,[R(d)],[]],["GetSignalChannelsSource",3,15,[],[R(d)]],["SetSignalChannelsSource",3,16,[R(d)],[]],["GetSignalChannelsSink",3,17,[],[R(d)]],["SetSignalChannelsSink",3,18,[R(d)],[]],["Startup",3,19,[],[]],["Shutdown",3,20,[],[]]],[["ControlProtocol",[Hs],3,3,!1,!1,null],["IDAdvertised",[A],3,2,!1,!1,null],["LinkType",[vi],3,1,!0,!1,null],["MediaProtocol",[yi],3,4,!1,!1,null],["SignalChannelsSink",[R(d)],3,10,!1,!1,null],["SignalChannelsSource",[R(d)],3,9,!1,!1,null],["Statistics",[Di],3,11,!1,!1,null],["Status",[Mi],3,5,!1,!1,null],["StreamConnectorsSink",[R(d)],3,8,!1,!1,null],["StreamConnectorsSource",[R(d)],3,7,!1,!1,null],["SystemInterfaces",[R(Ai)],3,6,!1,!1,null]],[]);class Ri{constructor(e,t,n,r){this.HostID=e,this.NetworkAddress=t,this.NodeID=n,this.StreamConnectorID=r}}const Fi=l({HostID:A,NetworkAddress:A,NodeID:A,StreamConnectorID:A},Ri);class Bi extends(G({NotConnected:0,Connected:1,Paused:2})){}const ji=$(Bi);class Vi extends(G({None:0,Unicast:1,Multicast:2})){}const zi=$(Vi);class qi{constructor(e,t,n,r,o,s,i,a,c,l,u){this.ErrorNumber=e,this.IDAdvertised=t,this.Index=n,this.Label=r,this.LocalConnectorONo=o,this.Priority=s,this.RemoteConnectorIdentification=i,this.Secure=a,this.Status=c,this.StreamParameters=l,this.StreamType=u}}const Hi=l({ErrorNumber:c,IDAdvertised:A,Index:c,Label:z,LocalConnectorONo:d,Priority:c,RemoteConnectorIdentification:Fi,Secure:k,Status:ji,StreamParameters:A,StreamType:zi},qi);class Wi extends(G({NotAvailable:0,Idle:1,Connected:2,Paused:3})){}const Ki=$(Wi),Xi=pe("OcaStreamConnector",3,"\v",2,go,[["ConnectStream",3,7,[Hi],[c]],["DisconnectStream",3,8,[c],[]],["GetIDAdvertised",3,3,[],[A]],["GetOwnerNetwork",3,1,[],[d]],["GetPins",3,10,[],[ft(c,d)]],["GetSourceOrSink",3,5,[],[wi]],["GetStatus",3,11,[],[Ki]],["GetStreams",3,9,[],[ft(c,Hi)]],["SetIDAdvertised",3,4,[A],[]],["SetOwnerNetwork",3,2,[d],[]],["SetSourceOrSink",3,6,[wi],[]]],[["IDAdvertised",[A],3,2,!1,!1,null],["OwnerNetwork",[d],3,1,!1,!1,null],["Pins",[ft(c,d)],3,5,!1,!1,null],["SourceOrSink",[wi],3,3,!1,!1,null],["Status",[Ki],3,6,!1,!1,null],["Streams",[ft(c,Hi)],3,4,!1,!1,null]],[]);var Yi=Object.freeze({__proto__:null,OcaRoot:_e,OcaWorker:en,OcaActuator:nn,OcaMute:sn,OcaPolarity:ln,OcaSwitch:un,OcaGain:hn,OcaPanBalance:dn,OcaDelay:gn,OcaDelayExtended:yn,OcaFrequencyActuator:On,OcaFilterClassical:Gn,OcaFilterParametric:Dn,OcaFilterPolynomial:In,OcaFilterFIR:Mn,OcaFilterArbitraryCurve:En,OcaDynamics:Vn,OcaDynamicsDetector:zn,OcaDynamicsCurve:qn,OcaSignalGenerator:Yn,OcaSignalInput:Qn,OcaSignalOutput:Jn,OcaTemperatureActuator:Zn,OcaIdentificationActuator:$n,OcaSummingPoint:er,OcaBasicActuator:tr,OcaBooleanActuator:nr,OcaInt8Actuator:or,OcaInt16Actuator:ir,OcaInt32Actuator:cr,OcaInt64Actuator:hr,OcaUint8Actuator:dr,OcaUint16Actuator:gr,OcaUint32Actuator:fr,OcaUint64Actuator:pr,OcaFloat32Actuator:Sr,OcaFloat64Actuator:yr,OcaStringActuator:Or,OcaBitstringActuator:_r,OcaSensor:vr,OcaLevelSensor:Tr,OcaAudioLevelSensor:Mr,OcaTimeIntervalSensor:Lr,OcaFrequencySensor:Ar,OcaTemperatureSensor:Er,OcaIdentificationSensor:kr,OcaVoltageSensor:xr,OcaCurrentSensor:Ur,OcaImpedanceSensor:Fr,OcaGainSensor:Br,OcaBasicSensor:jr,OcaBooleanSensor:Vr,OcaInt8Sensor:zr,OcaInt16Sensor:qr,OcaInt32Sensor:Hr,OcaInt64Sensor:Wr,OcaUint8Sensor:Kr,OcaUint16Sensor:Xr,OcaUint32Sensor:Yr,OcaFloat32Sensor:Qr,OcaFloat64Sensor:Jr,OcaStringSensor:Zr,OcaBitstringSensor:$r,OcaUint64Sensor:eo,OcaBlock:tn,OcaBlockFactory:lo,OcaMatrix:ho,OcaAgent:go,OcaGrouper:Do,OcaRamper:jo,OcaNumericObserver:Xo,OcaLibrary:rs,OcaPowerSupply:us,OcaEventHandler:hs,OcaNumericObserverList:fs,OcaMediaClock3:Os,OcaTimeSource:Ds,OcaPhysicalPosition:Us,OcaApplicationNetwork:zs,OcaControlNetwork:Ws,OcaMediaTransportNetwork:Oi,OcaManager:Pe,OcaDeviceManager:Ge,OcaSecurityManager:ve,OcaFirmwareManager:Le,OcaSubscriptionManager:Ve,OcaPowerManager:He,OcaNetworkManager:We,OcaMediaClockManager:Ye,OcaLibraryManager:nt,OcaAudioProcessingManager:rt,OcaDeviceTimeManager:gt,OcaTaskManager:It,OcaCodingManager:Mt,OcaDiagnosticManager:Lt,OcaNetworkSignalChannel:Pi,OcaNetwork:Ei,OcaMediaClock:Ui,OcaStreamNetwork:Ni,OcaStreamConnector:Xi});const Qi={DeviceManager:1,SecurityManager:2,FirmwareManager:3,SubscriptionManager:4,PowerManager:5,NetworkManager:6,MediaClockManager:7,LibraryManager:8,AudioProcessingManager:9,DeviceTimeManager:10,TaskManager:11,CodingManager:12,DiagnosticManager:13};function Ji(e){const t=e.EmitterONo,n=e.EventID;return[t,n.DefLevel,n.EventIndex].join(",")}const Zi={ONo:1055,MethodID:{DefLevel:1,MethodIndex:1}};const $i=Object.values(Yi);function ea(e){return new Promise(t=>setTimeout(t,e))}class ta extends(G({None:0,ParamSet:1,Patch:2,Program:3})){}class na extends(G({Ampere:4,DegreeCelsius:2,Hertz:1,None:0,Ohm:5,Volt:3})){}var ra=Object.freeze({__proto__:null,OcaApplicationNetworkCommand:Ns,OcaApplicationNetworkState:Fs,OcaBaseDataType:Io,OcaBlockMember:kt,OcaClassAuthorityID:class{constructor(e,t,n){this.Sentinel=e,this.Reserved=t,this.OrganizationID=n}},OcaClassIdentification:Se,OcaClassicalFilterShape:bn,OcaComponent:Te,OcaDBr:kn,OcaDelayUnit:fn,OcaDelayValue:Sn,OcaDeviceState:{Operational:1,Disabled:2,Error:4,Initializing:8,Updating:16},OcaDynamicsFunction:Un,OcaEnumItem:class{constructor(e){this.Value=e}},OcaEnumItem16:class{constructor(e){this.Value=e}},OcaEvent:g,OcaEventID:u,OcaFilterPassband:Cn,OcaGlobalTypeIdentifier:Ut,OcaGrouperCitizen:So,OcaGrouperEnrollment:yo,OcaGrouperGroup:bo,OcaGrouperMode:Co,OcaGrouperStatusChangeEventData:vo,OcaGrouperStatusChangeType:Po,OcaImpedance:Nr,OcaLevelDetectionLaw:Rn,OcaLevelMeterLaw:Dr,OcaLibAccess:Yo,OcaLibParamSetAssignment:class{constructor(e,t){this.ParamSetIdentifier=e,this.TargetBlockONo=t}},OcaLibVol:$o,OcaLibVolChangedEventData:ts,OcaLibVolData_ParamSet:Rt,OcaLibVolIdentifier:Qe,OcaLibVolMetadata:Jo,OcaLibVolStandardTypeID:ta,OcaLibVolType:Ze,OcaLibraryIdentifier:et,OcaManagerDefaultObjectNumbers:Qi,OcaManagerDescriptor:H,OcaMediaClockAvailability:ps,OcaMediaClockLockState:ki,OcaMediaClockRate:ms,OcaMediaClockType:Ke,OcaMediaCoding:Ks,OcaMediaConnection:Js,OcaMediaConnectorCommand:$s,OcaMediaConnectorElement:{PinMap:1,Connection:2,Coding:4,AlignmentLevel:8,AlignmentGain:16},OcaMediaConnectorState:ti,OcaMediaConnectorStatus:ri,OcaMediaConnectorStatusChangedEventData:si,OcaMediaSinkConnector:ci,OcaMediaSinkConnectorChangedEventData:hi,OcaMediaSourceConnector:gi,OcaMediaSourceConnectorChangedEventData:pi,OcaMediaStreamCastMode:Ys,OcaMethod:ke,OcaMethodID:Ae,OcaModelDescription:K,OcaModelGUID:Y,OcaMuteState:rn,OcaNetworkControlProtocol:qs,OcaNetworkLinkType:Gi,OcaNetworkMediaProtocol:mi,OcaNetworkMediaSourceOrSink:bi,OcaNetworkSignalChannelStatus:Ci,OcaNetworkStatistics:Ti,OcaNetworkStatus:Ii,OcaNetworkSystemInterfaceDescriptor:js,OcaNetworkSystemInterfaceID:Li,OcaNotificationDeliveryMode:Ue,OcaOPath:fo,OcaObjectIdentification:At,OcaObjectListEventData:Re,OcaObjectSearchResult:Bt,OcaObjectSearchResultFlags:{ONo:1,ClassIdentification:2,ContainerPath:4,Role:8,Label:16},OcaObservationEventData:Vo,OcaObservationListEventData:ds,OcaObserverState:qo,OcaParametricEQShape:vn,OcaPilotToneDetectorSpec:class{constructor(e,t,n){this.Threshold=e,this.Frequency=t,this.PollInterval=n}},OcaPolarityState:an,OcaPort:Kt,OcaPortID:Ht,OcaPortMode:zt,OcaPositionCoordinateSystem:Is,OcaPositionDescriptor:As,OcaPowerState:ze,OcaPowerSupplyLocation:os,OcaPowerSupplyState:is,OcaPowerSupplyType:cs,OcaPresentationUnit:Bn,OcaProperty:Eo,OcaPropertyChangeType:ie,OcaPropertyDescriptor:Lo,OcaPropertyID:ce,OcaProtoObjectIdentification:to,OcaProtoPort:so,OcaProtoPortID:ro,OcaProtoSignalPath:ao,OcaRamperCommand:xo,OcaRamperInterpolationLaw:No,OcaRamperState:Fo,OcaRelationalOperator:Wo,OcaResetCause:ee,OcaSensorReadingState:Pr,OcaSignalPath:Yt,OcaStatus:v,OcaStream:qi,OcaStreamConnectorIdentification:Ri,OcaStreamConnectorStatus:Wi,OcaStreamStatus:Bi,OcaStreamType:Vi,OcaStringComparisonType:Jt,OcaSubscriptionManagerState:Be,OcaSweepType:Hn,OcaTask:mt,OcaTaskCommand:Ot,OcaTaskManagerState:wt,OcaTaskState:_t,OcaTaskStateChangedEventData:Tt,OcaTaskStatus:Gt,OcaTimeMode:pt,OcaTimePTP:ht,OcaTimeProtocol:bs,OcaTimeReferenceType:Cs,OcaTimeSourceAvailability:Ps,OcaTimeSourceSyncStatus:vs,OcaTransferFunction:Ln,OcaUnitOfMeasure:na,OcaVersion:Ie,OcaWaveformType:Kn});class oa extends L{constructor(e,t){super(t),this.ws=e,this._onmessage=e=>{try{this.read(e.data)}catch(e){this.emit("error",e)}},this._onclose=()=>{this.emit("close")},this._onerror=e=>{this.emit("error",e)},e.binaryType="arraybuffer",e.addEventListener("message",this._onmessage),e.addEventListener("close",this._onclose),e.addEventListener("error",this._onerror)}write(e){this.ws.send(e),super.write(e)}static connect(e,t){return new Promise((n,r)=>{const o=new e(t.url),s=function(e){r(e)};o.addEventListener("open",()=>{o.removeEventListener("error",s),n(new this(o,t))}),o.addEventListener("error",s)})}cleanup(){super.cleanup();const e=this.ws;if(e){this.ws=null;try{e.removeEventListener("message",this._onmessage),e.removeEventListener("close",this._onclose),e.removeEventListener("error",this._onerror),e.close()}catch(e){}}}}var sa=Object.freeze({__proto__:null,warn:e,log:function(...e){try{console.log(...e)}catch(e){}},error:t,Connection:_,Command:s,CommandRrq:i,Response:S,Notification:p,KeepAlive:m,messageHeaderSize:10,encodeMessageTo:b,encodeMessage:w,decodeMessage:O,ClientConnection:L,RemoteDevice:class extends n{constructor(e,...t){super(),this.objects=new Map,this.connection=e,e.on("error",e=>{this.emit("error",e)}),e.on("close",e=>{this.emit("close",e)}),this.modules=[],this.add_control_classes(Object.values(Yi)),t.map(e=>this.add_control_classes(e)),this.DeviceManager=new Ge(Qi.DeviceManager,this),this.SecurityManager=new ve(Qi.SecurityManager,this),this.FirmwareManager=new Le(Qi.FirmwareManager,this),this.SubscriptionManager=new Ve(Qi.SubscriptionManager,this),this.PowerManager=new He(Qi.PowerManager,this),this.NetworkManager=new We(Qi.NetworkManager,this),this.MediaClockManager=new Ye(Qi.MediaClockManager,this),this.LibraryManager=new nt(Qi.LibraryManager,this),this.AudioProcessingManager=new rt(Qi.AudioProcessingManager,this),this.DeviceTimeManager=new gt(Qi.DeviceTimeManager,this),this.TaskManager=new It(Qi.TaskManager,this),this.CodingManager=new Mt(Qi.CodingManager,this),this.DiagnosticManager=new Lt(Qi.DiagnosticManager,this),this.Root=new tn(100,this),this.subscriptions=new Map}close(){this.connection.close()}send_command(e,t,n){return this.connection.send_command(e,t,n)}_doSubscribe(e){return this.SubscriptionManager.AddSubscription(e,Zi,new Uint8Array(0),Ue.Reliable,new Uint8Array(0))}async add_subscription(n,r){if(this.connection.is_closed())throw new Error("Connection was closed.");const o=Ji(n),s=this.subscriptions;{const e=s.get(o);if(e)return e.callbacks.add(r),!0}const i=n=>{const r=this.subscriptions.get(o);if(!r)return void e("Subscription lost.");r.callbacks.forEach((function(e){try{e(n)}catch(e){t(e)}}))};this.connection._addSubscriber(n,i);const a={callbacks:new Set([r]),callback:i};s.set(o,a);try{await this._doSubscribe(n)}catch(e){throw s.delete(o),e}}remove_subscription(e,t){const n=Ji(e),r=this.subscriptions.get(n);if(!r)return Promise.reject("Callback not registered.");const o=r.callbacks;return o.delete(t),o.size?Promise.resolve(!0):(this.connection._removeSubscriber(e),this.subscriptions.delete(n),this.SubscriptionManager.RemoveSubscription(e,Zi))}find_best_class(e){for("object"==typeof e&&e.ClassID&&(e=e.ClassID);e.length;){const t=this.find_class_by_id(e);if(t)return t;e=e.substr(0,e.length-1)}return null}add_control_classes(e){if(Array.isArray(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[r.ClassID]=r}e=t}else if("object"!=typeof e)throw new Error("Unsupported module.");this.modules.push(e)}find_class_by_id(e){"object"==typeof e&&e.ClassID&&(e=e.ClassID);const t=this.modules;for(let n=t.length-1;n>=0;n--){const r=t[n][e];if(r)return r}return null}allocate(e,t){"object"==typeof t&&(t=t.valueOf());const n=this.objects;return n.has(t)||n.set(t,new e(t,this)),n.get(t)}resolve_object(e){if("MemberObjectIdentification"in e)return this.resolve_object(e.MemberObjectIdentification);if("ONo"in e&&"ClassIdentification"in e){const t=e.ONo,n=e.ClassIdentification;return this.allocate(this.find_best_class(n),t)}throw new TypeError("Expected OcaObjectIdentification or OcaBlockMember")}GetDeviceTree(){const e=t=>t.GetMembers().then(t=>{const n=[];t=t.map(this.resolve_object,this);for(let r=0;r<t.length;r++)n.push(Promise.resolve(t[r])),t[r].ClassID.startsWith(tn.ClassID)&&n.push(e(t[r]));return Promise.all(n)});return e(this.Root)}get_device_tree(){return this.GetDeviceTree()}get_role_map(e){return this.get_device_tree().then((function(t){return function(e,t){const n=new Map;t||(t="/");const r=[],o=e=>{Array.isArray(e)?e.forEach(o):r.push(e.GetRole().then(t=>{n.set(e,t)}))};return e.forEach(o),Promise.all(r).then((function(){const r=new Map,o=(e,s)=>{const i=null!=s?s+t:"",a=new Map;e.forEach((function(e,t){if(Array.isArray(e))return;const r=n.get(e);if(a.has(r)){const t=a.get(r);Array.isArray(t)?t.push(e):a.set(r,[t,e])}else a.set(r,e)})),a.forEach((function(e,t){if(Array.isArray(e)){let n=1;for(let r=0;r<e.length;r++){let o;for(;a.has(o=t+n);)n++;a.set(o,e[r]),a.set(e[r],o)}a.delete(t)}else a.set(e,t)})),e.forEach((t,n)=>{if(Array.isArray(t))o(t,i+a.get(e[n-1]));else{const e=i+a.get(t);r.set(e,t)}})};return o(e,null),r}))}(t,e)}))}discover_all_fallback(){return this.GetDeviceTree().then(e=>{const t=[],n=function(e){for(let r=0;r<e.length;r++)Array.isArray(e[r])?n(e[r]):t.push(e[r])};return n(e),t})}discover_all(){return this.Root.GetMembersRecursive().then(e=>e.map(this.resolve_object,this)).catch(()=>this.discover_all_fallback())}set_keepalive_interval(e){this.connection.set_keepalive_interval(e)}},define_custom_class:function(e,t,n,r,o,s,i,a){if(n=String.fromCharCode.apply(String,n.split(".").map(e=>parseInt(e))),o){if("string"==typeof o)for(let e=0;e<$i.length;e++)if($i[e].ClassName===o){o=$i[e];break}}else{const e=n.substr(0,n.length-1);for(let t=0;t<$i.length;t++)if($i[t].ClassID===e){o=$i[t];break}}if("function"!=typeof o)throw new Error("Unknown parent class.");return pe(e,t,n,r,o,s,i,a)},AbstractUDPConnection:class extends L{constructor(e,t){t.batch>=0||(t.batch=128),super(t),this.socket=e,this.delay=t.delay>=0?t.delay:5,this.retry_interval=t.retry_interval>=0?t.retry_interval:250,this.retry_count=t.retry_count>=0?t.retry_count:3,this._write_out_id=-1,this._write_out_callback=()=>{this._write_out_id=-1,this._write_out()},this._retry_id=this.retry_interval>0?setInterval(()=>this._retryCommands(),this.retry_interval):-1,this.q=[],e.onmessage=e=>{try{this.read(e)}catch(e){console.warn("Failed to parse incoming AES70 packet: %o",e)}null!==this.inbuf&&this.close()},e.onerror=e=>this.error(e),this.set_keepalive_interval(1)}get is_reliable(){return!1}static async connect(e,t){const n=await e.connect(t.host,t.port,t.type);return await async function(e,t){const n=e.receiveMessage().then(e=>{const t=[],n=O(new DataView(e),0,t);if(1!==t.length)throw new Error("Expected keepalive response.");if(n!==e.byteLength)throw new Error("Trailing data in initial keepalive pdu.");return!0}),r=w(new m(1e3)),o=5*(t.retry_interval||250);for(let t=0;t<3;t++)if(e.send(r),await Promise.race([n,ea(o)]))return;throw new Error("Failed to connect.")}(n,t),new this(n,t)}write(e){this.q.push(e),this.tx_idle_time()>=this.delay?this._write_out():this._schedule_write_out()}flush(){super.flush(),this.tx_idle_time()>this.delay&&this._write_out()}cleanup(){super.cleanup(),this.socket&&(this.socket.close(),this.socket=null),-1!==this._write_out_id&&(clearTimeout(this._write_out_id),this._write_out_id=-1),-1!==this._retry_id&&(clearInterval(this._retry_id),this._retry_id=-1)}_estimate_next_tx_time(){return this._now()+(this.delay+2)*this.q.length}_write_out(){if(!this.socket)return;const e=this.q;if(!e.length)return;const t=e.shift();this.socket.send(t),super.write(t),e.length&&this._schedule_write_out()}_schedule_write_out(){const e=this.tx_idle_time(),t=this.delay;e>=t?this._write_out():-1===this._write_out_id&&(this._write_out_id=setTimeout(this._write_out_callback,t-e))}_retryCommands(){const e=this._now(),t=e-this.retry_interval,n=this.retry_interval/this.delay*5-this.q.length,r=this._pendingCommands,o=[],s=[];for(const e of r){const[,r]=e;if(r.lastSent>t)break;r.retries>=this.retry_count?s.push(e):o.length<n&&o.push(e)}if(s.length){const e=new Error("Timeout.");s.forEach(([t,n])=>{r.delete(t),n.reject(e)})}o.forEach(([t,n])=>{r.delete(t),r.set(t,n),this.send(n.command),n.lastSent=e,n.retries++})}},RemoteControlClasses:Yi,Types:ra,WebSocketConnection:class extends oa{static connect(e){return super.connect(WebSocket,e)}_now(){return performance.now()}}});window.OCA=sa}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aes70",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "description": "A controller library for the AES70 protocol.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -17,7 +17,8 @@
17
17
  "test": "node --test tests/*.test.js",
18
18
  "prepublishOnly": "make",
19
19
  "docs": "cd esdoc && npm run build",
20
- "prettier": "cd prettier && npm run prettier",
20
+ "prettier": "npx prettier@2.0.5 --write .",
21
+ "format": "npx prettier@2.0.5 --write .",
21
22
  "eslint": "./eslint/node_modules/.bin/eslint ."
22
23
  },
23
24
  "repository": {
@@ -0,0 +1,26 @@
1
+ export declare interface IOCP1Encoder<EncodeType, DecodeType> {
2
+ /**
3
+ * Returns true if the encoding of values has constant byte length.
4
+ */
5
+ isConstantLength: boolean;
6
+
7
+ /**
8
+ * Returns the length in bytes used by the encoding of value.
9
+ */
10
+ encodedLength(value: EncodeType): number;
11
+
12
+ /**
13
+ * Encodes value into dst starting at position pos.
14
+ */
15
+ encodeTo(dst: DataView, pos: number, value: EncodeType): number;
16
+
17
+ /**
18
+ * Decodes a value from src at position pos.
19
+ */
20
+ decodeFrom(src: DataView, pos: number): [number, DecodeType];
21
+
22
+ /**
23
+ * Returns the length in bytes of the encoded value in src at position pos.
24
+ */
25
+ decodeLength(src: DataView, pos: number): number;
26
+ }
package/src/types/Enum.js CHANGED
@@ -40,6 +40,10 @@ export function Enum(values) {
40
40
  }
41
41
 
42
42
  const result = class {
43
+ get isEnum() {
44
+ return true;
45
+ }
46
+
43
47
  constructor(value) {
44
48
  if (typeof value === 'string') {
45
49
  if (!hasOwnProperty(values, value))