buttplug 3.2.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/.eslintrc.js +25 -25
  2. package/.jscsrc +2 -2
  3. package/.jshintrc +5 -5
  4. package/.prettierrc.json +3 -3
  5. package/.yarnrc.yml +5 -5
  6. package/CHANGELOG.md +577 -577
  7. package/LICENSE +27 -27
  8. package/README.md +97 -97
  9. package/dist/main/src/client/ButtplugBrowserWebsocketClientConnector.js +6 -9
  10. package/dist/main/src/client/ButtplugBrowserWebsocketClientConnector.js.map +1 -1
  11. package/dist/main/src/client/{Client.d.ts → ButtplugClient.d.ts} +3 -4
  12. package/dist/main/src/client/ButtplugClient.js +227 -0
  13. package/dist/main/src/client/ButtplugClient.js.map +1 -0
  14. package/dist/main/src/client/ButtplugClientConnectorException.js +17 -7
  15. package/dist/main/src/client/ButtplugClientConnectorException.js.map +1 -1
  16. package/dist/main/src/client/ButtplugClientDevice.d.ts +13 -28
  17. package/dist/main/src/client/ButtplugClientDevice.js +105 -247
  18. package/dist/main/src/client/ButtplugClientDevice.js.map +1 -1
  19. package/dist/main/src/client/ButtplugClientDeviceCommand.d.ts +42 -0
  20. package/dist/main/src/client/ButtplugClientDeviceCommand.js +105 -0
  21. package/dist/main/src/client/ButtplugClientDeviceCommand.js.map +1 -0
  22. package/dist/main/src/client/ButtplugClientDeviceFeature.d.ts +18 -0
  23. package/dist/main/src/client/ButtplugClientDeviceFeature.js +166 -0
  24. package/dist/main/src/client/ButtplugClientDeviceFeature.js.map +1 -0
  25. package/dist/main/src/client/ButtplugNodeWebsocketClientConnector.d.ts +1 -8
  26. package/dist/main/src/client/ButtplugNodeWebsocketClientConnector.js +1 -4
  27. package/dist/main/src/client/ButtplugNodeWebsocketClientConnector.js.map +1 -1
  28. package/dist/main/src/core/Exceptions.js +27 -9
  29. package/dist/main/src/core/Exceptions.js.map +1 -1
  30. package/dist/main/src/core/Logging.js +12 -6
  31. package/dist/main/src/core/Logging.js.map +1 -1
  32. package/dist/main/src/core/Messages.d.ts +118 -228
  33. package/dist/main/src/core/Messages.js +51 -404
  34. package/dist/main/src/core/Messages.js.map +1 -1
  35. package/dist/main/src/index.d.ts +2 -2
  36. package/dist/main/src/index.js +4 -2
  37. package/dist/main/src/index.js.map +1 -1
  38. package/dist/main/src/utils/ButtplugBrowserWebsocketConnector.js +40 -52
  39. package/dist/main/src/utils/ButtplugBrowserWebsocketConnector.js.map +1 -1
  40. package/dist/main/src/utils/ButtplugMessageSorter.js +27 -15
  41. package/dist/main/src/utils/ButtplugMessageSorter.js.map +1 -1
  42. package/dist/main/src/utils/Utils.js +1 -2
  43. package/dist/main/src/utils/Utils.js.map +1 -1
  44. package/dist/web/buttplug.js +1 -38
  45. package/dist/web/buttplug.mjs +595 -1984
  46. package/dist/web/client/ButtplugBrowserWebsocketClientConnector.d.ts +0 -7
  47. package/dist/web/client/{Client.d.ts → ButtplugClient.d.ts} +3 -11
  48. package/dist/web/client/ButtplugClientConnectorException.d.ts +0 -7
  49. package/dist/web/client/ButtplugClientDevice.d.ts +14 -29
  50. package/dist/web/client/ButtplugClientDeviceCommand.d.ts +42 -0
  51. package/dist/web/client/ButtplugClientDeviceFeature.d.ts +18 -0
  52. package/dist/web/client/ButtplugNodeWebsocketClientConnector.d.ts +1 -15
  53. package/dist/web/client/IButtplugClientConnector.d.ts +0 -7
  54. package/dist/web/core/Exceptions.d.ts +1 -1
  55. package/dist/web/core/Logging.d.ts +0 -7
  56. package/dist/web/core/Messages.d.ts +118 -227
  57. package/dist/web/index.d.ts +2 -2
  58. package/dist/web/utils/ButtplugBrowserWebsocketConnector.d.ts +0 -7
  59. package/examples/node/SYNC_MANIFEST.md +105 -0
  60. package/examples/node/application-example.ts +213 -0
  61. package/examples/node/async-example.ts +124 -0
  62. package/examples/node/connection-example.ts +76 -0
  63. package/examples/node/device-control-example.ts +131 -0
  64. package/examples/node/device-enumeration-example.ts +86 -0
  65. package/examples/node/device-info-example.ts +131 -0
  66. package/examples/node/errors-example.ts +166 -0
  67. package/examples/node/package-lock.json +281 -0
  68. package/examples/node/package.json +25 -0
  69. package/examples/node/remote-connector-example.ts +84 -0
  70. package/examples/node/tsconfig.json +14 -0
  71. package/examples/web/application-example.js +197 -0
  72. package/examples/web/async-example.js +90 -0
  73. package/examples/web/device-control-example.js +87 -0
  74. package/examples/web/device-enumeration-example.js +49 -0
  75. package/examples/web/device-info-example.js +100 -0
  76. package/examples/web/errors-example.js +110 -0
  77. package/examples/web/index.html +55 -0
  78. package/examples/web/logging.js +42 -0
  79. package/examples/web/ping-timeout-example.js +59 -0
  80. package/examples/web/remote-connector-example.js +68 -0
  81. package/node-test.js +24 -0
  82. package/node-test.ts +23 -5
  83. package/package.json +85 -87
  84. package/src/client/ButtplugBrowserWebsocketClientConnector.ts +25 -25
  85. package/src/client/ButtplugClient.ts +242 -0
  86. package/src/client/ButtplugClientConnectorException.ts +16 -16
  87. package/src/client/ButtplugClientDevice.ts +178 -401
  88. package/src/client/ButtplugClientDeviceCommand.ts +112 -0
  89. package/src/client/ButtplugClientDeviceFeature.ts +138 -0
  90. package/src/client/ButtplugNodeWebsocketClientConnector.ts +17 -17
  91. package/src/client/IButtplugClientConnector.ts +18 -18
  92. package/src/core/Exceptions.ts +107 -101
  93. package/src/core/Logging.ts +197 -197
  94. package/src/core/Messages.ts +209 -480
  95. package/src/core/index.d.ts +4 -4
  96. package/src/index.ts +21 -19
  97. package/src/utils/ButtplugBrowserWebsocketConnector.ts +89 -89
  98. package/src/utils/ButtplugMessageSorter.ts +66 -65
  99. package/src/utils/Utils.ts +3 -3
  100. package/tsconfig.json +22 -22
  101. package/tsfmt.json +14 -14
  102. package/tslint.json +27 -27
  103. package/typedocconfig.js +6 -6
  104. package/vite.config.ts +26 -26
  105. package/dist/main/src/client/Client.js +0 -242
  106. package/dist/main/src/client/Client.js.map +0 -1
  107. package/dist/main/src/core/MessageUtils.d.ts +0 -10
  108. package/dist/main/src/core/MessageUtils.js +0 -65
  109. package/dist/main/src/core/MessageUtils.js.map +0 -1
  110. package/dist/web/core/MessageUtils.d.ts +0 -10
  111. package/doc/.nojekyll +0 -1
  112. package/doc/assets/highlight.css +0 -22
  113. package/doc/assets/main.js +0 -58
  114. package/doc/assets/search.js +0 -1
  115. package/doc/assets/style.css +0 -1280
  116. package/doc/classes/ButtplugBrowserWebsocketClientConnector.html +0 -234
  117. package/doc/classes/ButtplugClient.html +0 -331
  118. package/doc/classes/ButtplugClientConnectorException.html +0 -216
  119. package/doc/classes/ButtplugClientDevice.html +0 -489
  120. package/doc/classes/ButtplugDeviceError.html +0 -218
  121. package/doc/classes/ButtplugDeviceMessage.html +0 -165
  122. package/doc/classes/ButtplugError.html +0 -220
  123. package/doc/classes/ButtplugInitError.html +0 -218
  124. package/doc/classes/ButtplugLogger.html +0 -288
  125. package/doc/classes/ButtplugMessage.html +0 -147
  126. package/doc/classes/ButtplugMessageError.html +0 -218
  127. package/doc/classes/ButtplugMessageSorter.html +0 -128
  128. package/doc/classes/ButtplugNodeWebsocketClientConnector.html +0 -239
  129. package/doc/classes/ButtplugPingError.html +0 -218
  130. package/doc/classes/ButtplugSystemMessage.html +0 -150
  131. package/doc/classes/ButtplugUnknownError.html +0 -218
  132. package/doc/classes/DeviceAdded.html +0 -186
  133. package/doc/classes/DeviceInfo.html +0 -114
  134. package/doc/classes/DeviceList.html +0 -160
  135. package/doc/classes/DeviceRemoved.html +0 -158
  136. package/doc/classes/Error.html +0 -179
  137. package/doc/classes/GenericDeviceMessageAttributes.html +0 -107
  138. package/doc/classes/GenericMessageSubcommand.html +0 -90
  139. package/doc/classes/LinearCmd.html +0 -187
  140. package/doc/classes/LogMessage.html +0 -134
  141. package/doc/classes/MessageAttributes.html +0 -160
  142. package/doc/classes/Ok.html +0 -151
  143. package/doc/classes/Ping.html +0 -151
  144. package/doc/classes/RawDeviceMessageAttributes.html +0 -86
  145. package/doc/classes/RawReadCmd.html +0 -188
  146. package/doc/classes/RawReading.html +0 -179
  147. package/doc/classes/RawSubscribeCmd.html +0 -170
  148. package/doc/classes/RawUnsubscribeCmd.html +0 -170
  149. package/doc/classes/RawWriteCmd.html +0 -188
  150. package/doc/classes/RequestDeviceList.html +0 -151
  151. package/doc/classes/RequestServerInfo.html +0 -169
  152. package/doc/classes/RotateCmd.html +0 -187
  153. package/doc/classes/RotateSubcommand.html +0 -108
  154. package/doc/classes/ScalarCmd.html +0 -170
  155. package/doc/classes/ScalarSubcommand.html +0 -108
  156. package/doc/classes/ScanningFinished.html +0 -146
  157. package/doc/classes/SensorDeviceMessageAttributes.html +0 -107
  158. package/doc/classes/SensorReadCmd.html +0 -179
  159. package/doc/classes/SensorReading.html +0 -188
  160. package/doc/classes/ServerInfo.html +0 -178
  161. package/doc/classes/StartScanning.html +0 -151
  162. package/doc/classes/StopAllDevices.html +0 -151
  163. package/doc/classes/StopDeviceCmd.html +0 -161
  164. package/doc/classes/StopScanning.html +0 -151
  165. package/doc/classes/VectorSubcommand.html +0 -108
  166. package/doc/enums/ActuatorType.html +0 -104
  167. package/doc/enums/ButtplugLogLevel.html +0 -97
  168. package/doc/enums/ErrorClass.html +0 -90
  169. package/doc/enums/SensorType.html +0 -90
  170. package/doc/functions/FromJSON.html +0 -113
  171. package/doc/index.html +0 -184
  172. package/doc/interfaces/IButtplugClientConnector.html +0 -137
  173. package/doc/modules.html +0 -176
  174. package/doc/variables/DEFAULT_MESSAGE_ID.html +0 -104
  175. package/doc/variables/MAX_ID.html +0 -104
  176. package/doc/variables/MESSAGE_SPEC_VERSION.html +0 -104
  177. package/doc/variables/SYSTEM_MESSAGE_ID.html +0 -104
  178. package/src/client/Client.ts +0 -276
  179. package/src/core/MessageUtils.ts +0 -48
@@ -1,242 +0,0 @@
1
- /*!
2
- * Buttplug JS Source Code File - Visit https://buttplug.io for more info about
3
- * the project. Licensed under the BSD 3-Clause license. See LICENSE file in the
4
- * project root for full license information.
5
- *
6
- * @copyright Copyright (c) Nonpolynomial Labs LLC. All rights reserved.
7
- */
8
- 'use strict';
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
33
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
34
- return new (P || (P = Promise))(function (resolve, reject) {
35
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
36
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
37
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
38
- step((generator = generator.apply(thisArg, _arguments || [])).next());
39
- });
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.ButtplugClient = void 0;
43
- const Logging_1 = require("../core/Logging");
44
- const eventemitter3_1 = require("eventemitter3");
45
- const ButtplugClientDevice_1 = require("./ButtplugClientDevice");
46
- const ButtplugMessageSorter_1 = require("../utils/ButtplugMessageSorter");
47
- const Messages = __importStar(require("../core/Messages"));
48
- const Exceptions_1 = require("../core/Exceptions");
49
- const ButtplugClientConnectorException_1 = require("./ButtplugClientConnectorException");
50
- const MessageUtils_1 = require("../core/MessageUtils");
51
- class ButtplugClient extends eventemitter3_1.EventEmitter {
52
- constructor(clientName = 'Generic Buttplug Client') {
53
- super();
54
- this._pingTimer = null;
55
- this._connector = null;
56
- this._devices = new Map();
57
- this._logger = Logging_1.ButtplugLogger.Logger;
58
- this._isScanning = false;
59
- this._sorter = new ButtplugMessageSorter_1.ButtplugMessageSorter(true);
60
- this.connect = (connector) => __awaiter(this, void 0, void 0, function* () {
61
- this._logger.Info(`ButtplugClient: Connecting using ${connector.constructor.name}`);
62
- yield connector.connect();
63
- this._connector = connector;
64
- this._connector.addListener('message', this.parseMessages);
65
- this._connector.addListener('disconnect', this.disconnectHandler);
66
- yield this.initializeConnection();
67
- });
68
- this.disconnect = () => __awaiter(this, void 0, void 0, function* () {
69
- this._logger.Debug('ButtplugClient: Disconnect called');
70
- this.checkConnector();
71
- yield this.shutdownConnection();
72
- yield this._connector.disconnect();
73
- });
74
- this.startScanning = () => __awaiter(this, void 0, void 0, function* () {
75
- this._logger.Debug('ButtplugClient: StartScanning called');
76
- this._isScanning = true;
77
- yield this.sendMsgExpectOk(new Messages.StartScanning());
78
- });
79
- this.stopScanning = () => __awaiter(this, void 0, void 0, function* () {
80
- this._logger.Debug('ButtplugClient: StopScanning called');
81
- this._isScanning = false;
82
- yield this.sendMsgExpectOk(new Messages.StopScanning());
83
- });
84
- this.stopAllDevices = () => __awaiter(this, void 0, void 0, function* () {
85
- this._logger.Debug('ButtplugClient: StopAllDevices');
86
- yield this.sendMsgExpectOk(new Messages.StopAllDevices());
87
- });
88
- this.disconnectHandler = () => {
89
- this._logger.Info('ButtplugClient: Disconnect event receieved.');
90
- this.emit('disconnect');
91
- };
92
- this.parseMessages = (msgs) => {
93
- const leftoverMsgs = this._sorter.ParseIncomingMessages(msgs);
94
- for (const x of leftoverMsgs) {
95
- switch ((0, MessageUtils_1.getMessageClassFromMessage)(x)) {
96
- case Messages.DeviceAdded: {
97
- const addedMsg = x;
98
- const addedDevice = ButtplugClientDevice_1.ButtplugClientDevice.fromMsg(addedMsg, this.sendDeviceMessageClosure);
99
- this._devices.set(addedMsg.DeviceIndex, addedDevice);
100
- this.emit('deviceadded', addedDevice);
101
- break;
102
- }
103
- case Messages.DeviceRemoved: {
104
- const removedMsg = x;
105
- if (this._devices.has(removedMsg.DeviceIndex)) {
106
- const removedDevice = this._devices.get(removedMsg.DeviceIndex);
107
- removedDevice === null || removedDevice === void 0 ? void 0 : removedDevice.emitDisconnected();
108
- this._devices.delete(removedMsg.DeviceIndex);
109
- this.emit('deviceremoved', removedDevice);
110
- }
111
- break;
112
- }
113
- case Messages.ScanningFinished:
114
- this._isScanning = false;
115
- this.emit('scanningfinished', x);
116
- break;
117
- }
118
- }
119
- };
120
- this.initializeConnection = () => __awaiter(this, void 0, void 0, function* () {
121
- this.checkConnector();
122
- const msg = yield this.sendMessage(new Messages.RequestServerInfo(this._clientName, Messages.MESSAGE_SPEC_VERSION));
123
- switch ((0, MessageUtils_1.getMessageClassFromMessage)(msg)) {
124
- case Messages.ServerInfo: {
125
- const serverinfo = msg;
126
- this._logger.Info(`ButtplugClient: Connected to Server ${serverinfo.ServerName}`);
127
- // TODO: maybe store server name, do something with message template version?
128
- const ping = serverinfo.MaxPingTime;
129
- if (serverinfo.MessageVersion < Messages.MESSAGE_SPEC_VERSION) {
130
- // Disconnect and throw an exception explaining the version mismatch problem.
131
- yield this._connector.disconnect();
132
- throw Exceptions_1.ButtplugError.LogAndError(Exceptions_1.ButtplugInitError, this._logger, `Server protocol version ${serverinfo.MessageVersion} is older than client protocol version ${Messages.MESSAGE_SPEC_VERSION}. Please update server.`);
133
- }
134
- if (ping > 0) {
135
- /*
136
- this._pingTimer = setInterval(async () => {
137
- // If we've disconnected, stop trying to ping the server.
138
- if (!this.Connected) {
139
- await this.ShutdownConnection();
140
- return;
141
- }
142
- await this.SendMessage(new Messages.Ping());
143
- } , Math.round(ping / 2));
144
- */
145
- }
146
- yield this.requestDeviceList();
147
- return true;
148
- }
149
- case Messages.Error: {
150
- // Disconnect and throw an exception with the error message we got back.
151
- // This will usually only error out if we have a version mismatch that the
152
- // server has detected.
153
- yield this._connector.disconnect();
154
- const err = msg;
155
- throw Exceptions_1.ButtplugError.LogAndError(Exceptions_1.ButtplugInitError, this._logger, `Cannot connect to server. ${err.ErrorMessage}`);
156
- }
157
- }
158
- return false;
159
- });
160
- this.requestDeviceList = () => __awaiter(this, void 0, void 0, function* () {
161
- this.checkConnector();
162
- this._logger.Debug('ButtplugClient: ReceiveDeviceList called');
163
- const deviceList = (yield this.sendMessage(new Messages.RequestDeviceList()));
164
- deviceList.Devices.forEach((d) => {
165
- if (!this._devices.has(d.DeviceIndex)) {
166
- const device = ButtplugClientDevice_1.ButtplugClientDevice.fromMsg(d, this.sendDeviceMessageClosure);
167
- this._logger.Debug(`ButtplugClient: Adding Device: ${device}`);
168
- this._devices.set(d.DeviceIndex, device);
169
- this.emit('deviceadded', device);
170
- }
171
- else {
172
- this._logger.Debug(`ButtplugClient: Device already added: ${d}`);
173
- }
174
- });
175
- });
176
- this.shutdownConnection = () => __awaiter(this, void 0, void 0, function* () {
177
- yield this.stopAllDevices();
178
- if (this._pingTimer !== null) {
179
- clearInterval(this._pingTimer);
180
- this._pingTimer = null;
181
- }
182
- });
183
- this.sendMsgExpectOk = (msg) => __awaiter(this, void 0, void 0, function* () {
184
- const response = yield this.sendMessage(msg);
185
- switch ((0, MessageUtils_1.getMessageClassFromMessage)(response)) {
186
- case Messages.Ok:
187
- return;
188
- case Messages.Error:
189
- throw Exceptions_1.ButtplugError.FromError(response);
190
- default:
191
- throw Exceptions_1.ButtplugError.LogAndError(Exceptions_1.ButtplugMessageError, this._logger, `Message type ${(0, MessageUtils_1.getMessageClassFromMessage)(response).constructor} not handled by SendMsgExpectOk`);
192
- }
193
- });
194
- this.sendDeviceMessageClosure = (device, msg) => __awaiter(this, void 0, void 0, function* () {
195
- return yield this.sendDeviceMessage(device, msg);
196
- });
197
- this._clientName = clientName;
198
- this._logger.Debug(`ButtplugClient: Client ${clientName} created.`);
199
- }
200
- get connected() {
201
- return this._connector !== null && this._connector.Connected;
202
- }
203
- get devices() {
204
- // While this function doesn't actually send a message, if we don't have a
205
- // connector, we shouldn't have devices.
206
- this.checkConnector();
207
- const devices = [];
208
- this._devices.forEach((d) => {
209
- devices.push(d);
210
- });
211
- return devices;
212
- }
213
- get isScanning() {
214
- return this._isScanning;
215
- }
216
- sendDeviceMessage(device, deviceMsg) {
217
- return __awaiter(this, void 0, void 0, function* () {
218
- this.checkConnector();
219
- const dev = this._devices.get(device.index);
220
- if (dev === undefined) {
221
- throw Exceptions_1.ButtplugError.LogAndError(Exceptions_1.ButtplugDeviceError, this._logger, `Device ${device.index} not available.`);
222
- }
223
- deviceMsg.DeviceIndex = device.index;
224
- return yield this.sendMessage(deviceMsg);
225
- });
226
- }
227
- sendMessage(msg) {
228
- return __awaiter(this, void 0, void 0, function* () {
229
- this.checkConnector();
230
- const p = this._sorter.PrepareOutgoingMessage(msg);
231
- yield this._connector.send(msg);
232
- return yield p;
233
- });
234
- }
235
- checkConnector() {
236
- if (!this.connected) {
237
- throw new ButtplugClientConnectorException_1.ButtplugClientConnectorException('ButtplugClient not connected');
238
- }
239
- }
240
- }
241
- exports.ButtplugClient = ButtplugClient;
242
- //# sourceMappingURL=Client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Client.js","sourceRoot":"","sources":["../../../../src/client/Client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,6CAAiD;AACjD,iDAA6C;AAC7C,iEAA8D;AAE9D,0EAAuE;AAEvE,2DAA6C;AAC7C,mDAK4B;AAC5B,yFAAsF;AACtF,uDAAkE;AAElE,MAAa,cAAe,SAAQ,4BAAY;IAS9C,YAAY,UAAU,GAAG,yBAAyB;QAChD,KAAK,EAAE,CAAC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C,UAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACjC,OAAO,MAAM,CAAC,CAAC;QACjB,CAAC;KAAA;IAES,cAAc;QACtB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,MAAM,IAAI,mEAAgC,CACxC,8BAA8B,CAC/B,CAAC;SACH;IACH,CAAC;CA0BF;AAzPD,wCAyPC"}
@@ -1,10 +0,0 @@
1
- /*!
2
- * Buttplug JS Source Code File - Visit https://buttplug.io for more info about
3
- * the project. Licensed under the BSD 3-Clause license. See LICENSE file in the
4
- * project root for full license information.
5
- *
6
- * @copyright Copyright (c) Nonpolynomial Labs LLC. All rights reserved.
7
- */
8
- import * as Messages from './Messages';
9
- export declare function getMessageClassFromMessage(msg: Messages.ButtplugMessage): (new (...args: unknown[]) => Messages.ButtplugMessage) | null;
10
- export declare function fromJSON(str: any): Messages.ButtplugMessage[];
@@ -1,65 +0,0 @@
1
- /*!
2
- * Buttplug JS Source Code File - Visit https://buttplug.io for more info about
3
- * the project. Licensed under the BSD 3-Clause license. See LICENSE file in the
4
- * project root for full license information.
5
- *
6
- * @copyright Copyright (c) Nonpolynomial Labs LLC. All rights reserved.
7
- */
8
- 'use strict';
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
- Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.fromJSON = exports.getMessageClassFromMessage = void 0;
34
- const class_transformer_1 = require("class-transformer");
35
- const Messages = __importStar(require("./Messages"));
36
- function getMessageClass(type) {
37
- for (const value of Object.values(Messages)) {
38
- if (typeof value === 'function' && 'Name' in value && value.Name === type) {
39
- return value;
40
- }
41
- }
42
- return null;
43
- }
44
- function getMessageClassFromMessage(msg) {
45
- // Making the bold assumption all message classes have the Name static. Should define a
46
- // requirement for this in the abstract class.
47
- return getMessageClass(Object.getPrototypeOf(msg).constructor.Name);
48
- }
49
- exports.getMessageClassFromMessage = getMessageClassFromMessage;
50
- function fromJSON(str) {
51
- const msgarray = JSON.parse(str);
52
- const msgs = [];
53
- for (const x of Array.from(msgarray)) {
54
- const type = Object.getOwnPropertyNames(x)[0];
55
- const cls = getMessageClass(type);
56
- if (cls) {
57
- const msg = (0, class_transformer_1.plainToInstance)(cls, x[type]);
58
- msg.update();
59
- msgs.push(msg);
60
- }
61
- }
62
- return msgs;
63
- }
64
- exports.fromJSON = fromJSON;
65
- //# sourceMappingURL=MessageUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MessageUtils.js","sourceRoot":"","sources":["../../../../src/core/MessageUtils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,yDAAoD;AACpD,qDAAuC;AAEvC,SAAS,eAAe,CACtB,IAAY;IAEZ,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QAC3C,IAAI,OAAO,KAAK,KAAK,UAAU,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE;YACzE,OAAO,KAAK,CAAC;SACd;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,0BAA0B,CACxC,GAA6B;IAE7B,uFAAuF;IACvF,8CAA8C;IAC9C,OAAO,eAAe,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACtE,CAAC;AAND,gEAMC;AAED,SAAgB,QAAQ,CAAC,GAAG;IAC1B,MAAM,QAAQ,GAAa,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3C,MAAM,IAAI,GAA+B,EAAE,CAAC;IAC5C,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;QACpC,MAAM,IAAI,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9C,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,GAAG,EAAE;YACP,MAAM,GAAG,GAAG,IAAA,mCAAe,EACzB,GAAG,EACH,CAAC,CAAC,IAAI,CAAC,CACR,CAAC;YACF,GAAG,CAAC,MAAM,EAAE,CAAC;YACb,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAChB;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAhBD,4BAgBC"}
@@ -1,10 +0,0 @@
1
- /*!
2
- * Buttplug JS Source Code File - Visit https://buttplug.io for more info about
3
- * the project. Licensed under the BSD 3-Clause license. See LICENSE file in the
4
- * project root for full license information.
5
- *
6
- * @copyright Copyright (c) Nonpolynomial Labs LLC. All rights reserved.
7
- */
8
- import * as Messages from './Messages';
9
- export declare function getMessageClassFromMessage(msg: Messages.ButtplugMessage): (new (...args: unknown[]) => Messages.ButtplugMessage) | null;
10
- export declare function fromJSON(str: any): Messages.ButtplugMessage[];
package/doc/.nojekyll DELETED
@@ -1 +0,0 @@
1
- TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
@@ -1,22 +0,0 @@
1
- :root {
2
- --light-code-background: #FFFFFF;
3
- --dark-code-background: #1E1E1E;
4
- }
5
-
6
- @media (prefers-color-scheme: light) { :root {
7
- --code-background: var(--light-code-background);
8
- } }
9
-
10
- @media (prefers-color-scheme: dark) { :root {
11
- --code-background: var(--dark-code-background);
12
- } }
13
-
14
- :root[data-theme='light'] {
15
- --code-background: var(--light-code-background);
16
- }
17
-
18
- :root[data-theme='dark'] {
19
- --code-background: var(--dark-code-background);
20
- }
21
-
22
- pre, code { background: var(--code-background); }
@@ -1,58 +0,0 @@
1
- "use strict";
2
- "use strict";(()=>{var Qe=Object.create;var ae=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var _e=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Me=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ce(e))!Re.call(t,i)&&i!==n&&ae(t,i,{get:()=>e[i],enumerable:!(r=Pe(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Qe(Oe(t)):{},Me(e||!t||!t.__esModule?ae(n,"default",{value:t,enumerable:!0}):n,t));var de=_e((ce,he)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i<r.length;i++){var s=r[i],o=e[s];if(Array.isArray(o)){n[s]=o.slice();continue}if(typeof o=="string"||typeof o=="number"||typeof o=="boolean"){n[s]=o;continue}throw new TypeError("clone is not deep and does not support nested objects")}return n},t.FieldRef=function(e,n,r){this.docRef=e,this.fieldName=n,this._stringValue=r},t.FieldRef.joiner="/",t.FieldRef.fromString=function(e){var n=e.indexOf(t.FieldRef.joiner);if(n===-1)throw"malformed field ref string";var r=e.slice(0,n),i=e.slice(n+1);return new t.FieldRef(i,r,e)},t.FieldRef.prototype.toString=function(){return this._stringValue==null&&(this._stringValue=this.fieldName+t.FieldRef.joiner+this.docRef),this._stringValue};t.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var n=0;n<this.length;n++)this.elements[e[n]]=!0}else this.length=0},t.Set.complete={intersect:function(e){return e},union:function(){return this},contains:function(){return!0}},t.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},t.Set.prototype.contains=function(e){return!!this.elements[e]},t.Set.prototype.intersect=function(e){var n,r,i,s=[];if(e===t.Set.complete)return this;if(e===t.Set.empty)return e;this.length<e.length?(n=this,r=e):(n=e,r=this),i=Object.keys(n.elements);for(var o=0;o<i.length;o++){var a=i[o];a in r.elements&&s.push(a)}return new t.Set(s)},t.Set.prototype.union=function(e){return e===t.Set.complete?t.Set.complete:e===t.Set.empty?this:new t.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},t.idf=function(e,n){var r=0;for(var i in e)i!="_index"&&(r+=Object.keys(e[i]).length);var s=(n-r+.5)/(r+.5);return Math.log(1+Math.abs(s))},t.Token=function(e,n){this.str=e||"",this.metadata=n||{}},t.Token.prototype.toString=function(){return this.str},t.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},t.Token.prototype.clone=function(e){return e=e||function(n){return n},new t.Token(e(this.str,this.metadata),this.metadata)};t.tokenizer=function(e,n){if(e==null||e==null)return[];if(Array.isArray(e))return e.map(function(m){return new t.Token(t.utils.asString(m).toLowerCase(),t.utils.clone(n))});for(var r=e.toString().toLowerCase(),i=r.length,s=[],o=0,a=0;o<=i;o++){var u=r.charAt(o),l=o-a;if(u.match(t.tokenizer.separator)||o==i){if(l>0){var h=t.utils.clone(n)||{};h.position=[a,l],h.index=s.length,s.push(new t.Token(r.slice(a,o),h))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index.
3
- `,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r<n;r++){for(var i=this._stack[r],s=[],o=0;o<e.length;o++){var a=i(e[o],o,e);if(!(a==null||a===""))if(Array.isArray(a))for(var u=0;u<a.length;u++)s.push(a[u]);else s.push(a)}e=s}return e},t.Pipeline.prototype.runString=function(e,n){var r=new t.Token(e,n);return this.run([r]).map(function(i){return i.toString()})},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})};t.Vector=function(e){this._magnitude=0,this.elements=e||[]},t.Vector.prototype.positionForIndex=function(e){if(this.elements.length==0)return 0;for(var n=0,r=this.elements.length/2,i=r-n,s=Math.floor(i/2),o=this.elements[s*2];i>1&&(o<e&&(n=s),o>e&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(o<e)return(s+1)*2},t.Vector.prototype.insert=function(e,n){this.upsert(e,n,function(){throw"duplicate index"})},t.Vector.prototype.upsert=function(e,n,r){this._magnitude=0;var i=this.positionForIndex(e);this.elements[i]==e?this.elements[i+1]=r(this.elements[i+1],n):this.elements.splice(i,0,e,n)},t.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,n=this.elements.length,r=1;r<n;r+=2){var i=this.elements[r];e+=i*i}return this._magnitude=Math.sqrt(e)},t.Vector.prototype.dot=function(e){for(var n=0,r=this.elements,i=e.elements,s=r.length,o=i.length,a=0,u=0,l=0,h=0;l<s&&h<o;)a=r[l],u=i[h],a<u?l+=2:a>u?h+=2:a==u&&(n+=r[l+1]*i[h+1],l+=2,h+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n<this.elements.length;n+=2,r++)e[r]=this.elements[n];return e},t.Vector.prototype.toJSON=function(){return this.elements};t.stemmer=function(){var e={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},n={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},r="[^aeiou]",i="[aeiouy]",s=r+"[^aeiouy]*",o=i+"[aeiou]*",a="^("+s+")?"+o+s,u="^("+s+")?"+o+s+"("+o+")?$",l="^("+s+")?"+o+s+o+s,h="^("+s+")?"+i,m=new RegExp(a),v=new RegExp(l),b=new RegExp(u),y=new RegExp(h),E=/^(.+?)(ss|i)es$/,p=/^(.+?)([^s])s$/,f=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,w=/.$/,k=/(at|bl|iz)$/,_=new RegExp("([^aeiouylsz])\\1$"),z=new RegExp("^"+s+i+"[^aeiouwxy]$"),H=/^(.+?[^aeiou])y$/,q=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,$=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,V=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,W=/^(.+?)(s|t)(ion)$/,P=/^(.+?)e$/,U=/ll$/,G=new RegExp("^"+s+i+"[^aeiouwxy]$"),N=function(c){var g,C,T,d,x,O,D;if(c.length<3)return c;if(T=c.substr(0,1),T=="y"&&(c=T.toUpperCase()+c.substr(1)),d=E,x=p,d.test(c)?c=c.replace(d,"$1$2"):x.test(c)&&(c=c.replace(x,"$1$2")),d=f,x=S,d.test(c)){var L=d.exec(c);d=m,d.test(L[1])&&(d=w,c=c.replace(d,""))}else if(x.test(c)){var L=x.exec(c);g=L[1],x=y,x.test(g)&&(c=g,x=k,O=_,D=z,x.test(c)?c=c+"e":O.test(c)?(d=w,c=c.replace(d,"")):D.test(c)&&(c=c+"e"))}if(d=H,d.test(c)){var L=d.exec(c);g=L[1],c=g+"i"}if(d=q,d.test(c)){var L=d.exec(c);g=L[1],C=L[2],d=m,d.test(g)&&(c=g+e[C])}if(d=$,d.test(c)){var L=d.exec(c);g=L[1],C=L[2],d=m,d.test(g)&&(c=g+n[C])}if(d=V,x=W,d.test(c)){var L=d.exec(c);g=L[1],d=v,d.test(g)&&(c=g)}else if(x.test(c)){var L=x.exec(c);g=L[1]+L[2],x=v,x.test(g)&&(c=g)}if(d=P,d.test(c)){var L=d.exec(c);g=L[1],d=v,x=b,O=G,(d.test(g)||x.test(g)&&!O.test(g))&&(c=g)}return d=U,x=v,d.test(c)&&x.test(c)&&(d=w,c=c.replace(d,"")),T=="y"&&(c=T.toLowerCase()+c.substr(1)),c};return function(M){return M.update(N)}}(),t.Pipeline.registerFunction(t.stemmer,"stemmer");t.generateStopWordFilter=function(e){var n=e.reduce(function(r,i){return r[i]=i,r},{});return function(r){if(r&&n[r.toString()]!==r.toString())return r}},t.stopWordFilter=t.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter");t.trimmer=function(e){return e.update(function(n){return n.replace(/^\W+/,"").replace(/\W+$/,"")})},t.Pipeline.registerFunction(t.trimmer,"trimmer");t.TokenSet=function(){this.final=!1,this.edges={},this.id=t.TokenSet._nextId,t.TokenSet._nextId+=1},t.TokenSet._nextId=1,t.TokenSet.fromArray=function(e){for(var n=new t.TokenSet.Builder,r=0,i=e.length;r<i;r++)n.insert(e[r]);return n.finish(),n.root},t.TokenSet.fromClause=function(e){return"editDistance"in e?t.TokenSet.fromFuzzyString(e.term,e.editDistance):t.TokenSet.fromString(e.term)},t.TokenSet.fromFuzzyString=function(e,n){for(var r=new t.TokenSet,i=[{node:r,editsRemaining:n,str:e}];i.length;){var s=i.pop();if(s.str.length>0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}if(s.str.length==0&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}s.str.length==1&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var h=s.str.charAt(0),m=s.str.charAt(1),v;m in s.node.edges?v=s.node.edges[m]:(v=new t.TokenSet,s.node.edges[m]=v),s.str.length==1&&(v.final=!0),i.push({node:v,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i<s;i++){var o=e[i],a=i==s-1;if(o=="*")n.edges[o]=n,n.final=a;else{var u=new t.TokenSet;u.final=a,n.edges[o]=u,n=u}}return r},t.TokenSet.prototype.toArray=function(){for(var e=[],n=[{prefix:"",node:this}];n.length;){var r=n.pop(),i=Object.keys(r.node.edges),s=i.length;r.node.final&&(r.prefix.charAt(0),e.push(r.prefix));for(var o=0;o<s;o++){var a=i[o];n.push({prefix:r.prefix.concat(a),node:r.node.edges[a]})}}return e},t.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?"1":"0",n=Object.keys(this.edges).sort(),r=n.length,i=0;i<r;i++){var s=n[i],o=this.edges[s];e=e+s+o.id}return e},t.TokenSet.prototype.intersect=function(e){for(var n=new t.TokenSet,r=void 0,i=[{qNode:e,output:n,node:this}];i.length;){r=i.pop();for(var s=Object.keys(r.qNode.edges),o=s.length,a=Object.keys(r.node.edges),u=a.length,l=0;l<o;l++)for(var h=s[l],m=0;m<u;m++){var v=a[m];if(v==h||h=="*"){var b=r.node.edges[v],y=r.qNode.edges[h],E=b.final&&y.final,p=void 0;v in r.output.edges?(p=r.output.edges[v],p.final=p.final||E):(p=new t.TokenSet,p.final=E,r.output.edges[v]=p),i.push({qNode:y,output:p,node:b})}}}return n},t.TokenSet.Builder=function(){this.previousWord="",this.root=new t.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},t.TokenSet.Builder.prototype.insert=function(e){var n,r=0;if(e<this.previousWord)throw new Error("Out of order word insertion");for(var i=0;i<e.length&&i<this.previousWord.length&&e[i]==this.previousWord[i];i++)r++;this.minimize(r),this.uncheckedNodes.length==0?n=this.root:n=this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(var i=r;i<e.length;i++){var s=new t.TokenSet,o=e[i];n.edges[o]=s,this.uncheckedNodes.push({parent:n,char:o,child:s}),n=s}n.final=!0,this.previousWord=e},t.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},t.TokenSet.Builder.prototype.minimize=function(e){for(var n=this.uncheckedNodes.length-1;n>=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u<this.fields.length;u++)i[this.fields[u]]=new t.Vector;e.call(n,n);for(var u=0;u<n.clauses.length;u++){var l=n.clauses[u],h=null,m=t.Set.empty;l.usePipeline?h=this.pipeline.runString(l.term,{fields:l.fields}):h=[l.term];for(var v=0;v<h.length;v++){var b=h[v];l.term=b;var y=t.TokenSet.fromClause(l),E=this.tokenSet.intersect(y).toArray();if(E.length===0&&l.presence===t.Query.presence.REQUIRED){for(var p=0;p<l.fields.length;p++){var f=l.fields[p];o[f]=t.Set.empty}break}for(var S=0;S<E.length;S++)for(var w=E[S],k=this.invertedIndex[w],_=k._index,p=0;p<l.fields.length;p++){var f=l.fields[p],z=k[f],H=Object.keys(z),q=w+"/"+f,$=new t.Set(H);if(l.presence==t.Query.presence.REQUIRED&&(m=m.union($),o[f]===void 0&&(o[f]=t.Set.complete)),l.presence==t.Query.presence.PROHIBITED){a[f]===void 0&&(a[f]=t.Set.empty),a[f]=a[f].union($);continue}if(i[f].upsert(_,l.boost,function(Ie,ke){return Ie+ke}),!s[q]){for(var V=0;V<H.length;V++){var W=H[V],P=new t.FieldRef(W,f),U=z[W],G;(G=r[P])===void 0?r[P]=new t.MatchData(w,f,U):G.add(w,f,U)}s[q]=!0}}}if(l.presence===t.Query.presence.REQUIRED)for(var p=0;p<l.fields.length;p++){var f=l.fields[p];o[f]=o[f].intersect(m)}}for(var N=t.Set.complete,M=t.Set.empty,u=0;u<this.fields.length;u++){var f=this.fields[u];o[f]&&(N=N.intersect(o[f])),a[f]&&(M=M.union(a[f]))}var c=Object.keys(r),g=[],C=Object.create(null);if(n.isNegated()){c=Object.keys(this.fieldVectors);for(var u=0;u<c.length;u++){var P=c[u],T=t.FieldRef.fromString(P);r[P]=new t.MatchData}}for(var u=0;u<c.length;u++){var T=t.FieldRef.fromString(c[u]),d=T.docRef;if(N.contains(d)&&!M.contains(d)){var x=this.fieldVectors[T],O=i[T.fieldName].similarity(x),D;if((D=C[d])!==void 0)D.score+=O,D.matchData.combine(r[T]);else{var L={ref:d,score:O,matchData:r[T]};C[d]=L,g.push(L)}}}return g.sort(function(Se,Te){return Te.score-Se.score})},t.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map(function(r){return[r,this.invertedIndex[r]]},this),n=Object.keys(this.fieldVectors).map(function(r){return[r,this.fieldVectors[r].toJSON()]},this);return{version:t.version,fields:this.fields,fieldVectors:n,invertedIndex:e,pipeline:this.pipeline.toJSON()}},t.Index.load=function(e){var n={},r={},i=e.fieldVectors,s=Object.create(null),o=e.invertedIndex,a=new t.TokenSet.Builder,u=t.Pipeline.load(e.pipeline);e.version!=t.version&&t.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+t.version+"' does not match serialized index '"+e.version+"'");for(var l=0;l<i.length;l++){var h=i[l],m=h[0],v=h[1];r[m]=new t.Vector(v)}for(var l=0;l<o.length;l++){var h=o[l],b=h[0],y=h[1];a.insert(b),s[b]=y}return a.finish(),n.fields=e.fields,n.fieldVectors=r,n.invertedIndex=s,n.tokenSet=a.root,n.pipeline=u,new t.Index(n)};t.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=t.tokenizer,this.pipeline=new t.Pipeline,this.searchPipeline=new t.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},t.Builder.prototype.ref=function(e){this._ref=e},t.Builder.prototype.field=function(e,n){if(/\//.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=n||{}},t.Builder.prototype.b=function(e){e<0?this._b=0:e>1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s<i.length;s++){var o=i[s],a=this._fields[o].extractor,u=a?a(e):e[o],l=this.tokenizer(u,{fields:[o]}),h=this.pipeline.run(l),m=new t.FieldRef(r,o),v=Object.create(null);this.fieldTermFrequencies[m]=v,this.fieldLengths[m]=0,this.fieldLengths[m]+=h.length;for(var b=0;b<h.length;b++){var y=h[b];if(v[y]==null&&(v[y]=0),v[y]+=1,this.invertedIndex[y]==null){var E=Object.create(null);E._index=this.termIndex,this.termIndex+=1;for(var p=0;p<i.length;p++)E[i[p]]=Object.create(null);this.invertedIndex[y]=E}this.invertedIndex[y][o][r]==null&&(this.invertedIndex[y][o][r]=Object.create(null));for(var f=0;f<this.metadataWhitelist.length;f++){var S=this.metadataWhitelist[f],w=y.metadata[S];this.invertedIndex[y][o][r][S]==null&&(this.invertedIndex[y][o][r][S]=[]),this.invertedIndex[y][o][r][S].push(w)}}}},t.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),n=e.length,r={},i={},s=0;s<n;s++){var o=t.FieldRef.fromString(e[s]),a=o.fieldName;i[a]||(i[a]=0),i[a]+=1,r[a]||(r[a]=0),r[a]+=this.fieldLengths[o]}for(var u=Object.keys(this._fields),s=0;s<u.length;s++){var l=u[s];r[l]=r[l]/i[l]}this.averageFieldLength=r},t.Builder.prototype.createFieldVectors=function(){for(var e={},n=Object.keys(this.fieldTermFrequencies),r=n.length,i=Object.create(null),s=0;s<r;s++){for(var o=t.FieldRef.fromString(n[s]),a=o.fieldName,u=this.fieldLengths[o],l=new t.Vector,h=this.fieldTermFrequencies[o],m=Object.keys(h),v=m.length,b=this._fields[a].boost||1,y=this._documents[o.docRef].boost||1,E=0;E<v;E++){var p=m[E],f=h[p],S=this.invertedIndex[p]._index,w,k,_;i[p]===void 0?(w=t.idf(this.invertedIndex[p],this.documentCount),i[p]=w):w=i[p],k=w*((this._k1+1)*f)/(this._k1*(1-this._b+this._b*(u/this.averageFieldLength[a]))+f),k*=b,k*=y,_=Math.round(k*1e3)/1e3,l.insert(S,_)}e[o]=l}this.fieldVectors=e},t.Builder.prototype.createTokenSet=function(){this.tokenSet=t.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},t.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new t.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},t.Builder.prototype.use=function(e){var n=Array.prototype.slice.call(arguments,1);n.unshift(this),e.apply(this,n)},t.MatchData=function(e,n,r){for(var i=Object.create(null),s=Object.keys(r||{}),o=0;o<s.length;o++){var a=s[o];i[a]=r[a].slice()}this.metadata=Object.create(null),e!==void 0&&(this.metadata[e]=Object.create(null),this.metadata[e][n]=i)},t.MatchData.prototype.combine=function(e){for(var n=Object.keys(e.metadata),r=0;r<n.length;r++){var i=n[r],s=Object.keys(e.metadata[i]);this.metadata[i]==null&&(this.metadata[i]=Object.create(null));for(var o=0;o<s.length;o++){var a=s[o],u=Object.keys(e.metadata[i][a]);this.metadata[i][a]==null&&(this.metadata[i][a]=Object.create(null));for(var l=0;l<u.length;l++){var h=u[l];this.metadata[i][a][h]==null?this.metadata[i][a][h]=e.metadata[i][a][h]:this.metadata[i][a][h]=this.metadata[i][a][h].concat(e.metadata[i][a][h])}}}},t.MatchData.prototype.add=function(e,n,r){if(!(e in this.metadata)){this.metadata[e]=Object.create(null),this.metadata[e][n]=r;return}if(!(n in this.metadata[e])){this.metadata[e][n]=r;return}for(var i=Object.keys(r),s=0;s<i.length;s++){var o=i[s];o in this.metadata[e][n]?this.metadata[e][n][o]=this.metadata[e][n][o].concat(r[o]):this.metadata[e][n][o]=r[o]}},t.Query=function(e){this.clauses=[],this.allFields=e},t.Query.wildcard=new String("*"),t.Query.wildcard.NONE=0,t.Query.wildcard.LEADING=1,t.Query.wildcard.TRAILING=2,t.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},t.Query.prototype.clause=function(e){return"fields"in e||(e.fields=this.allFields),"boost"in e||(e.boost=1),"usePipeline"in e||(e.usePipeline=!0),"wildcard"in e||(e.wildcard=t.Query.wildcard.NONE),e.wildcard&t.Query.wildcard.LEADING&&e.term.charAt(0)!=t.Query.wildcard&&(e.term="*"+e.term),e.wildcard&t.Query.wildcard.TRAILING&&e.term.slice(-1)!=t.Query.wildcard&&(e.term=""+e.term+"*"),"presence"in e||(e.presence=t.Query.presence.OPTIONAL),this.clauses.push(e),this},t.Query.prototype.isNegated=function(){for(var e=0;e<this.clauses.length;e++)if(this.clauses[e].presence!=t.Query.presence.PROHIBITED)return!1;return!0},t.Query.prototype.term=function(e,n){if(Array.isArray(e))return e.forEach(function(i){this.term(i,t.utils.clone(n))},this),this;var r=n||{};return r.term=e.toString(),this.clause(r),this},t.QueryParseError=function(e,n,r){this.name="QueryParseError",this.message=e,this.start=n,this.end=r},t.QueryParseError.prototype=new Error,t.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},t.QueryLexer.prototype.run=function(){for(var e=t.QueryLexer.lexText;e;)e=e(this)},t.QueryLexer.prototype.sliceString=function(){for(var e=[],n=this.start,r=this.pos,i=0;i<this.escapeCharPositions.length;i++)r=this.escapeCharPositions[i],e.push(this.str.slice(n,r)),n=r+1;return e.push(this.str.slice(n,this.pos)),this.escapeCharPositions.length=0,e.join("")},t.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},t.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},t.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos<this.length},t.QueryLexer.EOS="EOS",t.QueryLexer.FIELD="FIELD",t.QueryLexer.TERM="TERM",t.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",t.QueryLexer.BOOST="BOOST",t.QueryLexer.PRESENCE="PRESENCE",t.QueryLexer.lexField=function(e){return e.backup(),e.emit(t.QueryLexer.FIELD),e.ignore(),t.QueryLexer.lexText},t.QueryLexer.lexTerm=function(e){if(e.width()>1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof ce=="object"?he.exports=n():e.lunr=n()}(this,function(){return t})})()});var le=[];function B(t,e){le.push({selector:e,constructor:t})}var Y=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){le.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureFocusedElementVisible(){this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null);let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n.tagName!=="SECTION";)n=n.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}};var I=class{constructor(e){this.el=e.el,this.app=e.app}};var J=class{constructor(){this.listeners={}}addEventListener(e,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(n)}removeEventListener(e,n){if(!(e in this.listeners))return;let r=this.listeners[e];for(let i=0,s=r.length;i<s;i++)if(r[i]===n){r.splice(i,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return!0;let n=this.listeners[e.type].slice();for(let r=0,i=n.length;r<i;r++)n[r].call(this,e);return!e.defaultPrevented}};var ne=(t,e=100)=>{let n=Date.now();return(...r)=>{n+e-Date.now()<0&&(t(...r),n=Date.now())}};var re=class extends J{constructor(){super();this.scrollTop=0;this.lastY=0;this.width=0;this.height=0;this.showToolbar=!0;this.toolbar=document.querySelector(".tsd-page-toolbar"),this.navigation=document.querySelector(".col-menu"),window.addEventListener("scroll",ne(()=>this.onScroll(),10)),window.addEventListener("resize",ne(()=>this.onResize(),10)),this.searchInput=document.querySelector("#tsd-search input"),this.searchInput&&this.searchInput.addEventListener("focus",()=>{this.hideShowToolbar()}),this.onResize(),this.onScroll()}triggerResize(){let n=new CustomEvent("resize",{detail:{width:this.width,height:this.height}});this.dispatchEvent(n)}onResize(){this.width=window.innerWidth||0,this.height=window.innerHeight||0;let n=new CustomEvent("resize",{detail:{width:this.width,height:this.height}});this.dispatchEvent(n)}onScroll(){this.scrollTop=window.scrollY||0;let n=new CustomEvent("scroll",{detail:{scrollTop:this.scrollTop}});this.dispatchEvent(n),this.hideShowToolbar()}hideShowToolbar(){let n=this.showToolbar;this.showToolbar=this.lastY>=this.scrollTop||this.scrollTop<=0||!!this.searchInput&&this.searchInput===document.activeElement,n!==this.showToolbar&&(this.toolbar.classList.toggle("tsd-page-toolbar--hide"),this.navigation?.classList.toggle("col-menu--hide")),this.lastY=this.scrollTop}},R=re;R.instance=new re;var X=class extends I{constructor(n){super(n);this.anchors=[];this.index=-1;R.instance.addEventListener("resize",()=>this.onResize()),R.instance.addEventListener("scroll",r=>this.onScroll(r)),this.createAnchors()}createAnchors(){let n=window.location.href;n.indexOf("#")!=-1&&(n=n.substring(0,n.indexOf("#"))),this.el.querySelectorAll("a").forEach(r=>{let i=r.href;if(i.indexOf("#")==-1||i.substring(0,n.length)!=n)return;let s=i.substring(i.indexOf("#")+1),o=document.querySelector("a.tsd-anchor[name="+s+"]"),a=r.parentNode;!o||!a||this.anchors.push({link:a,anchor:o,position:0})}),this.onResize()}onResize(){let n;for(let i=0,s=this.anchors.length;i<s;i++){n=this.anchors[i];let o=n.anchor.getBoundingClientRect();n.position=o.top+document.body.scrollTop}this.anchors.sort((i,s)=>i.position-s.position);let r=new CustomEvent("scroll",{detail:{scrollTop:R.instance.scrollTop}});this.onScroll(r)}onScroll(n){let r=n.detail.scrollTop+5,i=this.anchors,s=i.length-1,o=this.index;for(;o>-1&&i[o].position>r;)o-=1;for(;o<s&&i[o+1].position<r;)o+=1;this.index!=o&&(this.index>-1&&this.anchors[this.index].link.classList.remove("focus"),this.index=o,this.index>-1&&this.anchors[this.index].link.classList.add("focus"))}};var ue=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var me=De(de());function ve(){let t=document.getElementById("tsd-search");if(!t)return;let e=document.getElementById("search-script");t.classList.add("loading"),e&&(e.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),e.addEventListener("load",()=>{t.classList.remove("loading"),t.classList.add("ready")}),window.searchData&&t.classList.remove("loading"));let n=document.querySelector("#tsd-search input"),r=document.querySelector("#tsd-search .results");if(!n||!r)throw new Error("The input field or the result list wrapper was not found");let i=!1;r.addEventListener("mousedown",()=>i=!0),r.addEventListener("mouseup",()=>{i=!1,t.classList.remove("has-focus")}),n.addEventListener("focus",()=>t.classList.add("has-focus")),n.addEventListener("blur",()=>{i||(i=!1,t.classList.remove("has-focus"))});let s={base:t.dataset.base+"/"};Fe(t,r,n,s)}function Fe(t,e,n,r){n.addEventListener("input",ue(()=>{He(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?pe(e,-1):s.key==="ArrowDown"?pe(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ae(t,e){t.index||window.searchData&&(e.classList.remove("loading"),e.classList.add("ready"),t.data=window.searchData,t.index=me.Index.load(window.searchData.index))}function He(t,e,n,r){if(Ae(r,t),!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s=i?r.index.search(`*${i}*`):[];for(let o=0;o<s.length;o++){let a=s[o],u=r.data.rows[Number(a.ref)],l=1;u.name.toLowerCase().startsWith(i.toLowerCase())&&(l*=1+1/(1+Math.abs(u.name.length-i.length))),a.score*=l}s.sort((o,a)=>a.score-o.score);for(let o=0,a=Math.min(10,s.length);o<a;o++){let u=r.data.rows[Number(s[o].ref)],l=fe(u.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(l+=` (score: ${s[o].score.toFixed(2)})`),u.parent&&(l=`<span class="parent">${fe(u.parent,i)}.</span>${l}`);let h=document.createElement("li");h.classList.value=u.classes??"";let m=document.createElement("a");m.href=r.base+u.url,m.innerHTML=l,h.append(m),e.appendChild(h)}}function pe(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function fe(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(ie(t.substring(s,o)),`<b>${ie(t.substring(o,o+r.length))}</b>`),s=o+r.length,o=n.indexOf(r,s);return i.push(ie(t.substring(s))),i.join("")}var Ne={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#039;",'"':"&quot;"};function ie(t){return t.replace(/[&<>"'"]/g,e=>Ne[e])}var F="mousedown",ye="mousemove",j="mouseup",Z={x:0,y:0},ge=!1,se=!1,Be=!1,A=!1,xe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(xe?"is-mobile":"not-mobile");xe&&"ontouchstart"in document.documentElement&&(Be=!0,F="touchstart",ye="touchmove",j="touchend");document.addEventListener(F,t=>{se=!0,A=!1;let e=F=="touchstart"?t.targetTouches[0]:t;Z.y=e.pageY||0,Z.x=e.pageX||0});document.addEventListener(ye,t=>{if(se&&!A){let e=F=="touchstart"?t.targetTouches[0]:t,n=Z.x-(e.pageX||0),r=Z.y-(e.pageY||0);A=Math.sqrt(n*n+r*r)>10}});document.addEventListener(j,()=>{se=!1});document.addEventListener("click",t=>{ge&&(t.preventDefault(),t.stopImmediatePropagation(),ge=!1)});var K=class extends I{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(j,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(j,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){A||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-menu, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!A&&this.active&&n.target.closest(".col-menu")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var oe;try{oe=localStorage}catch{oe={getItem(){return null},setItem(){}}}var Q=oe;var Le=document.head.appendChild(document.createElement("style"));Le.dataset.for="filters";var ee=class extends I{constructor(n){super(n);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),Le.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; }
4
- `}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var te=class extends I{constructor(n){super(n);this.calculateHeights(),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.textContent.replace(/\s+/g,"-").toLowerCase()}`,this.setLocalStorage(this.fromLocalStorage(),!0),this.summary.addEventListener("click",r=>this.toggleVisibility(r)),this.icon.style.transform=this.getIconRotation()}getIconRotation(n=this.el.open){return`rotate(${n?0:-90}deg)`}calculateHeights(){let n=this.el.open,{position:r,left:i}=this.el.style;this.el.style.position="fixed",this.el.style.left="-9999px",this.el.open=!0,this.expandedHeight=this.el.offsetHeight+"px",this.el.open=!1,this.collapsedHeight=this.el.offsetHeight+"px",this.el.open=n,this.el.style.height=n?this.expandedHeight:this.collapsedHeight,this.el.style.position=r,this.el.style.left=i}toggleVisibility(n){n.preventDefault(),this.el.style.overflow="hidden",this.el.open?this.collapse():this.expand()}expand(n=!0){this.el.open=!0,this.animate(this.collapsedHeight,this.expandedHeight,{opening:!0,duration:n?300:0})}collapse(n=!0){this.animate(this.expandedHeight,this.collapsedHeight,{opening:!1,duration:n?300:0})}animate(n,r,{opening:i,duration:s=300}){if(this.animation)return;let o={duration:s,easing:"ease"};this.animation=this.el.animate({height:[n,r]},o),this.icon.animate({transform:[this.icon.style.transform||this.getIconRotation(!i),this.getIconRotation(i)]},o).addEventListener("finish",()=>{this.icon.style.transform=this.getIconRotation(i)}),this.animation.addEventListener("finish",()=>this.animationEnd(i))}animationEnd(n){this.el.open=n,this.animation=void 0,this.el.style.height="auto",this.el.style.overflow="visible",this.setLocalStorage(n)}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.open}setLocalStorage(n,r=!1){this.fromLocalStorage()===n&&!r||(Q.setItem(this.key,n.toString()),this.el.open=n,this.handleValueChange(r))}handleValueChange(n=!1){this.fromLocalStorage()===this.el.open&&!n||(this.fromLocalStorage()?this.expand(!1):this.collapse(!1))}};function be(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,Ee(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),Ee(t.value)})}function Ee(t){document.documentElement.dataset.theme=t}ve();B(X,".menu-highlight");B(K,"a[data-toggle]");B(te,".tsd-index-accordion");B(ee,".tsd-filter-item input[type=checkbox]");var we=document.getElementById("theme");we&&be(we);var je=new Y;Object.defineProperty(window,"app",{value:je});})();
5
- /*! Bundled license information:
6
-
7
- lunr/lunr.js:
8
- (**
9
- * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9
10
- * Copyright (C) 2020 Oliver Nightingale
11
- * @license MIT
12
- *)
13
- (*!
14
- * lunr.utils
15
- * Copyright (C) 2020 Oliver Nightingale
16
- *)
17
- (*!
18
- * lunr.Set
19
- * Copyright (C) 2020 Oliver Nightingale
20
- *)
21
- (*!
22
- * lunr.tokenizer
23
- * Copyright (C) 2020 Oliver Nightingale
24
- *)
25
- (*!
26
- * lunr.Pipeline
27
- * Copyright (C) 2020 Oliver Nightingale
28
- *)
29
- (*!
30
- * lunr.Vector
31
- * Copyright (C) 2020 Oliver Nightingale
32
- *)
33
- (*!
34
- * lunr.stemmer
35
- * Copyright (C) 2020 Oliver Nightingale
36
- * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
37
- *)
38
- (*!
39
- * lunr.stopWordFilter
40
- * Copyright (C) 2020 Oliver Nightingale
41
- *)
42
- (*!
43
- * lunr.trimmer
44
- * Copyright (C) 2020 Oliver Nightingale
45
- *)
46
- (*!
47
- * lunr.TokenSet
48
- * Copyright (C) 2020 Oliver Nightingale
49
- *)
50
- (*!
51
- * lunr.Index
52
- * Copyright (C) 2020 Oliver Nightingale
53
- *)
54
- (*!
55
- * lunr.Builder
56
- * Copyright (C) 2020 Oliver Nightingale
57
- *)
58
- */