@busy-app/busy-lib 0.15.0 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +892 -890
- package/dist/index.d.ts +3 -0
- package/dist/index.js +921 -917
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";var D=Object.defineProperty;var j=(e,n,t)=>n in e?D(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var u=(e,n,t)=>j(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("openapi-fetch"),L=(e,n)=>{if(typeof FormData<"u"&&e instanceof FormData||typeof Buffer<"u"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(e)||typeof File<"u"&&e instanceof File||typeof Blob<"u"&&e instanceof Blob||typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer||typeof ArrayBuffer<"u"&&ArrayBuffer.isView&&ArrayBuffer.isView(e))return e;let t;return n&&(n instanceof Headers?t=n.get("Content-Type")??n.get("content-type")??void 0:typeof n=="object"&&(t=n["Content-Type"]??n["content-type"]),t==="application/x-www-form-urlencoded")?e&&typeof e=="object"&&!(e instanceof URLSearchParams)?new URLSearchParams(e).toString():String(e):JSON.stringify(e)};async function w(e){const r=(e.headers.get("content-type")||"").includes("application/json")?await e.clone().json():await e.clone().text(),i=typeof r=="object"&&r!==null?r.error||r.message:typeof r=="string"?r:void 0;return Object.assign(new Error(i||`HTTP ${e.status} ${e.statusText}`),{status:e.status,statusText:e.statusText,body:r})}function x(e,n,t,r=3e3){let i,o=t??void 0,s,l=null;const a=async()=>{i||(l||(l=(async()=>{const f=await n();if(!f.api_semver)throw new Error("Empty API version");i=f.api_semver})().finally(()=>{l=null})),await l)},P={async onRequest({request:f,schemaPath:p}){return o&&f.headers.set("Authorization",`Bearer ${o}`),p!=="/version"&&(await a(),i&&f.headers.set("X-API-Sem-Ver",i),s&&f.headers.set("X-API-Token",s)),f},async onResponse({request:f,response:p,options:A,schemaPath:O}){if(p.ok)return p;if(O==="/version")throw await w(p);if(p.status!==405)throw await w(p);i=void 0,await a(),i&&f.headers.set("X-API-Sem-Ver",i),o&&f.headers.set("Authorization",`Bearer ${o}`);const m=await(A.fetch??fetch)(f);if(m.ok)return m;throw await w(m)}},R=I({baseUrl:e,bodySerializer:L});return R.withTimeout=async(f,p=r)=>{if(p<=0)return await f();const A=new AbortController,O=setTimeout(()=>A.abort(),p);try{return await f(A.signal)}catch(m){throw m instanceof DOMException&&m.name==="AbortError"?new Error(`Request timed out after ${p}ms`):m}finally{clearTimeout(O)}},R.use(P),{client:R,setApiKey:f=>{s=f},setToken:f=>{o=f}}}async function U(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/version",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function F(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/status",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function B(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/status/system",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function M(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/status/power",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function G(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/status/device",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function V(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/status/firmware",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function W(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/transport",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}class ${async SystemVersionGet(n){const t=await U(this.apiClient,n);return this.apiSemver=t.api_semver,t}async SystemStatusGet(n){return await F(this.apiClient,n)}async SystemInfoGet(n){return await B(this.apiClient,n)}async SystemStatusPowerGet(n){return await M(this.apiClient,n)}async SystemStatusDeviceGet(n){return await G(this.apiClient,n)}async SystemStatusFirmwareGet(n){return await V(this.apiClient,n)}async SystemTransportGet(n){return await W(this.apiClient,n)}}async function H(e,n){const{file:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/update",{headers:{"Content-Type":"application/octet-stream"},body:t,signal:o}),n.timeout);if(i)throw i;return r}async function z(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/update/check",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function J(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/update/status",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function K(e,n){const{version:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.GET("/update/changelog",{params:{query:{version:t}},signal:o}),n.timeout);if(i)throw i;return r}async function Y(e,n){const{version:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/update/install",{params:{query:{version:t}},signal:o}),n.timeout);if(i)throw i;return r}async function X(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/update/abort_download",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Z(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/update/autoupdate",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Q(e,n){const{is_enabled:t,interval_start:r,interval_end:i}=n,{data:o,error:s}=await e.withTimeout(l=>e.POST("/update/autoupdate",{body:{is_enabled:t,interval_start:r,interval_end:i},signal:l}),n.timeout);if(s)throw s;return o}class nn{async UpdateFromFile(n){return await H(this.apiClient,n)}async UpdateCheck(n){return await z(this.apiClient,n)}async UpdateStatusGet(n){return await J(this.apiClient,n)}async UpdateChangelogGet(n){return await K(this.apiClient,n)}async UpdateInstall(n){return await Y(this.apiClient,n)}async UpdateAbort(n){return await X(this.apiClient,n)}async UpdateAutoUpdateGet(n){return await Z(this.apiClient,n)}async UpdateAutoUpdateSet(n){return await Q(this.apiClient,n)}}async function en(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/time",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function tn(e,n){const{timestamp:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/time/timestamp",{params:{query:{timestamp:t}},signal:o}),n.timeout);if(i)throw i;return r}async function rn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/time/timezone",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function on(e,n){const{timezone:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/time/timezone",{params:{query:{timezone:t}},signal:o}),n.timeout);if(i)throw i;return r}async function sn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/time/tzlist",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}class an{async TimeGet(n){return await en(this.apiClient,n)}async TimeTimestampSet(n){return await tn(this.apiClient,n)}async TimeTimezoneGet(n){return await rn(this.apiClient,n)}async TimeTimezoneSet(n){return await on(this.apiClient,n)}async TimeTzListGet(n){return await sn(this.apiClient,n)}}async function un(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/account/status",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function ln(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/account/info",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function fn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/account/profile",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function cn(e,n){const{profile:t,custom_url:r}=n,{data:i,error:o}=await e.withTimeout(s=>e.POST("/account/profile",{params:{query:{profile:t,custom_url:r}},signal:s}),n.timeout);if(o)throw o;return i}async function dn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.DELETE("/account",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function pn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/account/link",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}class hn{async AccountInfoGet(n){return await ln(this.apiClient,n)}async AccountStateGet(n){return await un(this.apiClient,n)}async AccountProfileGet(n){return await fn(this.apiClient,n)}async AccountProfileSet(n){return await cn(this.apiClient,n)}async AccountUnlink(n){return await dn(this.apiClient,n)}async AccountLink(n){return await pn(this.apiClient,n)}}async function yn(e,n){const{application_name:t,elements:r,priority:i=50,timeout:o}=n,{data:s,error:l}=await e.withTimeout(a=>e.POST("/display/draw",{body:{application_name:t,priority:i,elements:r},signal:a}),o);if(l)throw l;return s}async function mn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.DELETE("/display/draw",{params:{query:{application_name:n==null?void 0:n.application_name}},signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function vn(e,n){const{display:t,timeout:r}=n,{data:i,error:o}=await e.withTimeout(s=>e.GET("/screen",{params:{query:{display:t}},parseAs:"blob",signal:s}),r);if(o)throw o;return i}async function gn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/display/brightness",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function bn(e,n){const{value:t}=n,i=(l=>{if(typeof l=="number"){if(l<0||l>100)throw new Error("Brightness value must be between 0 and 100 or 'auto'");return String(l)}return"auto"})(t),{data:o,error:s}=await e.withTimeout(l=>e.POST("/display/brightness",{params:{query:{value:i}},signal:l}),n.timeout);if(s)throw s;return o}class En{async DisplayDraw(n){return await yn(this.apiClient,n)}async DisplayClear(n){return await mn(this.apiClient,n)}async DisplayScreenFrameGet(n){return await vn(this.apiClient,n)}async DisplayBrightnessGet(n){return await gn(this.apiClient,n)}async DisplayBrightnessSet(n){return await bn(this.apiClient,n)}}async function _n(e,n){const{application_name:t,path:r}=n,{data:i,error:o}=await e.withTimeout(s=>e.POST("/audio/play",{params:{query:{application_name:t,path:r}},signal:s}),n.timeout);if(o)throw o;return i}async function An(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.DELETE("/audio/play",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Tn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/audio/volume",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Rn(e,n){const{volume:t,silent:r}=n;if(typeof t!="number"||t<0||t>100)throw new Error("Volume must be a number between 0 and 100");const{data:i,error:o}=await e.withTimeout(s=>e.POST("/audio/volume",{params:{query:{volume:t,silent:r}},signal:s}),n.timeout);if(o)throw o;return i}class On{async AudioPlay(n){return await _n(this.apiClient,n)}async AudioStop(n){return await An(this.apiClient,n)}async AudioVolumeGet(n){return await Tn(this.apiClient,n)}async AudioVolumeSet(n){return await Rn(this.apiClient,n)}}async function wn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/wifi/status",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Sn(e,n){const{ssid:t,password:r,security:i,ip_config:o}=n,{data:s,error:l}=await e.withTimeout(a=>e.POST("/wifi/connect",{body:{ssid:t,password:r,security:i,ip_config:o},signal:a}),n.timeout);if(l)throw l;return s}async function Nn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/wifi/disconnect",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function In(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/wifi/networks",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}class Cn{async WifiStatusGet(n){return await wn(this.apiClient,n)}async WifiConnect(n){return await Sn(this.apiClient,n)}async WifiDisconnect(n){return await Nn(this.apiClient,n)}async WifiNetworksGet(n){return await In(this.apiClient,n)}}async function kn(e,n){const{path:t,file:r}=n,{data:i,error:o}=await e.withTimeout(s=>e.POST("/storage/write",{params:{query:{path:t}},headers:{"Content-Type":"application/octet-stream"},body:r,signal:s}),n.timeout);if(o)throw o;return i}async function qn(e,n){const{path:t,as_array_buffer:r}=n,{data:i,error:o}=await e.withTimeout(s=>e.GET("/storage/read",{params:{query:{path:t}},parseAs:r?"arrayBuffer":"blob",signal:s}),n.timeout);if(o)throw o;return i}async function Pn(e,n){const{path:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.GET("/storage/list",{params:{query:{path:t}},signal:o}),n.timeout);if(i)throw i;return r}async function Dn(e,n){const{path:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.DELETE("/storage/remove",{params:{query:{path:t}},signal:o}),n.timeout);if(i)throw i;return r}async function jn(e,n){const{path:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/storage/mkdir",{params:{query:{path:t}},signal:o}),n.timeout);if(i)throw i;return r}async function Ln(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/storage/status",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function xn(e,n){const{path:t,new_path:r}=n,{data:i,error:o}=await e.withTimeout(s=>e.POST("/storage/rename",{params:{query:{path:t,new_path:r}},signal:s}),n.timeout);if(o)throw o;return i}class Un{async StorageWrite(n){return await kn(this.apiClient,n)}async StorageRead(n){return await qn(this.apiClient,n)}async StorageListGet(n){return await Pn(this.apiClient,n)}async StorageRemove(n){return await Dn(this.apiClient,n)}async StorageMkdir(n){return await jn(this.apiClient,n)}async StorageStatusGet(n){return await Ln(this.apiClient,n)}async StorageRename(n){return await xn(this.apiClient,n)}}async function Fn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/access",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Bn(e,n){const{mode:t,key:r}=n,i=r??"";if(String(i).trim()&&!/^\d{4,10}$/.test(String(i)))throw new Error("Key must be a string of 4 to 10 digits");const{data:o,error:s}=await e.withTimeout(l=>e.POST("/access",{params:{query:{mode:t,key:i}},signal:l}),n.timeout);if(s)throw s;return o}async function Mn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/name",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Gn(e,n){const{name:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/name",{body:{name:t},signal:o}),n.timeout);if(i)throw i;return r}class Vn{async SettingsAccessGet(n){return await Fn(this.apiClient,n)}async SettingsAccessSet(n){const t=await Bn(this.apiClient,n);return n.mode==="key"&&n.key&&this.setApiKey(n.key),t}async SettingsNameGet(n){return await Mn(this.apiClient,n)}async SettingsNameSet(n){return await Gn(this.apiClient,n)}}async function Wn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/ble/enable",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function $n(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/ble/disable",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Hn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.DELETE("/ble/pairing",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function zn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/ble/status",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}class Jn{async BleEnable(n){return await Wn(this.apiClient,n)}async BleDisable(n){return await $n(this.apiClient,n)}async BleUnpair(n){return await Hn(this.apiClient,n)}async BleStatusGet(n){return await zn(this.apiClient,n)}}async function Kn(e,n){const{key:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/input",{params:{query:{key:t}},signal:o}),n.timeout);if(i)throw i;return r}class Yn{async InputSend(n){return await Kn(this.apiClient,n)}}async function Xn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/smart_home/pairing",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Zn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/smart_home/pairing",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Qn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.DELETE("/smart_home/pairing",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function ne(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/smart_home/switch",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function ee(e,n){const{timeout:t,...r}=n,{data:i,error:o}=await e.withTimeout(s=>e.POST("/smart_home/switch",{body:r,signal:s}),t);if(o)throw o;return i}class te{async SmartHomePairingGet(n){return await Xn(this.apiClient,n)}async SmartHomePair(n){return await Zn(this.apiClient,n)}async SmartHomeErase(n){return await Qn(this.apiClient,n)}async SmartHomeSwitchStateGet(n){return await ne(this.apiClient,n)}async SmartHomeSwitchStateSet(n){return await ee(this.apiClient,n)}async MatterStatusGet(n){return await this.SmartHomePairingGet(n)}async MatterPair(n){return await this.SmartHomePair(n)}async MatterErase(n){return await this.SmartHomeErase(n)}}async function re(e,n){const{application_name:t,file:r,data:i}=n,{data:o,error:s}=await e.withTimeout(l=>e.POST("/assets/upload",{params:{query:{application_name:t,file:r}},headers:{"Content-Type":"application/octet-stream"},body:i,signal:l}),n.timeout);if(s)throw s;return o}async function ie(e,n){const{application_name:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.DELETE("/assets/upload",{params:{query:{application_name:t}},signal:o}),n.timeout);if(i)throw i;return r}class oe{async AssetsUpload(n){return await re(this.apiClient,n)}async AssetsDelete(n){return await ie(this.apiClient,n)}}const se="http://10.0.4.20",ae="https://proxy.busy.app",ue=/^https?:\/\/proxy(?:\.(?:dev|test|stage))?\.busy\.app$/i;function le(e){const n=e.split(".");if(n.length!==4)return!1;for(const t of n){if(t.length===0||t.length>1&&t[0]==="0"||!/^\d+$/.test(t))return!1;const r=Number(t);if(r<0||r>255)return!1}return!0}function fe(e){return/\.local$/i.test(e)}class C{constructor(n){u(this,"addr");u(this,"apiSemver");u(this,"apiClient");u(this,"setApiKeyFn");u(this,"setTokenFn");u(this,"connectionType","unknown");if(!n||!n.addr&&!n.token)this.addr=se;else if(!n.addr)this.addr=ae;else{let o=n.addr.trim();if(/^https?:\/\//i.test(o)||(o=`http://${o}`),ue.test(o)&&!n.token)throw new Error("Token is required. Please provide it.");this.addr=o}this.apiSemver="";const{client:t,setApiKey:r,setToken:i}=x(`${this.addr}/api/`,this.SystemVersionGet.bind(this),n==null?void 0:n.token,n==null?void 0:n.timeout);this.apiClient=t,this.setApiKeyFn=r,this.setTokenFn=i,this.detectConnectionType()}async detectConnectionType(){const n=new URL(this.addr).hostname;if(!le(n)&&!fe(n)){this.connectionType="wifi";return}const t=I({baseUrl:`${this.addr}/api/`});try{const{response:r}=await t.GET("/name");if(r.status===401||r.status===403)this.connectionType="wifi";else if(r.ok)this.connectionType="usb";else throw new Error(`Failed to detect connection type. Status: ${r.status}`)}catch(r){throw r}}setApiKey(n){this.setApiKeyFn(n)}setToken(n){this.setTokenFn(n)}}function ce(e,n){n.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(r=>{Object.defineProperty(e.prototype,r,Object.getOwnPropertyDescriptor(t.prototype,r)||Object.create(null))})})}ce(C,[$,nn,an,hn,En,On,Cn,Un,Vn,Jn,Yn,te,oe]);var c=(e=>(e.CONNECTION_FAILED="CONNECTION_FAILED",e.RECONNECT_FAILED="RECONNECT_FAILED",e.CONNECTION_LOST="CONNECTION_LOST",e.CONNECTION_TIMEOUT="CONNECTION_TIMEOUT",e.AUTH_FAILED="AUTH_FAILED",e.AUTH_REFRESH_FAILED="AUTH_REFRESH_FAILED",e.DEVICE_ERROR="DEVICE_ERROR",e.DECODE_ERROR="DECODE_ERROR",e.FRAME_PROCESS_ERROR="FRAME_PROCESS_ERROR",e.STREAM_ALREADY_STARTED="STREAM_ALREADY_STARTED",e.WORKER_INIT_FAILED="WORKER_INIT_FAILED",e.UNKNOWN_ERROR="UNKNOWN_ERROR",e))(c||{});class h extends Error{constructor(n,t,r){super(t),this.code=n,this.data=r,this.name="StateStreamError"}}var d=(e=>(e.IDLE="IDLE",e.STARTING="STARTING",e.RUNNING="RUNNING",e.STOPPED="STOPPED",e.FAILED="FAILED",e))(d||{}),y=(e=>(e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.RECONNECTING="RECONNECTING",e))(y||{}),v=(e=>(e.UNAUTHENTICATED="UNAUTHENTICATED",e.AUTHENTICATING="AUTHENTICATING",e.AUTHENTICATED="AUTHENTICATED",e.REAUTHENTICATING="REAUTHENTICATING",e.FAILED="FAILED",e))(v||{}),g=(e=>(e.NONE="NONE",e.ACTIVE="ACTIVE",e.STALE="STALE",e))(g||{}),b=(e=>(e.OFF="OFF",e.INITIALIZING="INITIALIZING",e.READY="READY",e.ERROR="ERROR",e))(b||{});const de=5,k=5,q=`var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, src = { exports: {} }, indexLight = { exports: {} }, indexMinimal = {}, minimal = {}, aspromise, hasRequiredAspromise;
|
|
1
|
+
"use strict";var D=Object.defineProperty;var L=(e,n,t)=>n in e?D(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var u=(e,n,t)=>L(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("openapi-fetch"),j=(e,n)=>{if(typeof FormData<"u"&&e instanceof FormData||typeof Buffer<"u"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(e)||typeof File<"u"&&e instanceof File||typeof Blob<"u"&&e instanceof Blob||typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer||typeof ArrayBuffer<"u"&&ArrayBuffer.isView&&ArrayBuffer.isView(e))return e;let t;return n&&(n instanceof Headers?t=n.get("Content-Type")??n.get("content-type")??void 0:typeof n=="object"&&(t=n["Content-Type"]??n["content-type"]),t==="application/x-www-form-urlencoded")?e&&typeof e=="object"&&!(e instanceof URLSearchParams)?new URLSearchParams(e).toString():String(e):JSON.stringify(e)};async function w(e){const r=(e.headers.get("content-type")||"").includes("application/json")?await e.clone().json():await e.clone().text(),i=typeof r=="object"&&r!==null?r.error||r.message:typeof r=="string"?r:void 0;return Object.assign(new Error(i||`HTTP ${e.status} ${e.statusText}`),{status:e.status,statusText:e.statusText,body:r})}function x(e,n,t,r=3e3){let i,o=t??void 0,s,l=null;const a=async()=>{i||(l||(l=(async()=>{const f=await n();if(!f.api_semver)throw new Error("Empty API version");i=f.api_semver})().finally(()=>{l=null})),await l)},P={async onRequest({request:f,schemaPath:p}){return o&&f.headers.set("Authorization",`Bearer ${o}`),p!=="/version"&&(await a(),i&&f.headers.set("X-API-Sem-Ver",i),s&&f.headers.set("X-API-Token",s)),f},async onResponse({request:f,response:p,options:A,schemaPath:O}){if(p.ok)return p;if(O==="/version")throw await w(p);if(p.status!==405)throw await w(p);i=void 0,await a(),i&&f.headers.set("X-API-Sem-Ver",i),o&&f.headers.set("Authorization",`Bearer ${o}`);const m=await(A.fetch??fetch)(f);if(m.ok)return m;throw await w(m)}},R=I({baseUrl:e,bodySerializer:j});return R.withTimeout=async(f,p=r)=>{if(p<=0)return await f();const A=new AbortController,O=setTimeout(()=>A.abort(),p);try{return await f(A.signal)}catch(m){throw m instanceof DOMException&&m.name==="AbortError"?new Error(`Request timed out after ${p}ms`):m}finally{clearTimeout(O)}},R.use(P),{client:R,setApiKey:f=>{s=f},setToken:f=>{o=f}}}async function U(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/version",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function F(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/status",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function B(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/status/system",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function M(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/status/power",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function G(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/status/device",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function V(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/status/firmware",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function W(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/transport",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}class ${async SystemVersionGet(n){const t=await U(this.apiClient,n);return this.apiSemver=t.api_semver,t}async SystemStatusGet(n){return await F(this.apiClient,n)}async SystemInfoGet(n){return await B(this.apiClient,n)}async SystemStatusPowerGet(n){return await M(this.apiClient,n)}async SystemStatusDeviceGet(n){return await G(this.apiClient,n)}async SystemStatusFirmwareGet(n){return await V(this.apiClient,n)}async SystemTransportGet(n){return await W(this.apiClient,n)}}async function H(e,n){const{file:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/update",{headers:{"Content-Type":"application/octet-stream"},body:t,signal:o}),n.timeout);if(i)throw i;return r}async function z(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/update/check",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function J(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/update/status",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function K(e,n){const{version:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.GET("/update/changelog",{params:{query:{version:t}},signal:o}),n.timeout);if(i)throw i;return r}async function Y(e,n){const{version:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/update/install",{params:{query:{version:t}},signal:o}),n.timeout);if(i)throw i;return r}async function X(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/update/abort_download",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Z(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/update/autoupdate",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Q(e,n){const{is_enabled:t,interval_start:r,interval_end:i}=n,{data:o,error:s}=await e.withTimeout(l=>e.POST("/update/autoupdate",{body:{is_enabled:t,interval_start:r,interval_end:i},signal:l}),n.timeout);if(s)throw s;return o}class nn{async UpdateFromFile(n){return await H(this.apiClient,n)}async UpdateCheck(n){return await z(this.apiClient,n)}async UpdateStatusGet(n){return await J(this.apiClient,n)}async UpdateChangelogGet(n){return await K(this.apiClient,n)}async UpdateInstall(n){return await Y(this.apiClient,n)}async UpdateAbort(n){return await X(this.apiClient,n)}async UpdateAutoUpdateGet(n){return await Z(this.apiClient,n)}async UpdateAutoUpdateSet(n){return await Q(this.apiClient,n)}}async function en(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/time",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function tn(e,n){const{timestamp:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/time/timestamp",{params:{query:{timestamp:t}},signal:o}),n.timeout);if(i)throw i;return r}async function rn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/time/timezone",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function on(e,n){const{timezone:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/time/timezone",{params:{query:{timezone:t}},signal:o}),n.timeout);if(i)throw i;return r}async function sn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/time/tzlist",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}class an{async TimeGet(n){return await en(this.apiClient,n)}async TimeTimestampSet(n){return await tn(this.apiClient,n)}async TimeTimezoneGet(n){return await rn(this.apiClient,n)}async TimeTimezoneSet(n){return await on(this.apiClient,n)}async TimeTzListGet(n){return await sn(this.apiClient,n)}}async function un(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/account/status",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function ln(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/account/info",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function fn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/account/profile",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function cn(e,n){const{profile:t,custom_url:r}=n,{data:i,error:o}=await e.withTimeout(s=>e.POST("/account/profile",{params:{query:{profile:t,custom_url:r}},signal:s}),n.timeout);if(o)throw o;return i}async function dn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.DELETE("/account",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function pn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/account/link",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}class hn{async AccountInfoGet(n){return await ln(this.apiClient,n)}async AccountStateGet(n){return await un(this.apiClient,n)}async AccountProfileGet(n){return await fn(this.apiClient,n)}async AccountProfileSet(n){return await cn(this.apiClient,n)}async AccountUnlink(n){return await dn(this.apiClient,n)}async AccountLink(n){return await pn(this.apiClient,n)}}async function yn(e,n){const{application_name:t,elements:r,priority:i=50,timeout:o}=n,{data:s,error:l}=await e.withTimeout(a=>e.POST("/display/draw",{body:{application_name:t,priority:i,elements:r},signal:a}),o);if(l)throw l;return s}async function mn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.DELETE("/display/draw",{params:{query:{application_name:n==null?void 0:n.application_name}},signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function vn(e,n){const{display:t,timeout:r}=n,{data:i,error:o}=await e.withTimeout(s=>e.GET("/screen",{params:{query:{display:t}},parseAs:"blob",signal:s}),r);if(o)throw o;return i}async function gn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/display/brightness",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function bn(e,n){const{value:t}=n,i=(l=>{if(typeof l=="number"){if(l<0||l>100)throw new Error("Brightness value must be between 0 and 100 or 'auto'");return String(l)}return"auto"})(t),{data:o,error:s}=await e.withTimeout(l=>e.POST("/display/brightness",{params:{query:{value:i}},signal:l}),n.timeout);if(s)throw s;return o}class En{async DisplayDraw(n){return await yn(this.apiClient,n)}async DisplayClear(n){return await mn(this.apiClient,n)}async DisplayScreenFrameGet(n){return await vn(this.apiClient,n)}async DisplayBrightnessGet(n){return await gn(this.apiClient,n)}async DisplayBrightnessSet(n){return await bn(this.apiClient,n)}}async function _n(e,n){const{application_name:t,path:r}=n,{data:i,error:o}=await e.withTimeout(s=>e.POST("/audio/play",{params:{query:{application_name:t,path:r}},signal:s}),n.timeout);if(o)throw o;return i}async function An(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.DELETE("/audio/play",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Tn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/audio/volume",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Rn(e,n){const{volume:t,silent:r}=n;if(typeof t!="number"||t<0||t>100)throw new Error("Volume must be a number between 0 and 100");const{data:i,error:o}=await e.withTimeout(s=>e.POST("/audio/volume",{params:{query:{volume:t,silent:r}},signal:s}),n.timeout);if(o)throw o;return i}class On{async AudioPlay(n){return await _n(this.apiClient,n)}async AudioStop(n){return await An(this.apiClient,n)}async AudioVolumeGet(n){return await Tn(this.apiClient,n)}async AudioVolumeSet(n){return await Rn(this.apiClient,n)}}async function wn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/wifi/status",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Sn(e,n){const{ssid:t,password:r,security:i,ip_config:o}=n,{data:s,error:l}=await e.withTimeout(a=>e.POST("/wifi/connect",{body:{ssid:t,password:r,security:i,ip_config:o},signal:a}),n.timeout);if(l)throw l;return s}async function Nn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/wifi/disconnect",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function In(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/wifi/networks",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}class Cn{async WifiStatusGet(n){return await wn(this.apiClient,n)}async WifiConnect(n){return await Sn(this.apiClient,n)}async WifiDisconnect(n){return await Nn(this.apiClient,n)}async WifiNetworksGet(n){return await In(this.apiClient,n)}}async function kn(e,n){const{path:t,file:r}=n,{data:i,error:o}=await e.withTimeout(s=>e.POST("/storage/write",{params:{query:{path:t}},headers:{"Content-Type":"application/octet-stream"},body:r,signal:s}),n.timeout);if(o)throw o;return i}async function qn(e,n){const{path:t,as_array_buffer:r}=n,{data:i,error:o}=await e.withTimeout(s=>e.GET("/storage/read",{params:{query:{path:t}},parseAs:r?"arrayBuffer":"blob",signal:s}),n.timeout);if(o)throw o;return i}async function Pn(e,n){const{path:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.GET("/storage/list",{params:{query:{path:t}},signal:o}),n.timeout);if(i)throw i;return r}async function Dn(e,n){const{path:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.DELETE("/storage/remove",{params:{query:{path:t}},signal:o}),n.timeout);if(i)throw i;return r}async function Ln(e,n){const{path:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/storage/mkdir",{params:{query:{path:t}},signal:o}),n.timeout);if(i)throw i;return r}async function jn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/storage/status",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function xn(e,n){const{path:t,new_path:r}=n,{data:i,error:o}=await e.withTimeout(s=>e.POST("/storage/rename",{params:{query:{path:t,new_path:r}},signal:s}),n.timeout);if(o)throw o;return i}class Un{async StorageWrite(n){return await kn(this.apiClient,n)}async StorageRead(n){return await qn(this.apiClient,n)}async StorageListGet(n){return await Pn(this.apiClient,n)}async StorageRemove(n){return await Dn(this.apiClient,n)}async StorageMkdir(n){return await Ln(this.apiClient,n)}async StorageStatusGet(n){return await jn(this.apiClient,n)}async StorageRename(n){return await xn(this.apiClient,n)}}async function Fn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/access",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Bn(e,n){const{mode:t,key:r}=n,i=r??"";if(String(i).trim()&&!/^\d{4,10}$/.test(String(i)))throw new Error("Key must be a string of 4 to 10 digits");const{data:o,error:s}=await e.withTimeout(l=>e.POST("/access",{params:{query:{mode:t,key:i}},signal:l}),n.timeout);if(s)throw s;return o}async function Mn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/name",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Gn(e,n){const{name:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/name",{body:{name:t},signal:o}),n.timeout);if(i)throw i;return r}class Vn{async SettingsAccessGet(n){return await Fn(this.apiClient,n)}async SettingsAccessSet(n){const t=await Bn(this.apiClient,n);return n.mode==="key"&&n.key&&this.setApiKey(n.key),t}async SettingsNameGet(n){return await Mn(this.apiClient,n)}async SettingsNameSet(n){return await Gn(this.apiClient,n)}}async function Wn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/ble/enable",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function $n(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/ble/disable",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Hn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.DELETE("/ble/pairing",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function zn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/ble/status",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}class Jn{async BleEnable(n){return await Wn(this.apiClient,n)}async BleDisable(n){return await $n(this.apiClient,n)}async BleUnpair(n){return await Hn(this.apiClient,n)}async BleStatusGet(n){return await zn(this.apiClient,n)}}async function Kn(e,n){const{key:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.POST("/input",{params:{query:{key:t}},signal:o}),n.timeout);if(i)throw i;return r}class Yn{async InputSend(n){return await Kn(this.apiClient,n)}}async function Xn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/smart_home/pairing",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Zn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.POST("/smart_home/pairing",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function Qn(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.DELETE("/smart_home/pairing",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function ne(e,n){const{data:t,error:r}=await e.withTimeout(i=>e.GET("/smart_home/switch",{signal:i}),n==null?void 0:n.timeout);if(r)throw r;return t}async function ee(e,n){const{timeout:t,...r}=n,{data:i,error:o}=await e.withTimeout(s=>e.POST("/smart_home/switch",{body:r,signal:s}),t);if(o)throw o;return i}class te{async SmartHomePairingGet(n){return await Xn(this.apiClient,n)}async SmartHomePair(n){return await Zn(this.apiClient,n)}async SmartHomeErase(n){return await Qn(this.apiClient,n)}async SmartHomeSwitchStateGet(n){return await ne(this.apiClient,n)}async SmartHomeSwitchStateSet(n){return await ee(this.apiClient,n)}async MatterStatusGet(n){return await this.SmartHomePairingGet(n)}async MatterPair(n){return await this.SmartHomePair(n)}async MatterErase(n){return await this.SmartHomeErase(n)}}async function re(e,n){const{application_name:t,file:r,data:i}=n,{data:o,error:s}=await e.withTimeout(l=>e.POST("/assets/upload",{params:{query:{application_name:t,file:r}},headers:{"Content-Type":"application/octet-stream"},body:i,signal:l}),n.timeout);if(s)throw s;return o}async function ie(e,n){const{application_name:t}=n,{data:r,error:i}=await e.withTimeout(o=>e.DELETE("/assets/upload",{params:{query:{application_name:t}},signal:o}),n.timeout);if(i)throw i;return r}class oe{async AssetsUpload(n){return await re(this.apiClient,n)}async AssetsDelete(n){return await ie(this.apiClient,n)}}const se="http://10.0.4.20",ae="https://proxy.busy.app",ue=/^https?:\/\/proxy(?:\.(?:dev|test|stage))?\.busy\.app$/i;function le(e){const n=e.split(".");if(n.length!==4)return!1;for(const t of n){if(t.length===0||t.length>1&&t[0]==="0"||!/^\d+$/.test(t))return!1;const r=Number(t);if(r<0||r>255)return!1}return!0}function fe(e){return/\.local$/i.test(e)}class C{constructor(n){u(this,"addr");u(this,"apiSemver");u(this,"apiClient");u(this,"setApiKeyFn");u(this,"setTokenFn");u(this,"connectionType","unknown");if(!n||!n.addr&&!n.token)this.addr=se;else if(!n.addr)this.addr=ae;else{let o=n.addr.trim();if(/^https?:\/\//i.test(o)||(o=`http://${o}`),ue.test(o)&&!n.token)throw new Error("Token is required. Please provide it.");this.addr=o}this.apiSemver="";const{client:t,setApiKey:r,setToken:i}=x(`${this.addr}/api/`,this.SystemVersionGet.bind(this),n==null?void 0:n.token,n==null?void 0:n.timeout);this.apiClient=t,this.setApiKeyFn=r,this.setTokenFn=i,this.detectConnectionType()}async detectConnectionType(){const n=new URL(this.addr).hostname;if(!le(n)&&!fe(n)){this.connectionType="wifi";return}const t=I({baseUrl:`${this.addr}/api/`});try{const{response:r}=await t.GET("/name");if(r.status===401||r.status===403)this.connectionType="wifi";else if(r.ok)this.connectionType="usb";else throw new Error(`Failed to detect connection type. Status: ${r.status}`)}catch(r){throw r}}setApiKey(n){this.setApiKeyFn(n)}setToken(n){this.setTokenFn(n)}}function ce(e,n){n.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(r=>{Object.defineProperty(e.prototype,r,Object.getOwnPropertyDescriptor(t.prototype,r)||Object.create(null))})})}ce(C,[$,nn,an,hn,En,On,Cn,Un,Vn,Jn,Yn,te,oe]);var c=(e=>(e.CONNECTION_FAILED="CONNECTION_FAILED",e.RECONNECT_FAILED="RECONNECT_FAILED",e.CONNECTION_LOST="CONNECTION_LOST",e.CONNECTION_TIMEOUT="CONNECTION_TIMEOUT",e.AUTH_FAILED="AUTH_FAILED",e.AUTH_REFRESH_FAILED="AUTH_REFRESH_FAILED",e.DEVICE_ERROR="DEVICE_ERROR",e.DECODE_ERROR="DECODE_ERROR",e.FRAME_PROCESS_ERROR="FRAME_PROCESS_ERROR",e.STREAM_ALREADY_STARTED="STREAM_ALREADY_STARTED",e.WORKER_INIT_FAILED="WORKER_INIT_FAILED",e.UNKNOWN_ERROR="UNKNOWN_ERROR",e))(c||{});class h extends Error{constructor(n,t,r){super(t),this.code=n,this.data=r,this.name="StateStreamError"}}var d=(e=>(e.IDLE="IDLE",e.STARTING="STARTING",e.RUNNING="RUNNING",e.STOPPED="STOPPED",e.FAILED="FAILED",e))(d||{}),y=(e=>(e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.RECONNECTING="RECONNECTING",e))(y||{}),v=(e=>(e.UNAUTHENTICATED="UNAUTHENTICATED",e.AUTHENTICATING="AUTHENTICATING",e.AUTHENTICATED="AUTHENTICATED",e.REAUTHENTICATING="REAUTHENTICATING",e.FAILED="FAILED",e))(v||{}),g=(e=>(e.NONE="NONE",e.ACTIVE="ACTIVE",e.STALE="STALE",e))(g||{}),b=(e=>(e.OFF="OFF",e.INITIALIZING="INITIALIZING",e.READY="READY",e.ERROR="ERROR",e))(b||{});const de=5,k=5,pe=500,q=`var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, src = { exports: {} }, indexLight = { exports: {} }, indexMinimal = {}, minimal = {}, aspromise, hasRequiredAspromise;
|
|
2
2
|
function requireAspromise() {
|
|
3
3
|
if (hasRequiredAspromise) return aspromise;
|
|
4
|
-
hasRequiredAspromise = 1, aspromise =
|
|
5
|
-
function
|
|
4
|
+
hasRequiredAspromise = 1, aspromise = a;
|
|
5
|
+
function a(f, h) {
|
|
6
6
|
for (var c = new Array(arguments.length - 1), d = 0, n = 2, e = !0; n < arguments.length; )
|
|
7
7
|
c[d++] = arguments[n++];
|
|
8
8
|
return new Promise(function(i, t) {
|
|
@@ -11,9 +11,9 @@ function requireAspromise() {
|
|
|
11
11
|
if (e = !1, s)
|
|
12
12
|
t(s);
|
|
13
13
|
else {
|
|
14
|
-
for (var
|
|
15
|
-
|
|
16
|
-
i.apply(null,
|
|
14
|
+
for (var u = new Array(arguments.length - 1), o = 0; o < u.length; )
|
|
15
|
+
u[o++] = arguments[o];
|
|
16
|
+
i.apply(null, u);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
try {
|
|
@@ -27,8 +27,8 @@ function requireAspromise() {
|
|
|
27
27
|
}
|
|
28
28
|
var base64 = {}, hasRequiredBase64;
|
|
29
29
|
function requireBase64() {
|
|
30
|
-
return hasRequiredBase64 || (hasRequiredBase64 = 1, function(
|
|
31
|
-
var f =
|
|
30
|
+
return hasRequiredBase64 || (hasRequiredBase64 = 1, function(a) {
|
|
31
|
+
var f = a;
|
|
32
32
|
f.length = function(r) {
|
|
33
33
|
var i = r.length;
|
|
34
34
|
if (!i)
|
|
@@ -40,26 +40,26 @@ function requireBase64() {
|
|
|
40
40
|
for (var h = new Array(64), c = new Array(123), d = 0; d < 64; )
|
|
41
41
|
c[h[d] = d < 26 ? d + 65 : d < 52 ? d + 71 : d < 62 ? d - 4 : d - 59 | 43] = d++;
|
|
42
42
|
f.encode = function(r, i, t) {
|
|
43
|
-
for (var l = null, s = [],
|
|
43
|
+
for (var l = null, s = [], u = 0, o = 0, p; i < t; ) {
|
|
44
44
|
var y = r[i++];
|
|
45
45
|
switch (o) {
|
|
46
46
|
case 0:
|
|
47
|
-
s[
|
|
47
|
+
s[u++] = h[y >> 2], p = (y & 3) << 4, o = 1;
|
|
48
48
|
break;
|
|
49
49
|
case 1:
|
|
50
|
-
s[
|
|
50
|
+
s[u++] = h[p | y >> 4], p = (y & 15) << 2, o = 2;
|
|
51
51
|
break;
|
|
52
52
|
case 2:
|
|
53
|
-
s[
|
|
53
|
+
s[u++] = h[p | y >> 6], s[u++] = h[y & 63], o = 0;
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
u > 8191 && ((l || (l = [])).push(String.fromCharCode.apply(String, s)), u = 0);
|
|
57
57
|
}
|
|
58
|
-
return o && (s[
|
|
58
|
+
return o && (s[u++] = h[p], s[u++] = 61, o === 1 && (s[u++] = 61)), l ? (u && l.push(String.fromCharCode.apply(String, s.slice(0, u))), l.join("")) : String.fromCharCode.apply(String, s.slice(0, u));
|
|
59
59
|
};
|
|
60
60
|
var n = "invalid encoding";
|
|
61
61
|
f.decode = function(r, i, t) {
|
|
62
|
-
for (var l = t, s = 0,
|
|
62
|
+
for (var l = t, s = 0, u, o = 0; o < r.length; ) {
|
|
63
63
|
var p = r.charCodeAt(o++);
|
|
64
64
|
if (p === 61 && s > 1)
|
|
65
65
|
break;
|
|
@@ -67,16 +67,16 @@ function requireBase64() {
|
|
|
67
67
|
throw Error(n);
|
|
68
68
|
switch (s) {
|
|
69
69
|
case 0:
|
|
70
|
-
|
|
70
|
+
u = p, s = 1;
|
|
71
71
|
break;
|
|
72
72
|
case 1:
|
|
73
|
-
i[t++] =
|
|
73
|
+
i[t++] = u << 2 | (p & 48) >> 4, u = p, s = 2;
|
|
74
74
|
break;
|
|
75
75
|
case 2:
|
|
76
|
-
i[t++] = (
|
|
76
|
+
i[t++] = (u & 15) << 4 | (p & 60) >> 2, u = p, s = 3;
|
|
77
77
|
break;
|
|
78
78
|
case 3:
|
|
79
|
-
i[t++] = (
|
|
79
|
+
i[t++] = (u & 3) << 6 | p, s = 0;
|
|
80
80
|
break;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -91,16 +91,16 @@ function requireBase64() {
|
|
|
91
91
|
var eventemitter, hasRequiredEventemitter;
|
|
92
92
|
function requireEventemitter() {
|
|
93
93
|
if (hasRequiredEventemitter) return eventemitter;
|
|
94
|
-
hasRequiredEventemitter = 1, eventemitter =
|
|
95
|
-
function
|
|
94
|
+
hasRequiredEventemitter = 1, eventemitter = a;
|
|
95
|
+
function a() {
|
|
96
96
|
this._listeners = {};
|
|
97
97
|
}
|
|
98
|
-
return
|
|
98
|
+
return a.prototype.on = function(h, c, d) {
|
|
99
99
|
return (this._listeners[h] || (this._listeners[h] = [])).push({
|
|
100
100
|
fn: c,
|
|
101
101
|
ctx: d || this
|
|
102
102
|
}), this;
|
|
103
|
-
},
|
|
103
|
+
}, a.prototype.off = function(h, c) {
|
|
104
104
|
if (h === void 0)
|
|
105
105
|
this._listeners = {};
|
|
106
106
|
else if (c === void 0)
|
|
@@ -109,7 +109,7 @@ function requireEventemitter() {
|
|
|
109
109
|
for (var d = this._listeners[h], n = 0; n < d.length; )
|
|
110
110
|
d[n].fn === c ? d.splice(n, 1) : ++n;
|
|
111
111
|
return this;
|
|
112
|
-
},
|
|
112
|
+
}, a.prototype.emit = function(h) {
|
|
113
113
|
var c = this._listeners[h];
|
|
114
114
|
if (c) {
|
|
115
115
|
for (var d = [], n = 1; n < arguments.length; )
|
|
@@ -123,8 +123,8 @@ function requireEventemitter() {
|
|
|
123
123
|
var float, hasRequiredFloat;
|
|
124
124
|
function requireFloat() {
|
|
125
125
|
if (hasRequiredFloat) return float;
|
|
126
|
-
hasRequiredFloat = 1, float =
|
|
127
|
-
function
|
|
126
|
+
hasRequiredFloat = 1, float = a(a);
|
|
127
|
+
function a(n) {
|
|
128
128
|
return typeof Float32Array < "u" ? function() {
|
|
129
129
|
var e = new Float32Array([-0]), r = new Uint8Array(e.buffer), i = r[3] === 128;
|
|
130
130
|
function t(o, p, y) {
|
|
@@ -137,14 +137,14 @@ function requireFloat() {
|
|
|
137
137
|
function s(o, p) {
|
|
138
138
|
return r[0] = o[p], r[1] = o[p + 1], r[2] = o[p + 2], r[3] = o[p + 3], e[0];
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function u(o, p) {
|
|
141
141
|
return r[3] = o[p], r[2] = o[p + 1], r[1] = o[p + 2], r[0] = o[p + 3], e[0];
|
|
142
142
|
}
|
|
143
|
-
n.readFloatLE = i ? s :
|
|
143
|
+
n.readFloatLE = i ? s : u, n.readFloatBE = i ? u : s;
|
|
144
144
|
}() : function() {
|
|
145
145
|
function e(i, t, l, s) {
|
|
146
|
-
var
|
|
147
|
-
if (
|
|
146
|
+
var u = t < 0 ? 1 : 0;
|
|
147
|
+
if (u && (t = -t), t === 0)
|
|
148
148
|
i(1 / t > 0 ? (
|
|
149
149
|
/* positive */
|
|
150
150
|
0
|
|
@@ -155,18 +155,18 @@ function requireFloat() {
|
|
|
155
155
|
else if (isNaN(t))
|
|
156
156
|
i(2143289344, l, s);
|
|
157
157
|
else if (t > 34028234663852886e22)
|
|
158
|
-
i((
|
|
158
|
+
i((u << 31 | 2139095040) >>> 0, l, s);
|
|
159
159
|
else if (t < 11754943508222875e-54)
|
|
160
|
-
i((
|
|
160
|
+
i((u << 31 | Math.round(t / 1401298464324817e-60)) >>> 0, l, s);
|
|
161
161
|
else {
|
|
162
162
|
var o = Math.floor(Math.log(t) / Math.LN2), p = Math.round(t * Math.pow(2, -o) * 8388608) & 8388607;
|
|
163
|
-
i((
|
|
163
|
+
i((u << 31 | o + 127 << 23 | p) >>> 0, l, s);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
n.writeFloatLE = e.bind(null, f), n.writeFloatBE = e.bind(null, h);
|
|
167
167
|
function r(i, t, l) {
|
|
168
|
-
var s = i(t, l),
|
|
169
|
-
return o === 255 ? p ? NaN :
|
|
168
|
+
var s = i(t, l), u = (s >> 31) * 2 + 1, o = s >>> 23 & 255, p = s & 8388607;
|
|
169
|
+
return o === 255 ? p ? NaN : u * (1 / 0) : o === 0 ? u * 1401298464324817e-60 * p : u * Math.pow(2, o - 150) * (p + 8388608);
|
|
170
170
|
}
|
|
171
171
|
n.readFloatLE = r.bind(null, c), n.readFloatBE = r.bind(null, d);
|
|
172
172
|
}(), typeof Float64Array < "u" ? function() {
|
|
@@ -181,38 +181,38 @@ function requireFloat() {
|
|
|
181
181
|
function s(o, p) {
|
|
182
182
|
return r[0] = o[p], r[1] = o[p + 1], r[2] = o[p + 2], r[3] = o[p + 3], r[4] = o[p + 4], r[5] = o[p + 5], r[6] = o[p + 6], r[7] = o[p + 7], e[0];
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function u(o, p) {
|
|
185
185
|
return r[7] = o[p], r[6] = o[p + 1], r[5] = o[p + 2], r[4] = o[p + 3], r[3] = o[p + 4], r[2] = o[p + 5], r[1] = o[p + 6], r[0] = o[p + 7], e[0];
|
|
186
186
|
}
|
|
187
|
-
n.readDoubleLE = i ? s :
|
|
187
|
+
n.readDoubleLE = i ? s : u, n.readDoubleBE = i ? u : s;
|
|
188
188
|
}() : function() {
|
|
189
|
-
function e(i, t, l, s,
|
|
189
|
+
function e(i, t, l, s, u, o) {
|
|
190
190
|
var p = s < 0 ? 1 : 0;
|
|
191
191
|
if (p && (s = -s), s === 0)
|
|
192
|
-
i(0,
|
|
192
|
+
i(0, u, o + t), i(1 / s > 0 ? (
|
|
193
193
|
/* positive */
|
|
194
194
|
0
|
|
195
195
|
) : (
|
|
196
196
|
/* negative 0 */
|
|
197
197
|
2147483648
|
|
198
|
-
),
|
|
198
|
+
), u, o + l);
|
|
199
199
|
else if (isNaN(s))
|
|
200
|
-
i(0,
|
|
200
|
+
i(0, u, o + t), i(2146959360, u, o + l);
|
|
201
201
|
else if (s > 17976931348623157e292)
|
|
202
|
-
i(0,
|
|
202
|
+
i(0, u, o + t), i((p << 31 | 2146435072) >>> 0, u, o + l);
|
|
203
203
|
else {
|
|
204
204
|
var y;
|
|
205
205
|
if (s < 22250738585072014e-324)
|
|
206
|
-
y = s / 5e-324, i(y >>> 0,
|
|
206
|
+
y = s / 5e-324, i(y >>> 0, u, o + t), i((p << 31 | y / 4294967296) >>> 0, u, o + l);
|
|
207
207
|
else {
|
|
208
208
|
var E = Math.floor(Math.log(s) / Math.LN2);
|
|
209
|
-
E === 1024 && (E = 1023), y = s * Math.pow(2, -E), i(y * 4503599627370496 >>> 0,
|
|
209
|
+
E === 1024 && (E = 1023), y = s * Math.pow(2, -E), i(y * 4503599627370496 >>> 0, u, o + t), i((p << 31 | E + 1023 << 20 | y * 1048576 & 1048575) >>> 0, u, o + l);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
n.writeDoubleLE = e.bind(null, f, 0, 4), n.writeDoubleBE = e.bind(null, h, 4, 0);
|
|
214
|
-
function r(i, t, l, s,
|
|
215
|
-
var o = i(s,
|
|
214
|
+
function r(i, t, l, s, u) {
|
|
215
|
+
var o = i(s, u + t), p = i(s, u + l), y = (p >> 31) * 2 + 1, E = p >>> 20 & 2047, v = 4294967296 * (p & 1048575) + o;
|
|
216
216
|
return E === 2047 ? v ? NaN : y * (1 / 0) : E === 0 ? y * 5e-324 * v : y * Math.pow(2, E - 1075) * (v + 4503599627370496);
|
|
217
217
|
}
|
|
218
218
|
n.readDoubleLE = r.bind(null, c, 0, 4), n.readDoubleBE = r.bind(null, d, 4, 0);
|
|
@@ -241,7 +241,7 @@ function requireInquire() {
|
|
|
241
241
|
var mod = eval("quire".replace(/^/, "re"))(moduleName);
|
|
242
242
|
if (mod && (mod.length || Object.keys(mod).length))
|
|
243
243
|
return mod;
|
|
244
|
-
} catch (
|
|
244
|
+
} catch (a) {
|
|
245
245
|
}
|
|
246
246
|
return null;
|
|
247
247
|
}
|
|
@@ -249,8 +249,8 @@ function requireInquire() {
|
|
|
249
249
|
}
|
|
250
250
|
var utf8 = {}, hasRequiredUtf8;
|
|
251
251
|
function requireUtf8() {
|
|
252
|
-
return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(
|
|
253
|
-
var f =
|
|
252
|
+
return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(a) {
|
|
253
|
+
var f = a;
|
|
254
254
|
f.length = function(c) {
|
|
255
255
|
for (var d = 0, n = 0, e = 0; e < c.length; ++e)
|
|
256
256
|
n = c.charCodeAt(e), n < 128 ? d += 1 : n < 2048 ? d += 2 : (n & 64512) === 55296 && (c.charCodeAt(e + 1) & 64512) === 56320 ? (++e, d += 4) : d += 3;
|
|
@@ -272,8 +272,8 @@ function requireUtf8() {
|
|
|
272
272
|
var pool_1, hasRequiredPool;
|
|
273
273
|
function requirePool() {
|
|
274
274
|
if (hasRequiredPool) return pool_1;
|
|
275
|
-
hasRequiredPool = 1, pool_1 =
|
|
276
|
-
function
|
|
275
|
+
hasRequiredPool = 1, pool_1 = a;
|
|
276
|
+
function a(f, h, c) {
|
|
277
277
|
var d = c || 8192, n = d >>> 1, e = null, r = d;
|
|
278
278
|
return function(t) {
|
|
279
279
|
if (t < 1 || t > n)
|
|
@@ -289,7 +289,7 @@ var longbits, hasRequiredLongbits;
|
|
|
289
289
|
function requireLongbits() {
|
|
290
290
|
if (hasRequiredLongbits) return longbits;
|
|
291
291
|
hasRequiredLongbits = 1, longbits = f;
|
|
292
|
-
var
|
|
292
|
+
var a = requireMinimal();
|
|
293
293
|
function f(n, e) {
|
|
294
294
|
this.lo = n >>> 0, this.hi = e >>> 0;
|
|
295
295
|
}
|
|
@@ -312,9 +312,9 @@ function requireLongbits() {
|
|
|
312
312
|
}, f.from = function(e) {
|
|
313
313
|
if (typeof e == "number")
|
|
314
314
|
return f.fromNumber(e);
|
|
315
|
-
if (
|
|
316
|
-
if (
|
|
317
|
-
e =
|
|
315
|
+
if (a.isString(e))
|
|
316
|
+
if (a.Long)
|
|
317
|
+
e = a.Long.fromString(e);
|
|
318
318
|
else
|
|
319
319
|
return f.fromNumber(parseInt(e, 10));
|
|
320
320
|
return e.low || e.high ? new f(e.low >>> 0, e.high >>> 0) : h;
|
|
@@ -325,7 +325,7 @@ function requireLongbits() {
|
|
|
325
325
|
}
|
|
326
326
|
return this.lo + this.hi * 4294967296;
|
|
327
327
|
}, f.prototype.toLong = function(e) {
|
|
328
|
-
return
|
|
328
|
+
return a.Long ? new a.Long(this.lo | 0, this.hi | 0, !!e) : { low: this.lo | 0, high: this.hi | 0, unsigned: !!e };
|
|
329
329
|
};
|
|
330
330
|
var d = String.prototype.charCodeAt;
|
|
331
331
|
return f.fromHash = function(e) {
|
|
@@ -357,8 +357,8 @@ function requireLongbits() {
|
|
|
357
357
|
}
|
|
358
358
|
var hasRequiredMinimal;
|
|
359
359
|
function requireMinimal() {
|
|
360
|
-
return hasRequiredMinimal || (hasRequiredMinimal = 1, function(
|
|
361
|
-
var f =
|
|
360
|
+
return hasRequiredMinimal || (hasRequiredMinimal = 1, function(a) {
|
|
361
|
+
var f = a;
|
|
362
362
|
f.asPromise = requireAspromise(), f.base64 = requireBase64(), f.EventEmitter = requireEventemitter(), f.float = requireFloat(), f.inquire = requireInquire(), f.utf8 = requireUtf8(), f.pool = requirePool(), f.LongBits = requireLongbits(), f.isNode = !!(typeof commonjsGlobal < "u" && commonjsGlobal && commonjsGlobal.process && commonjsGlobal.process.versions && commonjsGlobal.process.versions.node), f.global = f.isNode && commonjsGlobal || typeof window < "u" && window || typeof self < "u" && self || minimal, f.emptyArray = Object.freeze ? Object.freeze([]) : (
|
|
363
363
|
/* istanbul ignore next */
|
|
364
364
|
[]
|
|
@@ -485,7 +485,7 @@ var writer, hasRequiredWriter;
|
|
|
485
485
|
function requireWriter() {
|
|
486
486
|
if (hasRequiredWriter) return writer;
|
|
487
487
|
hasRequiredWriter = 1, writer = i;
|
|
488
|
-
var
|
|
488
|
+
var a = requireMinimal(), f, h = a.LongBits, c = a.base64, d = a.utf8;
|
|
489
489
|
function n(E, v, m) {
|
|
490
490
|
this.fn = E, this.len = v, this.next = void 0, this.val = m;
|
|
491
491
|
}
|
|
@@ -498,7 +498,7 @@ function requireWriter() {
|
|
|
498
498
|
this.len = 0, this.head = new n(e, 0, 0), this.tail = this.head, this.states = null;
|
|
499
499
|
}
|
|
500
500
|
var t = function() {
|
|
501
|
-
return
|
|
501
|
+
return a.Buffer ? function() {
|
|
502
502
|
return (i.create = function() {
|
|
503
503
|
return new f();
|
|
504
504
|
})();
|
|
@@ -507,8 +507,8 @@ function requireWriter() {
|
|
|
507
507
|
};
|
|
508
508
|
};
|
|
509
509
|
i.create = t(), i.alloc = function(v) {
|
|
510
|
-
return new
|
|
511
|
-
},
|
|
510
|
+
return new a.Array(v);
|
|
511
|
+
}, a.Array !== Array && (i.alloc = a.pool(i.alloc, a.Array.prototype.subarray)), i.prototype._push = function(v, m, _) {
|
|
512
512
|
return this.tail = this.tail.next = new n(v, m, _), this.len += m, this;
|
|
513
513
|
};
|
|
514
514
|
function l(E, v, m) {
|
|
@@ -519,11 +519,11 @@ function requireWriter() {
|
|
|
519
519
|
v[m++] = E & 127 | 128, E >>>= 7;
|
|
520
520
|
v[m] = E;
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function u(E, v) {
|
|
523
523
|
this.len = E, this.next = void 0, this.val = v;
|
|
524
524
|
}
|
|
525
|
-
|
|
526
|
-
return this.len += (this.tail = this.tail.next = new
|
|
525
|
+
u.prototype = Object.create(n.prototype), u.prototype.fn = s, i.prototype.uint32 = function(v) {
|
|
526
|
+
return this.len += (this.tail = this.tail.next = new u(
|
|
527
527
|
(v = v >>> 0) < 128 ? 1 : v < 16384 ? 2 : v < 2097152 ? 3 : v < 268435456 ? 4 : 5,
|
|
528
528
|
v
|
|
529
529
|
)).len, this;
|
|
@@ -557,11 +557,11 @@ function requireWriter() {
|
|
|
557
557
|
var m = h.from(v);
|
|
558
558
|
return this._push(p, 4, m.lo)._push(p, 4, m.hi);
|
|
559
559
|
}, i.prototype.sfixed64 = i.prototype.fixed64, i.prototype.float = function(v) {
|
|
560
|
-
return this._push(
|
|
560
|
+
return this._push(a.float.writeFloatLE, 4, v);
|
|
561
561
|
}, i.prototype.double = function(v) {
|
|
562
|
-
return this._push(
|
|
562
|
+
return this._push(a.float.writeDoubleLE, 8, v);
|
|
563
563
|
};
|
|
564
|
-
var y =
|
|
564
|
+
var y = a.Array.prototype.set ? function(v, m, _) {
|
|
565
565
|
m.set(v, _);
|
|
566
566
|
} : function(v, m, _) {
|
|
567
567
|
for (var A = 0; A < v.length; ++A)
|
|
@@ -571,7 +571,7 @@ function requireWriter() {
|
|
|
571
571
|
var m = v.length >>> 0;
|
|
572
572
|
if (!m)
|
|
573
573
|
return this._push(l, 1, 0);
|
|
574
|
-
if (
|
|
574
|
+
if (a.isString(v)) {
|
|
575
575
|
var _ = i.alloc(m = c.length(v));
|
|
576
576
|
c.decode(v, _, 0), v = _;
|
|
577
577
|
}
|
|
@@ -598,11 +598,11 @@ var writer_buffer, hasRequiredWriter_buffer;
|
|
|
598
598
|
function requireWriter_buffer() {
|
|
599
599
|
if (hasRequiredWriter_buffer) return writer_buffer;
|
|
600
600
|
hasRequiredWriter_buffer = 1, writer_buffer = h;
|
|
601
|
-
var
|
|
602
|
-
(h.prototype = Object.create(
|
|
601
|
+
var a = requireWriter();
|
|
602
|
+
(h.prototype = Object.create(a.prototype)).constructor = h;
|
|
603
603
|
var f = requireMinimal();
|
|
604
604
|
function h() {
|
|
605
|
-
|
|
605
|
+
a.call(this);
|
|
606
606
|
}
|
|
607
607
|
h._configure = function() {
|
|
608
608
|
h.alloc = f._Buffer_allocUnsafe, h.writeBytesBuffer = f.Buffer && f.Buffer.prototype instanceof Uint8Array && f.Buffer.prototype.set.name === "set" ? function(n, e, r) {
|
|
@@ -630,70 +630,70 @@ var reader, hasRequiredReader;
|
|
|
630
630
|
function requireReader() {
|
|
631
631
|
if (hasRequiredReader) return reader;
|
|
632
632
|
hasRequiredReader = 1, reader = n;
|
|
633
|
-
var
|
|
634
|
-
function d(s,
|
|
635
|
-
return RangeError("index out of range: " + s.pos + " + " + (
|
|
633
|
+
var a = requireMinimal(), f, h = a.LongBits, c = a.utf8;
|
|
634
|
+
function d(s, u) {
|
|
635
|
+
return RangeError("index out of range: " + s.pos + " + " + (u || 1) + " > " + s.len);
|
|
636
636
|
}
|
|
637
637
|
function n(s) {
|
|
638
638
|
this.buf = s, this.pos = 0, this.len = s.length;
|
|
639
639
|
}
|
|
640
|
-
var e = typeof Uint8Array < "u" ? function(
|
|
641
|
-
if (
|
|
642
|
-
return new n(
|
|
640
|
+
var e = typeof Uint8Array < "u" ? function(u) {
|
|
641
|
+
if (u instanceof Uint8Array || Array.isArray(u))
|
|
642
|
+
return new n(u);
|
|
643
643
|
throw Error("illegal buffer");
|
|
644
|
-
} : function(
|
|
645
|
-
if (Array.isArray(
|
|
646
|
-
return new n(
|
|
644
|
+
} : function(u) {
|
|
645
|
+
if (Array.isArray(u))
|
|
646
|
+
return new n(u);
|
|
647
647
|
throw Error("illegal buffer");
|
|
648
648
|
}, r = function() {
|
|
649
|
-
return
|
|
649
|
+
return a.Buffer ? function(o) {
|
|
650
650
|
return (n.create = function(y) {
|
|
651
|
-
return
|
|
651
|
+
return a.Buffer.isBuffer(y) ? new f(y) : e(y);
|
|
652
652
|
})(o);
|
|
653
653
|
} : e;
|
|
654
654
|
};
|
|
655
|
-
n.create = r(), n.prototype._slice =
|
|
656
|
-
|
|
657
|
-
var
|
|
655
|
+
n.create = r(), n.prototype._slice = a.Array.prototype.subarray || /* istanbul ignore next */
|
|
656
|
+
a.Array.prototype.slice, n.prototype.uint32 = /* @__PURE__ */ function() {
|
|
657
|
+
var u = 4294967295;
|
|
658
658
|
return function() {
|
|
659
|
-
if (
|
|
659
|
+
if (u = (this.buf[this.pos] & 127) >>> 0, this.buf[this.pos++] < 128 || (u = (u | (this.buf[this.pos] & 127) << 7) >>> 0, this.buf[this.pos++] < 128) || (u = (u | (this.buf[this.pos] & 127) << 14) >>> 0, this.buf[this.pos++] < 128) || (u = (u | (this.buf[this.pos] & 127) << 21) >>> 0, this.buf[this.pos++] < 128) || (u = (u | (this.buf[this.pos] & 15) << 28) >>> 0, this.buf[this.pos++] < 128)) return u;
|
|
660
660
|
if ((this.pos += 5) > this.len)
|
|
661
661
|
throw this.pos = this.len, d(this, 10);
|
|
662
|
-
return
|
|
662
|
+
return u;
|
|
663
663
|
};
|
|
664
664
|
}(), n.prototype.int32 = function() {
|
|
665
665
|
return this.uint32() | 0;
|
|
666
666
|
}, n.prototype.sint32 = function() {
|
|
667
|
-
var
|
|
668
|
-
return
|
|
667
|
+
var u = this.uint32();
|
|
668
|
+
return u >>> 1 ^ -(u & 1) | 0;
|
|
669
669
|
};
|
|
670
670
|
function i() {
|
|
671
|
-
var s = new h(0, 0),
|
|
671
|
+
var s = new h(0, 0), u = 0;
|
|
672
672
|
if (this.len - this.pos > 4) {
|
|
673
|
-
for (;
|
|
674
|
-
if (s.lo = (s.lo | (this.buf[this.pos] & 127) <<
|
|
673
|
+
for (; u < 4; ++u)
|
|
674
|
+
if (s.lo = (s.lo | (this.buf[this.pos] & 127) << u * 7) >>> 0, this.buf[this.pos++] < 128)
|
|
675
675
|
return s;
|
|
676
676
|
if (s.lo = (s.lo | (this.buf[this.pos] & 127) << 28) >>> 0, s.hi = (s.hi | (this.buf[this.pos] & 127) >> 4) >>> 0, this.buf[this.pos++] < 128)
|
|
677
677
|
return s;
|
|
678
|
-
|
|
678
|
+
u = 0;
|
|
679
679
|
} else {
|
|
680
|
-
for (;
|
|
680
|
+
for (; u < 3; ++u) {
|
|
681
681
|
if (this.pos >= this.len)
|
|
682
682
|
throw d(this);
|
|
683
|
-
if (s.lo = (s.lo | (this.buf[this.pos] & 127) <<
|
|
683
|
+
if (s.lo = (s.lo | (this.buf[this.pos] & 127) << u * 7) >>> 0, this.buf[this.pos++] < 128)
|
|
684
684
|
return s;
|
|
685
685
|
}
|
|
686
|
-
return s.lo = (s.lo | (this.buf[this.pos++] & 127) <<
|
|
686
|
+
return s.lo = (s.lo | (this.buf[this.pos++] & 127) << u * 7) >>> 0, s;
|
|
687
687
|
}
|
|
688
688
|
if (this.len - this.pos > 4) {
|
|
689
|
-
for (;
|
|
690
|
-
if (s.hi = (s.hi | (this.buf[this.pos] & 127) <<
|
|
689
|
+
for (; u < 5; ++u)
|
|
690
|
+
if (s.hi = (s.hi | (this.buf[this.pos] & 127) << u * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
|
|
691
691
|
return s;
|
|
692
692
|
} else
|
|
693
|
-
for (;
|
|
693
|
+
for (; u < 5; ++u) {
|
|
694
694
|
if (this.pos >= this.len)
|
|
695
695
|
throw d(this);
|
|
696
|
-
if (s.hi = (s.hi | (this.buf[this.pos] & 127) <<
|
|
696
|
+
if (s.hi = (s.hi | (this.buf[this.pos] & 127) << u * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
|
|
697
697
|
return s;
|
|
698
698
|
}
|
|
699
699
|
throw Error("invalid varint encoding");
|
|
@@ -701,8 +701,8 @@ function requireReader() {
|
|
|
701
701
|
n.prototype.bool = function() {
|
|
702
702
|
return this.uint32() !== 0;
|
|
703
703
|
};
|
|
704
|
-
function t(s,
|
|
705
|
-
return (s[
|
|
704
|
+
function t(s, u) {
|
|
705
|
+
return (s[u - 4] | s[u - 3] << 8 | s[u - 2] << 16 | s[u - 1] << 24) >>> 0;
|
|
706
706
|
}
|
|
707
707
|
n.prototype.fixed32 = function() {
|
|
708
708
|
if (this.pos + 4 > this.len)
|
|
@@ -721,32 +721,32 @@ function requireReader() {
|
|
|
721
721
|
return n.prototype.float = function() {
|
|
722
722
|
if (this.pos + 4 > this.len)
|
|
723
723
|
throw d(this, 4);
|
|
724
|
-
var
|
|
725
|
-
return this.pos += 4,
|
|
724
|
+
var u = a.float.readFloatLE(this.buf, this.pos);
|
|
725
|
+
return this.pos += 4, u;
|
|
726
726
|
}, n.prototype.double = function() {
|
|
727
727
|
if (this.pos + 8 > this.len)
|
|
728
728
|
throw d(this, 4);
|
|
729
|
-
var
|
|
730
|
-
return this.pos += 8,
|
|
729
|
+
var u = a.float.readDoubleLE(this.buf, this.pos);
|
|
730
|
+
return this.pos += 8, u;
|
|
731
731
|
}, n.prototype.bytes = function() {
|
|
732
|
-
var
|
|
732
|
+
var u = this.uint32(), o = this.pos, p = this.pos + u;
|
|
733
733
|
if (p > this.len)
|
|
734
|
-
throw d(this,
|
|
735
|
-
if (this.pos +=
|
|
734
|
+
throw d(this, u);
|
|
735
|
+
if (this.pos += u, Array.isArray(this.buf))
|
|
736
736
|
return this.buf.slice(o, p);
|
|
737
737
|
if (o === p) {
|
|
738
|
-
var y =
|
|
738
|
+
var y = a.Buffer;
|
|
739
739
|
return y ? y.alloc(0) : new this.buf.constructor(0);
|
|
740
740
|
}
|
|
741
741
|
return this._slice.call(this.buf, o, p);
|
|
742
742
|
}, n.prototype.string = function() {
|
|
743
|
-
var
|
|
744
|
-
return c.read(
|
|
745
|
-
}, n.prototype.skip = function(
|
|
746
|
-
if (typeof
|
|
747
|
-
if (this.pos +
|
|
748
|
-
throw d(this,
|
|
749
|
-
this.pos +=
|
|
743
|
+
var u = this.bytes();
|
|
744
|
+
return c.read(u, 0, u.length);
|
|
745
|
+
}, n.prototype.skip = function(u) {
|
|
746
|
+
if (typeof u == "number") {
|
|
747
|
+
if (this.pos + u > this.len)
|
|
748
|
+
throw d(this, u);
|
|
749
|
+
this.pos += u;
|
|
750
750
|
} else
|
|
751
751
|
do
|
|
752
752
|
if (this.pos >= this.len)
|
|
@@ -778,25 +778,25 @@ function requireReader() {
|
|
|
778
778
|
return this;
|
|
779
779
|
}, n._configure = function(s) {
|
|
780
780
|
f = s, n.create = r(), f._configure();
|
|
781
|
-
var
|
|
781
|
+
var u = a.Long ? "toLong" : (
|
|
782
782
|
/* istanbul ignore next */
|
|
783
783
|
"toNumber"
|
|
784
784
|
);
|
|
785
|
-
|
|
785
|
+
a.merge(n.prototype, {
|
|
786
786
|
int64: function() {
|
|
787
|
-
return i.call(this)[
|
|
787
|
+
return i.call(this)[u](!1);
|
|
788
788
|
},
|
|
789
789
|
uint64: function() {
|
|
790
|
-
return i.call(this)[
|
|
790
|
+
return i.call(this)[u](!0);
|
|
791
791
|
},
|
|
792
792
|
sint64: function() {
|
|
793
|
-
return i.call(this).zzDecode()[
|
|
793
|
+
return i.call(this).zzDecode()[u](!1);
|
|
794
794
|
},
|
|
795
795
|
fixed64: function() {
|
|
796
|
-
return l.call(this)[
|
|
796
|
+
return l.call(this)[u](!0);
|
|
797
797
|
},
|
|
798
798
|
sfixed64: function() {
|
|
799
|
-
return l.call(this)[
|
|
799
|
+
return l.call(this)[u](!1);
|
|
800
800
|
}
|
|
801
801
|
});
|
|
802
802
|
}, reader;
|
|
@@ -805,11 +805,11 @@ var reader_buffer, hasRequiredReader_buffer;
|
|
|
805
805
|
function requireReader_buffer() {
|
|
806
806
|
if (hasRequiredReader_buffer) return reader_buffer;
|
|
807
807
|
hasRequiredReader_buffer = 1, reader_buffer = h;
|
|
808
|
-
var
|
|
809
|
-
(h.prototype = Object.create(
|
|
808
|
+
var a = requireReader();
|
|
809
|
+
(h.prototype = Object.create(a.prototype)).constructor = h;
|
|
810
810
|
var f = requireMinimal();
|
|
811
811
|
function h(c) {
|
|
812
|
-
|
|
812
|
+
a.call(this, c);
|
|
813
813
|
}
|
|
814
814
|
return h._configure = function() {
|
|
815
815
|
f.Buffer && (h.prototype._slice = f.Buffer.prototype.slice);
|
|
@@ -822,19 +822,19 @@ var rpc = {}, service$1, hasRequiredService$1;
|
|
|
822
822
|
function requireService$1() {
|
|
823
823
|
if (hasRequiredService$1) return service$1;
|
|
824
824
|
hasRequiredService$1 = 1, service$1 = f;
|
|
825
|
-
var
|
|
826
|
-
(f.prototype = Object.create(
|
|
825
|
+
var a = requireMinimal();
|
|
826
|
+
(f.prototype = Object.create(a.EventEmitter.prototype)).constructor = f;
|
|
827
827
|
function f(h, c, d) {
|
|
828
828
|
if (typeof h != "function")
|
|
829
829
|
throw TypeError("rpcImpl must be a function");
|
|
830
|
-
|
|
830
|
+
a.EventEmitter.call(this), this.rpcImpl = h, this.requestDelimited = !!c, this.responseDelimited = !!d;
|
|
831
831
|
}
|
|
832
832
|
return f.prototype.rpcCall = function h(c, d, n, e, r) {
|
|
833
833
|
if (!e)
|
|
834
834
|
throw TypeError("request must be specified");
|
|
835
835
|
var i = this;
|
|
836
836
|
if (!r)
|
|
837
|
-
return
|
|
837
|
+
return a.asPromise(h, i, c, d, n, e);
|
|
838
838
|
if (!i.rpcImpl) {
|
|
839
839
|
setTimeout(function() {
|
|
840
840
|
r(Error("already ended"));
|
|
@@ -858,8 +858,8 @@ function requireService$1() {
|
|
|
858
858
|
if (!(s instanceof n))
|
|
859
859
|
try {
|
|
860
860
|
s = n[i.responseDelimited ? "decodeDelimited" : "decode"](s);
|
|
861
|
-
} catch (
|
|
862
|
-
return i.emit("error",
|
|
861
|
+
} catch (u) {
|
|
862
|
+
return i.emit("error", u, c), r(u);
|
|
863
863
|
}
|
|
864
864
|
return i.emit("data", s, c), r(null, s);
|
|
865
865
|
}
|
|
@@ -876,8 +876,8 @@ function requireService$1() {
|
|
|
876
876
|
}
|
|
877
877
|
var hasRequiredRpc;
|
|
878
878
|
function requireRpc() {
|
|
879
|
-
return hasRequiredRpc || (hasRequiredRpc = 1, function(
|
|
880
|
-
var f =
|
|
879
|
+
return hasRequiredRpc || (hasRequiredRpc = 1, function(a) {
|
|
880
|
+
var f = a;
|
|
881
881
|
f.Service = requireService$1();
|
|
882
882
|
}(rpc)), rpc;
|
|
883
883
|
}
|
|
@@ -887,8 +887,8 @@ function requireRoots() {
|
|
|
887
887
|
}
|
|
888
888
|
var hasRequiredIndexMinimal;
|
|
889
889
|
function requireIndexMinimal() {
|
|
890
|
-
return hasRequiredIndexMinimal || (hasRequiredIndexMinimal = 1, function(
|
|
891
|
-
var f =
|
|
890
|
+
return hasRequiredIndexMinimal || (hasRequiredIndexMinimal = 1, function(a) {
|
|
891
|
+
var f = a;
|
|
892
892
|
f.build = "minimal", f.Writer = requireWriter(), f.BufferWriter = requireWriter_buffer(), f.Reader = requireReader(), f.BufferReader = requireReader_buffer(), f.util = requireMinimal(), f.rpc = requireRpc(), f.roots = requireRoots(), f.configure = h;
|
|
893
893
|
function h() {
|
|
894
894
|
f.util._configure(), f.Writer._configure(f.BufferWriter), f.Reader._configure(f.BufferReader);
|
|
@@ -899,24 +899,24 @@ function requireIndexMinimal() {
|
|
|
899
899
|
var types = {}, util = { exports: {} }, codegen_1, hasRequiredCodegen;
|
|
900
900
|
function requireCodegen() {
|
|
901
901
|
if (hasRequiredCodegen) return codegen_1;
|
|
902
|
-
hasRequiredCodegen = 1, codegen_1 =
|
|
903
|
-
function
|
|
902
|
+
hasRequiredCodegen = 1, codegen_1 = a;
|
|
903
|
+
function a(f, h) {
|
|
904
904
|
typeof f == "string" && (h = f, f = void 0);
|
|
905
905
|
var c = [];
|
|
906
906
|
function d(e) {
|
|
907
907
|
if (typeof e != "string") {
|
|
908
908
|
var r = n();
|
|
909
|
-
if (
|
|
909
|
+
if (a.verbose && console.log("codegen: " + r), r = "return " + r, e) {
|
|
910
910
|
for (var i = Object.keys(e), t = new Array(i.length + 1), l = new Array(i.length), s = 0; s < i.length; )
|
|
911
911
|
t[s] = i[s], l[s] = e[i[s++]];
|
|
912
912
|
return t[s] = r, Function.apply(null, t).apply(null, l);
|
|
913
913
|
}
|
|
914
914
|
return Function(r)();
|
|
915
915
|
}
|
|
916
|
-
for (var
|
|
917
|
-
|
|
916
|
+
for (var u = new Array(arguments.length - 1), o = 0; o < u.length; )
|
|
917
|
+
u[o] = arguments[++o];
|
|
918
918
|
if (o = 0, e = e.replace(/%([%dfijs])/g, function(y, E) {
|
|
919
|
-
var v =
|
|
919
|
+
var v = u[o++];
|
|
920
920
|
switch (E) {
|
|
921
921
|
case "d":
|
|
922
922
|
case "f":
|
|
@@ -929,7 +929,7 @@ function requireCodegen() {
|
|
|
929
929
|
return String(v);
|
|
930
930
|
}
|
|
931
931
|
return "%";
|
|
932
|
-
}), o !==
|
|
932
|
+
}), o !== u.length)
|
|
933
933
|
throw Error("parameter count mismatch");
|
|
934
934
|
return c.push(e), d;
|
|
935
935
|
}
|
|
@@ -941,17 +941,17 @@ function requireCodegen() {
|
|
|
941
941
|
}
|
|
942
942
|
return d.toString = n, d;
|
|
943
943
|
}
|
|
944
|
-
return
|
|
944
|
+
return a.verbose = !1, codegen_1;
|
|
945
945
|
}
|
|
946
946
|
var fetch_1, hasRequiredFetch;
|
|
947
947
|
function requireFetch() {
|
|
948
948
|
if (hasRequiredFetch) return fetch_1;
|
|
949
949
|
hasRequiredFetch = 1, fetch_1 = c;
|
|
950
|
-
var
|
|
950
|
+
var a = requireAspromise(), f = requireInquire(), h = f("fs");
|
|
951
951
|
function c(d, n, e) {
|
|
952
952
|
return typeof n == "function" ? (e = n, n = {}) : n || (n = {}), e ? !n.xhr && h && h.readFile ? h.readFile(d, function(i, t) {
|
|
953
953
|
return i && typeof XMLHttpRequest < "u" ? c.xhr(d, n, e) : i ? e(i) : e(null, n.binary ? t : t.toString("utf8"));
|
|
954
|
-
}) : c.xhr(d, n, e) :
|
|
954
|
+
}) : c.xhr(d, n, e) : a(c, this, d, n);
|
|
955
955
|
}
|
|
956
956
|
return c.xhr = function(n, e, r) {
|
|
957
957
|
var i = new XMLHttpRequest();
|
|
@@ -975,8 +975,8 @@ function requireFetch() {
|
|
|
975
975
|
}
|
|
976
976
|
var path = {}, hasRequiredPath;
|
|
977
977
|
function requirePath() {
|
|
978
|
-
return hasRequiredPath || (hasRequiredPath = 1, function(
|
|
979
|
-
var f =
|
|
978
|
+
return hasRequiredPath || (hasRequiredPath = 1, function(a) {
|
|
979
|
+
var f = a, h = (
|
|
980
980
|
/**
|
|
981
981
|
* Tests if the specified path is absolute.
|
|
982
982
|
* @param {string} path Path to test
|
|
@@ -1009,36 +1009,36 @@ var namespace, hasRequiredNamespace;
|
|
|
1009
1009
|
function requireNamespace() {
|
|
1010
1010
|
if (hasRequiredNamespace) return namespace;
|
|
1011
1011
|
hasRequiredNamespace = 1, namespace = i;
|
|
1012
|
-
var
|
|
1013
|
-
((i.prototype = Object.create(
|
|
1012
|
+
var a = requireObject();
|
|
1013
|
+
((i.prototype = Object.create(a.prototype)).constructor = i).className = "Namespace";
|
|
1014
1014
|
var f = requireField(), h = requireUtil(), c = requireOneof(), d, n, e;
|
|
1015
|
-
i.fromJSON = function(s,
|
|
1016
|
-
return new i(s,
|
|
1015
|
+
i.fromJSON = function(s, u) {
|
|
1016
|
+
return new i(s, u.options).addJSON(u.nested);
|
|
1017
1017
|
};
|
|
1018
1018
|
function r(l, s) {
|
|
1019
1019
|
if (l && l.length) {
|
|
1020
|
-
for (var
|
|
1021
|
-
|
|
1022
|
-
return
|
|
1020
|
+
for (var u = {}, o = 0; o < l.length; ++o)
|
|
1021
|
+
u[l[o].name] = l[o].toJSON(s);
|
|
1022
|
+
return u;
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
|
-
i.arrayToJSON = r, i.isReservedId = function(s,
|
|
1025
|
+
i.arrayToJSON = r, i.isReservedId = function(s, u) {
|
|
1026
1026
|
if (s) {
|
|
1027
1027
|
for (var o = 0; o < s.length; ++o)
|
|
1028
|
-
if (typeof s[o] != "string" && s[o][0] <=
|
|
1028
|
+
if (typeof s[o] != "string" && s[o][0] <= u && s[o][1] > u)
|
|
1029
1029
|
return !0;
|
|
1030
1030
|
}
|
|
1031
1031
|
return !1;
|
|
1032
|
-
}, i.isReservedName = function(s,
|
|
1032
|
+
}, i.isReservedName = function(s, u) {
|
|
1033
1033
|
if (s) {
|
|
1034
1034
|
for (var o = 0; o < s.length; ++o)
|
|
1035
|
-
if (s[o] ===
|
|
1035
|
+
if (s[o] === u)
|
|
1036
1036
|
return !0;
|
|
1037
1037
|
}
|
|
1038
1038
|
return !1;
|
|
1039
1039
|
};
|
|
1040
1040
|
function i(l, s) {
|
|
1041
|
-
|
|
1041
|
+
a.call(this, l, s), this.nested = void 0, this._nestedArray = null, this._lookupCache = {}, this._needsRecursiveFeatureResolution = !0, this._needsRecursiveResolve = !0;
|
|
1042
1042
|
}
|
|
1043
1043
|
function t(l) {
|
|
1044
1044
|
l._nestedArray = null, l._lookupCache = {};
|
|
@@ -1058,10 +1058,10 @@ function requireNamespace() {
|
|
|
1058
1058
|
r(this.nestedArray, s)
|
|
1059
1059
|
]);
|
|
1060
1060
|
}, i.prototype.addJSON = function(s) {
|
|
1061
|
-
var
|
|
1061
|
+
var u = this;
|
|
1062
1062
|
if (s)
|
|
1063
1063
|
for (var o = Object.keys(s), p = 0, y; p < o.length; ++p)
|
|
1064
|
-
y = s[o[p]],
|
|
1064
|
+
y = s[o[p]], u.add(
|
|
1065
1065
|
// most to least likely
|
|
1066
1066
|
(y.fields !== void 0 ? d.fromJSON : y.values !== void 0 ? e.fromJSON : y.methods !== void 0 ? n.fromJSON : y.id !== void 0 ? f.fromJSON : i.fromJSON)(o[p], y)
|
|
1067
1067
|
);
|
|
@@ -1078,12 +1078,12 @@ function requireNamespace() {
|
|
|
1078
1078
|
if (!this.nested)
|
|
1079
1079
|
this.nested = {};
|
|
1080
1080
|
else {
|
|
1081
|
-
var
|
|
1082
|
-
if (
|
|
1083
|
-
if (
|
|
1084
|
-
for (var o =
|
|
1081
|
+
var u = this.get(s.name);
|
|
1082
|
+
if (u)
|
|
1083
|
+
if (u instanceof i && s instanceof i && !(u instanceof d || u instanceof n)) {
|
|
1084
|
+
for (var o = u.nestedArray, p = 0; p < o.length; ++p)
|
|
1085
1085
|
s.add(o[p]);
|
|
1086
|
-
this.remove(
|
|
1086
|
+
this.remove(u), this.nested || (this.nested = {}), s.setOptions(u.options, !0);
|
|
1087
1087
|
} else
|
|
1088
1088
|
throw Error("duplicate name '" + s.name + "' in " + this);
|
|
1089
1089
|
}
|
|
@@ -1092,12 +1092,12 @@ function requireNamespace() {
|
|
|
1092
1092
|
y._needsRecursiveFeatureResolution = !0, y._needsRecursiveResolve = !0;
|
|
1093
1093
|
return s.onAdd(this), t(this);
|
|
1094
1094
|
}, i.prototype.remove = function(s) {
|
|
1095
|
-
if (!(s instanceof
|
|
1095
|
+
if (!(s instanceof a))
|
|
1096
1096
|
throw TypeError("object must be a ReflectionObject");
|
|
1097
1097
|
if (s.parent !== this)
|
|
1098
1098
|
throw Error(s + " is not a member of " + this);
|
|
1099
1099
|
return delete this.nested[s.name], Object.keys(this.nested).length || (this.nested = void 0), s.onRemove(this), t(this);
|
|
1100
|
-
}, i.prototype.define = function(s,
|
|
1100
|
+
}, i.prototype.define = function(s, u) {
|
|
1101
1101
|
if (h.isString(s))
|
|
1102
1102
|
s = s.split(".");
|
|
1103
1103
|
else if (!Array.isArray(s))
|
|
@@ -1112,20 +1112,20 @@ function requireNamespace() {
|
|
|
1112
1112
|
} else
|
|
1113
1113
|
o.add(o = new i(p));
|
|
1114
1114
|
}
|
|
1115
|
-
return
|
|
1115
|
+
return u && o.addJSON(u), o;
|
|
1116
1116
|
}, i.prototype.resolveAll = function() {
|
|
1117
1117
|
if (!this._needsRecursiveResolve) return this;
|
|
1118
1118
|
this._resolveFeaturesRecursive(this._edition);
|
|
1119
|
-
var s = this.nestedArray,
|
|
1120
|
-
for (this.resolve();
|
|
1121
|
-
s[
|
|
1119
|
+
var s = this.nestedArray, u = 0;
|
|
1120
|
+
for (this.resolve(); u < s.length; )
|
|
1121
|
+
s[u] instanceof i ? s[u++].resolveAll() : s[u++].resolve();
|
|
1122
1122
|
return this._needsRecursiveResolve = !1, this;
|
|
1123
1123
|
}, i.prototype._resolveFeaturesRecursive = function(s) {
|
|
1124
|
-
return this._needsRecursiveFeatureResolution ? (this._needsRecursiveFeatureResolution = !1, s = this._edition || s,
|
|
1125
|
-
|
|
1124
|
+
return this._needsRecursiveFeatureResolution ? (this._needsRecursiveFeatureResolution = !1, s = this._edition || s, a.prototype._resolveFeaturesRecursive.call(this, s), this.nestedArray.forEach((u) => {
|
|
1125
|
+
u._resolveFeaturesRecursive(s);
|
|
1126
1126
|
}), this) : this;
|
|
1127
|
-
}, i.prototype.lookup = function(s,
|
|
1128
|
-
if (typeof
|
|
1127
|
+
}, i.prototype.lookup = function(s, u, o) {
|
|
1128
|
+
if (typeof u == "boolean" ? (o = u, u = void 0) : u && !Array.isArray(u) && (u = [u]), h.isString(s) && s.length) {
|
|
1129
1129
|
if (s === ".")
|
|
1130
1130
|
return this.root;
|
|
1131
1131
|
s = s.split(".");
|
|
@@ -1133,61 +1133,61 @@ function requireNamespace() {
|
|
|
1133
1133
|
return this;
|
|
1134
1134
|
var p = s.join(".");
|
|
1135
1135
|
if (s[0] === "")
|
|
1136
|
-
return this.root.lookup(s.slice(1),
|
|
1136
|
+
return this.root.lookup(s.slice(1), u);
|
|
1137
1137
|
var y = this.root._fullyQualifiedObjects && this.root._fullyQualifiedObjects["." + p];
|
|
1138
|
-
if (y && (!
|
|
1138
|
+
if (y && (!u || u.indexOf(y.constructor) > -1) || (y = this._lookupImpl(s, p), y && (!u || u.indexOf(y.constructor) > -1)))
|
|
1139
1139
|
return y;
|
|
1140
1140
|
if (o)
|
|
1141
1141
|
return null;
|
|
1142
1142
|
for (var E = this; E.parent; ) {
|
|
1143
|
-
if (y = E.parent._lookupImpl(s, p), y && (!
|
|
1143
|
+
if (y = E.parent._lookupImpl(s, p), y && (!u || u.indexOf(y.constructor) > -1))
|
|
1144
1144
|
return y;
|
|
1145
1145
|
E = E.parent;
|
|
1146
1146
|
}
|
|
1147
1147
|
return null;
|
|
1148
|
-
}, i.prototype._lookupImpl = function(s,
|
|
1149
|
-
if (Object.prototype.hasOwnProperty.call(this._lookupCache,
|
|
1150
|
-
return this._lookupCache[
|
|
1148
|
+
}, i.prototype._lookupImpl = function(s, u) {
|
|
1149
|
+
if (Object.prototype.hasOwnProperty.call(this._lookupCache, u))
|
|
1150
|
+
return this._lookupCache[u];
|
|
1151
1151
|
var o = this.get(s[0]), p = null;
|
|
1152
1152
|
if (o)
|
|
1153
1153
|
s.length === 1 ? p = o : o instanceof i && (s = s.slice(1), p = o._lookupImpl(s, s.join(".")));
|
|
1154
1154
|
else
|
|
1155
1155
|
for (var y = 0; y < this.nestedArray.length; ++y)
|
|
1156
|
-
this._nestedArray[y] instanceof i && (o = this._nestedArray[y]._lookupImpl(s,
|
|
1157
|
-
return this._lookupCache[
|
|
1156
|
+
this._nestedArray[y] instanceof i && (o = this._nestedArray[y]._lookupImpl(s, u)) && (p = o);
|
|
1157
|
+
return this._lookupCache[u] = p, p;
|
|
1158
1158
|
}, i.prototype.lookupType = function(s) {
|
|
1159
|
-
var
|
|
1160
|
-
if (!
|
|
1159
|
+
var u = this.lookup(s, [d]);
|
|
1160
|
+
if (!u)
|
|
1161
1161
|
throw Error("no such type: " + s);
|
|
1162
|
-
return
|
|
1162
|
+
return u;
|
|
1163
1163
|
}, i.prototype.lookupEnum = function(s) {
|
|
1164
|
-
var
|
|
1165
|
-
if (!
|
|
1164
|
+
var u = this.lookup(s, [e]);
|
|
1165
|
+
if (!u)
|
|
1166
1166
|
throw Error("no such Enum '" + s + "' in " + this);
|
|
1167
|
-
return
|
|
1167
|
+
return u;
|
|
1168
1168
|
}, i.prototype.lookupTypeOrEnum = function(s) {
|
|
1169
|
-
var
|
|
1170
|
-
if (!
|
|
1169
|
+
var u = this.lookup(s, [d, e]);
|
|
1170
|
+
if (!u)
|
|
1171
1171
|
throw Error("no such Type or Enum '" + s + "' in " + this);
|
|
1172
|
-
return
|
|
1172
|
+
return u;
|
|
1173
1173
|
}, i.prototype.lookupService = function(s) {
|
|
1174
|
-
var
|
|
1175
|
-
if (!
|
|
1174
|
+
var u = this.lookup(s, [n]);
|
|
1175
|
+
if (!u)
|
|
1176
1176
|
throw Error("no such Service '" + s + "' in " + this);
|
|
1177
|
-
return
|
|
1178
|
-
}, i._configure = function(l, s,
|
|
1179
|
-
d = l, n = s, e =
|
|
1177
|
+
return u;
|
|
1178
|
+
}, i._configure = function(l, s, u) {
|
|
1179
|
+
d = l, n = s, e = u;
|
|
1180
1180
|
}, namespace;
|
|
1181
1181
|
}
|
|
1182
1182
|
var mapfield, hasRequiredMapfield;
|
|
1183
1183
|
function requireMapfield() {
|
|
1184
1184
|
if (hasRequiredMapfield) return mapfield;
|
|
1185
1185
|
hasRequiredMapfield = 1, mapfield = c;
|
|
1186
|
-
var
|
|
1187
|
-
((c.prototype = Object.create(
|
|
1186
|
+
var a = requireField();
|
|
1187
|
+
((c.prototype = Object.create(a.prototype)).constructor = c).className = "MapField";
|
|
1188
1188
|
var f = requireTypes(), h = requireUtil();
|
|
1189
1189
|
function c(d, n, e, r, i, t) {
|
|
1190
|
-
if (
|
|
1190
|
+
if (a.call(this, d, n, r, void 0, void 0, i, t), !h.isString(e))
|
|
1191
1191
|
throw TypeError("keyType must be a string");
|
|
1192
1192
|
this.keyType = e, this.resolvedKeyType = null, this.map = !0;
|
|
1193
1193
|
}
|
|
@@ -1214,7 +1214,7 @@ function requireMapfield() {
|
|
|
1214
1214
|
return this;
|
|
1215
1215
|
if (f.mapKey[this.keyType] === void 0)
|
|
1216
1216
|
throw Error("invalid key type: " + this.keyType);
|
|
1217
|
-
return
|
|
1217
|
+
return a.prototype.resolve.call(this);
|
|
1218
1218
|
}, c.d = function(n, e, r) {
|
|
1219
1219
|
return typeof r == "function" ? r = h.decorateType(r).name : r && typeof r == "object" && (r = h.decorateEnum(r).name), function(t, l) {
|
|
1220
1220
|
h.decorateType(t.constructor).add(new c(l, n, e, r));
|
|
@@ -1225,8 +1225,8 @@ var method, hasRequiredMethod;
|
|
|
1225
1225
|
function requireMethod() {
|
|
1226
1226
|
if (hasRequiredMethod) return method;
|
|
1227
1227
|
hasRequiredMethod = 1, method = h;
|
|
1228
|
-
var
|
|
1229
|
-
((h.prototype = Object.create(
|
|
1228
|
+
var a = requireObject();
|
|
1229
|
+
((h.prototype = Object.create(a.prototype)).constructor = h).className = "Method";
|
|
1230
1230
|
var f = requireUtil();
|
|
1231
1231
|
function h(c, d, n, e, r, i, t, l, s) {
|
|
1232
1232
|
if (f.isObject(r) ? (t = r, r = i = void 0) : f.isObject(i) && (t = i, i = void 0), !(d === void 0 || f.isString(d)))
|
|
@@ -1235,7 +1235,7 @@ function requireMethod() {
|
|
|
1235
1235
|
throw TypeError("requestType must be a string");
|
|
1236
1236
|
if (!f.isString(e))
|
|
1237
1237
|
throw TypeError("responseType must be a string");
|
|
1238
|
-
|
|
1238
|
+
a.call(this, c, t), this.type = d || "rpc", this.requestType = n, this.requestStream = r ? !0 : void 0, this.responseType = e, this.responseStream = i ? !0 : void 0, this.resolvedRequestType = null, this.resolvedResponseType = null, this.comment = l, this.parsedOptions = s;
|
|
1239
1239
|
}
|
|
1240
1240
|
return h.fromJSON = function(d, n) {
|
|
1241
1241
|
return new h(d, n.type, n.requestType, n.responseType, n.requestStream, n.responseStream, n.options, n.comment, n.parsedOptions);
|
|
@@ -1261,18 +1261,18 @@ function requireMethod() {
|
|
|
1261
1261
|
this.parsedOptions
|
|
1262
1262
|
]);
|
|
1263
1263
|
}, h.prototype.resolve = function() {
|
|
1264
|
-
return this.resolved ? this : (this.resolvedRequestType = this.parent.lookupType(this.requestType), this.resolvedResponseType = this.parent.lookupType(this.responseType),
|
|
1264
|
+
return this.resolved ? this : (this.resolvedRequestType = this.parent.lookupType(this.requestType), this.resolvedResponseType = this.parent.lookupType(this.responseType), a.prototype.resolve.call(this));
|
|
1265
1265
|
}, method;
|
|
1266
1266
|
}
|
|
1267
1267
|
var service, hasRequiredService;
|
|
1268
1268
|
function requireService() {
|
|
1269
1269
|
if (hasRequiredService) return service;
|
|
1270
1270
|
hasRequiredService = 1, service = d;
|
|
1271
|
-
var
|
|
1272
|
-
((d.prototype = Object.create(
|
|
1271
|
+
var a = requireNamespace();
|
|
1272
|
+
((d.prototype = Object.create(a.prototype)).constructor = d).className = "Service";
|
|
1273
1273
|
var f = requireMethod(), h = requireUtil(), c = requireRpc();
|
|
1274
1274
|
function d(e, r) {
|
|
1275
|
-
|
|
1275
|
+
a.call(this, e, r), this.methods = {}, this._methodsArray = null;
|
|
1276
1276
|
}
|
|
1277
1277
|
d.fromJSON = function(r, i) {
|
|
1278
1278
|
var t = new d(r, i.options);
|
|
@@ -1281,14 +1281,14 @@ function requireService() {
|
|
|
1281
1281
|
t.add(f.fromJSON(l[s], i.methods[l[s]]));
|
|
1282
1282
|
return i.nested && t.addJSON(i.nested), i.edition && (t._edition = i.edition), t.comment = i.comment, t._defaultEdition = "proto3", t;
|
|
1283
1283
|
}, d.prototype.toJSON = function(r) {
|
|
1284
|
-
var i =
|
|
1284
|
+
var i = a.prototype.toJSON.call(this, r), t = r ? !!r.keepComments : !1;
|
|
1285
1285
|
return h.toObject([
|
|
1286
1286
|
"edition",
|
|
1287
1287
|
this._editionToJSON(),
|
|
1288
1288
|
"options",
|
|
1289
1289
|
i && i.options || void 0,
|
|
1290
1290
|
"methods",
|
|
1291
|
-
|
|
1291
|
+
a.arrayToJSON(this.methodsArray, r) || /* istanbul ignore next */
|
|
1292
1292
|
{},
|
|
1293
1293
|
"nested",
|
|
1294
1294
|
i && i.nested || void 0,
|
|
@@ -1304,36 +1304,36 @@ function requireService() {
|
|
|
1304
1304
|
return e._methodsArray = null, e;
|
|
1305
1305
|
}
|
|
1306
1306
|
return d.prototype.get = function(r) {
|
|
1307
|
-
return this.methods[r] ||
|
|
1307
|
+
return this.methods[r] || a.prototype.get.call(this, r);
|
|
1308
1308
|
}, d.prototype.resolveAll = function() {
|
|
1309
1309
|
if (!this._needsRecursiveResolve) return this;
|
|
1310
|
-
|
|
1310
|
+
a.prototype.resolve.call(this);
|
|
1311
1311
|
for (var r = this.methodsArray, i = 0; i < r.length; ++i)
|
|
1312
1312
|
r[i].resolve();
|
|
1313
1313
|
return this;
|
|
1314
1314
|
}, d.prototype._resolveFeaturesRecursive = function(r) {
|
|
1315
|
-
return this._needsRecursiveFeatureResolution ? (r = this._edition || r,
|
|
1315
|
+
return this._needsRecursiveFeatureResolution ? (r = this._edition || r, a.prototype._resolveFeaturesRecursive.call(this, r), this.methodsArray.forEach((i) => {
|
|
1316
1316
|
i._resolveFeaturesRecursive(r);
|
|
1317
1317
|
}), this) : this;
|
|
1318
1318
|
}, d.prototype.add = function(r) {
|
|
1319
1319
|
if (this.get(r.name))
|
|
1320
1320
|
throw Error("duplicate name '" + r.name + "' in " + this);
|
|
1321
|
-
return r instanceof f ? (this.methods[r.name] = r, r.parent = this, n(this)) :
|
|
1321
|
+
return r instanceof f ? (this.methods[r.name] = r, r.parent = this, n(this)) : a.prototype.add.call(this, r);
|
|
1322
1322
|
}, d.prototype.remove = function(r) {
|
|
1323
1323
|
if (r instanceof f) {
|
|
1324
1324
|
if (this.methods[r.name] !== r)
|
|
1325
1325
|
throw Error(r + " is not a member of " + this);
|
|
1326
1326
|
return delete this.methods[r.name], r.parent = null, n(this);
|
|
1327
1327
|
}
|
|
1328
|
-
return
|
|
1328
|
+
return a.prototype.remove.call(this, r);
|
|
1329
1329
|
}, d.prototype.create = function(r, i, t) {
|
|
1330
|
-
for (var l = new c.Service(r, i, t), s = 0,
|
|
1330
|
+
for (var l = new c.Service(r, i, t), s = 0, u; s < /* initializes */
|
|
1331
1331
|
this.methodsArray.length; ++s) {
|
|
1332
|
-
var o = h.lcFirst((
|
|
1332
|
+
var o = h.lcFirst((u = this._methodsArray[s]).resolve().name).replace(/[^$\\w_]/g, "");
|
|
1333
1333
|
l[o] = h.codegen(["r", "c"], h.isReserved(o) ? o + "_" : o)("return this.rpcCall(m,q,s,r,c)")({
|
|
1334
|
-
m:
|
|
1335
|
-
q:
|
|
1336
|
-
s:
|
|
1334
|
+
m: u,
|
|
1335
|
+
q: u.resolvedRequestType.ctor,
|
|
1336
|
+
s: u.resolvedResponseType.ctor
|
|
1337
1337
|
});
|
|
1338
1338
|
}
|
|
1339
1339
|
return l;
|
|
@@ -1343,7 +1343,7 @@ var message, hasRequiredMessage;
|
|
|
1343
1343
|
function requireMessage() {
|
|
1344
1344
|
if (hasRequiredMessage) return message;
|
|
1345
1345
|
hasRequiredMessage = 1, message = f;
|
|
1346
|
-
var
|
|
1346
|
+
var a = requireMinimal();
|
|
1347
1347
|
function f(h) {
|
|
1348
1348
|
if (h)
|
|
1349
1349
|
for (var c = Object.keys(h), d = 0; d < c.length; ++d) {
|
|
@@ -1368,23 +1368,23 @@ function requireMessage() {
|
|
|
1368
1368
|
}, f.toObject = function(c, d) {
|
|
1369
1369
|
return this.$type.toObject(c, d);
|
|
1370
1370
|
}, f.prototype.toJSON = function() {
|
|
1371
|
-
return this.$type.toObject(this,
|
|
1371
|
+
return this.$type.toObject(this, a.toJSONOptions);
|
|
1372
1372
|
}, message;
|
|
1373
1373
|
}
|
|
1374
1374
|
var decoder_1, hasRequiredDecoder;
|
|
1375
1375
|
function requireDecoder() {
|
|
1376
1376
|
if (hasRequiredDecoder) return decoder_1;
|
|
1377
1377
|
hasRequiredDecoder = 1, decoder_1 = d;
|
|
1378
|
-
var
|
|
1378
|
+
var a = require_enum(), f = requireTypes(), h = requireUtil();
|
|
1379
1379
|
function c(n) {
|
|
1380
1380
|
return "missing required '" + n.name + "'";
|
|
1381
1381
|
}
|
|
1382
1382
|
function d(n) {
|
|
1383
|
-
for (var e = h.codegen(["r", "l", "e"], n.name + "$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor" + (n.fieldsArray.filter(function(
|
|
1384
|
-
return
|
|
1383
|
+
for (var e = h.codegen(["r", "l", "e"], n.name + "$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor" + (n.fieldsArray.filter(function(u) {
|
|
1384
|
+
return u.map;
|
|
1385
1385
|
}).length ? ",k,value" : ""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"), r = 0; r < /* initializes */
|
|
1386
1386
|
n.fieldsArray.length; ++r) {
|
|
1387
|
-
var i = n._fieldsArray[r].resolve(), t = i.resolvedType instanceof
|
|
1387
|
+
var i = n._fieldsArray[r].resolve(), t = i.resolvedType instanceof a ? "int32" : i.type, l = "m" + h.safeProp(i.name);
|
|
1388
1388
|
e("case %i: {", i.id), i.map ? (e("if(%s===util.emptyObject)", l)("%s={}", l)("var c2 = r.uint32()+r.pos"), f.defaults[i.keyType] !== void 0 ? e("k=%j", f.defaults[i.keyType]) : e("k=null"), f.defaults[t] !== void 0 ? e("value=%j", f.defaults[t]) : e("value=null"), e("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break", i.keyType)("case 2:"), f.basic[t] === void 0 ? e("value=types[%i].decode(r,r.uint32())", r) : e("value=r.%s()", t), e("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"), f.long[i.keyType] !== void 0 ? e('%s[typeof k==="object"?util.longToHash(k):k]=value', l) : e("%s[k]=value", l)) : i.repeated ? (e("if(!(%s&&%s.length))", l, l)("%s=[]", l), f.packed[t] !== void 0 && e("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())", l, t)("}else"), f.basic[t] === void 0 ? e(i.delimited ? "%s.push(types[%i].decode(r,undefined,((t&~7)|4)))" : "%s.push(types[%i].decode(r,r.uint32()))", l, r) : e("%s.push(r.%s())", l, t)) : f.basic[t] === void 0 ? e(i.delimited ? "%s=types[%i].decode(r,undefined,((t&~7)|4))" : "%s=types[%i].decode(r,r.uint32())", l, r) : e("%s=r.%s()", l, t), e("break")("}");
|
|
1389
1389
|
}
|
|
1390
1390
|
for (e("default:")("r.skipType(t&7)")("break")("}")("}"), r = 0; r < n._fieldsArray.length; ++r) {
|
|
@@ -1399,13 +1399,13 @@ var verifier_1, hasRequiredVerifier;
|
|
|
1399
1399
|
function requireVerifier() {
|
|
1400
1400
|
if (hasRequiredVerifier) return verifier_1;
|
|
1401
1401
|
hasRequiredVerifier = 1, verifier_1 = n;
|
|
1402
|
-
var
|
|
1402
|
+
var a = require_enum(), f = requireUtil();
|
|
1403
1403
|
function h(e, r) {
|
|
1404
1404
|
return e.name + ": " + r + (e.repeated && r !== "array" ? "[]" : e.map && r !== "object" ? "{k:" + e.keyType + "}" : "") + " expected";
|
|
1405
1405
|
}
|
|
1406
1406
|
function c(e, r, i, t) {
|
|
1407
1407
|
if (r.resolvedType)
|
|
1408
|
-
if (r.resolvedType instanceof
|
|
1408
|
+
if (r.resolvedType instanceof a) {
|
|
1409
1409
|
e("switch(%s){", t)("default:")("return%j", h(r, "enum value"));
|
|
1410
1410
|
for (var l = Object.keys(r.resolvedType.values), s = 0; s < l.length; ++s) e("case %i:", r.resolvedType.values[l[s]]);
|
|
1411
1411
|
e("break")("}");
|
|
@@ -1470,17 +1470,17 @@ function requireVerifier() {
|
|
|
1470
1470
|
i.length && r("var p={}");
|
|
1471
1471
|
for (var l = 0; l < /* initializes */
|
|
1472
1472
|
e.fieldsArray.length; ++l) {
|
|
1473
|
-
var s = e._fieldsArray[l].resolve(),
|
|
1474
|
-
if (s.optional && r("if(%s!=null&&m.hasOwnProperty(%j)){",
|
|
1475
|
-
r("if(!util.isObject(%s))",
|
|
1473
|
+
var s = e._fieldsArray[l].resolve(), u = "m" + f.safeProp(s.name);
|
|
1474
|
+
if (s.optional && r("if(%s!=null&&m.hasOwnProperty(%j)){", u, s.name), s.map)
|
|
1475
|
+
r("if(!util.isObject(%s))", u)("return%j", h(s, "object"))("var k=Object.keys(%s)", u)("for(var i=0;i<k.length;++i){"), d(r, s, "k[i]"), c(r, s, l, u + "[k[i]]")("}");
|
|
1476
1476
|
else if (s.repeated)
|
|
1477
|
-
r("if(!Array.isArray(%s))",
|
|
1477
|
+
r("if(!Array.isArray(%s))", u)("return%j", h(s, "array"))("for(var i=0;i<%s.length;++i){", u), c(r, s, l, u + "[i]")("}");
|
|
1478
1478
|
else {
|
|
1479
1479
|
if (s.partOf) {
|
|
1480
1480
|
var o = f.safeProp(s.partOf.name);
|
|
1481
1481
|
t[s.partOf.name] === 1 && r("if(p%s===1)", o)("return%j", s.partOf.name + ": multiple values"), t[s.partOf.name] = 1, r("p%s=1", o);
|
|
1482
1482
|
}
|
|
1483
|
-
c(r, s, l,
|
|
1483
|
+
c(r, s, l, u);
|
|
1484
1484
|
}
|
|
1485
1485
|
s.optional && r("}");
|
|
1486
1486
|
}
|
|
@@ -1490,15 +1490,15 @@ function requireVerifier() {
|
|
|
1490
1490
|
}
|
|
1491
1491
|
var converter = {}, hasRequiredConverter;
|
|
1492
1492
|
function requireConverter() {
|
|
1493
|
-
return hasRequiredConverter || (hasRequiredConverter = 1, function(
|
|
1494
|
-
var f =
|
|
1493
|
+
return hasRequiredConverter || (hasRequiredConverter = 1, function(a) {
|
|
1494
|
+
var f = a, h = require_enum(), c = requireUtil();
|
|
1495
1495
|
function d(e, r, i, t) {
|
|
1496
1496
|
var l = !1;
|
|
1497
1497
|
if (r.resolvedType)
|
|
1498
1498
|
if (r.resolvedType instanceof h) {
|
|
1499
1499
|
e("switch(d%s){", t);
|
|
1500
|
-
for (var s = r.resolvedType.values,
|
|
1501
|
-
s[
|
|
1500
|
+
for (var s = r.resolvedType.values, u = Object.keys(s), o = 0; o < u.length; ++o)
|
|
1501
|
+
s[u[o]] === r.typeDefault && !l && (e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}', t, t, t), r.repeated || e("break"), l = !0), e("case%j:", u[o])("case %i:", s[u[o]])("m%s=%j", t, s[u[o]])("break");
|
|
1502
1502
|
e("}");
|
|
1503
1503
|
} else e('if(typeof d%s!=="object")', t)("throw TypeError(%j)", r.fullName + ": object expected")("m%s=types[%i].fromObject(d%s)", t, i, t);
|
|
1504
1504
|
else {
|
|
@@ -1544,25 +1544,25 @@ function requireConverter() {
|
|
|
1544
1544
|
if (!i.length) return t("return new this.ctor");
|
|
1545
1545
|
t("var m=new this.ctor");
|
|
1546
1546
|
for (var l = 0; l < i.length; ++l) {
|
|
1547
|
-
var s = i[l].resolve(),
|
|
1548
|
-
s.map ? (t("if(d%s){",
|
|
1547
|
+
var s = i[l].resolve(), u = c.safeProp(s.name);
|
|
1548
|
+
s.map ? (t("if(d%s){", u)('if(typeof d%s!=="object")', u)("throw TypeError(%j)", s.fullName + ": object expected")("m%s={}", u)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){", u), d(
|
|
1549
1549
|
t,
|
|
1550
1550
|
s,
|
|
1551
1551
|
/* not sorted */
|
|
1552
1552
|
l,
|
|
1553
|
-
|
|
1554
|
-
)("}")("}")) : s.repeated ? (t("if(d%s){",
|
|
1553
|
+
u + "[ks[i]]"
|
|
1554
|
+
)("}")("}")) : s.repeated ? (t("if(d%s){", u)("if(!Array.isArray(d%s))", u)("throw TypeError(%j)", s.fullName + ": array expected")("m%s=[]", u)("for(var i=0;i<d%s.length;++i){", u), d(
|
|
1555
1555
|
t,
|
|
1556
1556
|
s,
|
|
1557
1557
|
/* not sorted */
|
|
1558
1558
|
l,
|
|
1559
|
-
|
|
1560
|
-
)("}")("}")) : (s.resolvedType instanceof h || t("if(d%s!=null){",
|
|
1559
|
+
u + "[i]"
|
|
1560
|
+
)("}")("}")) : (s.resolvedType instanceof h || t("if(d%s!=null){", u), d(
|
|
1561
1561
|
t,
|
|
1562
1562
|
s,
|
|
1563
1563
|
/* not sorted */
|
|
1564
1564
|
l,
|
|
1565
|
-
|
|
1565
|
+
u
|
|
1566
1566
|
), s.resolvedType instanceof h || t("}"));
|
|
1567
1567
|
}
|
|
1568
1568
|
return t("return m");
|
|
@@ -1600,8 +1600,8 @@ function requireConverter() {
|
|
|
1600
1600
|
var i = r.fieldsArray.slice().sort(c.compareFieldsById);
|
|
1601
1601
|
if (!i.length)
|
|
1602
1602
|
return c.codegen()("return {}");
|
|
1603
|
-
for (var t = c.codegen(["m", "o"], r.name + "$toObject")("if(!o)")("o={}")("var d={}"), l = [], s = [],
|
|
1604
|
-
i[o].partOf || (i[o].resolve().repeated ? l : i[o].map ? s :
|
|
1603
|
+
for (var t = c.codegen(["m", "o"], r.name + "$toObject")("if(!o)")("o={}")("var d={}"), l = [], s = [], u = [], o = 0; o < i.length; ++o)
|
|
1604
|
+
i[o].partOf || (i[o].resolve().repeated ? l : i[o].map ? s : u).push(i[o]);
|
|
1605
1605
|
if (l.length) {
|
|
1606
1606
|
for (t("if(o.arrays||o.defaults){"), o = 0; o < l.length; ++o) t("d%s=[]", c.safeProp(l[o].name));
|
|
1607
1607
|
t("}");
|
|
@@ -1610,9 +1610,9 @@ function requireConverter() {
|
|
|
1610
1610
|
for (t("if(o.objects||o.defaults){"), o = 0; o < s.length; ++o) t("d%s={}", c.safeProp(s[o].name));
|
|
1611
1611
|
t("}");
|
|
1612
1612
|
}
|
|
1613
|
-
if (
|
|
1614
|
-
for (t("if(o.defaults){"), o = 0; o <
|
|
1615
|
-
var p =
|
|
1613
|
+
if (u.length) {
|
|
1614
|
+
for (t("if(o.defaults){"), o = 0; o < u.length; ++o) {
|
|
1615
|
+
var p = u[o], y = c.safeProp(p.name);
|
|
1616
1616
|
if (p.resolvedType instanceof h) t("d%s=o.enums===String?%j:%j", y, p.resolvedType.valuesById[p.typeDefault], p.typeDefault);
|
|
1617
1617
|
else if (p.long) t("if(util.Long){")("var n=new util.Long(%i,%i,%j)", p.typeDefault.low, p.typeDefault.high, p.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", y)("}else")("d%s=o.longs===String?%j:%i", y, p.typeDefault.toString(), p.typeDefault.toNumber());
|
|
1618
1618
|
else if (p.bytes) {
|
|
@@ -1651,8 +1651,8 @@ function requireConverter() {
|
|
|
1651
1651
|
}
|
|
1652
1652
|
var wrappers = {}, hasRequiredWrappers;
|
|
1653
1653
|
function requireWrappers() {
|
|
1654
|
-
return hasRequiredWrappers || (hasRequiredWrappers = 1, function(
|
|
1655
|
-
var f =
|
|
1654
|
+
return hasRequiredWrappers || (hasRequiredWrappers = 1, function(a) {
|
|
1655
|
+
var f = a, h = requireMessage();
|
|
1656
1656
|
f[".google.protobuf.Any"] = {
|
|
1657
1657
|
fromObject: function(c) {
|
|
1658
1658
|
if (c && c["@type"]) {
|
|
@@ -1687,11 +1687,11 @@ var type, hasRequiredType;
|
|
|
1687
1687
|
function requireType() {
|
|
1688
1688
|
if (hasRequiredType) return type;
|
|
1689
1689
|
hasRequiredType = 1, type = y;
|
|
1690
|
-
var
|
|
1691
|
-
((y.prototype = Object.create(
|
|
1692
|
-
var f = require_enum(), h = requireOneof(), c = requireField(), d = requireMapfield(), n = requireService(), e = requireMessage(), r = requireReader(), i = requireWriter(), t = requireUtil(), l = requireEncoder(), s = requireDecoder(),
|
|
1690
|
+
var a = requireNamespace();
|
|
1691
|
+
((y.prototype = Object.create(a.prototype)).constructor = y).className = "Type";
|
|
1692
|
+
var f = require_enum(), h = requireOneof(), c = requireField(), d = requireMapfield(), n = requireService(), e = requireMessage(), r = requireReader(), i = requireWriter(), t = requireUtil(), l = requireEncoder(), s = requireDecoder(), u = requireVerifier(), o = requireConverter(), p = requireWrappers();
|
|
1693
1693
|
function y(v, m) {
|
|
1694
|
-
v = v.replace(/\\W/g, ""),
|
|
1694
|
+
v = v.replace(/\\W/g, ""), a.call(this, v, m), this.fields = {}, this.oneofs = void 0, this.extensions = void 0, this.reserved = void 0, this.group = void 0, this._fieldsById = null, this._fieldsArray = null, this._oneofsArray = null, this._ctor = null;
|
|
1695
1695
|
}
|
|
1696
1696
|
Object.defineProperties(y.prototype, {
|
|
1697
1697
|
/**
|
|
@@ -1785,21 +1785,21 @@ function requireType() {
|
|
|
1785
1785
|
var j = _.nested[I[C]];
|
|
1786
1786
|
A.add(
|
|
1787
1787
|
// most to least likely
|
|
1788
|
-
(j.id !== void 0 ? c.fromJSON : j.fields !== void 0 ? y.fromJSON : j.values !== void 0 ? f.fromJSON : j.methods !== void 0 ? n.fromJSON :
|
|
1788
|
+
(j.id !== void 0 ? c.fromJSON : j.fields !== void 0 ? y.fromJSON : j.values !== void 0 ? f.fromJSON : j.methods !== void 0 ? n.fromJSON : a.fromJSON)(I[C], j)
|
|
1789
1789
|
);
|
|
1790
1790
|
}
|
|
1791
1791
|
return _.extensions && _.extensions.length && (A.extensions = _.extensions), _.reserved && _.reserved.length && (A.reserved = _.reserved), _.group && (A.group = !0), _.comment && (A.comment = _.comment), _.edition && (A._edition = _.edition), A._defaultEdition = "proto3", A;
|
|
1792
1792
|
}, y.prototype.toJSON = function(m) {
|
|
1793
|
-
var _ =
|
|
1793
|
+
var _ = a.prototype.toJSON.call(this, m), A = m ? !!m.keepComments : !1;
|
|
1794
1794
|
return t.toObject([
|
|
1795
1795
|
"edition",
|
|
1796
1796
|
this._editionToJSON(),
|
|
1797
1797
|
"options",
|
|
1798
1798
|
_ && _.options || void 0,
|
|
1799
1799
|
"oneofs",
|
|
1800
|
-
|
|
1800
|
+
a.arrayToJSON(this.oneofsArray, m),
|
|
1801
1801
|
"fields",
|
|
1802
|
-
|
|
1802
|
+
a.arrayToJSON(this.fieldsArray.filter(function(I) {
|
|
1803
1803
|
return !I.declaringField;
|
|
1804
1804
|
}), m) || {},
|
|
1805
1805
|
"extensions",
|
|
@@ -1815,7 +1815,7 @@ function requireType() {
|
|
|
1815
1815
|
]);
|
|
1816
1816
|
}, y.prototype.resolveAll = function() {
|
|
1817
1817
|
if (!this._needsRecursiveResolve) return this;
|
|
1818
|
-
|
|
1818
|
+
a.prototype.resolveAll.call(this);
|
|
1819
1819
|
var m = this.oneofsArray;
|
|
1820
1820
|
for (A = 0; A < m.length; )
|
|
1821
1821
|
m[A++].resolve();
|
|
@@ -1823,7 +1823,7 @@ function requireType() {
|
|
|
1823
1823
|
_[A++].resolve();
|
|
1824
1824
|
return this;
|
|
1825
1825
|
}, y.prototype._resolveFeaturesRecursive = function(m) {
|
|
1826
|
-
return this._needsRecursiveFeatureResolution ? (m = this._edition || m,
|
|
1826
|
+
return this._needsRecursiveFeatureResolution ? (m = this._edition || m, a.prototype._resolveFeaturesRecursive.call(this, m), this.oneofsArray.forEach((_) => {
|
|
1827
1827
|
_._resolveFeatures(m);
|
|
1828
1828
|
}), this.fieldsArray.forEach((_) => {
|
|
1829
1829
|
_._resolveFeatures(m);
|
|
@@ -1845,7 +1845,7 @@ function requireType() {
|
|
|
1845
1845
|
throw Error("name '" + m.name + "' is reserved in " + this);
|
|
1846
1846
|
return m.parent && m.parent.remove(m), this.fields[m.name] = m, m.message = this, m.onAdd(this), E(this);
|
|
1847
1847
|
}
|
|
1848
|
-
return m instanceof h ? (this.oneofs || (this.oneofs = {}), this.oneofs[m.name] = m, m.onAdd(this), E(this)) :
|
|
1848
|
+
return m instanceof h ? (this.oneofs || (this.oneofs = {}), this.oneofs[m.name] = m, m.onAdd(this), E(this)) : a.prototype.add.call(this, m);
|
|
1849
1849
|
}, y.prototype.remove = function(m) {
|
|
1850
1850
|
if (m instanceof c && m.extend === void 0) {
|
|
1851
1851
|
if (!this.fields || this.fields[m.name] !== m)
|
|
@@ -1857,11 +1857,11 @@ function requireType() {
|
|
|
1857
1857
|
throw Error(m + " is not a member of " + this);
|
|
1858
1858
|
return delete this.oneofs[m.name], m.parent = null, m.onRemove(this), E(this);
|
|
1859
1859
|
}
|
|
1860
|
-
return
|
|
1860
|
+
return a.prototype.remove.call(this, m);
|
|
1861
1861
|
}, y.prototype.isReservedId = function(m) {
|
|
1862
|
-
return
|
|
1862
|
+
return a.isReservedId(this.reserved, m);
|
|
1863
1863
|
}, y.prototype.isReservedName = function(m) {
|
|
1864
|
-
return
|
|
1864
|
+
return a.isReservedName(this.reserved, m);
|
|
1865
1865
|
}, y.prototype.create = function(m) {
|
|
1866
1866
|
return new this.ctor(m);
|
|
1867
1867
|
}, y.prototype.setup = function() {
|
|
@@ -1876,7 +1876,7 @@ function requireType() {
|
|
|
1876
1876
|
Reader: r,
|
|
1877
1877
|
types: _,
|
|
1878
1878
|
util: t
|
|
1879
|
-
}), this.verify =
|
|
1879
|
+
}), this.verify = u(this)({
|
|
1880
1880
|
types: _,
|
|
1881
1881
|
util: t
|
|
1882
1882
|
}), this.fromObject = o.fromObject(this)({
|
|
@@ -1916,22 +1916,22 @@ var root$1, hasRequiredRoot;
|
|
|
1916
1916
|
function requireRoot() {
|
|
1917
1917
|
if (hasRequiredRoot) return root$1;
|
|
1918
1918
|
hasRequiredRoot = 1, root$1 = i;
|
|
1919
|
-
var
|
|
1920
|
-
((i.prototype = Object.create(
|
|
1919
|
+
var a = requireNamespace();
|
|
1920
|
+
((i.prototype = Object.create(a.prototype)).constructor = i).className = "Root";
|
|
1921
1921
|
var f = requireField(), h = require_enum(), c = requireOneof(), d = requireUtil(), n, e, r;
|
|
1922
|
-
function i(
|
|
1923
|
-
|
|
1922
|
+
function i(u) {
|
|
1923
|
+
a.call(this, "", u), this.deferred = [], this.files = [], this._edition = "proto2", this._fullyQualifiedObjects = {};
|
|
1924
1924
|
}
|
|
1925
1925
|
i.fromJSON = function(o, p) {
|
|
1926
1926
|
return p || (p = new i()), o.options && p.setOptions(o.options), p.addJSON(o.nested).resolveAll();
|
|
1927
1927
|
}, i.prototype.resolvePath = d.path.resolve, i.prototype.fetch = d.fetch;
|
|
1928
1928
|
function t() {
|
|
1929
1929
|
}
|
|
1930
|
-
i.prototype.load = function
|
|
1930
|
+
i.prototype.load = function u(o, p, y) {
|
|
1931
1931
|
typeof p == "function" && (y = p, p = void 0);
|
|
1932
1932
|
var E = this;
|
|
1933
1933
|
if (!y)
|
|
1934
|
-
return d.asPromise(
|
|
1934
|
+
return d.asPromise(u, E, o, p);
|
|
1935
1935
|
var v = y === t;
|
|
1936
1936
|
function m(B, L) {
|
|
1937
1937
|
if (y) {
|
|
@@ -2013,10 +2013,10 @@ function requireRoot() {
|
|
|
2013
2013
|
throw Error("unresolvable extensions: " + this.deferred.map(function(o) {
|
|
2014
2014
|
return "'extend " + o.extend + "' in " + o.parent.fullName;
|
|
2015
2015
|
}).join(", "));
|
|
2016
|
-
return
|
|
2016
|
+
return a.prototype.resolveAll.call(this);
|
|
2017
2017
|
};
|
|
2018
2018
|
var l = /^[A-Z]/;
|
|
2019
|
-
function s(
|
|
2019
|
+
function s(u, o) {
|
|
2020
2020
|
var p = o.parent.lookup(o.extend);
|
|
2021
2021
|
if (p) {
|
|
2022
2022
|
var y = new f(o.fullName, o.id, o.type, o.rule, void 0, o.options);
|
|
@@ -2058,66 +2058,66 @@ function requireRoot() {
|
|
|
2058
2058
|
}
|
|
2059
2059
|
} else if (o instanceof h)
|
|
2060
2060
|
l.test(o.name) && delete o.parent[o.name];
|
|
2061
|
-
else if (o instanceof
|
|
2061
|
+
else if (o instanceof a) {
|
|
2062
2062
|
for (var y = 0; y < /* initializes */
|
|
2063
2063
|
o.nestedArray.length; ++y)
|
|
2064
2064
|
this._handleRemove(o._nestedArray[y]);
|
|
2065
2065
|
l.test(o.name) && delete o.parent[o.name];
|
|
2066
2066
|
}
|
|
2067
2067
|
delete this._fullyQualifiedObjects[o.fullName];
|
|
2068
|
-
}, i._configure = function(
|
|
2069
|
-
n =
|
|
2068
|
+
}, i._configure = function(u, o, p) {
|
|
2069
|
+
n = u, e = o, r = p;
|
|
2070
2070
|
}, root$1;
|
|
2071
2071
|
}
|
|
2072
2072
|
var hasRequiredUtil;
|
|
2073
2073
|
function requireUtil() {
|
|
2074
2074
|
if (hasRequiredUtil) return util.exports;
|
|
2075
2075
|
hasRequiredUtil = 1;
|
|
2076
|
-
var
|
|
2077
|
-
|
|
2076
|
+
var a = util.exports = requireMinimal(), f = requireRoots(), h, c;
|
|
2077
|
+
a.codegen = requireCodegen(), a.fetch = requireFetch(), a.path = requirePath(), a.fs = a.inquire("fs"), a.toArray = function(t) {
|
|
2078
2078
|
if (t) {
|
|
2079
|
-
for (var l = Object.keys(t), s = new Array(l.length),
|
|
2080
|
-
s[
|
|
2079
|
+
for (var l = Object.keys(t), s = new Array(l.length), u = 0; u < l.length; )
|
|
2080
|
+
s[u] = t[l[u++]];
|
|
2081
2081
|
return s;
|
|
2082
2082
|
}
|
|
2083
2083
|
return [];
|
|
2084
|
-
},
|
|
2084
|
+
}, a.toObject = function(t) {
|
|
2085
2085
|
for (var l = {}, s = 0; s < t.length; ) {
|
|
2086
|
-
var
|
|
2087
|
-
o !== void 0 && (l[
|
|
2086
|
+
var u = t[s++], o = t[s++];
|
|
2087
|
+
o !== void 0 && (l[u] = o);
|
|
2088
2088
|
}
|
|
2089
2089
|
return l;
|
|
2090
2090
|
};
|
|
2091
2091
|
var d = /\\\\/g, n = /"/g;
|
|
2092
|
-
|
|
2092
|
+
a.isReserved = function(t) {
|
|
2093
2093
|
return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(t);
|
|
2094
|
-
},
|
|
2095
|
-
return !/^[$\\w_]+$/.test(t) ||
|
|
2096
|
-
},
|
|
2094
|
+
}, a.safeProp = function(t) {
|
|
2095
|
+
return !/^[$\\w_]+$/.test(t) || a.isReserved(t) ? '["' + t.replace(d, "\\\\\\\\").replace(n, '\\\\"') + '"]' : "." + t;
|
|
2096
|
+
}, a.ucFirst = function(t) {
|
|
2097
2097
|
return t.charAt(0).toUpperCase() + t.substring(1);
|
|
2098
2098
|
};
|
|
2099
2099
|
var e = /_([a-z])/g;
|
|
2100
|
-
|
|
2100
|
+
a.camelCase = function(t) {
|
|
2101
2101
|
return t.substring(0, 1) + t.substring(1).replace(e, function(l, s) {
|
|
2102
2102
|
return s.toUpperCase();
|
|
2103
2103
|
});
|
|
2104
|
-
},
|
|
2104
|
+
}, a.compareFieldsById = function(t, l) {
|
|
2105
2105
|
return t.id - l.id;
|
|
2106
|
-
},
|
|
2106
|
+
}, a.decorateType = function(t, l) {
|
|
2107
2107
|
if (t.$type)
|
|
2108
|
-
return l && t.$type.name !== l && (
|
|
2108
|
+
return l && t.$type.name !== l && (a.decorateRoot.remove(t.$type), t.$type.name = l, a.decorateRoot.add(t.$type)), t.$type;
|
|
2109
2109
|
h || (h = requireType());
|
|
2110
2110
|
var s = new h(l || t.name);
|
|
2111
|
-
return
|
|
2111
|
+
return a.decorateRoot.add(s), s.ctor = t, Object.defineProperty(t, "$type", { value: s, enumerable: !1 }), Object.defineProperty(t.prototype, "$type", { value: s, enumerable: !1 }), s;
|
|
2112
2112
|
};
|
|
2113
2113
|
var r = 0;
|
|
2114
|
-
return
|
|
2114
|
+
return a.decorateEnum = function(t) {
|
|
2115
2115
|
if (t.$type)
|
|
2116
2116
|
return t.$type;
|
|
2117
2117
|
c || (c = require_enum());
|
|
2118
2118
|
var l = new c("Enum" + r++, t);
|
|
2119
|
-
return
|
|
2120
|
-
},
|
|
2119
|
+
return a.decorateRoot.add(l), Object.defineProperty(t, "$type", { value: l, enumerable: !1 }), l;
|
|
2120
|
+
}, a.setProperty = function(t, l, s, u) {
|
|
2121
2121
|
function o(p, y, E) {
|
|
2122
2122
|
var v = y.shift();
|
|
2123
2123
|
if (v === "__proto__" || v === "prototype")
|
|
@@ -2126,7 +2126,7 @@ function requireUtil() {
|
|
|
2126
2126
|
p[v] = o(p[v] || {}, y, E);
|
|
2127
2127
|
else {
|
|
2128
2128
|
var m = p[v];
|
|
2129
|
-
if (m &&
|
|
2129
|
+
if (m && u)
|
|
2130
2130
|
return p;
|
|
2131
2131
|
m && (E = [].concat(m).concat(E)), p[v] = E;
|
|
2132
2132
|
}
|
|
@@ -2137,7 +2137,7 @@ function requireUtil() {
|
|
|
2137
2137
|
if (!l)
|
|
2138
2138
|
throw TypeError("path must be specified");
|
|
2139
2139
|
return l = l.split("."), o(t, l, s);
|
|
2140
|
-
}, Object.defineProperty(
|
|
2140
|
+
}, Object.defineProperty(a, "decorateRoot", {
|
|
2141
2141
|
get: function() {
|
|
2142
2142
|
return f.decorated || (f.decorated = new (requireRoot())());
|
|
2143
2143
|
}
|
|
@@ -2145,8 +2145,8 @@ function requireUtil() {
|
|
|
2145
2145
|
}
|
|
2146
2146
|
var hasRequiredTypes;
|
|
2147
2147
|
function requireTypes() {
|
|
2148
|
-
return hasRequiredTypes || (hasRequiredTypes = 1, function(
|
|
2149
|
-
var f =
|
|
2148
|
+
return hasRequiredTypes || (hasRequiredTypes = 1, function(a) {
|
|
2149
|
+
var f = a, h = requireUtil(), c = [
|
|
2150
2150
|
"double",
|
|
2151
2151
|
// 0
|
|
2152
2152
|
"float",
|
|
@@ -2317,15 +2317,15 @@ var field, hasRequiredField;
|
|
|
2317
2317
|
function requireField() {
|
|
2318
2318
|
if (hasRequiredField) return field;
|
|
2319
2319
|
hasRequiredField = 1, field = e;
|
|
2320
|
-
var
|
|
2321
|
-
((e.prototype = Object.create(
|
|
2320
|
+
var a = requireObject();
|
|
2321
|
+
((e.prototype = Object.create(a.prototype)).constructor = e).className = "Field";
|
|
2322
2322
|
var f = require_enum(), h = requireTypes(), c = requireUtil(), d, n = /^required|optional|repeated$/;
|
|
2323
2323
|
e.fromJSON = function(i, t) {
|
|
2324
2324
|
var l = new e(i, t.id, t.type, t.rule, t.extend, t.options, t.comment);
|
|
2325
2325
|
return t.edition && (l._edition = t.edition), l._defaultEdition = "proto3", l;
|
|
2326
2326
|
};
|
|
2327
|
-
function e(r, i, t, l, s,
|
|
2328
|
-
if (c.isObject(l) ? (o = s,
|
|
2327
|
+
function e(r, i, t, l, s, u, o) {
|
|
2328
|
+
if (c.isObject(l) ? (o = s, u = l, l = s = void 0) : c.isObject(s) && (o = u, u = s, s = void 0), a.call(this, r, u), !c.isInteger(i) || i < 0)
|
|
2329
2329
|
throw TypeError("id must be a non-negative integer");
|
|
2330
2330
|
if (!c.isString(t))
|
|
2331
2331
|
throw TypeError("type must be a string");
|
|
@@ -2361,7 +2361,7 @@ function requireField() {
|
|
|
2361
2361
|
this._features.field_presence !== "IMPLICIT";
|
|
2362
2362
|
}
|
|
2363
2363
|
}), e.prototype.setOption = function(i, t, l) {
|
|
2364
|
-
return
|
|
2364
|
+
return a.prototype.setOption.call(this, i, t, l);
|
|
2365
2365
|
}, e.prototype.toJSON = function(i) {
|
|
2366
2366
|
var t = i ? !!i.keepComments : !1;
|
|
2367
2367
|
return c.toObject([
|
|
@@ -2389,7 +2389,7 @@ function requireField() {
|
|
|
2389
2389
|
var i;
|
|
2390
2390
|
c.base64.test(this.typeDefault) ? c.base64.decode(this.typeDefault, i = c.newBuffer(c.base64.length(this.typeDefault)), 0) : c.utf8.write(this.typeDefault, i = c.newBuffer(c.utf8.length(this.typeDefault)), 0), this.typeDefault = i;
|
|
2391
2391
|
}
|
|
2392
|
-
return this.map ? this.defaultValue = c.emptyObject : this.repeated ? this.defaultValue = c.emptyArray : this.defaultValue = this.typeDefault, this.parent instanceof d && (this.parent.ctor.prototype[this.name] = this.defaultValue),
|
|
2392
|
+
return this.map ? this.defaultValue = c.emptyObject : this.repeated ? this.defaultValue = c.emptyArray : this.defaultValue = this.typeDefault, this.parent instanceof d && (this.parent.ctor.prototype[this.name] = this.defaultValue), a.prototype.resolve.call(this);
|
|
2393
2393
|
}, e.prototype._inferLegacyProtoFeatures = function(i) {
|
|
2394
2394
|
if (i !== "proto2" && i !== "proto3")
|
|
2395
2395
|
return {};
|
|
@@ -2400,7 +2400,7 @@ function requireField() {
|
|
|
2400
2400
|
}
|
|
2401
2401
|
return this.getOption("packed") === !0 ? t.repeated_field_encoding = "PACKED" : this.getOption("packed") === !1 && (t.repeated_field_encoding = "EXPANDED"), t;
|
|
2402
2402
|
}, e.prototype._resolveFeatures = function(i) {
|
|
2403
|
-
return
|
|
2403
|
+
return a.prototype._resolveFeatures.call(this, this._edition || i);
|
|
2404
2404
|
}, e.d = function(i, t, l, s) {
|
|
2405
2405
|
return typeof t == "function" ? t = c.decorateType(t).name : t && typeof t == "object" && (t = c.decorateEnum(t).name), function(o, p) {
|
|
2406
2406
|
c.decorateType(o.constructor).add(new e(p, i, t, l, { default: s }));
|
|
@@ -2413,11 +2413,11 @@ var oneof, hasRequiredOneof;
|
|
|
2413
2413
|
function requireOneof() {
|
|
2414
2414
|
if (hasRequiredOneof) return oneof;
|
|
2415
2415
|
hasRequiredOneof = 1, oneof = c;
|
|
2416
|
-
var
|
|
2417
|
-
((c.prototype = Object.create(
|
|
2416
|
+
var a = requireObject();
|
|
2417
|
+
((c.prototype = Object.create(a.prototype)).constructor = c).className = "OneOf";
|
|
2418
2418
|
var f = requireField(), h = requireUtil();
|
|
2419
2419
|
function c(n, e, r, i) {
|
|
2420
|
-
if (Array.isArray(e) || (r = e, e = void 0),
|
|
2420
|
+
if (Array.isArray(e) || (r = e, e = void 0), a.call(this, n, r), !(e === void 0 || Array.isArray(e)))
|
|
2421
2421
|
throw TypeError("fieldNames must be an Array");
|
|
2422
2422
|
this.oneof = e || [], this.fieldsArray = [], this.comment = i;
|
|
2423
2423
|
}
|
|
@@ -2451,7 +2451,7 @@ function requireOneof() {
|
|
|
2451
2451
|
throw Error(e + " is not a member of " + this);
|
|
2452
2452
|
return this.fieldsArray.splice(r, 1), r = this.oneof.indexOf(e.name), r > -1 && this.oneof.splice(r, 1), e.partOf = null, this;
|
|
2453
2453
|
}, c.prototype.onAdd = function(e) {
|
|
2454
|
-
|
|
2454
|
+
a.prototype.onAdd.call(this, e);
|
|
2455
2455
|
for (var r = this, i = 0; i < this.oneof.length; ++i) {
|
|
2456
2456
|
var t = e.get(this.oneof[i]);
|
|
2457
2457
|
t && !t.partOf && (t.partOf = r, r.fieldsArray.push(t));
|
|
@@ -2460,7 +2460,7 @@ function requireOneof() {
|
|
|
2460
2460
|
}, c.prototype.onRemove = function(e) {
|
|
2461
2461
|
for (var r = 0, i; r < this.fieldsArray.length; ++r)
|
|
2462
2462
|
(i = this.fieldsArray[r]).parent && i.parent.remove(i);
|
|
2463
|
-
|
|
2463
|
+
a.prototype.onRemove.call(this, e);
|
|
2464
2464
|
}, Object.defineProperty(c.prototype, "isProto3Optional", {
|
|
2465
2465
|
get: function() {
|
|
2466
2466
|
if (this.fieldsArray == null || this.fieldsArray.length !== 1)
|
|
@@ -2483,7 +2483,7 @@ var object, hasRequiredObject;
|
|
|
2483
2483
|
function requireObject() {
|
|
2484
2484
|
if (hasRequiredObject) return object;
|
|
2485
2485
|
hasRequiredObject = 1, object = r, r.className = "ReflectionObject";
|
|
2486
|
-
const
|
|
2486
|
+
const a = requireOneof();
|
|
2487
2487
|
var f = requireUtil(), h, c = { enum_type: "OPEN", field_presence: "EXPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY", enforce_naming_style: "STYLE2024", default_symbol_visibility: "EXPORT_TOP_LEVEL" }, d = { enum_type: "OPEN", field_presence: "EXPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY", enforce_naming_style: "STYLE_LEGACY", default_symbol_visibility: "EXPORT_ALL" }, n = { enum_type: "CLOSED", field_presence: "EXPLICIT", json_format: "LEGACY_BEST_EFFORT", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "EXPANDED", utf8_validation: "NONE", enforce_naming_style: "STYLE_LEGACY", default_symbol_visibility: "EXPORT_ALL" }, e = { enum_type: "OPEN", field_presence: "IMPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY", enforce_naming_style: "STYLE_LEGACY", default_symbol_visibility: "EXPORT_ALL" };
|
|
2488
2488
|
function r(i, t) {
|
|
2489
2489
|
if (!f.isString(i))
|
|
@@ -2556,9 +2556,9 @@ function requireObject() {
|
|
|
2556
2556
|
this._features = Object.assign(l, s || {}), this._featuresResolved = !0;
|
|
2557
2557
|
return;
|
|
2558
2558
|
}
|
|
2559
|
-
if (this.partOf instanceof
|
|
2560
|
-
var
|
|
2561
|
-
this._features = Object.assign(
|
|
2559
|
+
if (this.partOf instanceof a) {
|
|
2560
|
+
var u = Object.assign({}, this.partOf._features);
|
|
2561
|
+
this._features = Object.assign(u, s || {});
|
|
2562
2562
|
} else if (!this.declaringField) if (this.parent) {
|
|
2563
2563
|
var o = Object.assign({}, this.parent._features);
|
|
2564
2564
|
this._features = Object.assign(o, s || {});
|
|
@@ -2575,25 +2575,25 @@ function requireObject() {
|
|
|
2575
2575
|
return this.options || (this.options = {}), /^features\\./.test(t) ? f.setProperty(this.options, t, l, s) : (!s || this.options[t] === void 0) && (this.getOption(t) !== l && (this.resolved = !1), this.options[t] = l), this;
|
|
2576
2576
|
}, r.prototype.setParsedOption = function(t, l, s) {
|
|
2577
2577
|
this.parsedOptions || (this.parsedOptions = []);
|
|
2578
|
-
var
|
|
2578
|
+
var u = this.parsedOptions;
|
|
2579
2579
|
if (s) {
|
|
2580
|
-
var o =
|
|
2580
|
+
var o = u.find(function(E) {
|
|
2581
2581
|
return Object.prototype.hasOwnProperty.call(E, t);
|
|
2582
2582
|
});
|
|
2583
2583
|
if (o) {
|
|
2584
2584
|
var p = o[t];
|
|
2585
2585
|
f.setProperty(p, s, l);
|
|
2586
2586
|
} else
|
|
2587
|
-
o = {}, o[t] = f.setProperty({}, s, l),
|
|
2587
|
+
o = {}, o[t] = f.setProperty({}, s, l), u.push(o);
|
|
2588
2588
|
} else {
|
|
2589
2589
|
var y = {};
|
|
2590
|
-
y[t] = l,
|
|
2590
|
+
y[t] = l, u.push(y);
|
|
2591
2591
|
}
|
|
2592
2592
|
return this;
|
|
2593
2593
|
}, r.prototype.setOptions = function(t, l) {
|
|
2594
2594
|
if (t)
|
|
2595
|
-
for (var s = Object.keys(t),
|
|
2596
|
-
this.setOption(s[
|
|
2595
|
+
for (var s = Object.keys(t), u = 0; u < s.length; ++u)
|
|
2596
|
+
this.setOption(s[u], t[s[u]], l);
|
|
2597
2597
|
return this;
|
|
2598
2598
|
}, r.prototype.toString = function() {
|
|
2599
2599
|
var t = this.constructor.className, l = this.fullName;
|
|
@@ -2609,18 +2609,18 @@ var _enum, hasRequired_enum;
|
|
|
2609
2609
|
function require_enum() {
|
|
2610
2610
|
if (hasRequired_enum) return _enum;
|
|
2611
2611
|
hasRequired_enum = 1, _enum = c;
|
|
2612
|
-
var
|
|
2613
|
-
((c.prototype = Object.create(
|
|
2612
|
+
var a = requireObject();
|
|
2613
|
+
((c.prototype = Object.create(a.prototype)).constructor = c).className = "Enum";
|
|
2614
2614
|
var f = requireNamespace(), h = requireUtil();
|
|
2615
2615
|
function c(d, n, e, r, i, t) {
|
|
2616
|
-
if (
|
|
2616
|
+
if (a.call(this, d, e), n && typeof n != "object")
|
|
2617
2617
|
throw TypeError("values must be an object");
|
|
2618
2618
|
if (this.valuesById = {}, this.values = Object.create(this.valuesById), this.comment = r, this.comments = i || {}, this.valuesOptions = t, this._valuesFeatures = {}, this.reserved = void 0, n)
|
|
2619
2619
|
for (var l = Object.keys(n), s = 0; s < l.length; ++s)
|
|
2620
2620
|
typeof n[l[s]] == "number" && (this.valuesById[this.values[l[s]] = n[l[s]]] = l[s]);
|
|
2621
2621
|
}
|
|
2622
2622
|
return c.prototype._resolveFeatures = function(n) {
|
|
2623
|
-
return n = this._edition || n,
|
|
2623
|
+
return n = this._edition || n, a.prototype._resolveFeatures.call(this, n), Object.keys(this.values).forEach((e) => {
|
|
2624
2624
|
var r = Object.assign({}, this._features);
|
|
2625
2625
|
this._valuesFeatures[e] = Object.assign(r, this.valuesOptions && this.valuesOptions[e] && this.valuesOptions[e].features);
|
|
2626
2626
|
}), this;
|
|
@@ -2680,7 +2680,7 @@ var encoder_1, hasRequiredEncoder;
|
|
|
2680
2680
|
function requireEncoder() {
|
|
2681
2681
|
if (hasRequiredEncoder) return encoder_1;
|
|
2682
2682
|
hasRequiredEncoder = 1, encoder_1 = d;
|
|
2683
|
-
var
|
|
2683
|
+
var a = require_enum(), f = requireTypes(), h = requireUtil();
|
|
2684
2684
|
function c(n, e, r, i) {
|
|
2685
2685
|
return e.delimited ? n("types[%i].encode(%s,w.uint32(%i)).uint32(%i)", r, i, (e.id << 3 | 3) >>> 0, (e.id << 3 | 4) >>> 0) : n("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", r, i, (e.id << 3 | 2) >>> 0);
|
|
2686
2686
|
}
|
|
@@ -2689,8 +2689,8 @@ function requireEncoder() {
|
|
|
2689
2689
|
/* initializes */
|
|
2690
2690
|
n.fieldsArray.slice().sort(h.compareFieldsById)
|
|
2691
2691
|
), r = 0; r < t.length; ++r) {
|
|
2692
|
-
var l = t[r].resolve(), s = n._fieldsArray.indexOf(l),
|
|
2693
|
-
i = "m" + h.safeProp(l.name), l.map ? (e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", i, l.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){", i)("w.uint32(%i).fork().uint32(%i).%s(ks[i])", (l.id << 3 | 2) >>> 0, 8 | f.mapKey[l.keyType], l.keyType), o === void 0 ? e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", s, i) : e(".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | o,
|
|
2692
|
+
var l = t[r].resolve(), s = n._fieldsArray.indexOf(l), u = l.resolvedType instanceof a ? "int32" : l.type, o = f.basic[u];
|
|
2693
|
+
i = "m" + h.safeProp(l.name), l.map ? (e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", i, l.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){", i)("w.uint32(%i).fork().uint32(%i).%s(ks[i])", (l.id << 3 | 2) >>> 0, 8 | f.mapKey[l.keyType], l.keyType), o === void 0 ? e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", s, i) : e(".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | o, u, i), e("}")("}")) : l.repeated ? (e("if(%s!=null&&%s.length){", i, i), l.packed && f.packed[u] !== void 0 ? e("w.uint32(%i).fork()", (l.id << 3 | 2) >>> 0)("for(var i=0;i<%s.length;++i)", i)("w.%s(%s[i])", u, i)("w.ldelim()") : (e("for(var i=0;i<%s.length;++i)", i), o === void 0 ? c(e, l, s, i + "[i]") : e("w.uint32(%i).%s(%s[i])", (l.id << 3 | o) >>> 0, u, i)), e("}")) : (l.optional && e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", i, l.name), o === void 0 ? c(e, l, s, i) : e("w.uint32(%i).%s(%s)", (l.id << 3 | o) >>> 0, u, i));
|
|
2694
2694
|
}
|
|
2695
2695
|
return e("return w");
|
|
2696
2696
|
}
|
|
@@ -2700,22 +2700,22 @@ var hasRequiredIndexLight;
|
|
|
2700
2700
|
function requireIndexLight() {
|
|
2701
2701
|
if (hasRequiredIndexLight) return indexLight.exports;
|
|
2702
2702
|
hasRequiredIndexLight = 1;
|
|
2703
|
-
var
|
|
2704
|
-
|
|
2703
|
+
var a = indexLight.exports = requireIndexMinimal();
|
|
2704
|
+
a.build = "light";
|
|
2705
2705
|
function f(c, d, n) {
|
|
2706
|
-
return typeof d == "function" ? (n = d, d = new
|
|
2706
|
+
return typeof d == "function" ? (n = d, d = new a.Root()) : d || (d = new a.Root()), d.load(c, n);
|
|
2707
2707
|
}
|
|
2708
|
-
|
|
2708
|
+
a.load = f;
|
|
2709
2709
|
function h(c, d) {
|
|
2710
|
-
return d || (d = new
|
|
2710
|
+
return d || (d = new a.Root()), d.loadSync(c);
|
|
2711
2711
|
}
|
|
2712
|
-
return
|
|
2712
|
+
return a.loadSync = h, a.encoder = requireEncoder(), a.decoder = requireDecoder(), a.verifier = requireVerifier(), a.converter = requireConverter(), a.ReflectionObject = requireObject(), a.Namespace = requireNamespace(), a.Root = requireRoot(), a.Enum = require_enum(), a.Type = requireType(), a.Field = requireField(), a.OneOf = requireOneof(), a.MapField = requireMapfield(), a.Service = requireService(), a.Method = requireMethod(), a.Message = requireMessage(), a.wrappers = requireWrappers(), a.types = requireTypes(), a.util = requireUtil(), a.ReflectionObject._configure(a.Root), a.Namespace._configure(a.Type, a.Service, a.Enum), a.Root._configure(a.Type), a.Field._configure(a.Type), indexLight.exports;
|
|
2713
2713
|
}
|
|
2714
2714
|
var tokenize_1, hasRequiredTokenize;
|
|
2715
2715
|
function requireTokenize() {
|
|
2716
2716
|
if (hasRequiredTokenize) return tokenize_1;
|
|
2717
2717
|
hasRequiredTokenize = 1, tokenize_1 = l;
|
|
2718
|
-
var
|
|
2718
|
+
var a = /[\\s{}=;:[\\],'"()<>]/g, f = /(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)")/g, h = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g, c = /^ *[*/]+ */, d = /^\\s*\\*?\\/*/, n = /\\n/g, e = /\\s/, r = /\\\\(.?)/g, i = {
|
|
2719
2719
|
0: "\\0",
|
|
2720
2720
|
r: "\\r",
|
|
2721
2721
|
n: \`
|
|
@@ -2723,7 +2723,7 @@ function requireTokenize() {
|
|
|
2723
2723
|
t: " "
|
|
2724
2724
|
};
|
|
2725
2725
|
function t(s) {
|
|
2726
|
-
return s.replace(r, function(
|
|
2726
|
+
return s.replace(r, function(u, o) {
|
|
2727
2727
|
switch (o) {
|
|
2728
2728
|
case "\\\\":
|
|
2729
2729
|
case "":
|
|
@@ -2734,7 +2734,7 @@ function requireTokenize() {
|
|
|
2734
2734
|
});
|
|
2735
2735
|
}
|
|
2736
2736
|
l.unescape = t;
|
|
2737
|
-
function l(s,
|
|
2737
|
+
function l(s, u) {
|
|
2738
2738
|
s = s.toString();
|
|
2739
2739
|
var o = 0, p = s.length, y = 1, E = 0, v = {}, m = [], _ = null;
|
|
2740
2740
|
function A(k) {
|
|
@@ -2757,7 +2757,7 @@ function requireTokenize() {
|
|
|
2757
2757
|
lineEmpty: !1,
|
|
2758
2758
|
leading: F
|
|
2759
2759
|
}, H;
|
|
2760
|
-
|
|
2760
|
+
u ? H = 2 : H = 3;
|
|
2761
2761
|
var D = k - H, $;
|
|
2762
2762
|
do
|
|
2763
2763
|
if (--D < 0 || ($ = s.charAt(D)) === \`
|
|
@@ -2766,9 +2766,9 @@ function requireTokenize() {
|
|
|
2766
2766
|
break;
|
|
2767
2767
|
}
|
|
2768
2768
|
while ($ === " " || $ === " ");
|
|
2769
|
-
for (var
|
|
2770
|
-
|
|
2771
|
-
W.text =
|
|
2769
|
+
for (var Y = s.substring(k, P).split(n), z = 0; z < Y.length; ++z)
|
|
2770
|
+
Y[z] = Y[z].replace(u ? d : c, "").trim();
|
|
2771
|
+
W.text = Y.join(\`
|
|
2772
2772
|
\`).trim(), v[y] = W, E = y;
|
|
2773
2773
|
}
|
|
2774
2774
|
function K(k) {
|
|
@@ -2798,7 +2798,7 @@ function requireTokenize() {
|
|
|
2798
2798
|
if (++o === p)
|
|
2799
2799
|
throw A("comment");
|
|
2800
2800
|
if (C(o) === "/")
|
|
2801
|
-
if (
|
|
2801
|
+
if (u) {
|
|
2802
2802
|
if (W = o, H = !1, K(o - 1)) {
|
|
2803
2803
|
H = !0;
|
|
2804
2804
|
do
|
|
@@ -2816,7 +2816,7 @@ function requireTokenize() {
|
|
|
2816
2816
|
++o, H && (j(W, o - 1, D), D = !0), ++y, k = !0;
|
|
2817
2817
|
}
|
|
2818
2818
|
else if ((F = C(o)) === "*") {
|
|
2819
|
-
W = o + 1, H =
|
|
2819
|
+
W = o + 1, H = u || C(W) === "*";
|
|
2820
2820
|
do {
|
|
2821
2821
|
if (F === \`
|
|
2822
2822
|
\` && ++y, ++o === p)
|
|
@@ -2829,10 +2829,10 @@ function requireTokenize() {
|
|
|
2829
2829
|
}
|
|
2830
2830
|
} while (k);
|
|
2831
2831
|
var $ = o;
|
|
2832
|
-
|
|
2833
|
-
var
|
|
2834
|
-
if (!
|
|
2835
|
-
for (; $ < p && !
|
|
2832
|
+
a.lastIndex = 0;
|
|
2833
|
+
var Y = a.test(C($++));
|
|
2834
|
+
if (!Y)
|
|
2835
|
+
for (; $ < p && !a.test(C($)); )
|
|
2836
2836
|
++$;
|
|
2837
2837
|
var z = s.substring(o, o = $);
|
|
2838
2838
|
return (z === '"' || z === "'") && (_ = z), z;
|
|
@@ -2859,7 +2859,7 @@ function requireTokenize() {
|
|
|
2859
2859
|
}
|
|
2860
2860
|
function T(k) {
|
|
2861
2861
|
var P = null, F;
|
|
2862
|
-
return k === void 0 ? (F = v[y - 1], delete v[y - 1], F && (
|
|
2862
|
+
return k === void 0 ? (F = v[y - 1], delete v[y - 1], F && (u || F.type === "*" || F.lineEmpty) && (P = F.leading ? F.text : null)) : (E < k && J(), F = v[k], delete v[k], F && !F.lineEmpty && (u || F.type === "/") && (P = F.leading ? null : F.text)), P;
|
|
2863
2863
|
}
|
|
2864
2864
|
return Object.defineProperty({
|
|
2865
2865
|
next: L,
|
|
@@ -2879,14 +2879,14 @@ var parse_1, hasRequiredParse;
|
|
|
2879
2879
|
function requireParse() {
|
|
2880
2880
|
if (hasRequiredParse) return parse_1;
|
|
2881
2881
|
hasRequiredParse = 1, parse_1 = I, I.filename = null, I.defaults = { keepCase: !1 };
|
|
2882
|
-
var
|
|
2882
|
+
var a = requireTokenize(), f = requireRoot(), h = requireType(), c = requireField(), d = requireMapfield(), n = requireOneof(), e = require_enum(), r = requireService(), i = requireMethod(), t = requireObject(), l = requireTypes(), s = requireUtil(), u = /^[1-9][0-9]*$/, o = /^-?[1-9][0-9]*$/, p = /^0[x][0-9a-fA-F]+$/, y = /^-?0[x][0-9a-fA-F]+$/, E = /^0[0-7]+$/, v = /^-?0[0-7]+$/, m = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, _ = /^[a-zA-Z_][a-zA-Z_0-9]*$/, A = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
|
|
2883
2883
|
function I(C, j, K) {
|
|
2884
2884
|
j instanceof f || (K = j, j = new f()), K || (K = I.defaults);
|
|
2885
|
-
var B = K.preferTrailingComment || !1, L =
|
|
2885
|
+
var B = K.preferTrailingComment || !1, L = a(C, K.alternateCommentMode || !1), S = L.next, J = L.push, M = L.peek, T = L.skip, k = L.cmnt, P = !0, F, W, H, D = "proto2", $ = j, Y = [], z = {}, ae = K.keepCase ? function(R) {
|
|
2886
2886
|
return R;
|
|
2887
2887
|
} : s.camelCase;
|
|
2888
2888
|
function he() {
|
|
2889
|
-
|
|
2889
|
+
Y.forEach((R) => {
|
|
2890
2890
|
R._edition = D, Object.keys(z).forEach((g) => {
|
|
2891
2891
|
R.getOption(g) === void 0 && R.setOption(g, z[g], !0);
|
|
2892
2892
|
});
|
|
@@ -2978,7 +2978,7 @@ function requireParse() {
|
|
|
2978
2978
|
case "0":
|
|
2979
2979
|
return 0;
|
|
2980
2980
|
}
|
|
2981
|
-
if (
|
|
2981
|
+
if (u.test(R))
|
|
2982
2982
|
return O * parseInt(R, 10);
|
|
2983
2983
|
if (p.test(R))
|
|
2984
2984
|
return O * parseInt(R, 16);
|
|
@@ -3086,15 +3086,15 @@ function requireParse() {
|
|
|
3086
3086
|
throw N(w);
|
|
3087
3087
|
/* eslint-disable no-fallthrough */
|
|
3088
3088
|
case "repeated":
|
|
3089
|
-
|
|
3089
|
+
X(O, w);
|
|
3090
3090
|
break;
|
|
3091
3091
|
case "optional":
|
|
3092
3092
|
if (D === "proto3")
|
|
3093
|
-
|
|
3093
|
+
X(O, "proto3_optional");
|
|
3094
3094
|
else {
|
|
3095
3095
|
if (D !== "proto2")
|
|
3096
3096
|
throw N(w);
|
|
3097
|
-
|
|
3097
|
+
X(O, "optional");
|
|
3098
3098
|
}
|
|
3099
3099
|
break;
|
|
3100
3100
|
case "oneof":
|
|
@@ -3109,12 +3109,12 @@ function requireParse() {
|
|
|
3109
3109
|
default:
|
|
3110
3110
|
if (D === "proto2" || !A.test(w))
|
|
3111
3111
|
throw N(w);
|
|
3112
|
-
J(w),
|
|
3112
|
+
J(w), X(O, "optional");
|
|
3113
3113
|
break;
|
|
3114
3114
|
}
|
|
3115
|
-
}), R.add(O), R === $ &&
|
|
3115
|
+
}), R.add(O), R === $ && Y.push(O);
|
|
3116
3116
|
}
|
|
3117
|
-
function
|
|
3117
|
+
function X(R, g, O) {
|
|
3118
3118
|
var b = S();
|
|
3119
3119
|
if (b === "group") {
|
|
3120
3120
|
_e(R, g);
|
|
@@ -3141,7 +3141,7 @@ function requireParse() {
|
|
|
3141
3141
|
q.setOption("proto3_optional", !0), x.add(q), R.add(x);
|
|
3142
3142
|
} else
|
|
3143
3143
|
R.add(q);
|
|
3144
|
-
R === $ &&
|
|
3144
|
+
R === $ && Y.push(q);
|
|
3145
3145
|
}
|
|
3146
3146
|
function _e(R, g) {
|
|
3147
3147
|
if (D >= 2023)
|
|
@@ -3161,10 +3161,10 @@ function requireParse() {
|
|
|
3161
3161
|
break;
|
|
3162
3162
|
case "required":
|
|
3163
3163
|
case "repeated":
|
|
3164
|
-
|
|
3164
|
+
X(q, U);
|
|
3165
3165
|
break;
|
|
3166
3166
|
case "optional":
|
|
3167
|
-
D === "proto3" ?
|
|
3167
|
+
D === "proto3" ? X(q, "proto3_optional") : X(q, "optional");
|
|
3168
3168
|
break;
|
|
3169
3169
|
case "message":
|
|
3170
3170
|
ne(q, U);
|
|
@@ -3225,7 +3225,7 @@ function requireParse() {
|
|
|
3225
3225
|
throw N(g, "name");
|
|
3226
3226
|
var O = new n(ae(g));
|
|
3227
3227
|
Z(O, function(w) {
|
|
3228
|
-
w === "option" ? (Q(O, w), T(";")) : (J(w),
|
|
3228
|
+
w === "option" ? (Q(O, w), T(";")) : (J(w), X(O, "optional"));
|
|
3229
3229
|
}), R.add(O);
|
|
3230
3230
|
}
|
|
3231
3231
|
function de(R, g) {
|
|
@@ -3243,7 +3243,7 @@ function requireParse() {
|
|
|
3243
3243
|
default:
|
|
3244
3244
|
Oe(O, w);
|
|
3245
3245
|
}
|
|
3246
|
-
}), R.add(O), R === $ &&
|
|
3246
|
+
}), R.add(O), R === $ && Y.push(O);
|
|
3247
3247
|
}
|
|
3248
3248
|
function Oe(R, g) {
|
|
3249
3249
|
if (!_.test(g))
|
|
@@ -3345,7 +3345,7 @@ function requireParse() {
|
|
|
3345
3345
|
we(O, w);
|
|
3346
3346
|
else
|
|
3347
3347
|
throw N(w);
|
|
3348
|
-
}), R.add(O), R === $ &&
|
|
3348
|
+
}), R.add(O), R === $ && Y.push(O);
|
|
3349
3349
|
}
|
|
3350
3350
|
function we(R, g) {
|
|
3351
3351
|
var O = k(), b = g;
|
|
@@ -3371,15 +3371,15 @@ function requireParse() {
|
|
|
3371
3371
|
switch (w) {
|
|
3372
3372
|
case "required":
|
|
3373
3373
|
case "repeated":
|
|
3374
|
-
|
|
3374
|
+
X(R, w, O);
|
|
3375
3375
|
break;
|
|
3376
3376
|
case "optional":
|
|
3377
|
-
D === "proto3" ?
|
|
3377
|
+
D === "proto3" ? X(R, "proto3_optional", O) : X(R, "optional", O);
|
|
3378
3378
|
break;
|
|
3379
3379
|
default:
|
|
3380
3380
|
if (D === "proto2" || !A.test(w))
|
|
3381
3381
|
throw N(w);
|
|
3382
|
-
J(w),
|
|
3382
|
+
J(w), X(R, "optional", O);
|
|
3383
3383
|
break;
|
|
3384
3384
|
}
|
|
3385
3385
|
});
|
|
@@ -3429,9 +3429,9 @@ var common_1, hasRequiredCommon;
|
|
|
3429
3429
|
function requireCommon() {
|
|
3430
3430
|
if (hasRequiredCommon) return common_1;
|
|
3431
3431
|
hasRequiredCommon = 1, common_1 = f;
|
|
3432
|
-
var
|
|
3432
|
+
var a = /\\/|\\./;
|
|
3433
3433
|
function f(c, d) {
|
|
3434
|
-
|
|
3434
|
+
a.test(c) || (c = "google/protobuf/" + c + ".proto", d = { nested: { google: { nested: { protobuf: { nested: d } } } } }), f[c] = d;
|
|
3435
3435
|
}
|
|
3436
3436
|
f("any", {
|
|
3437
3437
|
/**
|
|
@@ -3748,34 +3748,34 @@ var hasRequiredSrc;
|
|
|
3748
3748
|
function requireSrc() {
|
|
3749
3749
|
if (hasRequiredSrc) return src.exports;
|
|
3750
3750
|
hasRequiredSrc = 1;
|
|
3751
|
-
var
|
|
3752
|
-
return
|
|
3751
|
+
var a = src.exports = requireIndexLight();
|
|
3752
|
+
return a.build = "full", a.tokenize = requireTokenize(), a.parse = requireParse(), a.common = requireCommon(), a.Root._configure(a.Type, a.parse, a.common), src.exports;
|
|
3753
3753
|
}
|
|
3754
3754
|
var protobufjs, hasRequiredProtobufjs;
|
|
3755
3755
|
function requireProtobufjs() {
|
|
3756
3756
|
return hasRequiredProtobufjs || (hasRequiredProtobufjs = 1, protobufjs = requireSrc()), protobufjs;
|
|
3757
3757
|
}
|
|
3758
|
-
var protobufjsExports = requireProtobufjs(), StateStreamErrorCode = /* @__PURE__ */ ((
|
|
3759
|
-
const DEFAULT_MAX_RECONNECT_ATTEMPTS = 5, DEFAULT_MAX_AUTH_ATTEMPTS = 5, nested = { BSB_State: { nested: { StateUpdate: { oneofs: { state: { oneof: ["deviceName", "power", "brightness", "audioVolume", "wifi", "updateState", "updateCheck", "timezone", "matter", "frame", "input", "timer", "ble", "autoUpdateState"] } }, fields: { deviceName: { type: "BSB_State.DeviceName", id: 1 }, power: { type: "BSB_State.Power", id: 2 }, brightness: { type: "BSB_State.Brightness", id: 3 }, audioVolume: { type: "BSB_State.AudioVolume", id: 4 }, wifi: { type: "BSB_State.Wifi", id: 5 }, updateState: { type: "BSB_Update.UpdateState", id: 6 }, updateCheck: { type: "BSB_Update.CheckState", id: 7 }, timezone: { type: "BSB_State.Timezone", id: 8 }, matter: { type: "BSB_State.Matter", id: 9 }, frame: { type: "BSB_Frame.Frame", id: 10 }, input: { type: "BSB_Input.InputEvent", id: 11 }, timer: { type: "BSB_Timer.Timer", id: 12 }, ble: { type: "BSB_State.Ble.Ble", id: 13 }, autoUpdateState: { type: "BSB_Update.AutoUpdateState", id: 14 } } }, State: { oneofs: { _error: { oneof: ["error"] } }, fields: { timestamp: { type: "fixed64", id: 1 }, updates: { rule: "repeated", type: "StateUpdate", id: 2 }, error: { type: "BSB_Error.Error", id: 3, options: { proto3_optional: !0 } } } }, DeviceName: { fields: { name: { type: "string", id: 1 } } }, BrightnessAutomatic: { fields: {} }, BrightnessManual: { fields: { brightness: { type: "uint32", id: 1 } } }, Brightness: { oneofs: { setting: { oneof: ["automatic", "manual"] } }, fields: { automatic: { type: "BrightnessAutomatic", id: 1 }, manual: { type: "BrightnessManual", id: 2 }, actualBrightness: { type: "uint32", id: 3 } } }, BatteryStatus: { values: { DISCHARGING: 0, CHARGING: 1, CHARGED: 2 } }, UnknownPowerState: { fields: {} }, PowerState: { fields: { batteryStatus: { type: "BatteryStatus", id: 1 }, batteryChargePercent: { type: "uint32", id: 2 }, batteryVoltageMv: { type: "uint32", id: 3 }, batteryCurrentMa: { type: "sint32", id: 4 }, usbVoltageMv: { type: "uint32", id: 5 } } }, Power: { oneofs: { state: { oneof: ["unknown", "known"] } }, fields: { unknown: { type: "UnknownPowerState", id: 1 }, known: { type: "PowerState", id: 2 } } }, AudioVolume: { fields: { volume: { type: "uint32", id: 1 } } }, WifiConnectionStatus: { values: { CONNECTED: 0, CONNECTING: 1, DISCONNECTING: 2, RECONNECTING: 3 } }, WifiSecurity: { values: { UNKNOWN: 0, OPEN: 1, WPA: 2, WPA2: 3, WEP: 4, WPA_WPA2: 5, WPA3: 6, WPA2_WPA3: 7 } }, IpConfigurationMethod: { values: { DHCP: 0, STATIC: 1 } }, IpProtocol: { values: { IPV4: 0, IPV6: 1 } }, WifiStateUnknown: { fields: {} }, WifiStateDisconnected: { fields: {} }, WifiStateConnected: { fields: { status: { type: "WifiConnectionStatus", id: 1 }, ssid: { type: "string", id: 2 }, bssid: { type: "string", id: 3 }, channel: { type: "uint32", id: 4 }, rssi: { type: "sint32", id: 5 }, security: { type: "WifiSecurity", id: 6 } } }, IpAddress: { fields: { protocol: { type: "IpProtocol", id: 1 }, method: { type: "IpConfigurationMethod", id: 2 }, address: { type: "string", id: 3 }, gateway: { type: "string", id: 4 }, netmask: { type: "string", id: 5 } } }, Wifi: { oneofs: { wifiState: { oneof: ["unknown", "disconnected", "connected"] } }, fields: { unknown: { type: "WifiStateUnknown", id: 1 }, disconnected: { type: "WifiStateDisconnected", id: 2 }, connected: { type: "WifiStateConnected", id: 3 }, ipAddresses: { rule: "repeated", type: "IpAddress", id: 4 } } }, Timezone: { fields: { name: { type: "string", id: 1 }, offset: { type: "sint32", id: 2 }, abbr: { type: "string", id: 3 } } }, MatterCommissioningStatus: { values: { NEVER_STARTED: 0, STARTED: 1, COMPLETED_SUCCESSFULLY: 2, FAILED: 3 } }, MatterCommissioningState: { fields: { status: { type: "MatterCommissioningStatus", id: 1 }, timestamp: { type: "fixed64", id: 2 } } }, Matter: { fields: { fabricCount: { type: "uint32", id: 1 }, state: { type: "MatterCommissioningState", id: 2 } } }, Ble: { nested: { ServiceStatus: { values: { RESET: 0, INITIALIZATION: 1, READY: 2, ADVERTISING: 3, CONNECTABLE: 4, CONNECTED: 5, ERROR: 6 } }, Ble: { oneofs: { _remoteAddress: { oneof: ["remoteAddress"] } }, fields: { status: { type: "ServiceStatus", id: 1 }, remoteAddress: { type: "string", id: 2, options: { proto3_optional: !0 } } } } } } } }, BSB_Update: { nested: { UpdateEvent: { values: { SESSION_START: 0, SESSION_STOP: 1, ACTION_BEGIN: 2, ACTION_DONE: 3, DETAIL_CHANGE: 4, ACTION_PROGRESS: 5, EVENT_NONE: 6 } }, UpdateAction: { values: { DOWNLOAD: 0, SHA_VERIFICATION: 1, UNPACK: 2, INSTALLATION_PREPARE: 3, INSTALLATION_APPLY: 4, ACTION_NONE: 5 } }, UpdateStatus: { values: { OK: 0, BATTERY_LOW: 1, BUSY: 2, DOWNLOAD_FAILURE: 3, DOWNLOAD_ABORT: 4, SHA_MISMATCH: 5, UNPACK_CREATE_STAGING_DIRECTORY_FAILURE: 6, UNPACK_ARCHIVE_OPEN_FAILURE: 7, UNPACK_ARCHIVE_UNPACK_FAILURE: 8, INSTALLATION_PREPARE_MANIFEST_NOT_FOUND: 9, INSTALLATION_PREPARE_MANIFEST_INVALID: 10, INSTALLATION_PREPARE_SESSION_CONFIG_SETUP_FAILURE: 11, INSTALLATION_PREPARE_POINTER_SETUP_FAILURE: 12, UNKNOWN_FAILURE: 13 } }, CheckError: { values: { NOT_AVAILABLE: 0, FAILURE: 1, IDLE: 2 } }, UpdateAvailable: { fields: { version: { type: "string", id: 1 } } }, UpdateUnavailable: { fields: { reason: { type: "CheckError", id: 1 } } }, UpdateState: { fields: { event: { type: "UpdateEvent", id: 1 }, action: { type: "UpdateAction", id: 2 }, status: { type: "UpdateStatus", id: 3 } } }, CheckState: { oneofs: { status: { oneof: ["available", "unavailable"] } }, fields: { available: { type: "UpdateAvailable", id: 1 }, unavailable: { type: "UpdateUnavailable", id: 2 } } }, AutoUpdateInterval: { fields: { start: { type: "uint32", id: 1 }, end: { type: "uint32", id: 2 } } }, AutoUpdateState: { fields: { enabled: { type: "bool", id: 1 }, interval: { type: "AutoUpdateInterval", id: 2 } } } } }, BSB_Frame: { nested: { Encoding: { values: { PLAIN: 0, RUN_LENGTH: 1, DEFLATE: 2, DEFLATE_RUN_LENGTH: 3 } }, PixelFormat: { values: { RGB888: 0, L8: 1, L4: 2 } }, Screen: { values: { FRONT: 0, BACK: 1 } }, Frame: { fields: { screen: { type: "Screen", id: 1 }, width: { type: "uint32", id: 2 }, height: { type: "uint32", id: 3 }, encoding: { type: "Encoding", id: 4 }, pixelFormat: { type: "PixelFormat", id: 5 }, data: { type: "bytes", id: 6 } } } } }, BSB_Timer: { nested: { Timer: { fields: { json: { type: "BSB_Util.Json", id: 1 } } } } }, BSB_Util: { nested: { Compression: { values: { PLAIN: 0, GZIP: 1 } }, Json: { fields: { compression: { type: "Compression", id: 1 }, data: { type: "bytes", id: 2 } } } } }, BSB_Input: { nested: { Button: { values: { OK: 0, BACK: 1, START: 2 } }, ButtonAction: { values: { PRESS: 0, RELEASE: 1 } }, SwitchPosition: { values: { BUSY: 0, CUSTOM: 1, OFF: 2, APPS: 3, SETTINGS: 4 } }, ButtonEvent: { fields: { button: { type: "Button", id: 1 }, action: { type: "ButtonAction", id: 2 } } }, SwitchEvent: { fields: { position: { type: "SwitchPosition", id: 1 } } }, EncoderEvent: { fields: { delta: { type: "sint32", id: 1 } } }, InputEvent: { oneofs: { event: { oneof: ["buttonEvent", "switchEvent", "encoderEvent"] } }, fields: { buttonEvent: { type: "ButtonEvent", id: 1 }, switchEvent: { type: "SwitchEvent", id: 2 }, encoderEvent: { type: "EncoderEvent", id: 3 } } } } }, BSB_Error: { nested: { Cause: { values: { RESOURCE_LIMIT: 0 } }, Severity: { values: { FATAL: 0, ERROR: 1, WARNING: 2 } }, Error: { fields: { cause: { type: "Cause", id: 1 }, severity: { type: "Severity", id: 2 } } } } } };
|
|
3758
|
+
var protobufjsExports = requireProtobufjs(), StateStreamErrorCode = /* @__PURE__ */ ((a) => (a.CONNECTION_FAILED = "CONNECTION_FAILED", a.RECONNECT_FAILED = "RECONNECT_FAILED", a.CONNECTION_LOST = "CONNECTION_LOST", a.CONNECTION_TIMEOUT = "CONNECTION_TIMEOUT", a.AUTH_FAILED = "AUTH_FAILED", a.AUTH_REFRESH_FAILED = "AUTH_REFRESH_FAILED", a.DEVICE_ERROR = "DEVICE_ERROR", a.DECODE_ERROR = "DECODE_ERROR", a.FRAME_PROCESS_ERROR = "FRAME_PROCESS_ERROR", a.STREAM_ALREADY_STARTED = "STREAM_ALREADY_STARTED", a.WORKER_INIT_FAILED = "WORKER_INIT_FAILED", a.UNKNOWN_ERROR = "UNKNOWN_ERROR", a))(StateStreamErrorCode || {}), ConnectionStatus = /* @__PURE__ */ ((a) => (a.DISCONNECTED = "DISCONNECTED", a.CONNECTING = "CONNECTING", a.CONNECTED = "CONNECTED", a.RECONNECTING = "RECONNECTING", a))(ConnectionStatus || {}), AuthStatus = /* @__PURE__ */ ((a) => (a.UNAUTHENTICATED = "UNAUTHENTICATED", a.AUTHENTICATING = "AUTHENTICATING", a.AUTHENTICATED = "AUTHENTICATED", a.REAUTHENTICATING = "REAUTHENTICATING", a.FAILED = "FAILED", a))(AuthStatus || {});
|
|
3759
|
+
const DEFAULT_MAX_RECONNECT_ATTEMPTS = 5, DEFAULT_MAX_AUTH_ATTEMPTS = 5, DEFAULT_DELAY_RECONNECT = 500, nested = { BSB_State: { nested: { StateUpdate: { oneofs: { state: { oneof: ["deviceName", "power", "brightness", "audioVolume", "wifi", "updateState", "updateCheck", "timezone", "matter", "frame", "input", "timer", "ble", "autoUpdateState"] } }, fields: { deviceName: { type: "BSB_State.DeviceName", id: 1 }, power: { type: "BSB_State.Power", id: 2 }, brightness: { type: "BSB_State.Brightness", id: 3 }, audioVolume: { type: "BSB_State.AudioVolume", id: 4 }, wifi: { type: "BSB_State.Wifi", id: 5 }, updateState: { type: "BSB_Update.UpdateState", id: 6 }, updateCheck: { type: "BSB_Update.CheckState", id: 7 }, timezone: { type: "BSB_State.Timezone", id: 8 }, matter: { type: "BSB_State.Matter", id: 9 }, frame: { type: "BSB_Frame.Frame", id: 10 }, input: { type: "BSB_Input.InputEvent", id: 11 }, timer: { type: "BSB_Timer.Timer", id: 12 }, ble: { type: "BSB_State.Ble.Ble", id: 13 }, autoUpdateState: { type: "BSB_Update.AutoUpdateState", id: 14 } } }, State: { oneofs: { _error: { oneof: ["error"] } }, fields: { timestamp: { type: "fixed64", id: 1 }, updates: { rule: "repeated", type: "StateUpdate", id: 2 }, error: { type: "BSB_Error.Error", id: 3, options: { proto3_optional: !0 } } } }, DeviceName: { fields: { name: { type: "string", id: 1 } } }, BrightnessAutomatic: { fields: {} }, BrightnessManual: { fields: { brightness: { type: "uint32", id: 1 } } }, Brightness: { oneofs: { setting: { oneof: ["automatic", "manual"] } }, fields: { automatic: { type: "BrightnessAutomatic", id: 1 }, manual: { type: "BrightnessManual", id: 2 }, actualBrightness: { type: "uint32", id: 3 } } }, BatteryStatus: { values: { DISCHARGING: 0, CHARGING: 1, CHARGED: 2 } }, UnknownPowerState: { fields: {} }, PowerState: { fields: { batteryStatus: { type: "BatteryStatus", id: 1 }, batteryChargePercent: { type: "uint32", id: 2 }, batteryVoltageMv: { type: "uint32", id: 3 }, batteryCurrentMa: { type: "sint32", id: 4 }, usbVoltageMv: { type: "uint32", id: 5 } } }, Power: { oneofs: { state: { oneof: ["unknown", "known"] } }, fields: { unknown: { type: "UnknownPowerState", id: 1 }, known: { type: "PowerState", id: 2 } } }, AudioVolume: { fields: { volume: { type: "uint32", id: 1 } } }, WifiConnectionStatus: { values: { CONNECTED: 0, CONNECTING: 1, DISCONNECTING: 2, RECONNECTING: 3 } }, WifiSecurity: { values: { UNKNOWN: 0, OPEN: 1, WPA: 2, WPA2: 3, WEP: 4, WPA_WPA2: 5, WPA3: 6, WPA2_WPA3: 7 } }, IpConfigurationMethod: { values: { DHCP: 0, STATIC: 1 } }, IpProtocol: { values: { IPV4: 0, IPV6: 1 } }, WifiStateUnknown: { fields: {} }, WifiStateDisconnected: { fields: {} }, WifiStateConnected: { fields: { status: { type: "WifiConnectionStatus", id: 1 }, ssid: { type: "string", id: 2 }, bssid: { type: "string", id: 3 }, channel: { type: "uint32", id: 4 }, rssi: { type: "sint32", id: 5 }, security: { type: "WifiSecurity", id: 6 } } }, IpAddress: { fields: { protocol: { type: "IpProtocol", id: 1 }, method: { type: "IpConfigurationMethod", id: 2 }, address: { type: "string", id: 3 }, gateway: { type: "string", id: 4 }, netmask: { type: "string", id: 5 } } }, Wifi: { oneofs: { wifiState: { oneof: ["unknown", "disconnected", "connected"] } }, fields: { unknown: { type: "WifiStateUnknown", id: 1 }, disconnected: { type: "WifiStateDisconnected", id: 2 }, connected: { type: "WifiStateConnected", id: 3 }, ipAddresses: { rule: "repeated", type: "IpAddress", id: 4 } } }, Timezone: { fields: { name: { type: "string", id: 1 }, offset: { type: "sint32", id: 2 }, abbr: { type: "string", id: 3 } } }, MatterCommissioningStatus: { values: { NEVER_STARTED: 0, STARTED: 1, COMPLETED_SUCCESSFULLY: 2, FAILED: 3 } }, MatterCommissioningState: { fields: { status: { type: "MatterCommissioningStatus", id: 1 }, timestamp: { type: "fixed64", id: 2 } } }, Matter: { fields: { fabricCount: { type: "uint32", id: 1 }, state: { type: "MatterCommissioningState", id: 2 } } }, Ble: { nested: { ServiceStatus: { values: { RESET: 0, INITIALIZATION: 1, READY: 2, ADVERTISING: 3, CONNECTABLE: 4, CONNECTED: 5, ERROR: 6 } }, Ble: { oneofs: { _remoteAddress: { oneof: ["remoteAddress"] } }, fields: { status: { type: "ServiceStatus", id: 1 }, remoteAddress: { type: "string", id: 2, options: { proto3_optional: !0 } } } } } } } }, BSB_Update: { nested: { UpdateEvent: { values: { SESSION_START: 0, SESSION_STOP: 1, ACTION_BEGIN: 2, ACTION_DONE: 3, DETAIL_CHANGE: 4, ACTION_PROGRESS: 5, EVENT_NONE: 6 } }, UpdateAction: { values: { DOWNLOAD: 0, SHA_VERIFICATION: 1, UNPACK: 2, INSTALLATION_PREPARE: 3, INSTALLATION_APPLY: 4, ACTION_NONE: 5 } }, UpdateStatus: { values: { OK: 0, BATTERY_LOW: 1, BUSY: 2, DOWNLOAD_FAILURE: 3, DOWNLOAD_ABORT: 4, SHA_MISMATCH: 5, UNPACK_CREATE_STAGING_DIRECTORY_FAILURE: 6, UNPACK_ARCHIVE_OPEN_FAILURE: 7, UNPACK_ARCHIVE_UNPACK_FAILURE: 8, INSTALLATION_PREPARE_MANIFEST_NOT_FOUND: 9, INSTALLATION_PREPARE_MANIFEST_INVALID: 10, INSTALLATION_PREPARE_SESSION_CONFIG_SETUP_FAILURE: 11, INSTALLATION_PREPARE_POINTER_SETUP_FAILURE: 12, UNKNOWN_FAILURE: 13 } }, CheckError: { values: { NOT_AVAILABLE: 0, FAILURE: 1, IDLE: 2 } }, UpdateAvailable: { fields: { version: { type: "string", id: 1 } } }, UpdateUnavailable: { fields: { reason: { type: "CheckError", id: 1 } } }, UpdateState: { fields: { event: { type: "UpdateEvent", id: 1 }, action: { type: "UpdateAction", id: 2 }, status: { type: "UpdateStatus", id: 3 } } }, CheckState: { oneofs: { status: { oneof: ["available", "unavailable"] } }, fields: { available: { type: "UpdateAvailable", id: 1 }, unavailable: { type: "UpdateUnavailable", id: 2 } } }, AutoUpdateInterval: { fields: { start: { type: "uint32", id: 1 }, end: { type: "uint32", id: 2 } } }, AutoUpdateState: { fields: { enabled: { type: "bool", id: 1 }, interval: { type: "AutoUpdateInterval", id: 2 } } } } }, BSB_Frame: { nested: { Encoding: { values: { PLAIN: 0, RUN_LENGTH: 1, DEFLATE: 2, DEFLATE_RUN_LENGTH: 3 } }, PixelFormat: { values: { RGB888: 0, L8: 1, L4: 2 } }, Screen: { values: { FRONT: 0, BACK: 1 } }, Frame: { fields: { screen: { type: "Screen", id: 1 }, width: { type: "uint32", id: 2 }, height: { type: "uint32", id: 3 }, encoding: { type: "Encoding", id: 4 }, pixelFormat: { type: "PixelFormat", id: 5 }, data: { type: "bytes", id: 6 } } } } }, BSB_Timer: { nested: { Timer: { fields: { json: { type: "BSB_Util.Json", id: 1 } } } } }, BSB_Util: { nested: { Compression: { values: { PLAIN: 0, GZIP: 1 } }, Json: { fields: { compression: { type: "Compression", id: 1 }, data: { type: "bytes", id: 2 } } } } }, BSB_Input: { nested: { Button: { values: { OK: 0, BACK: 1, START: 2 } }, ButtonAction: { values: { PRESS: 0, RELEASE: 1 } }, SwitchPosition: { values: { BUSY: 0, CUSTOM: 1, OFF: 2, APPS: 3, SETTINGS: 4 } }, ButtonEvent: { fields: { button: { type: "Button", id: 1 }, action: { type: "ButtonAction", id: 2 } } }, SwitchEvent: { fields: { position: { type: "SwitchPosition", id: 1 } } }, EncoderEvent: { fields: { delta: { type: "sint32", id: 1 } } }, InputEvent: { oneofs: { event: { oneof: ["buttonEvent", "switchEvent", "encoderEvent"] } }, fields: { buttonEvent: { type: "ButtonEvent", id: 1 }, switchEvent: { type: "SwitchEvent", id: 2 }, encoderEvent: { type: "EncoderEvent", id: 3 } } } } }, BSB_Error: { nested: { Cause: { values: { RESOURCE_LIMIT: 0 } }, Severity: { values: { FATAL: 0, ERROR: 1, WARNING: 2 } }, Error: { fields: { cause: { type: "Cause", id: 1 }, severity: { type: "Severity", id: 2 } } } } } };
|
|
3760
3760
|
var bundle = {
|
|
3761
3761
|
nested
|
|
3762
3762
|
};
|
|
3763
|
-
function decompressRLE(
|
|
3763
|
+
function decompressRLE(a, f) {
|
|
3764
3764
|
const h = [];
|
|
3765
|
-
for (let c = 0; c <
|
|
3766
|
-
const d =
|
|
3765
|
+
for (let c = 0; c < a.length; ) {
|
|
3766
|
+
const d = a[c++];
|
|
3767
3767
|
if (d === void 0) break;
|
|
3768
3768
|
const n = d & 127;
|
|
3769
3769
|
if (!n)
|
|
3770
3770
|
continue;
|
|
3771
3771
|
if (d & 128) {
|
|
3772
|
-
const r = n * f, i =
|
|
3772
|
+
const r = n * f, i = a.subarray(c, c + r);
|
|
3773
3773
|
for (let t = 0; t < i.length; t++)
|
|
3774
3774
|
h.push(i[t]);
|
|
3775
3775
|
c += r;
|
|
3776
3776
|
continue;
|
|
3777
3777
|
}
|
|
3778
|
-
const e =
|
|
3778
|
+
const e = a.subarray(c, c + f);
|
|
3779
3779
|
c += f;
|
|
3780
3780
|
for (let r = 0; r < n; r++)
|
|
3781
3781
|
for (let i = 0; i < f; i++)
|
|
@@ -3783,23 +3783,23 @@ function decompressRLE(u, f) {
|
|
|
3783
3783
|
}
|
|
3784
3784
|
return new Uint8Array(h);
|
|
3785
3785
|
}
|
|
3786
|
-
async function decompressDeflate(
|
|
3786
|
+
async function decompressDeflate(a) {
|
|
3787
3787
|
if (typeof DecompressionStream > "u")
|
|
3788
3788
|
throw new Error("DecompressionStream is not supported in this environment.");
|
|
3789
3789
|
try {
|
|
3790
3790
|
const f = new DecompressionStream("deflate"), h = f.writable.getWriter();
|
|
3791
|
-
h.write(
|
|
3791
|
+
h.write(a), h.close();
|
|
3792
3792
|
const d = await new Response(f.readable).arrayBuffer();
|
|
3793
3793
|
return new Uint8Array(d);
|
|
3794
3794
|
} catch (f) {
|
|
3795
3795
|
throw new Error(\`Deflate decompression failed: \${f instanceof Error ? f.message : String(f)}\`);
|
|
3796
3796
|
}
|
|
3797
3797
|
}
|
|
3798
|
-
function convertL4toRGBA(
|
|
3798
|
+
function convertL4toRGBA(a, f, h) {
|
|
3799
3799
|
const c = new Uint8ClampedArray(f * h * 4);
|
|
3800
3800
|
let d = 0;
|
|
3801
|
-
for (let n = 0; n <
|
|
3802
|
-
const e =
|
|
3801
|
+
for (let n = 0; n < a.length; n++) {
|
|
3802
|
+
const e = a[n], r = (e & 15) * 17, i = (e >> 4 & 15) * 17, t = [r, i];
|
|
3803
3803
|
for (const l of t)
|
|
3804
3804
|
if (d < f * h) {
|
|
3805
3805
|
const s = d * 4;
|
|
@@ -3808,28 +3808,28 @@ function convertL4toRGBA(u, f, h) {
|
|
|
3808
3808
|
}
|
|
3809
3809
|
return c;
|
|
3810
3810
|
}
|
|
3811
|
-
function convertL8toRGBA(
|
|
3812
|
-
const c = new Uint8ClampedArray(f * h * 4), d = Math.min(
|
|
3811
|
+
function convertL8toRGBA(a, f, h) {
|
|
3812
|
+
const c = new Uint8ClampedArray(f * h * 4), d = Math.min(a.length, f * h);
|
|
3813
3813
|
for (let n = 0; n < d; n++) {
|
|
3814
|
-
const e =
|
|
3814
|
+
const e = a[n], r = n * 4;
|
|
3815
3815
|
c[r] = e, c[r + 1] = e, c[r + 2] = e, c[r + 3] = 255;
|
|
3816
3816
|
}
|
|
3817
3817
|
return c;
|
|
3818
3818
|
}
|
|
3819
|
-
function convertRGB888toRGBA(
|
|
3819
|
+
function convertRGB888toRGBA(a, f, h) {
|
|
3820
3820
|
const c = new Uint8ClampedArray(f * h * 4), d = f * h;
|
|
3821
3821
|
for (let n = 0; n < d; n++) {
|
|
3822
3822
|
const e = n * 3, r = n * 4;
|
|
3823
|
-
e + 2 <
|
|
3823
|
+
e + 2 < a.length && (c[r] = a[e + 2], c[r + 1] = a[e + 1], c[r + 2] = a[e], c[r + 3] = 255);
|
|
3824
3824
|
}
|
|
3825
3825
|
return c;
|
|
3826
3826
|
}
|
|
3827
|
-
async function processFrame(
|
|
3828
|
-
if (!
|
|
3827
|
+
async function processFrame(a) {
|
|
3828
|
+
if (!a.data || !a.width || !a.height)
|
|
3829
3829
|
return null;
|
|
3830
|
-
let f =
|
|
3831
|
-
const h =
|
|
3832
|
-
switch (
|
|
3830
|
+
let f = a.data;
|
|
3831
|
+
const h = a.pixelFormat === 0 ? 3 : 1;
|
|
3832
|
+
switch (a.encoding) {
|
|
3833
3833
|
case 1:
|
|
3834
3834
|
f = decompressRLE(f, h);
|
|
3835
3835
|
break;
|
|
@@ -3840,24 +3840,24 @@ async function processFrame(u) {
|
|
|
3840
3840
|
f = await decompressDeflate(f), f = decompressRLE(f, h);
|
|
3841
3841
|
break;
|
|
3842
3842
|
}
|
|
3843
|
-
switch (
|
|
3843
|
+
switch (a.pixelFormat) {
|
|
3844
3844
|
case 2:
|
|
3845
|
-
return convertL4toRGBA(f,
|
|
3845
|
+
return convertL4toRGBA(f, a.width, a.height);
|
|
3846
3846
|
case 1:
|
|
3847
|
-
return convertL8toRGBA(f,
|
|
3847
|
+
return convertL8toRGBA(f, a.width, a.height);
|
|
3848
3848
|
case 0:
|
|
3849
|
-
return convertRGB888toRGBA(f,
|
|
3849
|
+
return convertRGB888toRGBA(f, a.width, a.height);
|
|
3850
3850
|
default:
|
|
3851
|
-
return new Uint8ClampedArray(
|
|
3851
|
+
return new Uint8ClampedArray(a.width * a.height * 4);
|
|
3852
3852
|
}
|
|
3853
3853
|
}
|
|
3854
|
-
const root = protobufjsExports.Root.fromJSON(bundle), StateType = root.lookupType("BSB_State.State"), AUTH_CODE = 3e3
|
|
3855
|
-
let maxAuthAttempts = DEFAULT_MAX_AUTH_ATTEMPTS, maxReconnectAttempts = DEFAULT_MAX_RECONNECT_ATTEMPTS, socket = null, isBinaryMode = !0, currentMode = "local", currentToken, currentAddr = "", retryCount = 0, authRetryCount = 0, isAuthReported = !1
|
|
3854
|
+
const root = protobufjsExports.Root.fromJSON(bundle), StateType = root.lookupType("BSB_State.State"), AUTH_CODE = 3e3;
|
|
3855
|
+
let maxAuthAttempts = DEFAULT_MAX_AUTH_ATTEMPTS, maxReconnectAttempts = DEFAULT_MAX_RECONNECT_ATTEMPTS, reconnectDelay = DEFAULT_DELAY_RECONNECT, socket = null, isBinaryMode = !0, currentMode = "local", currentToken, currentAddr = "", retryCount = 0, authRetryCount = 0, isAuthReported = !1;
|
|
3856
3856
|
const activePorts = /* @__PURE__ */ new Set(), subscriptions = /* @__PURE__ */ new Map();
|
|
3857
3857
|
let processingQueue = Promise.resolve();
|
|
3858
|
-
function broadcast(
|
|
3858
|
+
function broadcast(a) {
|
|
3859
3859
|
for (const f of activePorts)
|
|
3860
|
-
f.postMessage(
|
|
3860
|
+
f.postMessage(a);
|
|
3861
3861
|
}
|
|
3862
3862
|
function sendAuth() {
|
|
3863
3863
|
currentMode === "remote" && currentToken && (socket == null ? void 0 : socket.readyState) === WebSocket.OPEN && (broadcast({ type: "STATUS_UPDATE", auth: AuthStatus.AUTHENTICATING }), socket.send(JSON.stringify({ token: currentToken })));
|
|
@@ -3869,16 +3869,17 @@ function sendSubscriptions() {
|
|
|
3869
3869
|
})
|
|
3870
3870
|
);
|
|
3871
3871
|
}
|
|
3872
|
+
function stopSocket() {
|
|
3873
|
+
socket && (socket.onopen = null, socket.onmessage = null, socket.onerror = null, socket.onclose = null, socket.close(), socket = null);
|
|
3874
|
+
}
|
|
3872
3875
|
function stopAndCleanup() {
|
|
3873
|
-
|
|
3876
|
+
stopSocket(), subscriptions.clear(), activePorts.clear(), retryCount = 0, authRetryCount = 0, isAuthReported = !1;
|
|
3874
3877
|
}
|
|
3875
|
-
function connect(
|
|
3876
|
-
|
|
3877
|
-
const d = new URL(
|
|
3878
|
+
function connect(a, f, h = !0, c = "local") {
|
|
3879
|
+
stopSocket(), broadcast({ type: "STATUS_UPDATE", connection: ConnectionStatus.CONNECTING }), currentAddr = a, isBinaryMode = h, currentMode = c, currentToken = f, isAuthReported = !1;
|
|
3880
|
+
const d = new URL(a);
|
|
3878
3881
|
socket = new WebSocket(d.toString()), socket.binaryType = "arraybuffer", socket.onopen = () => {
|
|
3879
|
-
broadcast({ type: "CONNECTED" }), currentMode === "local" && (socket == null || socket.send(JSON.stringify({ enable: !0 }))), sendAuth(),
|
|
3880
|
-
retryCount = 0, authRetryCount = 0, console.log("[Worker] Connection stable. All retry counters reset.");
|
|
3881
|
-
}, 5e3), currentMode === "remote" && subscriptions.size > 0 && sendSubscriptions(), currentMode === "local" && broadcast({ type: "STATUS_UPDATE", auth: AuthStatus.AUTHENTICATED });
|
|
3882
|
+
broadcast({ type: "CONNECTED" }), currentMode === "local" && (socket == null || socket.send(JSON.stringify({ enable: !0 }))), sendAuth(), retryCount = 0, authRetryCount = 0, console.log("[Worker] Connection stable. All retry counters reset."), currentMode === "remote" && subscriptions.size > 0 && sendSubscriptions(), currentMode === "local" && broadcast({ type: "STATUS_UPDATE", auth: AuthStatus.AUTHENTICATED });
|
|
3882
3883
|
}, socket.onmessage = (n) => {
|
|
3883
3884
|
processingQueue = processingQueue.then(async () => {
|
|
3884
3885
|
try {
|
|
@@ -3897,19 +3898,19 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
3897
3898
|
defaults: !0
|
|
3898
3899
|
});
|
|
3899
3900
|
if (l.error) {
|
|
3900
|
-
const { cause: s, severity:
|
|
3901
|
-
if (s != null &&
|
|
3902
|
-
const o = root.lookupEnum("BSB_Error.Cause"), p = root.lookupEnum("BSB_Error.Severity"), y = o.valuesById[s] || "UNKNOWN", E = p.valuesById[
|
|
3901
|
+
const { cause: s, severity: u } = l.error;
|
|
3902
|
+
if (s != null && u != null) {
|
|
3903
|
+
const o = root.lookupEnum("BSB_Error.Cause"), p = root.lookupEnum("BSB_Error.Severity"), y = o.valuesById[s] || "UNKNOWN", E = p.valuesById[u] || "UNKNOWN";
|
|
3903
3904
|
if (broadcast({
|
|
3904
3905
|
type: "ERROR",
|
|
3905
3906
|
code: StateStreamErrorCode.DEVICE_ERROR,
|
|
3906
3907
|
message: \`Server reported \${E}: \${y}\`,
|
|
3907
3908
|
data: l.error
|
|
3908
|
-
}),
|
|
3909
|
+
}), u === p.values.FATAL) {
|
|
3909
3910
|
stopAndCleanup();
|
|
3910
3911
|
return;
|
|
3911
3912
|
}
|
|
3912
|
-
if (
|
|
3913
|
+
if (u === p.values.ERROR)
|
|
3913
3914
|
return;
|
|
3914
3915
|
} else
|
|
3915
3916
|
broadcast({
|
|
@@ -3921,17 +3922,17 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
3921
3922
|
}
|
|
3922
3923
|
if (l.updates)
|
|
3923
3924
|
for (const s of l.updates) {
|
|
3924
|
-
const
|
|
3925
|
-
if (
|
|
3925
|
+
const u = s.frame;
|
|
3926
|
+
if (u && u.data)
|
|
3926
3927
|
try {
|
|
3927
|
-
const o = await processFrame(
|
|
3928
|
-
o && (
|
|
3928
|
+
const o = await processFrame(u);
|
|
3929
|
+
o && (u.data = o);
|
|
3929
3930
|
} catch (o) {
|
|
3930
3931
|
broadcast({
|
|
3931
3932
|
type: "ERROR",
|
|
3932
3933
|
code: StateStreamErrorCode.FRAME_PROCESS_ERROR,
|
|
3933
3934
|
message: o instanceof Error ? o.message : String(o),
|
|
3934
|
-
data:
|
|
3935
|
+
data: u.data
|
|
3935
3936
|
});
|
|
3936
3937
|
}
|
|
3937
3938
|
}
|
|
@@ -3952,7 +3953,7 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
3952
3953
|
}, socket.onerror = () => {
|
|
3953
3954
|
broadcast({ type: "ERROR", code: StateStreamErrorCode.CONNECTION_FAILED, message: "WebSocket connection error" });
|
|
3954
3955
|
}, socket.onclose = (n) => {
|
|
3955
|
-
if (console.log("[Worker] Socket closed:", n),
|
|
3956
|
+
if (console.log("[Worker] Socket closed:", n), !socket || activePorts.size === 0) {
|
|
3956
3957
|
console.log("[Worker] Connection closed or no active ports. No retries.");
|
|
3957
3958
|
return;
|
|
3958
3959
|
}
|
|
@@ -3964,11 +3965,11 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
3964
3965
|
}));
|
|
3965
3966
|
return;
|
|
3966
3967
|
}
|
|
3967
|
-
if (
|
|
3968
|
+
if (n.code !== 1e3) {
|
|
3968
3969
|
if (retryCount < maxReconnectAttempts) {
|
|
3969
3970
|
retryCount++;
|
|
3970
|
-
|
|
3971
|
-
console.log(\`[Worker] Reconnecting (network code: \${n.code}) in \${e}ms... (Attempt \${retryCount}/\${maxReconnectAttempts})\`), broadcast({ type: "STATUS_UPDATE", connection: ConnectionStatus.RECONNECTING, connectionAttempts: retryCount }), setTimeout(() => {
|
|
3971
|
+
let e = Math.min(1e3 * retryCount, 5e3);
|
|
3972
|
+
reconnectDelay && (e = reconnectDelay), console.log(\`[Worker] Reconnecting (network code: \${n.code}) in \${e}ms... (Attempt \${retryCount}/\${maxReconnectAttempts})\`), broadcast({ type: "STATUS_UPDATE", connection: ConnectionStatus.RECONNECTING, connectionAttempts: retryCount }), setTimeout(() => {
|
|
3972
3973
|
activePorts.size > 0 && socket && connect(currentAddr, currentToken, isBinaryMode, currentMode);
|
|
3973
3974
|
}, e);
|
|
3974
3975
|
} else
|
|
@@ -3986,10 +3987,10 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
3986
3987
|
});
|
|
3987
3988
|
};
|
|
3988
3989
|
}
|
|
3989
|
-
function handleCommand(
|
|
3990
|
-
switch (
|
|
3990
|
+
function handleCommand(a, f) {
|
|
3991
|
+
switch (a.type) {
|
|
3991
3992
|
case "START":
|
|
3992
|
-
maxAuthAttempts =
|
|
3993
|
+
maxAuthAttempts = a.maxAuthAttempts ?? DEFAULT_MAX_AUTH_ATTEMPTS, maxReconnectAttempts = a.maxReconnectAttempts ?? DEFAULT_MAX_RECONNECT_ATTEMPTS, reconnectDelay = a.reconnectDelay ?? DEFAULT_DELAY_RECONNECT, activePorts.add(f), socket && socket.readyState === WebSocket.OPEN && currentAddr === a.addr ? (f.postMessage({ type: "CONNECTED" }), f.postMessage({ type: "STATUS_UPDATE", auth: AuthStatus.AUTHENTICATED })) : connect(a.addr, a.token, a.isBinary, a.mode);
|
|
3993
3994
|
break;
|
|
3994
3995
|
case "STOP":
|
|
3995
3996
|
activePorts.delete(f);
|
|
@@ -3999,42 +4000,42 @@ function handleCommand(u, f) {
|
|
|
3999
4000
|
break;
|
|
4000
4001
|
case "UPDATE_TOKEN":
|
|
4001
4002
|
const h = currentToken;
|
|
4002
|
-
if (currentToken =
|
|
4003
|
+
if (currentToken = a.token, currentMode === "remote") {
|
|
4003
4004
|
const e = socket && socket.readyState === WebSocket.OPEN;
|
|
4004
|
-
if (e && h ===
|
|
4005
|
+
if (e && h === a.token)
|
|
4005
4006
|
return;
|
|
4006
|
-
e ? sendAuth() : h !==
|
|
4007
|
+
e ? sendAuth() : h !== a.token && currentAddr && activePorts.size > 0 && connect(currentAddr, currentToken, isBinaryMode, currentMode);
|
|
4007
4008
|
}
|
|
4008
4009
|
break;
|
|
4009
4010
|
case "SUBSCRIBE":
|
|
4010
|
-
let c = subscriptions.get(
|
|
4011
|
-
c || (c = /* @__PURE__ */ new Set(), subscriptions.set(
|
|
4011
|
+
let c = subscriptions.get(a.guid);
|
|
4012
|
+
c || (c = /* @__PURE__ */ new Set(), subscriptions.set(a.guid, c));
|
|
4012
4013
|
const d = c.size === 0;
|
|
4013
|
-
c.add(f), d && (socket == null ? void 0 : socket.readyState) === WebSocket.OPEN && currentMode === "remote" && socket.send(JSON.stringify({ subscribe: [
|
|
4014
|
+
c.add(f), d && (socket == null ? void 0 : socket.readyState) === WebSocket.OPEN && currentMode === "remote" && socket.send(JSON.stringify({ subscribe: [a.guid] }));
|
|
4014
4015
|
break;
|
|
4015
4016
|
case "UNSUBSCRIBE":
|
|
4016
|
-
const n = subscriptions.get(
|
|
4017
|
-
n && (n.delete(f), n.size === 0 && (subscriptions.delete(
|
|
4017
|
+
const n = subscriptions.get(a.guid);
|
|
4018
|
+
n && (n.delete(f), n.size === 0 && (subscriptions.delete(a.guid), (socket == null ? void 0 : socket.readyState) === WebSocket.OPEN && currentMode === "remote" && socket.send(JSON.stringify({ unsubscribe: [a.guid] }))));
|
|
4018
4019
|
break;
|
|
4019
4020
|
}
|
|
4020
4021
|
}
|
|
4021
4022
|
if ("SharedWorkerGlobalScope" in self) {
|
|
4022
|
-
const
|
|
4023
|
-
|
|
4023
|
+
const a = self;
|
|
4024
|
+
a.onconnect = (f) => {
|
|
4024
4025
|
const h = f.ports[0];
|
|
4025
4026
|
h && (h.onmessage = (c) => handleCommand(c.data, h), h.start());
|
|
4026
4027
|
};
|
|
4027
4028
|
} else {
|
|
4028
|
-
const
|
|
4029
|
-
|
|
4030
|
-
handleCommand(f.data,
|
|
4029
|
+
const a = self;
|
|
4030
|
+
a.onmessage = (f) => {
|
|
4031
|
+
handleCommand(f.data, a);
|
|
4031
4032
|
};
|
|
4032
4033
|
}
|
|
4033
|
-
`,N=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",q],{type:"text/javascript;charset=utf-8"});function
|
|
4034
|
+
`,N=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",q],{type:"text/javascript;charset=utf-8"});function he(e){let n;try{if(n=N&&(self.URL||self.webkitURL).createObjectURL(N),!n)throw"";const t=new Worker(n,{type:"module",name:e==null?void 0:e.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(q),{type:"module",name:e==null?void 0:e.name})}}const ye=`var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, src = { exports: {} }, indexLight = { exports: {} }, indexMinimal = {}, minimal = {}, aspromise, hasRequiredAspromise;
|
|
4034
4035
|
function requireAspromise() {
|
|
4035
4036
|
if (hasRequiredAspromise) return aspromise;
|
|
4036
|
-
hasRequiredAspromise = 1, aspromise =
|
|
4037
|
-
function
|
|
4037
|
+
hasRequiredAspromise = 1, aspromise = a;
|
|
4038
|
+
function a(f, h) {
|
|
4038
4039
|
for (var c = new Array(arguments.length - 1), d = 0, n = 2, e = !0; n < arguments.length; )
|
|
4039
4040
|
c[d++] = arguments[n++];
|
|
4040
4041
|
return new Promise(function(i, t) {
|
|
@@ -4043,9 +4044,9 @@ function requireAspromise() {
|
|
|
4043
4044
|
if (e = !1, s)
|
|
4044
4045
|
t(s);
|
|
4045
4046
|
else {
|
|
4046
|
-
for (var
|
|
4047
|
-
|
|
4048
|
-
i.apply(null,
|
|
4047
|
+
for (var u = new Array(arguments.length - 1), o = 0; o < u.length; )
|
|
4048
|
+
u[o++] = arguments[o];
|
|
4049
|
+
i.apply(null, u);
|
|
4049
4050
|
}
|
|
4050
4051
|
};
|
|
4051
4052
|
try {
|
|
@@ -4059,8 +4060,8 @@ function requireAspromise() {
|
|
|
4059
4060
|
}
|
|
4060
4061
|
var base64 = {}, hasRequiredBase64;
|
|
4061
4062
|
function requireBase64() {
|
|
4062
|
-
return hasRequiredBase64 || (hasRequiredBase64 = 1, function(
|
|
4063
|
-
var f =
|
|
4063
|
+
return hasRequiredBase64 || (hasRequiredBase64 = 1, function(a) {
|
|
4064
|
+
var f = a;
|
|
4064
4065
|
f.length = function(r) {
|
|
4065
4066
|
var i = r.length;
|
|
4066
4067
|
if (!i)
|
|
@@ -4072,26 +4073,26 @@ function requireBase64() {
|
|
|
4072
4073
|
for (var h = new Array(64), c = new Array(123), d = 0; d < 64; )
|
|
4073
4074
|
c[h[d] = d < 26 ? d + 65 : d < 52 ? d + 71 : d < 62 ? d - 4 : d - 59 | 43] = d++;
|
|
4074
4075
|
f.encode = function(r, i, t) {
|
|
4075
|
-
for (var l = null, s = [],
|
|
4076
|
+
for (var l = null, s = [], u = 0, o = 0, p; i < t; ) {
|
|
4076
4077
|
var y = r[i++];
|
|
4077
4078
|
switch (o) {
|
|
4078
4079
|
case 0:
|
|
4079
|
-
s[
|
|
4080
|
+
s[u++] = h[y >> 2], p = (y & 3) << 4, o = 1;
|
|
4080
4081
|
break;
|
|
4081
4082
|
case 1:
|
|
4082
|
-
s[
|
|
4083
|
+
s[u++] = h[p | y >> 4], p = (y & 15) << 2, o = 2;
|
|
4083
4084
|
break;
|
|
4084
4085
|
case 2:
|
|
4085
|
-
s[
|
|
4086
|
+
s[u++] = h[p | y >> 6], s[u++] = h[y & 63], o = 0;
|
|
4086
4087
|
break;
|
|
4087
4088
|
}
|
|
4088
|
-
|
|
4089
|
+
u > 8191 && ((l || (l = [])).push(String.fromCharCode.apply(String, s)), u = 0);
|
|
4089
4090
|
}
|
|
4090
|
-
return o && (s[
|
|
4091
|
+
return o && (s[u++] = h[p], s[u++] = 61, o === 1 && (s[u++] = 61)), l ? (u && l.push(String.fromCharCode.apply(String, s.slice(0, u))), l.join("")) : String.fromCharCode.apply(String, s.slice(0, u));
|
|
4091
4092
|
};
|
|
4092
4093
|
var n = "invalid encoding";
|
|
4093
4094
|
f.decode = function(r, i, t) {
|
|
4094
|
-
for (var l = t, s = 0,
|
|
4095
|
+
for (var l = t, s = 0, u, o = 0; o < r.length; ) {
|
|
4095
4096
|
var p = r.charCodeAt(o++);
|
|
4096
4097
|
if (p === 61 && s > 1)
|
|
4097
4098
|
break;
|
|
@@ -4099,16 +4100,16 @@ function requireBase64() {
|
|
|
4099
4100
|
throw Error(n);
|
|
4100
4101
|
switch (s) {
|
|
4101
4102
|
case 0:
|
|
4102
|
-
|
|
4103
|
+
u = p, s = 1;
|
|
4103
4104
|
break;
|
|
4104
4105
|
case 1:
|
|
4105
|
-
i[t++] =
|
|
4106
|
+
i[t++] = u << 2 | (p & 48) >> 4, u = p, s = 2;
|
|
4106
4107
|
break;
|
|
4107
4108
|
case 2:
|
|
4108
|
-
i[t++] = (
|
|
4109
|
+
i[t++] = (u & 15) << 4 | (p & 60) >> 2, u = p, s = 3;
|
|
4109
4110
|
break;
|
|
4110
4111
|
case 3:
|
|
4111
|
-
i[t++] = (
|
|
4112
|
+
i[t++] = (u & 3) << 6 | p, s = 0;
|
|
4112
4113
|
break;
|
|
4113
4114
|
}
|
|
4114
4115
|
}
|
|
@@ -4123,16 +4124,16 @@ function requireBase64() {
|
|
|
4123
4124
|
var eventemitter, hasRequiredEventemitter;
|
|
4124
4125
|
function requireEventemitter() {
|
|
4125
4126
|
if (hasRequiredEventemitter) return eventemitter;
|
|
4126
|
-
hasRequiredEventemitter = 1, eventemitter =
|
|
4127
|
-
function
|
|
4127
|
+
hasRequiredEventemitter = 1, eventemitter = a;
|
|
4128
|
+
function a() {
|
|
4128
4129
|
this._listeners = {};
|
|
4129
4130
|
}
|
|
4130
|
-
return
|
|
4131
|
+
return a.prototype.on = function(h, c, d) {
|
|
4131
4132
|
return (this._listeners[h] || (this._listeners[h] = [])).push({
|
|
4132
4133
|
fn: c,
|
|
4133
4134
|
ctx: d || this
|
|
4134
4135
|
}), this;
|
|
4135
|
-
},
|
|
4136
|
+
}, a.prototype.off = function(h, c) {
|
|
4136
4137
|
if (h === void 0)
|
|
4137
4138
|
this._listeners = {};
|
|
4138
4139
|
else if (c === void 0)
|
|
@@ -4141,7 +4142,7 @@ function requireEventemitter() {
|
|
|
4141
4142
|
for (var d = this._listeners[h], n = 0; n < d.length; )
|
|
4142
4143
|
d[n].fn === c ? d.splice(n, 1) : ++n;
|
|
4143
4144
|
return this;
|
|
4144
|
-
},
|
|
4145
|
+
}, a.prototype.emit = function(h) {
|
|
4145
4146
|
var c = this._listeners[h];
|
|
4146
4147
|
if (c) {
|
|
4147
4148
|
for (var d = [], n = 1; n < arguments.length; )
|
|
@@ -4155,8 +4156,8 @@ function requireEventemitter() {
|
|
|
4155
4156
|
var float, hasRequiredFloat;
|
|
4156
4157
|
function requireFloat() {
|
|
4157
4158
|
if (hasRequiredFloat) return float;
|
|
4158
|
-
hasRequiredFloat = 1, float =
|
|
4159
|
-
function
|
|
4159
|
+
hasRequiredFloat = 1, float = a(a);
|
|
4160
|
+
function a(n) {
|
|
4160
4161
|
return typeof Float32Array < "u" ? function() {
|
|
4161
4162
|
var e = new Float32Array([-0]), r = new Uint8Array(e.buffer), i = r[3] === 128;
|
|
4162
4163
|
function t(o, p, y) {
|
|
@@ -4169,14 +4170,14 @@ function requireFloat() {
|
|
|
4169
4170
|
function s(o, p) {
|
|
4170
4171
|
return r[0] = o[p], r[1] = o[p + 1], r[2] = o[p + 2], r[3] = o[p + 3], e[0];
|
|
4171
4172
|
}
|
|
4172
|
-
function
|
|
4173
|
+
function u(o, p) {
|
|
4173
4174
|
return r[3] = o[p], r[2] = o[p + 1], r[1] = o[p + 2], r[0] = o[p + 3], e[0];
|
|
4174
4175
|
}
|
|
4175
|
-
n.readFloatLE = i ? s :
|
|
4176
|
+
n.readFloatLE = i ? s : u, n.readFloatBE = i ? u : s;
|
|
4176
4177
|
}() : function() {
|
|
4177
4178
|
function e(i, t, l, s) {
|
|
4178
|
-
var
|
|
4179
|
-
if (
|
|
4179
|
+
var u = t < 0 ? 1 : 0;
|
|
4180
|
+
if (u && (t = -t), t === 0)
|
|
4180
4181
|
i(1 / t > 0 ? (
|
|
4181
4182
|
/* positive */
|
|
4182
4183
|
0
|
|
@@ -4187,18 +4188,18 @@ function requireFloat() {
|
|
|
4187
4188
|
else if (isNaN(t))
|
|
4188
4189
|
i(2143289344, l, s);
|
|
4189
4190
|
else if (t > 34028234663852886e22)
|
|
4190
|
-
i((
|
|
4191
|
+
i((u << 31 | 2139095040) >>> 0, l, s);
|
|
4191
4192
|
else if (t < 11754943508222875e-54)
|
|
4192
|
-
i((
|
|
4193
|
+
i((u << 31 | Math.round(t / 1401298464324817e-60)) >>> 0, l, s);
|
|
4193
4194
|
else {
|
|
4194
4195
|
var o = Math.floor(Math.log(t) / Math.LN2), p = Math.round(t * Math.pow(2, -o) * 8388608) & 8388607;
|
|
4195
|
-
i((
|
|
4196
|
+
i((u << 31 | o + 127 << 23 | p) >>> 0, l, s);
|
|
4196
4197
|
}
|
|
4197
4198
|
}
|
|
4198
4199
|
n.writeFloatLE = e.bind(null, f), n.writeFloatBE = e.bind(null, h);
|
|
4199
4200
|
function r(i, t, l) {
|
|
4200
|
-
var s = i(t, l),
|
|
4201
|
-
return o === 255 ? p ? NaN :
|
|
4201
|
+
var s = i(t, l), u = (s >> 31) * 2 + 1, o = s >>> 23 & 255, p = s & 8388607;
|
|
4202
|
+
return o === 255 ? p ? NaN : u * (1 / 0) : o === 0 ? u * 1401298464324817e-60 * p : u * Math.pow(2, o - 150) * (p + 8388608);
|
|
4202
4203
|
}
|
|
4203
4204
|
n.readFloatLE = r.bind(null, c), n.readFloatBE = r.bind(null, d);
|
|
4204
4205
|
}(), typeof Float64Array < "u" ? function() {
|
|
@@ -4213,38 +4214,38 @@ function requireFloat() {
|
|
|
4213
4214
|
function s(o, p) {
|
|
4214
4215
|
return r[0] = o[p], r[1] = o[p + 1], r[2] = o[p + 2], r[3] = o[p + 3], r[4] = o[p + 4], r[5] = o[p + 5], r[6] = o[p + 6], r[7] = o[p + 7], e[0];
|
|
4215
4216
|
}
|
|
4216
|
-
function
|
|
4217
|
+
function u(o, p) {
|
|
4217
4218
|
return r[7] = o[p], r[6] = o[p + 1], r[5] = o[p + 2], r[4] = o[p + 3], r[3] = o[p + 4], r[2] = o[p + 5], r[1] = o[p + 6], r[0] = o[p + 7], e[0];
|
|
4218
4219
|
}
|
|
4219
|
-
n.readDoubleLE = i ? s :
|
|
4220
|
+
n.readDoubleLE = i ? s : u, n.readDoubleBE = i ? u : s;
|
|
4220
4221
|
}() : function() {
|
|
4221
|
-
function e(i, t, l, s,
|
|
4222
|
+
function e(i, t, l, s, u, o) {
|
|
4222
4223
|
var p = s < 0 ? 1 : 0;
|
|
4223
4224
|
if (p && (s = -s), s === 0)
|
|
4224
|
-
i(0,
|
|
4225
|
+
i(0, u, o + t), i(1 / s > 0 ? (
|
|
4225
4226
|
/* positive */
|
|
4226
4227
|
0
|
|
4227
4228
|
) : (
|
|
4228
4229
|
/* negative 0 */
|
|
4229
4230
|
2147483648
|
|
4230
|
-
),
|
|
4231
|
+
), u, o + l);
|
|
4231
4232
|
else if (isNaN(s))
|
|
4232
|
-
i(0,
|
|
4233
|
+
i(0, u, o + t), i(2146959360, u, o + l);
|
|
4233
4234
|
else if (s > 17976931348623157e292)
|
|
4234
|
-
i(0,
|
|
4235
|
+
i(0, u, o + t), i((p << 31 | 2146435072) >>> 0, u, o + l);
|
|
4235
4236
|
else {
|
|
4236
4237
|
var y;
|
|
4237
4238
|
if (s < 22250738585072014e-324)
|
|
4238
|
-
y = s / 5e-324, i(y >>> 0,
|
|
4239
|
+
y = s / 5e-324, i(y >>> 0, u, o + t), i((p << 31 | y / 4294967296) >>> 0, u, o + l);
|
|
4239
4240
|
else {
|
|
4240
4241
|
var E = Math.floor(Math.log(s) / Math.LN2);
|
|
4241
|
-
E === 1024 && (E = 1023), y = s * Math.pow(2, -E), i(y * 4503599627370496 >>> 0,
|
|
4242
|
+
E === 1024 && (E = 1023), y = s * Math.pow(2, -E), i(y * 4503599627370496 >>> 0, u, o + t), i((p << 31 | E + 1023 << 20 | y * 1048576 & 1048575) >>> 0, u, o + l);
|
|
4242
4243
|
}
|
|
4243
4244
|
}
|
|
4244
4245
|
}
|
|
4245
4246
|
n.writeDoubleLE = e.bind(null, f, 0, 4), n.writeDoubleBE = e.bind(null, h, 4, 0);
|
|
4246
|
-
function r(i, t, l, s,
|
|
4247
|
-
var o = i(s,
|
|
4247
|
+
function r(i, t, l, s, u) {
|
|
4248
|
+
var o = i(s, u + t), p = i(s, u + l), y = (p >> 31) * 2 + 1, E = p >>> 20 & 2047, v = 4294967296 * (p & 1048575) + o;
|
|
4248
4249
|
return E === 2047 ? v ? NaN : y * (1 / 0) : E === 0 ? y * 5e-324 * v : y * Math.pow(2, E - 1075) * (v + 4503599627370496);
|
|
4249
4250
|
}
|
|
4250
4251
|
n.readDoubleLE = r.bind(null, c, 0, 4), n.readDoubleBE = r.bind(null, d, 4, 0);
|
|
@@ -4273,7 +4274,7 @@ function requireInquire() {
|
|
|
4273
4274
|
var mod = eval("quire".replace(/^/, "re"))(moduleName);
|
|
4274
4275
|
if (mod && (mod.length || Object.keys(mod).length))
|
|
4275
4276
|
return mod;
|
|
4276
|
-
} catch (
|
|
4277
|
+
} catch (a) {
|
|
4277
4278
|
}
|
|
4278
4279
|
return null;
|
|
4279
4280
|
}
|
|
@@ -4281,8 +4282,8 @@ function requireInquire() {
|
|
|
4281
4282
|
}
|
|
4282
4283
|
var utf8 = {}, hasRequiredUtf8;
|
|
4283
4284
|
function requireUtf8() {
|
|
4284
|
-
return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(
|
|
4285
|
-
var f =
|
|
4285
|
+
return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(a) {
|
|
4286
|
+
var f = a;
|
|
4286
4287
|
f.length = function(c) {
|
|
4287
4288
|
for (var d = 0, n = 0, e = 0; e < c.length; ++e)
|
|
4288
4289
|
n = c.charCodeAt(e), n < 128 ? d += 1 : n < 2048 ? d += 2 : (n & 64512) === 55296 && (c.charCodeAt(e + 1) & 64512) === 56320 ? (++e, d += 4) : d += 3;
|
|
@@ -4304,8 +4305,8 @@ function requireUtf8() {
|
|
|
4304
4305
|
var pool_1, hasRequiredPool;
|
|
4305
4306
|
function requirePool() {
|
|
4306
4307
|
if (hasRequiredPool) return pool_1;
|
|
4307
|
-
hasRequiredPool = 1, pool_1 =
|
|
4308
|
-
function
|
|
4308
|
+
hasRequiredPool = 1, pool_1 = a;
|
|
4309
|
+
function a(f, h, c) {
|
|
4309
4310
|
var d = c || 8192, n = d >>> 1, e = null, r = d;
|
|
4310
4311
|
return function(t) {
|
|
4311
4312
|
if (t < 1 || t > n)
|
|
@@ -4321,7 +4322,7 @@ var longbits, hasRequiredLongbits;
|
|
|
4321
4322
|
function requireLongbits() {
|
|
4322
4323
|
if (hasRequiredLongbits) return longbits;
|
|
4323
4324
|
hasRequiredLongbits = 1, longbits = f;
|
|
4324
|
-
var
|
|
4325
|
+
var a = requireMinimal();
|
|
4325
4326
|
function f(n, e) {
|
|
4326
4327
|
this.lo = n >>> 0, this.hi = e >>> 0;
|
|
4327
4328
|
}
|
|
@@ -4344,9 +4345,9 @@ function requireLongbits() {
|
|
|
4344
4345
|
}, f.from = function(e) {
|
|
4345
4346
|
if (typeof e == "number")
|
|
4346
4347
|
return f.fromNumber(e);
|
|
4347
|
-
if (
|
|
4348
|
-
if (
|
|
4349
|
-
e =
|
|
4348
|
+
if (a.isString(e))
|
|
4349
|
+
if (a.Long)
|
|
4350
|
+
e = a.Long.fromString(e);
|
|
4350
4351
|
else
|
|
4351
4352
|
return f.fromNumber(parseInt(e, 10));
|
|
4352
4353
|
return e.low || e.high ? new f(e.low >>> 0, e.high >>> 0) : h;
|
|
@@ -4357,7 +4358,7 @@ function requireLongbits() {
|
|
|
4357
4358
|
}
|
|
4358
4359
|
return this.lo + this.hi * 4294967296;
|
|
4359
4360
|
}, f.prototype.toLong = function(e) {
|
|
4360
|
-
return
|
|
4361
|
+
return a.Long ? new a.Long(this.lo | 0, this.hi | 0, !!e) : { low: this.lo | 0, high: this.hi | 0, unsigned: !!e };
|
|
4361
4362
|
};
|
|
4362
4363
|
var d = String.prototype.charCodeAt;
|
|
4363
4364
|
return f.fromHash = function(e) {
|
|
@@ -4389,8 +4390,8 @@ function requireLongbits() {
|
|
|
4389
4390
|
}
|
|
4390
4391
|
var hasRequiredMinimal;
|
|
4391
4392
|
function requireMinimal() {
|
|
4392
|
-
return hasRequiredMinimal || (hasRequiredMinimal = 1, function(
|
|
4393
|
-
var f =
|
|
4393
|
+
return hasRequiredMinimal || (hasRequiredMinimal = 1, function(a) {
|
|
4394
|
+
var f = a;
|
|
4394
4395
|
f.asPromise = requireAspromise(), f.base64 = requireBase64(), f.EventEmitter = requireEventemitter(), f.float = requireFloat(), f.inquire = requireInquire(), f.utf8 = requireUtf8(), f.pool = requirePool(), f.LongBits = requireLongbits(), f.isNode = !!(typeof commonjsGlobal < "u" && commonjsGlobal && commonjsGlobal.process && commonjsGlobal.process.versions && commonjsGlobal.process.versions.node), f.global = f.isNode && commonjsGlobal || typeof window < "u" && window || typeof self < "u" && self || minimal, f.emptyArray = Object.freeze ? Object.freeze([]) : (
|
|
4395
4396
|
/* istanbul ignore next */
|
|
4396
4397
|
[]
|
|
@@ -4517,7 +4518,7 @@ var writer, hasRequiredWriter;
|
|
|
4517
4518
|
function requireWriter() {
|
|
4518
4519
|
if (hasRequiredWriter) return writer;
|
|
4519
4520
|
hasRequiredWriter = 1, writer = i;
|
|
4520
|
-
var
|
|
4521
|
+
var a = requireMinimal(), f, h = a.LongBits, c = a.base64, d = a.utf8;
|
|
4521
4522
|
function n(E, v, m) {
|
|
4522
4523
|
this.fn = E, this.len = v, this.next = void 0, this.val = m;
|
|
4523
4524
|
}
|
|
@@ -4530,7 +4531,7 @@ function requireWriter() {
|
|
|
4530
4531
|
this.len = 0, this.head = new n(e, 0, 0), this.tail = this.head, this.states = null;
|
|
4531
4532
|
}
|
|
4532
4533
|
var t = function() {
|
|
4533
|
-
return
|
|
4534
|
+
return a.Buffer ? function() {
|
|
4534
4535
|
return (i.create = function() {
|
|
4535
4536
|
return new f();
|
|
4536
4537
|
})();
|
|
@@ -4539,8 +4540,8 @@ function requireWriter() {
|
|
|
4539
4540
|
};
|
|
4540
4541
|
};
|
|
4541
4542
|
i.create = t(), i.alloc = function(v) {
|
|
4542
|
-
return new
|
|
4543
|
-
},
|
|
4543
|
+
return new a.Array(v);
|
|
4544
|
+
}, a.Array !== Array && (i.alloc = a.pool(i.alloc, a.Array.prototype.subarray)), i.prototype._push = function(v, m, _) {
|
|
4544
4545
|
return this.tail = this.tail.next = new n(v, m, _), this.len += m, this;
|
|
4545
4546
|
};
|
|
4546
4547
|
function l(E, v, m) {
|
|
@@ -4551,11 +4552,11 @@ function requireWriter() {
|
|
|
4551
4552
|
v[m++] = E & 127 | 128, E >>>= 7;
|
|
4552
4553
|
v[m] = E;
|
|
4553
4554
|
}
|
|
4554
|
-
function
|
|
4555
|
+
function u(E, v) {
|
|
4555
4556
|
this.len = E, this.next = void 0, this.val = v;
|
|
4556
4557
|
}
|
|
4557
|
-
|
|
4558
|
-
return this.len += (this.tail = this.tail.next = new
|
|
4558
|
+
u.prototype = Object.create(n.prototype), u.prototype.fn = s, i.prototype.uint32 = function(v) {
|
|
4559
|
+
return this.len += (this.tail = this.tail.next = new u(
|
|
4559
4560
|
(v = v >>> 0) < 128 ? 1 : v < 16384 ? 2 : v < 2097152 ? 3 : v < 268435456 ? 4 : 5,
|
|
4560
4561
|
v
|
|
4561
4562
|
)).len, this;
|
|
@@ -4589,11 +4590,11 @@ function requireWriter() {
|
|
|
4589
4590
|
var m = h.from(v);
|
|
4590
4591
|
return this._push(p, 4, m.lo)._push(p, 4, m.hi);
|
|
4591
4592
|
}, i.prototype.sfixed64 = i.prototype.fixed64, i.prototype.float = function(v) {
|
|
4592
|
-
return this._push(
|
|
4593
|
+
return this._push(a.float.writeFloatLE, 4, v);
|
|
4593
4594
|
}, i.prototype.double = function(v) {
|
|
4594
|
-
return this._push(
|
|
4595
|
+
return this._push(a.float.writeDoubleLE, 8, v);
|
|
4595
4596
|
};
|
|
4596
|
-
var y =
|
|
4597
|
+
var y = a.Array.prototype.set ? function(v, m, _) {
|
|
4597
4598
|
m.set(v, _);
|
|
4598
4599
|
} : function(v, m, _) {
|
|
4599
4600
|
for (var A = 0; A < v.length; ++A)
|
|
@@ -4603,7 +4604,7 @@ function requireWriter() {
|
|
|
4603
4604
|
var m = v.length >>> 0;
|
|
4604
4605
|
if (!m)
|
|
4605
4606
|
return this._push(l, 1, 0);
|
|
4606
|
-
if (
|
|
4607
|
+
if (a.isString(v)) {
|
|
4607
4608
|
var _ = i.alloc(m = c.length(v));
|
|
4608
4609
|
c.decode(v, _, 0), v = _;
|
|
4609
4610
|
}
|
|
@@ -4630,11 +4631,11 @@ var writer_buffer, hasRequiredWriter_buffer;
|
|
|
4630
4631
|
function requireWriter_buffer() {
|
|
4631
4632
|
if (hasRequiredWriter_buffer) return writer_buffer;
|
|
4632
4633
|
hasRequiredWriter_buffer = 1, writer_buffer = h;
|
|
4633
|
-
var
|
|
4634
|
-
(h.prototype = Object.create(
|
|
4634
|
+
var a = requireWriter();
|
|
4635
|
+
(h.prototype = Object.create(a.prototype)).constructor = h;
|
|
4635
4636
|
var f = requireMinimal();
|
|
4636
4637
|
function h() {
|
|
4637
|
-
|
|
4638
|
+
a.call(this);
|
|
4638
4639
|
}
|
|
4639
4640
|
h._configure = function() {
|
|
4640
4641
|
h.alloc = f._Buffer_allocUnsafe, h.writeBytesBuffer = f.Buffer && f.Buffer.prototype instanceof Uint8Array && f.Buffer.prototype.set.name === "set" ? function(n, e, r) {
|
|
@@ -4662,70 +4663,70 @@ var reader, hasRequiredReader;
|
|
|
4662
4663
|
function requireReader() {
|
|
4663
4664
|
if (hasRequiredReader) return reader;
|
|
4664
4665
|
hasRequiredReader = 1, reader = n;
|
|
4665
|
-
var
|
|
4666
|
-
function d(s,
|
|
4667
|
-
return RangeError("index out of range: " + s.pos + " + " + (
|
|
4666
|
+
var a = requireMinimal(), f, h = a.LongBits, c = a.utf8;
|
|
4667
|
+
function d(s, u) {
|
|
4668
|
+
return RangeError("index out of range: " + s.pos + " + " + (u || 1) + " > " + s.len);
|
|
4668
4669
|
}
|
|
4669
4670
|
function n(s) {
|
|
4670
4671
|
this.buf = s, this.pos = 0, this.len = s.length;
|
|
4671
4672
|
}
|
|
4672
|
-
var e = typeof Uint8Array < "u" ? function(
|
|
4673
|
-
if (
|
|
4674
|
-
return new n(
|
|
4673
|
+
var e = typeof Uint8Array < "u" ? function(u) {
|
|
4674
|
+
if (u instanceof Uint8Array || Array.isArray(u))
|
|
4675
|
+
return new n(u);
|
|
4675
4676
|
throw Error("illegal buffer");
|
|
4676
|
-
} : function(
|
|
4677
|
-
if (Array.isArray(
|
|
4678
|
-
return new n(
|
|
4677
|
+
} : function(u) {
|
|
4678
|
+
if (Array.isArray(u))
|
|
4679
|
+
return new n(u);
|
|
4679
4680
|
throw Error("illegal buffer");
|
|
4680
4681
|
}, r = function() {
|
|
4681
|
-
return
|
|
4682
|
+
return a.Buffer ? function(o) {
|
|
4682
4683
|
return (n.create = function(y) {
|
|
4683
|
-
return
|
|
4684
|
+
return a.Buffer.isBuffer(y) ? new f(y) : e(y);
|
|
4684
4685
|
})(o);
|
|
4685
4686
|
} : e;
|
|
4686
4687
|
};
|
|
4687
|
-
n.create = r(), n.prototype._slice =
|
|
4688
|
-
|
|
4689
|
-
var
|
|
4688
|
+
n.create = r(), n.prototype._slice = a.Array.prototype.subarray || /* istanbul ignore next */
|
|
4689
|
+
a.Array.prototype.slice, n.prototype.uint32 = /* @__PURE__ */ function() {
|
|
4690
|
+
var u = 4294967295;
|
|
4690
4691
|
return function() {
|
|
4691
|
-
if (
|
|
4692
|
+
if (u = (this.buf[this.pos] & 127) >>> 0, this.buf[this.pos++] < 128 || (u = (u | (this.buf[this.pos] & 127) << 7) >>> 0, this.buf[this.pos++] < 128) || (u = (u | (this.buf[this.pos] & 127) << 14) >>> 0, this.buf[this.pos++] < 128) || (u = (u | (this.buf[this.pos] & 127) << 21) >>> 0, this.buf[this.pos++] < 128) || (u = (u | (this.buf[this.pos] & 15) << 28) >>> 0, this.buf[this.pos++] < 128)) return u;
|
|
4692
4693
|
if ((this.pos += 5) > this.len)
|
|
4693
4694
|
throw this.pos = this.len, d(this, 10);
|
|
4694
|
-
return
|
|
4695
|
+
return u;
|
|
4695
4696
|
};
|
|
4696
4697
|
}(), n.prototype.int32 = function() {
|
|
4697
4698
|
return this.uint32() | 0;
|
|
4698
4699
|
}, n.prototype.sint32 = function() {
|
|
4699
|
-
var
|
|
4700
|
-
return
|
|
4700
|
+
var u = this.uint32();
|
|
4701
|
+
return u >>> 1 ^ -(u & 1) | 0;
|
|
4701
4702
|
};
|
|
4702
4703
|
function i() {
|
|
4703
|
-
var s = new h(0, 0),
|
|
4704
|
+
var s = new h(0, 0), u = 0;
|
|
4704
4705
|
if (this.len - this.pos > 4) {
|
|
4705
|
-
for (;
|
|
4706
|
-
if (s.lo = (s.lo | (this.buf[this.pos] & 127) <<
|
|
4706
|
+
for (; u < 4; ++u)
|
|
4707
|
+
if (s.lo = (s.lo | (this.buf[this.pos] & 127) << u * 7) >>> 0, this.buf[this.pos++] < 128)
|
|
4707
4708
|
return s;
|
|
4708
4709
|
if (s.lo = (s.lo | (this.buf[this.pos] & 127) << 28) >>> 0, s.hi = (s.hi | (this.buf[this.pos] & 127) >> 4) >>> 0, this.buf[this.pos++] < 128)
|
|
4709
4710
|
return s;
|
|
4710
|
-
|
|
4711
|
+
u = 0;
|
|
4711
4712
|
} else {
|
|
4712
|
-
for (;
|
|
4713
|
+
for (; u < 3; ++u) {
|
|
4713
4714
|
if (this.pos >= this.len)
|
|
4714
4715
|
throw d(this);
|
|
4715
|
-
if (s.lo = (s.lo | (this.buf[this.pos] & 127) <<
|
|
4716
|
+
if (s.lo = (s.lo | (this.buf[this.pos] & 127) << u * 7) >>> 0, this.buf[this.pos++] < 128)
|
|
4716
4717
|
return s;
|
|
4717
4718
|
}
|
|
4718
|
-
return s.lo = (s.lo | (this.buf[this.pos++] & 127) <<
|
|
4719
|
+
return s.lo = (s.lo | (this.buf[this.pos++] & 127) << u * 7) >>> 0, s;
|
|
4719
4720
|
}
|
|
4720
4721
|
if (this.len - this.pos > 4) {
|
|
4721
|
-
for (;
|
|
4722
|
-
if (s.hi = (s.hi | (this.buf[this.pos] & 127) <<
|
|
4722
|
+
for (; u < 5; ++u)
|
|
4723
|
+
if (s.hi = (s.hi | (this.buf[this.pos] & 127) << u * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
|
|
4723
4724
|
return s;
|
|
4724
4725
|
} else
|
|
4725
|
-
for (;
|
|
4726
|
+
for (; u < 5; ++u) {
|
|
4726
4727
|
if (this.pos >= this.len)
|
|
4727
4728
|
throw d(this);
|
|
4728
|
-
if (s.hi = (s.hi | (this.buf[this.pos] & 127) <<
|
|
4729
|
+
if (s.hi = (s.hi | (this.buf[this.pos] & 127) << u * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
|
|
4729
4730
|
return s;
|
|
4730
4731
|
}
|
|
4731
4732
|
throw Error("invalid varint encoding");
|
|
@@ -4733,8 +4734,8 @@ function requireReader() {
|
|
|
4733
4734
|
n.prototype.bool = function() {
|
|
4734
4735
|
return this.uint32() !== 0;
|
|
4735
4736
|
};
|
|
4736
|
-
function t(s,
|
|
4737
|
-
return (s[
|
|
4737
|
+
function t(s, u) {
|
|
4738
|
+
return (s[u - 4] | s[u - 3] << 8 | s[u - 2] << 16 | s[u - 1] << 24) >>> 0;
|
|
4738
4739
|
}
|
|
4739
4740
|
n.prototype.fixed32 = function() {
|
|
4740
4741
|
if (this.pos + 4 > this.len)
|
|
@@ -4753,32 +4754,32 @@ function requireReader() {
|
|
|
4753
4754
|
return n.prototype.float = function() {
|
|
4754
4755
|
if (this.pos + 4 > this.len)
|
|
4755
4756
|
throw d(this, 4);
|
|
4756
|
-
var
|
|
4757
|
-
return this.pos += 4,
|
|
4757
|
+
var u = a.float.readFloatLE(this.buf, this.pos);
|
|
4758
|
+
return this.pos += 4, u;
|
|
4758
4759
|
}, n.prototype.double = function() {
|
|
4759
4760
|
if (this.pos + 8 > this.len)
|
|
4760
4761
|
throw d(this, 4);
|
|
4761
|
-
var
|
|
4762
|
-
return this.pos += 8,
|
|
4762
|
+
var u = a.float.readDoubleLE(this.buf, this.pos);
|
|
4763
|
+
return this.pos += 8, u;
|
|
4763
4764
|
}, n.prototype.bytes = function() {
|
|
4764
|
-
var
|
|
4765
|
+
var u = this.uint32(), o = this.pos, p = this.pos + u;
|
|
4765
4766
|
if (p > this.len)
|
|
4766
|
-
throw d(this,
|
|
4767
|
-
if (this.pos +=
|
|
4767
|
+
throw d(this, u);
|
|
4768
|
+
if (this.pos += u, Array.isArray(this.buf))
|
|
4768
4769
|
return this.buf.slice(o, p);
|
|
4769
4770
|
if (o === p) {
|
|
4770
|
-
var y =
|
|
4771
|
+
var y = a.Buffer;
|
|
4771
4772
|
return y ? y.alloc(0) : new this.buf.constructor(0);
|
|
4772
4773
|
}
|
|
4773
4774
|
return this._slice.call(this.buf, o, p);
|
|
4774
4775
|
}, n.prototype.string = function() {
|
|
4775
|
-
var
|
|
4776
|
-
return c.read(
|
|
4777
|
-
}, n.prototype.skip = function(
|
|
4778
|
-
if (typeof
|
|
4779
|
-
if (this.pos +
|
|
4780
|
-
throw d(this,
|
|
4781
|
-
this.pos +=
|
|
4776
|
+
var u = this.bytes();
|
|
4777
|
+
return c.read(u, 0, u.length);
|
|
4778
|
+
}, n.prototype.skip = function(u) {
|
|
4779
|
+
if (typeof u == "number") {
|
|
4780
|
+
if (this.pos + u > this.len)
|
|
4781
|
+
throw d(this, u);
|
|
4782
|
+
this.pos += u;
|
|
4782
4783
|
} else
|
|
4783
4784
|
do
|
|
4784
4785
|
if (this.pos >= this.len)
|
|
@@ -4810,25 +4811,25 @@ function requireReader() {
|
|
|
4810
4811
|
return this;
|
|
4811
4812
|
}, n._configure = function(s) {
|
|
4812
4813
|
f = s, n.create = r(), f._configure();
|
|
4813
|
-
var
|
|
4814
|
+
var u = a.Long ? "toLong" : (
|
|
4814
4815
|
/* istanbul ignore next */
|
|
4815
4816
|
"toNumber"
|
|
4816
4817
|
);
|
|
4817
|
-
|
|
4818
|
+
a.merge(n.prototype, {
|
|
4818
4819
|
int64: function() {
|
|
4819
|
-
return i.call(this)[
|
|
4820
|
+
return i.call(this)[u](!1);
|
|
4820
4821
|
},
|
|
4821
4822
|
uint64: function() {
|
|
4822
|
-
return i.call(this)[
|
|
4823
|
+
return i.call(this)[u](!0);
|
|
4823
4824
|
},
|
|
4824
4825
|
sint64: function() {
|
|
4825
|
-
return i.call(this).zzDecode()[
|
|
4826
|
+
return i.call(this).zzDecode()[u](!1);
|
|
4826
4827
|
},
|
|
4827
4828
|
fixed64: function() {
|
|
4828
|
-
return l.call(this)[
|
|
4829
|
+
return l.call(this)[u](!0);
|
|
4829
4830
|
},
|
|
4830
4831
|
sfixed64: function() {
|
|
4831
|
-
return l.call(this)[
|
|
4832
|
+
return l.call(this)[u](!1);
|
|
4832
4833
|
}
|
|
4833
4834
|
});
|
|
4834
4835
|
}, reader;
|
|
@@ -4837,11 +4838,11 @@ var reader_buffer, hasRequiredReader_buffer;
|
|
|
4837
4838
|
function requireReader_buffer() {
|
|
4838
4839
|
if (hasRequiredReader_buffer) return reader_buffer;
|
|
4839
4840
|
hasRequiredReader_buffer = 1, reader_buffer = h;
|
|
4840
|
-
var
|
|
4841
|
-
(h.prototype = Object.create(
|
|
4841
|
+
var a = requireReader();
|
|
4842
|
+
(h.prototype = Object.create(a.prototype)).constructor = h;
|
|
4842
4843
|
var f = requireMinimal();
|
|
4843
4844
|
function h(c) {
|
|
4844
|
-
|
|
4845
|
+
a.call(this, c);
|
|
4845
4846
|
}
|
|
4846
4847
|
return h._configure = function() {
|
|
4847
4848
|
f.Buffer && (h.prototype._slice = f.Buffer.prototype.slice);
|
|
@@ -4854,19 +4855,19 @@ var rpc = {}, service$1, hasRequiredService$1;
|
|
|
4854
4855
|
function requireService$1() {
|
|
4855
4856
|
if (hasRequiredService$1) return service$1;
|
|
4856
4857
|
hasRequiredService$1 = 1, service$1 = f;
|
|
4857
|
-
var
|
|
4858
|
-
(f.prototype = Object.create(
|
|
4858
|
+
var a = requireMinimal();
|
|
4859
|
+
(f.prototype = Object.create(a.EventEmitter.prototype)).constructor = f;
|
|
4859
4860
|
function f(h, c, d) {
|
|
4860
4861
|
if (typeof h != "function")
|
|
4861
4862
|
throw TypeError("rpcImpl must be a function");
|
|
4862
|
-
|
|
4863
|
+
a.EventEmitter.call(this), this.rpcImpl = h, this.requestDelimited = !!c, this.responseDelimited = !!d;
|
|
4863
4864
|
}
|
|
4864
4865
|
return f.prototype.rpcCall = function h(c, d, n, e, r) {
|
|
4865
4866
|
if (!e)
|
|
4866
4867
|
throw TypeError("request must be specified");
|
|
4867
4868
|
var i = this;
|
|
4868
4869
|
if (!r)
|
|
4869
|
-
return
|
|
4870
|
+
return a.asPromise(h, i, c, d, n, e);
|
|
4870
4871
|
if (!i.rpcImpl) {
|
|
4871
4872
|
setTimeout(function() {
|
|
4872
4873
|
r(Error("already ended"));
|
|
@@ -4890,8 +4891,8 @@ function requireService$1() {
|
|
|
4890
4891
|
if (!(s instanceof n))
|
|
4891
4892
|
try {
|
|
4892
4893
|
s = n[i.responseDelimited ? "decodeDelimited" : "decode"](s);
|
|
4893
|
-
} catch (
|
|
4894
|
-
return i.emit("error",
|
|
4894
|
+
} catch (u) {
|
|
4895
|
+
return i.emit("error", u, c), r(u);
|
|
4895
4896
|
}
|
|
4896
4897
|
return i.emit("data", s, c), r(null, s);
|
|
4897
4898
|
}
|
|
@@ -4908,8 +4909,8 @@ function requireService$1() {
|
|
|
4908
4909
|
}
|
|
4909
4910
|
var hasRequiredRpc;
|
|
4910
4911
|
function requireRpc() {
|
|
4911
|
-
return hasRequiredRpc || (hasRequiredRpc = 1, function(
|
|
4912
|
-
var f =
|
|
4912
|
+
return hasRequiredRpc || (hasRequiredRpc = 1, function(a) {
|
|
4913
|
+
var f = a;
|
|
4913
4914
|
f.Service = requireService$1();
|
|
4914
4915
|
}(rpc)), rpc;
|
|
4915
4916
|
}
|
|
@@ -4919,8 +4920,8 @@ function requireRoots() {
|
|
|
4919
4920
|
}
|
|
4920
4921
|
var hasRequiredIndexMinimal;
|
|
4921
4922
|
function requireIndexMinimal() {
|
|
4922
|
-
return hasRequiredIndexMinimal || (hasRequiredIndexMinimal = 1, function(
|
|
4923
|
-
var f =
|
|
4923
|
+
return hasRequiredIndexMinimal || (hasRequiredIndexMinimal = 1, function(a) {
|
|
4924
|
+
var f = a;
|
|
4924
4925
|
f.build = "minimal", f.Writer = requireWriter(), f.BufferWriter = requireWriter_buffer(), f.Reader = requireReader(), f.BufferReader = requireReader_buffer(), f.util = requireMinimal(), f.rpc = requireRpc(), f.roots = requireRoots(), f.configure = h;
|
|
4925
4926
|
function h() {
|
|
4926
4927
|
f.util._configure(), f.Writer._configure(f.BufferWriter), f.Reader._configure(f.BufferReader);
|
|
@@ -4931,24 +4932,24 @@ function requireIndexMinimal() {
|
|
|
4931
4932
|
var types = {}, util = { exports: {} }, codegen_1, hasRequiredCodegen;
|
|
4932
4933
|
function requireCodegen() {
|
|
4933
4934
|
if (hasRequiredCodegen) return codegen_1;
|
|
4934
|
-
hasRequiredCodegen = 1, codegen_1 =
|
|
4935
|
-
function
|
|
4935
|
+
hasRequiredCodegen = 1, codegen_1 = a;
|
|
4936
|
+
function a(f, h) {
|
|
4936
4937
|
typeof f == "string" && (h = f, f = void 0);
|
|
4937
4938
|
var c = [];
|
|
4938
4939
|
function d(e) {
|
|
4939
4940
|
if (typeof e != "string") {
|
|
4940
4941
|
var r = n();
|
|
4941
|
-
if (
|
|
4942
|
+
if (a.verbose && console.log("codegen: " + r), r = "return " + r, e) {
|
|
4942
4943
|
for (var i = Object.keys(e), t = new Array(i.length + 1), l = new Array(i.length), s = 0; s < i.length; )
|
|
4943
4944
|
t[s] = i[s], l[s] = e[i[s++]];
|
|
4944
4945
|
return t[s] = r, Function.apply(null, t).apply(null, l);
|
|
4945
4946
|
}
|
|
4946
4947
|
return Function(r)();
|
|
4947
4948
|
}
|
|
4948
|
-
for (var
|
|
4949
|
-
|
|
4949
|
+
for (var u = new Array(arguments.length - 1), o = 0; o < u.length; )
|
|
4950
|
+
u[o] = arguments[++o];
|
|
4950
4951
|
if (o = 0, e = e.replace(/%([%dfijs])/g, function(y, E) {
|
|
4951
|
-
var v =
|
|
4952
|
+
var v = u[o++];
|
|
4952
4953
|
switch (E) {
|
|
4953
4954
|
case "d":
|
|
4954
4955
|
case "f":
|
|
@@ -4961,7 +4962,7 @@ function requireCodegen() {
|
|
|
4961
4962
|
return String(v);
|
|
4962
4963
|
}
|
|
4963
4964
|
return "%";
|
|
4964
|
-
}), o !==
|
|
4965
|
+
}), o !== u.length)
|
|
4965
4966
|
throw Error("parameter count mismatch");
|
|
4966
4967
|
return c.push(e), d;
|
|
4967
4968
|
}
|
|
@@ -4973,17 +4974,17 @@ function requireCodegen() {
|
|
|
4973
4974
|
}
|
|
4974
4975
|
return d.toString = n, d;
|
|
4975
4976
|
}
|
|
4976
|
-
return
|
|
4977
|
+
return a.verbose = !1, codegen_1;
|
|
4977
4978
|
}
|
|
4978
4979
|
var fetch_1, hasRequiredFetch;
|
|
4979
4980
|
function requireFetch() {
|
|
4980
4981
|
if (hasRequiredFetch) return fetch_1;
|
|
4981
4982
|
hasRequiredFetch = 1, fetch_1 = c;
|
|
4982
|
-
var
|
|
4983
|
+
var a = requireAspromise(), f = requireInquire(), h = f("fs");
|
|
4983
4984
|
function c(d, n, e) {
|
|
4984
4985
|
return typeof n == "function" ? (e = n, n = {}) : n || (n = {}), e ? !n.xhr && h && h.readFile ? h.readFile(d, function(i, t) {
|
|
4985
4986
|
return i && typeof XMLHttpRequest < "u" ? c.xhr(d, n, e) : i ? e(i) : e(null, n.binary ? t : t.toString("utf8"));
|
|
4986
|
-
}) : c.xhr(d, n, e) :
|
|
4987
|
+
}) : c.xhr(d, n, e) : a(c, this, d, n);
|
|
4987
4988
|
}
|
|
4988
4989
|
return c.xhr = function(n, e, r) {
|
|
4989
4990
|
var i = new XMLHttpRequest();
|
|
@@ -5007,8 +5008,8 @@ function requireFetch() {
|
|
|
5007
5008
|
}
|
|
5008
5009
|
var path = {}, hasRequiredPath;
|
|
5009
5010
|
function requirePath() {
|
|
5010
|
-
return hasRequiredPath || (hasRequiredPath = 1, function(
|
|
5011
|
-
var f =
|
|
5011
|
+
return hasRequiredPath || (hasRequiredPath = 1, function(a) {
|
|
5012
|
+
var f = a, h = (
|
|
5012
5013
|
/**
|
|
5013
5014
|
* Tests if the specified path is absolute.
|
|
5014
5015
|
* @param {string} path Path to test
|
|
@@ -5041,36 +5042,36 @@ var namespace, hasRequiredNamespace;
|
|
|
5041
5042
|
function requireNamespace() {
|
|
5042
5043
|
if (hasRequiredNamespace) return namespace;
|
|
5043
5044
|
hasRequiredNamespace = 1, namespace = i;
|
|
5044
|
-
var
|
|
5045
|
-
((i.prototype = Object.create(
|
|
5045
|
+
var a = requireObject();
|
|
5046
|
+
((i.prototype = Object.create(a.prototype)).constructor = i).className = "Namespace";
|
|
5046
5047
|
var f = requireField(), h = requireUtil(), c = requireOneof(), d, n, e;
|
|
5047
|
-
i.fromJSON = function(s,
|
|
5048
|
-
return new i(s,
|
|
5048
|
+
i.fromJSON = function(s, u) {
|
|
5049
|
+
return new i(s, u.options).addJSON(u.nested);
|
|
5049
5050
|
};
|
|
5050
5051
|
function r(l, s) {
|
|
5051
5052
|
if (l && l.length) {
|
|
5052
|
-
for (var
|
|
5053
|
-
|
|
5054
|
-
return
|
|
5053
|
+
for (var u = {}, o = 0; o < l.length; ++o)
|
|
5054
|
+
u[l[o].name] = l[o].toJSON(s);
|
|
5055
|
+
return u;
|
|
5055
5056
|
}
|
|
5056
5057
|
}
|
|
5057
|
-
i.arrayToJSON = r, i.isReservedId = function(s,
|
|
5058
|
+
i.arrayToJSON = r, i.isReservedId = function(s, u) {
|
|
5058
5059
|
if (s) {
|
|
5059
5060
|
for (var o = 0; o < s.length; ++o)
|
|
5060
|
-
if (typeof s[o] != "string" && s[o][0] <=
|
|
5061
|
+
if (typeof s[o] != "string" && s[o][0] <= u && s[o][1] > u)
|
|
5061
5062
|
return !0;
|
|
5062
5063
|
}
|
|
5063
5064
|
return !1;
|
|
5064
|
-
}, i.isReservedName = function(s,
|
|
5065
|
+
}, i.isReservedName = function(s, u) {
|
|
5065
5066
|
if (s) {
|
|
5066
5067
|
for (var o = 0; o < s.length; ++o)
|
|
5067
|
-
if (s[o] ===
|
|
5068
|
+
if (s[o] === u)
|
|
5068
5069
|
return !0;
|
|
5069
5070
|
}
|
|
5070
5071
|
return !1;
|
|
5071
5072
|
};
|
|
5072
5073
|
function i(l, s) {
|
|
5073
|
-
|
|
5074
|
+
a.call(this, l, s), this.nested = void 0, this._nestedArray = null, this._lookupCache = {}, this._needsRecursiveFeatureResolution = !0, this._needsRecursiveResolve = !0;
|
|
5074
5075
|
}
|
|
5075
5076
|
function t(l) {
|
|
5076
5077
|
l._nestedArray = null, l._lookupCache = {};
|
|
@@ -5090,10 +5091,10 @@ function requireNamespace() {
|
|
|
5090
5091
|
r(this.nestedArray, s)
|
|
5091
5092
|
]);
|
|
5092
5093
|
}, i.prototype.addJSON = function(s) {
|
|
5093
|
-
var
|
|
5094
|
+
var u = this;
|
|
5094
5095
|
if (s)
|
|
5095
5096
|
for (var o = Object.keys(s), p = 0, y; p < o.length; ++p)
|
|
5096
|
-
y = s[o[p]],
|
|
5097
|
+
y = s[o[p]], u.add(
|
|
5097
5098
|
// most to least likely
|
|
5098
5099
|
(y.fields !== void 0 ? d.fromJSON : y.values !== void 0 ? e.fromJSON : y.methods !== void 0 ? n.fromJSON : y.id !== void 0 ? f.fromJSON : i.fromJSON)(o[p], y)
|
|
5099
5100
|
);
|
|
@@ -5110,12 +5111,12 @@ function requireNamespace() {
|
|
|
5110
5111
|
if (!this.nested)
|
|
5111
5112
|
this.nested = {};
|
|
5112
5113
|
else {
|
|
5113
|
-
var
|
|
5114
|
-
if (
|
|
5115
|
-
if (
|
|
5116
|
-
for (var o =
|
|
5114
|
+
var u = this.get(s.name);
|
|
5115
|
+
if (u)
|
|
5116
|
+
if (u instanceof i && s instanceof i && !(u instanceof d || u instanceof n)) {
|
|
5117
|
+
for (var o = u.nestedArray, p = 0; p < o.length; ++p)
|
|
5117
5118
|
s.add(o[p]);
|
|
5118
|
-
this.remove(
|
|
5119
|
+
this.remove(u), this.nested || (this.nested = {}), s.setOptions(u.options, !0);
|
|
5119
5120
|
} else
|
|
5120
5121
|
throw Error("duplicate name '" + s.name + "' in " + this);
|
|
5121
5122
|
}
|
|
@@ -5124,12 +5125,12 @@ function requireNamespace() {
|
|
|
5124
5125
|
y._needsRecursiveFeatureResolution = !0, y._needsRecursiveResolve = !0;
|
|
5125
5126
|
return s.onAdd(this), t(this);
|
|
5126
5127
|
}, i.prototype.remove = function(s) {
|
|
5127
|
-
if (!(s instanceof
|
|
5128
|
+
if (!(s instanceof a))
|
|
5128
5129
|
throw TypeError("object must be a ReflectionObject");
|
|
5129
5130
|
if (s.parent !== this)
|
|
5130
5131
|
throw Error(s + " is not a member of " + this);
|
|
5131
5132
|
return delete this.nested[s.name], Object.keys(this.nested).length || (this.nested = void 0), s.onRemove(this), t(this);
|
|
5132
|
-
}, i.prototype.define = function(s,
|
|
5133
|
+
}, i.prototype.define = function(s, u) {
|
|
5133
5134
|
if (h.isString(s))
|
|
5134
5135
|
s = s.split(".");
|
|
5135
5136
|
else if (!Array.isArray(s))
|
|
@@ -5144,20 +5145,20 @@ function requireNamespace() {
|
|
|
5144
5145
|
} else
|
|
5145
5146
|
o.add(o = new i(p));
|
|
5146
5147
|
}
|
|
5147
|
-
return
|
|
5148
|
+
return u && o.addJSON(u), o;
|
|
5148
5149
|
}, i.prototype.resolveAll = function() {
|
|
5149
5150
|
if (!this._needsRecursiveResolve) return this;
|
|
5150
5151
|
this._resolveFeaturesRecursive(this._edition);
|
|
5151
|
-
var s = this.nestedArray,
|
|
5152
|
-
for (this.resolve();
|
|
5153
|
-
s[
|
|
5152
|
+
var s = this.nestedArray, u = 0;
|
|
5153
|
+
for (this.resolve(); u < s.length; )
|
|
5154
|
+
s[u] instanceof i ? s[u++].resolveAll() : s[u++].resolve();
|
|
5154
5155
|
return this._needsRecursiveResolve = !1, this;
|
|
5155
5156
|
}, i.prototype._resolveFeaturesRecursive = function(s) {
|
|
5156
|
-
return this._needsRecursiveFeatureResolution ? (this._needsRecursiveFeatureResolution = !1, s = this._edition || s,
|
|
5157
|
-
|
|
5157
|
+
return this._needsRecursiveFeatureResolution ? (this._needsRecursiveFeatureResolution = !1, s = this._edition || s, a.prototype._resolveFeaturesRecursive.call(this, s), this.nestedArray.forEach((u) => {
|
|
5158
|
+
u._resolveFeaturesRecursive(s);
|
|
5158
5159
|
}), this) : this;
|
|
5159
|
-
}, i.prototype.lookup = function(s,
|
|
5160
|
-
if (typeof
|
|
5160
|
+
}, i.prototype.lookup = function(s, u, o) {
|
|
5161
|
+
if (typeof u == "boolean" ? (o = u, u = void 0) : u && !Array.isArray(u) && (u = [u]), h.isString(s) && s.length) {
|
|
5161
5162
|
if (s === ".")
|
|
5162
5163
|
return this.root;
|
|
5163
5164
|
s = s.split(".");
|
|
@@ -5165,61 +5166,61 @@ function requireNamespace() {
|
|
|
5165
5166
|
return this;
|
|
5166
5167
|
var p = s.join(".");
|
|
5167
5168
|
if (s[0] === "")
|
|
5168
|
-
return this.root.lookup(s.slice(1),
|
|
5169
|
+
return this.root.lookup(s.slice(1), u);
|
|
5169
5170
|
var y = this.root._fullyQualifiedObjects && this.root._fullyQualifiedObjects["." + p];
|
|
5170
|
-
if (y && (!
|
|
5171
|
+
if (y && (!u || u.indexOf(y.constructor) > -1) || (y = this._lookupImpl(s, p), y && (!u || u.indexOf(y.constructor) > -1)))
|
|
5171
5172
|
return y;
|
|
5172
5173
|
if (o)
|
|
5173
5174
|
return null;
|
|
5174
5175
|
for (var E = this; E.parent; ) {
|
|
5175
|
-
if (y = E.parent._lookupImpl(s, p), y && (!
|
|
5176
|
+
if (y = E.parent._lookupImpl(s, p), y && (!u || u.indexOf(y.constructor) > -1))
|
|
5176
5177
|
return y;
|
|
5177
5178
|
E = E.parent;
|
|
5178
5179
|
}
|
|
5179
5180
|
return null;
|
|
5180
|
-
}, i.prototype._lookupImpl = function(s,
|
|
5181
|
-
if (Object.prototype.hasOwnProperty.call(this._lookupCache,
|
|
5182
|
-
return this._lookupCache[
|
|
5181
|
+
}, i.prototype._lookupImpl = function(s, u) {
|
|
5182
|
+
if (Object.prototype.hasOwnProperty.call(this._lookupCache, u))
|
|
5183
|
+
return this._lookupCache[u];
|
|
5183
5184
|
var o = this.get(s[0]), p = null;
|
|
5184
5185
|
if (o)
|
|
5185
5186
|
s.length === 1 ? p = o : o instanceof i && (s = s.slice(1), p = o._lookupImpl(s, s.join(".")));
|
|
5186
5187
|
else
|
|
5187
5188
|
for (var y = 0; y < this.nestedArray.length; ++y)
|
|
5188
|
-
this._nestedArray[y] instanceof i && (o = this._nestedArray[y]._lookupImpl(s,
|
|
5189
|
-
return this._lookupCache[
|
|
5189
|
+
this._nestedArray[y] instanceof i && (o = this._nestedArray[y]._lookupImpl(s, u)) && (p = o);
|
|
5190
|
+
return this._lookupCache[u] = p, p;
|
|
5190
5191
|
}, i.prototype.lookupType = function(s) {
|
|
5191
|
-
var
|
|
5192
|
-
if (!
|
|
5192
|
+
var u = this.lookup(s, [d]);
|
|
5193
|
+
if (!u)
|
|
5193
5194
|
throw Error("no such type: " + s);
|
|
5194
|
-
return
|
|
5195
|
+
return u;
|
|
5195
5196
|
}, i.prototype.lookupEnum = function(s) {
|
|
5196
|
-
var
|
|
5197
|
-
if (!
|
|
5197
|
+
var u = this.lookup(s, [e]);
|
|
5198
|
+
if (!u)
|
|
5198
5199
|
throw Error("no such Enum '" + s + "' in " + this);
|
|
5199
|
-
return
|
|
5200
|
+
return u;
|
|
5200
5201
|
}, i.prototype.lookupTypeOrEnum = function(s) {
|
|
5201
|
-
var
|
|
5202
|
-
if (!
|
|
5202
|
+
var u = this.lookup(s, [d, e]);
|
|
5203
|
+
if (!u)
|
|
5203
5204
|
throw Error("no such Type or Enum '" + s + "' in " + this);
|
|
5204
|
-
return
|
|
5205
|
+
return u;
|
|
5205
5206
|
}, i.prototype.lookupService = function(s) {
|
|
5206
|
-
var
|
|
5207
|
-
if (!
|
|
5207
|
+
var u = this.lookup(s, [n]);
|
|
5208
|
+
if (!u)
|
|
5208
5209
|
throw Error("no such Service '" + s + "' in " + this);
|
|
5209
|
-
return
|
|
5210
|
-
}, i._configure = function(l, s,
|
|
5211
|
-
d = l, n = s, e =
|
|
5210
|
+
return u;
|
|
5211
|
+
}, i._configure = function(l, s, u) {
|
|
5212
|
+
d = l, n = s, e = u;
|
|
5212
5213
|
}, namespace;
|
|
5213
5214
|
}
|
|
5214
5215
|
var mapfield, hasRequiredMapfield;
|
|
5215
5216
|
function requireMapfield() {
|
|
5216
5217
|
if (hasRequiredMapfield) return mapfield;
|
|
5217
5218
|
hasRequiredMapfield = 1, mapfield = c;
|
|
5218
|
-
var
|
|
5219
|
-
((c.prototype = Object.create(
|
|
5219
|
+
var a = requireField();
|
|
5220
|
+
((c.prototype = Object.create(a.prototype)).constructor = c).className = "MapField";
|
|
5220
5221
|
var f = requireTypes(), h = requireUtil();
|
|
5221
5222
|
function c(d, n, e, r, i, t) {
|
|
5222
|
-
if (
|
|
5223
|
+
if (a.call(this, d, n, r, void 0, void 0, i, t), !h.isString(e))
|
|
5223
5224
|
throw TypeError("keyType must be a string");
|
|
5224
5225
|
this.keyType = e, this.resolvedKeyType = null, this.map = !0;
|
|
5225
5226
|
}
|
|
@@ -5246,7 +5247,7 @@ function requireMapfield() {
|
|
|
5246
5247
|
return this;
|
|
5247
5248
|
if (f.mapKey[this.keyType] === void 0)
|
|
5248
5249
|
throw Error("invalid key type: " + this.keyType);
|
|
5249
|
-
return
|
|
5250
|
+
return a.prototype.resolve.call(this);
|
|
5250
5251
|
}, c.d = function(n, e, r) {
|
|
5251
5252
|
return typeof r == "function" ? r = h.decorateType(r).name : r && typeof r == "object" && (r = h.decorateEnum(r).name), function(t, l) {
|
|
5252
5253
|
h.decorateType(t.constructor).add(new c(l, n, e, r));
|
|
@@ -5257,8 +5258,8 @@ var method, hasRequiredMethod;
|
|
|
5257
5258
|
function requireMethod() {
|
|
5258
5259
|
if (hasRequiredMethod) return method;
|
|
5259
5260
|
hasRequiredMethod = 1, method = h;
|
|
5260
|
-
var
|
|
5261
|
-
((h.prototype = Object.create(
|
|
5261
|
+
var a = requireObject();
|
|
5262
|
+
((h.prototype = Object.create(a.prototype)).constructor = h).className = "Method";
|
|
5262
5263
|
var f = requireUtil();
|
|
5263
5264
|
function h(c, d, n, e, r, i, t, l, s) {
|
|
5264
5265
|
if (f.isObject(r) ? (t = r, r = i = void 0) : f.isObject(i) && (t = i, i = void 0), !(d === void 0 || f.isString(d)))
|
|
@@ -5267,7 +5268,7 @@ function requireMethod() {
|
|
|
5267
5268
|
throw TypeError("requestType must be a string");
|
|
5268
5269
|
if (!f.isString(e))
|
|
5269
5270
|
throw TypeError("responseType must be a string");
|
|
5270
|
-
|
|
5271
|
+
a.call(this, c, t), this.type = d || "rpc", this.requestType = n, this.requestStream = r ? !0 : void 0, this.responseType = e, this.responseStream = i ? !0 : void 0, this.resolvedRequestType = null, this.resolvedResponseType = null, this.comment = l, this.parsedOptions = s;
|
|
5271
5272
|
}
|
|
5272
5273
|
return h.fromJSON = function(d, n) {
|
|
5273
5274
|
return new h(d, n.type, n.requestType, n.responseType, n.requestStream, n.responseStream, n.options, n.comment, n.parsedOptions);
|
|
@@ -5293,18 +5294,18 @@ function requireMethod() {
|
|
|
5293
5294
|
this.parsedOptions
|
|
5294
5295
|
]);
|
|
5295
5296
|
}, h.prototype.resolve = function() {
|
|
5296
|
-
return this.resolved ? this : (this.resolvedRequestType = this.parent.lookupType(this.requestType), this.resolvedResponseType = this.parent.lookupType(this.responseType),
|
|
5297
|
+
return this.resolved ? this : (this.resolvedRequestType = this.parent.lookupType(this.requestType), this.resolvedResponseType = this.parent.lookupType(this.responseType), a.prototype.resolve.call(this));
|
|
5297
5298
|
}, method;
|
|
5298
5299
|
}
|
|
5299
5300
|
var service, hasRequiredService;
|
|
5300
5301
|
function requireService() {
|
|
5301
5302
|
if (hasRequiredService) return service;
|
|
5302
5303
|
hasRequiredService = 1, service = d;
|
|
5303
|
-
var
|
|
5304
|
-
((d.prototype = Object.create(
|
|
5304
|
+
var a = requireNamespace();
|
|
5305
|
+
((d.prototype = Object.create(a.prototype)).constructor = d).className = "Service";
|
|
5305
5306
|
var f = requireMethod(), h = requireUtil(), c = requireRpc();
|
|
5306
5307
|
function d(e, r) {
|
|
5307
|
-
|
|
5308
|
+
a.call(this, e, r), this.methods = {}, this._methodsArray = null;
|
|
5308
5309
|
}
|
|
5309
5310
|
d.fromJSON = function(r, i) {
|
|
5310
5311
|
var t = new d(r, i.options);
|
|
@@ -5313,14 +5314,14 @@ function requireService() {
|
|
|
5313
5314
|
t.add(f.fromJSON(l[s], i.methods[l[s]]));
|
|
5314
5315
|
return i.nested && t.addJSON(i.nested), i.edition && (t._edition = i.edition), t.comment = i.comment, t._defaultEdition = "proto3", t;
|
|
5315
5316
|
}, d.prototype.toJSON = function(r) {
|
|
5316
|
-
var i =
|
|
5317
|
+
var i = a.prototype.toJSON.call(this, r), t = r ? !!r.keepComments : !1;
|
|
5317
5318
|
return h.toObject([
|
|
5318
5319
|
"edition",
|
|
5319
5320
|
this._editionToJSON(),
|
|
5320
5321
|
"options",
|
|
5321
5322
|
i && i.options || void 0,
|
|
5322
5323
|
"methods",
|
|
5323
|
-
|
|
5324
|
+
a.arrayToJSON(this.methodsArray, r) || /* istanbul ignore next */
|
|
5324
5325
|
{},
|
|
5325
5326
|
"nested",
|
|
5326
5327
|
i && i.nested || void 0,
|
|
@@ -5336,36 +5337,36 @@ function requireService() {
|
|
|
5336
5337
|
return e._methodsArray = null, e;
|
|
5337
5338
|
}
|
|
5338
5339
|
return d.prototype.get = function(r) {
|
|
5339
|
-
return this.methods[r] ||
|
|
5340
|
+
return this.methods[r] || a.prototype.get.call(this, r);
|
|
5340
5341
|
}, d.prototype.resolveAll = function() {
|
|
5341
5342
|
if (!this._needsRecursiveResolve) return this;
|
|
5342
|
-
|
|
5343
|
+
a.prototype.resolve.call(this);
|
|
5343
5344
|
for (var r = this.methodsArray, i = 0; i < r.length; ++i)
|
|
5344
5345
|
r[i].resolve();
|
|
5345
5346
|
return this;
|
|
5346
5347
|
}, d.prototype._resolveFeaturesRecursive = function(r) {
|
|
5347
|
-
return this._needsRecursiveFeatureResolution ? (r = this._edition || r,
|
|
5348
|
+
return this._needsRecursiveFeatureResolution ? (r = this._edition || r, a.prototype._resolveFeaturesRecursive.call(this, r), this.methodsArray.forEach((i) => {
|
|
5348
5349
|
i._resolveFeaturesRecursive(r);
|
|
5349
5350
|
}), this) : this;
|
|
5350
5351
|
}, d.prototype.add = function(r) {
|
|
5351
5352
|
if (this.get(r.name))
|
|
5352
5353
|
throw Error("duplicate name '" + r.name + "' in " + this);
|
|
5353
|
-
return r instanceof f ? (this.methods[r.name] = r, r.parent = this, n(this)) :
|
|
5354
|
+
return r instanceof f ? (this.methods[r.name] = r, r.parent = this, n(this)) : a.prototype.add.call(this, r);
|
|
5354
5355
|
}, d.prototype.remove = function(r) {
|
|
5355
5356
|
if (r instanceof f) {
|
|
5356
5357
|
if (this.methods[r.name] !== r)
|
|
5357
5358
|
throw Error(r + " is not a member of " + this);
|
|
5358
5359
|
return delete this.methods[r.name], r.parent = null, n(this);
|
|
5359
5360
|
}
|
|
5360
|
-
return
|
|
5361
|
+
return a.prototype.remove.call(this, r);
|
|
5361
5362
|
}, d.prototype.create = function(r, i, t) {
|
|
5362
|
-
for (var l = new c.Service(r, i, t), s = 0,
|
|
5363
|
+
for (var l = new c.Service(r, i, t), s = 0, u; s < /* initializes */
|
|
5363
5364
|
this.methodsArray.length; ++s) {
|
|
5364
|
-
var o = h.lcFirst((
|
|
5365
|
+
var o = h.lcFirst((u = this._methodsArray[s]).resolve().name).replace(/[^$\\w_]/g, "");
|
|
5365
5366
|
l[o] = h.codegen(["r", "c"], h.isReserved(o) ? o + "_" : o)("return this.rpcCall(m,q,s,r,c)")({
|
|
5366
|
-
m:
|
|
5367
|
-
q:
|
|
5368
|
-
s:
|
|
5367
|
+
m: u,
|
|
5368
|
+
q: u.resolvedRequestType.ctor,
|
|
5369
|
+
s: u.resolvedResponseType.ctor
|
|
5369
5370
|
});
|
|
5370
5371
|
}
|
|
5371
5372
|
return l;
|
|
@@ -5375,7 +5376,7 @@ var message, hasRequiredMessage;
|
|
|
5375
5376
|
function requireMessage() {
|
|
5376
5377
|
if (hasRequiredMessage) return message;
|
|
5377
5378
|
hasRequiredMessage = 1, message = f;
|
|
5378
|
-
var
|
|
5379
|
+
var a = requireMinimal();
|
|
5379
5380
|
function f(h) {
|
|
5380
5381
|
if (h)
|
|
5381
5382
|
for (var c = Object.keys(h), d = 0; d < c.length; ++d) {
|
|
@@ -5400,23 +5401,23 @@ function requireMessage() {
|
|
|
5400
5401
|
}, f.toObject = function(c, d) {
|
|
5401
5402
|
return this.$type.toObject(c, d);
|
|
5402
5403
|
}, f.prototype.toJSON = function() {
|
|
5403
|
-
return this.$type.toObject(this,
|
|
5404
|
+
return this.$type.toObject(this, a.toJSONOptions);
|
|
5404
5405
|
}, message;
|
|
5405
5406
|
}
|
|
5406
5407
|
var decoder_1, hasRequiredDecoder;
|
|
5407
5408
|
function requireDecoder() {
|
|
5408
5409
|
if (hasRequiredDecoder) return decoder_1;
|
|
5409
5410
|
hasRequiredDecoder = 1, decoder_1 = d;
|
|
5410
|
-
var
|
|
5411
|
+
var a = require_enum(), f = requireTypes(), h = requireUtil();
|
|
5411
5412
|
function c(n) {
|
|
5412
5413
|
return "missing required '" + n.name + "'";
|
|
5413
5414
|
}
|
|
5414
5415
|
function d(n) {
|
|
5415
|
-
for (var e = h.codegen(["r", "l", "e"], n.name + "$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor" + (n.fieldsArray.filter(function(
|
|
5416
|
-
return
|
|
5416
|
+
for (var e = h.codegen(["r", "l", "e"], n.name + "$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor" + (n.fieldsArray.filter(function(u) {
|
|
5417
|
+
return u.map;
|
|
5417
5418
|
}).length ? ",k,value" : ""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"), r = 0; r < /* initializes */
|
|
5418
5419
|
n.fieldsArray.length; ++r) {
|
|
5419
|
-
var i = n._fieldsArray[r].resolve(), t = i.resolvedType instanceof
|
|
5420
|
+
var i = n._fieldsArray[r].resolve(), t = i.resolvedType instanceof a ? "int32" : i.type, l = "m" + h.safeProp(i.name);
|
|
5420
5421
|
e("case %i: {", i.id), i.map ? (e("if(%s===util.emptyObject)", l)("%s={}", l)("var c2 = r.uint32()+r.pos"), f.defaults[i.keyType] !== void 0 ? e("k=%j", f.defaults[i.keyType]) : e("k=null"), f.defaults[t] !== void 0 ? e("value=%j", f.defaults[t]) : e("value=null"), e("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break", i.keyType)("case 2:"), f.basic[t] === void 0 ? e("value=types[%i].decode(r,r.uint32())", r) : e("value=r.%s()", t), e("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"), f.long[i.keyType] !== void 0 ? e('%s[typeof k==="object"?util.longToHash(k):k]=value', l) : e("%s[k]=value", l)) : i.repeated ? (e("if(!(%s&&%s.length))", l, l)("%s=[]", l), f.packed[t] !== void 0 && e("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())", l, t)("}else"), f.basic[t] === void 0 ? e(i.delimited ? "%s.push(types[%i].decode(r,undefined,((t&~7)|4)))" : "%s.push(types[%i].decode(r,r.uint32()))", l, r) : e("%s.push(r.%s())", l, t)) : f.basic[t] === void 0 ? e(i.delimited ? "%s=types[%i].decode(r,undefined,((t&~7)|4))" : "%s=types[%i].decode(r,r.uint32())", l, r) : e("%s=r.%s()", l, t), e("break")("}");
|
|
5421
5422
|
}
|
|
5422
5423
|
for (e("default:")("r.skipType(t&7)")("break")("}")("}"), r = 0; r < n._fieldsArray.length; ++r) {
|
|
@@ -5431,13 +5432,13 @@ var verifier_1, hasRequiredVerifier;
|
|
|
5431
5432
|
function requireVerifier() {
|
|
5432
5433
|
if (hasRequiredVerifier) return verifier_1;
|
|
5433
5434
|
hasRequiredVerifier = 1, verifier_1 = n;
|
|
5434
|
-
var
|
|
5435
|
+
var a = require_enum(), f = requireUtil();
|
|
5435
5436
|
function h(e, r) {
|
|
5436
5437
|
return e.name + ": " + r + (e.repeated && r !== "array" ? "[]" : e.map && r !== "object" ? "{k:" + e.keyType + "}" : "") + " expected";
|
|
5437
5438
|
}
|
|
5438
5439
|
function c(e, r, i, t) {
|
|
5439
5440
|
if (r.resolvedType)
|
|
5440
|
-
if (r.resolvedType instanceof
|
|
5441
|
+
if (r.resolvedType instanceof a) {
|
|
5441
5442
|
e("switch(%s){", t)("default:")("return%j", h(r, "enum value"));
|
|
5442
5443
|
for (var l = Object.keys(r.resolvedType.values), s = 0; s < l.length; ++s) e("case %i:", r.resolvedType.values[l[s]]);
|
|
5443
5444
|
e("break")("}");
|
|
@@ -5502,17 +5503,17 @@ function requireVerifier() {
|
|
|
5502
5503
|
i.length && r("var p={}");
|
|
5503
5504
|
for (var l = 0; l < /* initializes */
|
|
5504
5505
|
e.fieldsArray.length; ++l) {
|
|
5505
|
-
var s = e._fieldsArray[l].resolve(),
|
|
5506
|
-
if (s.optional && r("if(%s!=null&&m.hasOwnProperty(%j)){",
|
|
5507
|
-
r("if(!util.isObject(%s))",
|
|
5506
|
+
var s = e._fieldsArray[l].resolve(), u = "m" + f.safeProp(s.name);
|
|
5507
|
+
if (s.optional && r("if(%s!=null&&m.hasOwnProperty(%j)){", u, s.name), s.map)
|
|
5508
|
+
r("if(!util.isObject(%s))", u)("return%j", h(s, "object"))("var k=Object.keys(%s)", u)("for(var i=0;i<k.length;++i){"), d(r, s, "k[i]"), c(r, s, l, u + "[k[i]]")("}");
|
|
5508
5509
|
else if (s.repeated)
|
|
5509
|
-
r("if(!Array.isArray(%s))",
|
|
5510
|
+
r("if(!Array.isArray(%s))", u)("return%j", h(s, "array"))("for(var i=0;i<%s.length;++i){", u), c(r, s, l, u + "[i]")("}");
|
|
5510
5511
|
else {
|
|
5511
5512
|
if (s.partOf) {
|
|
5512
5513
|
var o = f.safeProp(s.partOf.name);
|
|
5513
5514
|
t[s.partOf.name] === 1 && r("if(p%s===1)", o)("return%j", s.partOf.name + ": multiple values"), t[s.partOf.name] = 1, r("p%s=1", o);
|
|
5514
5515
|
}
|
|
5515
|
-
c(r, s, l,
|
|
5516
|
+
c(r, s, l, u);
|
|
5516
5517
|
}
|
|
5517
5518
|
s.optional && r("}");
|
|
5518
5519
|
}
|
|
@@ -5522,15 +5523,15 @@ function requireVerifier() {
|
|
|
5522
5523
|
}
|
|
5523
5524
|
var converter = {}, hasRequiredConverter;
|
|
5524
5525
|
function requireConverter() {
|
|
5525
|
-
return hasRequiredConverter || (hasRequiredConverter = 1, function(
|
|
5526
|
-
var f =
|
|
5526
|
+
return hasRequiredConverter || (hasRequiredConverter = 1, function(a) {
|
|
5527
|
+
var f = a, h = require_enum(), c = requireUtil();
|
|
5527
5528
|
function d(e, r, i, t) {
|
|
5528
5529
|
var l = !1;
|
|
5529
5530
|
if (r.resolvedType)
|
|
5530
5531
|
if (r.resolvedType instanceof h) {
|
|
5531
5532
|
e("switch(d%s){", t);
|
|
5532
|
-
for (var s = r.resolvedType.values,
|
|
5533
|
-
s[
|
|
5533
|
+
for (var s = r.resolvedType.values, u = Object.keys(s), o = 0; o < u.length; ++o)
|
|
5534
|
+
s[u[o]] === r.typeDefault && !l && (e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}', t, t, t), r.repeated || e("break"), l = !0), e("case%j:", u[o])("case %i:", s[u[o]])("m%s=%j", t, s[u[o]])("break");
|
|
5534
5535
|
e("}");
|
|
5535
5536
|
} else e('if(typeof d%s!=="object")', t)("throw TypeError(%j)", r.fullName + ": object expected")("m%s=types[%i].fromObject(d%s)", t, i, t);
|
|
5536
5537
|
else {
|
|
@@ -5576,25 +5577,25 @@ function requireConverter() {
|
|
|
5576
5577
|
if (!i.length) return t("return new this.ctor");
|
|
5577
5578
|
t("var m=new this.ctor");
|
|
5578
5579
|
for (var l = 0; l < i.length; ++l) {
|
|
5579
|
-
var s = i[l].resolve(),
|
|
5580
|
-
s.map ? (t("if(d%s){",
|
|
5580
|
+
var s = i[l].resolve(), u = c.safeProp(s.name);
|
|
5581
|
+
s.map ? (t("if(d%s){", u)('if(typeof d%s!=="object")', u)("throw TypeError(%j)", s.fullName + ": object expected")("m%s={}", u)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){", u), d(
|
|
5581
5582
|
t,
|
|
5582
5583
|
s,
|
|
5583
5584
|
/* not sorted */
|
|
5584
5585
|
l,
|
|
5585
|
-
|
|
5586
|
-
)("}")("}")) : s.repeated ? (t("if(d%s){",
|
|
5586
|
+
u + "[ks[i]]"
|
|
5587
|
+
)("}")("}")) : s.repeated ? (t("if(d%s){", u)("if(!Array.isArray(d%s))", u)("throw TypeError(%j)", s.fullName + ": array expected")("m%s=[]", u)("for(var i=0;i<d%s.length;++i){", u), d(
|
|
5587
5588
|
t,
|
|
5588
5589
|
s,
|
|
5589
5590
|
/* not sorted */
|
|
5590
5591
|
l,
|
|
5591
|
-
|
|
5592
|
-
)("}")("}")) : (s.resolvedType instanceof h || t("if(d%s!=null){",
|
|
5592
|
+
u + "[i]"
|
|
5593
|
+
)("}")("}")) : (s.resolvedType instanceof h || t("if(d%s!=null){", u), d(
|
|
5593
5594
|
t,
|
|
5594
5595
|
s,
|
|
5595
5596
|
/* not sorted */
|
|
5596
5597
|
l,
|
|
5597
|
-
|
|
5598
|
+
u
|
|
5598
5599
|
), s.resolvedType instanceof h || t("}"));
|
|
5599
5600
|
}
|
|
5600
5601
|
return t("return m");
|
|
@@ -5632,8 +5633,8 @@ function requireConverter() {
|
|
|
5632
5633
|
var i = r.fieldsArray.slice().sort(c.compareFieldsById);
|
|
5633
5634
|
if (!i.length)
|
|
5634
5635
|
return c.codegen()("return {}");
|
|
5635
|
-
for (var t = c.codegen(["m", "o"], r.name + "$toObject")("if(!o)")("o={}")("var d={}"), l = [], s = [],
|
|
5636
|
-
i[o].partOf || (i[o].resolve().repeated ? l : i[o].map ? s :
|
|
5636
|
+
for (var t = c.codegen(["m", "o"], r.name + "$toObject")("if(!o)")("o={}")("var d={}"), l = [], s = [], u = [], o = 0; o < i.length; ++o)
|
|
5637
|
+
i[o].partOf || (i[o].resolve().repeated ? l : i[o].map ? s : u).push(i[o]);
|
|
5637
5638
|
if (l.length) {
|
|
5638
5639
|
for (t("if(o.arrays||o.defaults){"), o = 0; o < l.length; ++o) t("d%s=[]", c.safeProp(l[o].name));
|
|
5639
5640
|
t("}");
|
|
@@ -5642,9 +5643,9 @@ function requireConverter() {
|
|
|
5642
5643
|
for (t("if(o.objects||o.defaults){"), o = 0; o < s.length; ++o) t("d%s={}", c.safeProp(s[o].name));
|
|
5643
5644
|
t("}");
|
|
5644
5645
|
}
|
|
5645
|
-
if (
|
|
5646
|
-
for (t("if(o.defaults){"), o = 0; o <
|
|
5647
|
-
var p =
|
|
5646
|
+
if (u.length) {
|
|
5647
|
+
for (t("if(o.defaults){"), o = 0; o < u.length; ++o) {
|
|
5648
|
+
var p = u[o], y = c.safeProp(p.name);
|
|
5648
5649
|
if (p.resolvedType instanceof h) t("d%s=o.enums===String?%j:%j", y, p.resolvedType.valuesById[p.typeDefault], p.typeDefault);
|
|
5649
5650
|
else if (p.long) t("if(util.Long){")("var n=new util.Long(%i,%i,%j)", p.typeDefault.low, p.typeDefault.high, p.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", y)("}else")("d%s=o.longs===String?%j:%i", y, p.typeDefault.toString(), p.typeDefault.toNumber());
|
|
5650
5651
|
else if (p.bytes) {
|
|
@@ -5683,8 +5684,8 @@ function requireConverter() {
|
|
|
5683
5684
|
}
|
|
5684
5685
|
var wrappers = {}, hasRequiredWrappers;
|
|
5685
5686
|
function requireWrappers() {
|
|
5686
|
-
return hasRequiredWrappers || (hasRequiredWrappers = 1, function(
|
|
5687
|
-
var f =
|
|
5687
|
+
return hasRequiredWrappers || (hasRequiredWrappers = 1, function(a) {
|
|
5688
|
+
var f = a, h = requireMessage();
|
|
5688
5689
|
f[".google.protobuf.Any"] = {
|
|
5689
5690
|
fromObject: function(c) {
|
|
5690
5691
|
if (c && c["@type"]) {
|
|
@@ -5719,11 +5720,11 @@ var type, hasRequiredType;
|
|
|
5719
5720
|
function requireType() {
|
|
5720
5721
|
if (hasRequiredType) return type;
|
|
5721
5722
|
hasRequiredType = 1, type = y;
|
|
5722
|
-
var
|
|
5723
|
-
((y.prototype = Object.create(
|
|
5724
|
-
var f = require_enum(), h = requireOneof(), c = requireField(), d = requireMapfield(), n = requireService(), e = requireMessage(), r = requireReader(), i = requireWriter(), t = requireUtil(), l = requireEncoder(), s = requireDecoder(),
|
|
5723
|
+
var a = requireNamespace();
|
|
5724
|
+
((y.prototype = Object.create(a.prototype)).constructor = y).className = "Type";
|
|
5725
|
+
var f = require_enum(), h = requireOneof(), c = requireField(), d = requireMapfield(), n = requireService(), e = requireMessage(), r = requireReader(), i = requireWriter(), t = requireUtil(), l = requireEncoder(), s = requireDecoder(), u = requireVerifier(), o = requireConverter(), p = requireWrappers();
|
|
5725
5726
|
function y(v, m) {
|
|
5726
|
-
v = v.replace(/\\W/g, ""),
|
|
5727
|
+
v = v.replace(/\\W/g, ""), a.call(this, v, m), this.fields = {}, this.oneofs = void 0, this.extensions = void 0, this.reserved = void 0, this.group = void 0, this._fieldsById = null, this._fieldsArray = null, this._oneofsArray = null, this._ctor = null;
|
|
5727
5728
|
}
|
|
5728
5729
|
Object.defineProperties(y.prototype, {
|
|
5729
5730
|
/**
|
|
@@ -5817,21 +5818,21 @@ function requireType() {
|
|
|
5817
5818
|
var j = _.nested[I[C]];
|
|
5818
5819
|
A.add(
|
|
5819
5820
|
// most to least likely
|
|
5820
|
-
(j.id !== void 0 ? c.fromJSON : j.fields !== void 0 ? y.fromJSON : j.values !== void 0 ? f.fromJSON : j.methods !== void 0 ? n.fromJSON :
|
|
5821
|
+
(j.id !== void 0 ? c.fromJSON : j.fields !== void 0 ? y.fromJSON : j.values !== void 0 ? f.fromJSON : j.methods !== void 0 ? n.fromJSON : a.fromJSON)(I[C], j)
|
|
5821
5822
|
);
|
|
5822
5823
|
}
|
|
5823
5824
|
return _.extensions && _.extensions.length && (A.extensions = _.extensions), _.reserved && _.reserved.length && (A.reserved = _.reserved), _.group && (A.group = !0), _.comment && (A.comment = _.comment), _.edition && (A._edition = _.edition), A._defaultEdition = "proto3", A;
|
|
5824
5825
|
}, y.prototype.toJSON = function(m) {
|
|
5825
|
-
var _ =
|
|
5826
|
+
var _ = a.prototype.toJSON.call(this, m), A = m ? !!m.keepComments : !1;
|
|
5826
5827
|
return t.toObject([
|
|
5827
5828
|
"edition",
|
|
5828
5829
|
this._editionToJSON(),
|
|
5829
5830
|
"options",
|
|
5830
5831
|
_ && _.options || void 0,
|
|
5831
5832
|
"oneofs",
|
|
5832
|
-
|
|
5833
|
+
a.arrayToJSON(this.oneofsArray, m),
|
|
5833
5834
|
"fields",
|
|
5834
|
-
|
|
5835
|
+
a.arrayToJSON(this.fieldsArray.filter(function(I) {
|
|
5835
5836
|
return !I.declaringField;
|
|
5836
5837
|
}), m) || {},
|
|
5837
5838
|
"extensions",
|
|
@@ -5847,7 +5848,7 @@ function requireType() {
|
|
|
5847
5848
|
]);
|
|
5848
5849
|
}, y.prototype.resolveAll = function() {
|
|
5849
5850
|
if (!this._needsRecursiveResolve) return this;
|
|
5850
|
-
|
|
5851
|
+
a.prototype.resolveAll.call(this);
|
|
5851
5852
|
var m = this.oneofsArray;
|
|
5852
5853
|
for (A = 0; A < m.length; )
|
|
5853
5854
|
m[A++].resolve();
|
|
@@ -5855,7 +5856,7 @@ function requireType() {
|
|
|
5855
5856
|
_[A++].resolve();
|
|
5856
5857
|
return this;
|
|
5857
5858
|
}, y.prototype._resolveFeaturesRecursive = function(m) {
|
|
5858
|
-
return this._needsRecursiveFeatureResolution ? (m = this._edition || m,
|
|
5859
|
+
return this._needsRecursiveFeatureResolution ? (m = this._edition || m, a.prototype._resolveFeaturesRecursive.call(this, m), this.oneofsArray.forEach((_) => {
|
|
5859
5860
|
_._resolveFeatures(m);
|
|
5860
5861
|
}), this.fieldsArray.forEach((_) => {
|
|
5861
5862
|
_._resolveFeatures(m);
|
|
@@ -5877,7 +5878,7 @@ function requireType() {
|
|
|
5877
5878
|
throw Error("name '" + m.name + "' is reserved in " + this);
|
|
5878
5879
|
return m.parent && m.parent.remove(m), this.fields[m.name] = m, m.message = this, m.onAdd(this), E(this);
|
|
5879
5880
|
}
|
|
5880
|
-
return m instanceof h ? (this.oneofs || (this.oneofs = {}), this.oneofs[m.name] = m, m.onAdd(this), E(this)) :
|
|
5881
|
+
return m instanceof h ? (this.oneofs || (this.oneofs = {}), this.oneofs[m.name] = m, m.onAdd(this), E(this)) : a.prototype.add.call(this, m);
|
|
5881
5882
|
}, y.prototype.remove = function(m) {
|
|
5882
5883
|
if (m instanceof c && m.extend === void 0) {
|
|
5883
5884
|
if (!this.fields || this.fields[m.name] !== m)
|
|
@@ -5889,11 +5890,11 @@ function requireType() {
|
|
|
5889
5890
|
throw Error(m + " is not a member of " + this);
|
|
5890
5891
|
return delete this.oneofs[m.name], m.parent = null, m.onRemove(this), E(this);
|
|
5891
5892
|
}
|
|
5892
|
-
return
|
|
5893
|
+
return a.prototype.remove.call(this, m);
|
|
5893
5894
|
}, y.prototype.isReservedId = function(m) {
|
|
5894
|
-
return
|
|
5895
|
+
return a.isReservedId(this.reserved, m);
|
|
5895
5896
|
}, y.prototype.isReservedName = function(m) {
|
|
5896
|
-
return
|
|
5897
|
+
return a.isReservedName(this.reserved, m);
|
|
5897
5898
|
}, y.prototype.create = function(m) {
|
|
5898
5899
|
return new this.ctor(m);
|
|
5899
5900
|
}, y.prototype.setup = function() {
|
|
@@ -5908,7 +5909,7 @@ function requireType() {
|
|
|
5908
5909
|
Reader: r,
|
|
5909
5910
|
types: _,
|
|
5910
5911
|
util: t
|
|
5911
|
-
}), this.verify =
|
|
5912
|
+
}), this.verify = u(this)({
|
|
5912
5913
|
types: _,
|
|
5913
5914
|
util: t
|
|
5914
5915
|
}), this.fromObject = o.fromObject(this)({
|
|
@@ -5948,22 +5949,22 @@ var root$1, hasRequiredRoot;
|
|
|
5948
5949
|
function requireRoot() {
|
|
5949
5950
|
if (hasRequiredRoot) return root$1;
|
|
5950
5951
|
hasRequiredRoot = 1, root$1 = i;
|
|
5951
|
-
var
|
|
5952
|
-
((i.prototype = Object.create(
|
|
5952
|
+
var a = requireNamespace();
|
|
5953
|
+
((i.prototype = Object.create(a.prototype)).constructor = i).className = "Root";
|
|
5953
5954
|
var f = requireField(), h = require_enum(), c = requireOneof(), d = requireUtil(), n, e, r;
|
|
5954
|
-
function i(
|
|
5955
|
-
|
|
5955
|
+
function i(u) {
|
|
5956
|
+
a.call(this, "", u), this.deferred = [], this.files = [], this._edition = "proto2", this._fullyQualifiedObjects = {};
|
|
5956
5957
|
}
|
|
5957
5958
|
i.fromJSON = function(o, p) {
|
|
5958
5959
|
return p || (p = new i()), o.options && p.setOptions(o.options), p.addJSON(o.nested).resolveAll();
|
|
5959
5960
|
}, i.prototype.resolvePath = d.path.resolve, i.prototype.fetch = d.fetch;
|
|
5960
5961
|
function t() {
|
|
5961
5962
|
}
|
|
5962
|
-
i.prototype.load = function
|
|
5963
|
+
i.prototype.load = function u(o, p, y) {
|
|
5963
5964
|
typeof p == "function" && (y = p, p = void 0);
|
|
5964
5965
|
var E = this;
|
|
5965
5966
|
if (!y)
|
|
5966
|
-
return d.asPromise(
|
|
5967
|
+
return d.asPromise(u, E, o, p);
|
|
5967
5968
|
var v = y === t;
|
|
5968
5969
|
function m(B, L) {
|
|
5969
5970
|
if (y) {
|
|
@@ -6045,10 +6046,10 @@ function requireRoot() {
|
|
|
6045
6046
|
throw Error("unresolvable extensions: " + this.deferred.map(function(o) {
|
|
6046
6047
|
return "'extend " + o.extend + "' in " + o.parent.fullName;
|
|
6047
6048
|
}).join(", "));
|
|
6048
|
-
return
|
|
6049
|
+
return a.prototype.resolveAll.call(this);
|
|
6049
6050
|
};
|
|
6050
6051
|
var l = /^[A-Z]/;
|
|
6051
|
-
function s(
|
|
6052
|
+
function s(u, o) {
|
|
6052
6053
|
var p = o.parent.lookup(o.extend);
|
|
6053
6054
|
if (p) {
|
|
6054
6055
|
var y = new f(o.fullName, o.id, o.type, o.rule, void 0, o.options);
|
|
@@ -6090,66 +6091,66 @@ function requireRoot() {
|
|
|
6090
6091
|
}
|
|
6091
6092
|
} else if (o instanceof h)
|
|
6092
6093
|
l.test(o.name) && delete o.parent[o.name];
|
|
6093
|
-
else if (o instanceof
|
|
6094
|
+
else if (o instanceof a) {
|
|
6094
6095
|
for (var y = 0; y < /* initializes */
|
|
6095
6096
|
o.nestedArray.length; ++y)
|
|
6096
6097
|
this._handleRemove(o._nestedArray[y]);
|
|
6097
6098
|
l.test(o.name) && delete o.parent[o.name];
|
|
6098
6099
|
}
|
|
6099
6100
|
delete this._fullyQualifiedObjects[o.fullName];
|
|
6100
|
-
}, i._configure = function(
|
|
6101
|
-
n =
|
|
6101
|
+
}, i._configure = function(u, o, p) {
|
|
6102
|
+
n = u, e = o, r = p;
|
|
6102
6103
|
}, root$1;
|
|
6103
6104
|
}
|
|
6104
6105
|
var hasRequiredUtil;
|
|
6105
6106
|
function requireUtil() {
|
|
6106
6107
|
if (hasRequiredUtil) return util.exports;
|
|
6107
6108
|
hasRequiredUtil = 1;
|
|
6108
|
-
var
|
|
6109
|
-
|
|
6109
|
+
var a = util.exports = requireMinimal(), f = requireRoots(), h, c;
|
|
6110
|
+
a.codegen = requireCodegen(), a.fetch = requireFetch(), a.path = requirePath(), a.fs = a.inquire("fs"), a.toArray = function(t) {
|
|
6110
6111
|
if (t) {
|
|
6111
|
-
for (var l = Object.keys(t), s = new Array(l.length),
|
|
6112
|
-
s[
|
|
6112
|
+
for (var l = Object.keys(t), s = new Array(l.length), u = 0; u < l.length; )
|
|
6113
|
+
s[u] = t[l[u++]];
|
|
6113
6114
|
return s;
|
|
6114
6115
|
}
|
|
6115
6116
|
return [];
|
|
6116
|
-
},
|
|
6117
|
+
}, a.toObject = function(t) {
|
|
6117
6118
|
for (var l = {}, s = 0; s < t.length; ) {
|
|
6118
|
-
var
|
|
6119
|
-
o !== void 0 && (l[
|
|
6119
|
+
var u = t[s++], o = t[s++];
|
|
6120
|
+
o !== void 0 && (l[u] = o);
|
|
6120
6121
|
}
|
|
6121
6122
|
return l;
|
|
6122
6123
|
};
|
|
6123
6124
|
var d = /\\\\/g, n = /"/g;
|
|
6124
|
-
|
|
6125
|
+
a.isReserved = function(t) {
|
|
6125
6126
|
return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(t);
|
|
6126
|
-
},
|
|
6127
|
-
return !/^[$\\w_]+$/.test(t) ||
|
|
6128
|
-
},
|
|
6127
|
+
}, a.safeProp = function(t) {
|
|
6128
|
+
return !/^[$\\w_]+$/.test(t) || a.isReserved(t) ? '["' + t.replace(d, "\\\\\\\\").replace(n, '\\\\"') + '"]' : "." + t;
|
|
6129
|
+
}, a.ucFirst = function(t) {
|
|
6129
6130
|
return t.charAt(0).toUpperCase() + t.substring(1);
|
|
6130
6131
|
};
|
|
6131
6132
|
var e = /_([a-z])/g;
|
|
6132
|
-
|
|
6133
|
+
a.camelCase = function(t) {
|
|
6133
6134
|
return t.substring(0, 1) + t.substring(1).replace(e, function(l, s) {
|
|
6134
6135
|
return s.toUpperCase();
|
|
6135
6136
|
});
|
|
6136
|
-
},
|
|
6137
|
+
}, a.compareFieldsById = function(t, l) {
|
|
6137
6138
|
return t.id - l.id;
|
|
6138
|
-
},
|
|
6139
|
+
}, a.decorateType = function(t, l) {
|
|
6139
6140
|
if (t.$type)
|
|
6140
|
-
return l && t.$type.name !== l && (
|
|
6141
|
+
return l && t.$type.name !== l && (a.decorateRoot.remove(t.$type), t.$type.name = l, a.decorateRoot.add(t.$type)), t.$type;
|
|
6141
6142
|
h || (h = requireType());
|
|
6142
6143
|
var s = new h(l || t.name);
|
|
6143
|
-
return
|
|
6144
|
+
return a.decorateRoot.add(s), s.ctor = t, Object.defineProperty(t, "$type", { value: s, enumerable: !1 }), Object.defineProperty(t.prototype, "$type", { value: s, enumerable: !1 }), s;
|
|
6144
6145
|
};
|
|
6145
6146
|
var r = 0;
|
|
6146
|
-
return
|
|
6147
|
+
return a.decorateEnum = function(t) {
|
|
6147
6148
|
if (t.$type)
|
|
6148
6149
|
return t.$type;
|
|
6149
6150
|
c || (c = require_enum());
|
|
6150
6151
|
var l = new c("Enum" + r++, t);
|
|
6151
|
-
return
|
|
6152
|
-
},
|
|
6152
|
+
return a.decorateRoot.add(l), Object.defineProperty(t, "$type", { value: l, enumerable: !1 }), l;
|
|
6153
|
+
}, a.setProperty = function(t, l, s, u) {
|
|
6153
6154
|
function o(p, y, E) {
|
|
6154
6155
|
var v = y.shift();
|
|
6155
6156
|
if (v === "__proto__" || v === "prototype")
|
|
@@ -6158,7 +6159,7 @@ function requireUtil() {
|
|
|
6158
6159
|
p[v] = o(p[v] || {}, y, E);
|
|
6159
6160
|
else {
|
|
6160
6161
|
var m = p[v];
|
|
6161
|
-
if (m &&
|
|
6162
|
+
if (m && u)
|
|
6162
6163
|
return p;
|
|
6163
6164
|
m && (E = [].concat(m).concat(E)), p[v] = E;
|
|
6164
6165
|
}
|
|
@@ -6169,7 +6170,7 @@ function requireUtil() {
|
|
|
6169
6170
|
if (!l)
|
|
6170
6171
|
throw TypeError("path must be specified");
|
|
6171
6172
|
return l = l.split("."), o(t, l, s);
|
|
6172
|
-
}, Object.defineProperty(
|
|
6173
|
+
}, Object.defineProperty(a, "decorateRoot", {
|
|
6173
6174
|
get: function() {
|
|
6174
6175
|
return f.decorated || (f.decorated = new (requireRoot())());
|
|
6175
6176
|
}
|
|
@@ -6177,8 +6178,8 @@ function requireUtil() {
|
|
|
6177
6178
|
}
|
|
6178
6179
|
var hasRequiredTypes;
|
|
6179
6180
|
function requireTypes() {
|
|
6180
|
-
return hasRequiredTypes || (hasRequiredTypes = 1, function(
|
|
6181
|
-
var f =
|
|
6181
|
+
return hasRequiredTypes || (hasRequiredTypes = 1, function(a) {
|
|
6182
|
+
var f = a, h = requireUtil(), c = [
|
|
6182
6183
|
"double",
|
|
6183
6184
|
// 0
|
|
6184
6185
|
"float",
|
|
@@ -6349,15 +6350,15 @@ var field, hasRequiredField;
|
|
|
6349
6350
|
function requireField() {
|
|
6350
6351
|
if (hasRequiredField) return field;
|
|
6351
6352
|
hasRequiredField = 1, field = e;
|
|
6352
|
-
var
|
|
6353
|
-
((e.prototype = Object.create(
|
|
6353
|
+
var a = requireObject();
|
|
6354
|
+
((e.prototype = Object.create(a.prototype)).constructor = e).className = "Field";
|
|
6354
6355
|
var f = require_enum(), h = requireTypes(), c = requireUtil(), d, n = /^required|optional|repeated$/;
|
|
6355
6356
|
e.fromJSON = function(i, t) {
|
|
6356
6357
|
var l = new e(i, t.id, t.type, t.rule, t.extend, t.options, t.comment);
|
|
6357
6358
|
return t.edition && (l._edition = t.edition), l._defaultEdition = "proto3", l;
|
|
6358
6359
|
};
|
|
6359
|
-
function e(r, i, t, l, s,
|
|
6360
|
-
if (c.isObject(l) ? (o = s,
|
|
6360
|
+
function e(r, i, t, l, s, u, o) {
|
|
6361
|
+
if (c.isObject(l) ? (o = s, u = l, l = s = void 0) : c.isObject(s) && (o = u, u = s, s = void 0), a.call(this, r, u), !c.isInteger(i) || i < 0)
|
|
6361
6362
|
throw TypeError("id must be a non-negative integer");
|
|
6362
6363
|
if (!c.isString(t))
|
|
6363
6364
|
throw TypeError("type must be a string");
|
|
@@ -6393,7 +6394,7 @@ function requireField() {
|
|
|
6393
6394
|
this._features.field_presence !== "IMPLICIT";
|
|
6394
6395
|
}
|
|
6395
6396
|
}), e.prototype.setOption = function(i, t, l) {
|
|
6396
|
-
return
|
|
6397
|
+
return a.prototype.setOption.call(this, i, t, l);
|
|
6397
6398
|
}, e.prototype.toJSON = function(i) {
|
|
6398
6399
|
var t = i ? !!i.keepComments : !1;
|
|
6399
6400
|
return c.toObject([
|
|
@@ -6421,7 +6422,7 @@ function requireField() {
|
|
|
6421
6422
|
var i;
|
|
6422
6423
|
c.base64.test(this.typeDefault) ? c.base64.decode(this.typeDefault, i = c.newBuffer(c.base64.length(this.typeDefault)), 0) : c.utf8.write(this.typeDefault, i = c.newBuffer(c.utf8.length(this.typeDefault)), 0), this.typeDefault = i;
|
|
6423
6424
|
}
|
|
6424
|
-
return this.map ? this.defaultValue = c.emptyObject : this.repeated ? this.defaultValue = c.emptyArray : this.defaultValue = this.typeDefault, this.parent instanceof d && (this.parent.ctor.prototype[this.name] = this.defaultValue),
|
|
6425
|
+
return this.map ? this.defaultValue = c.emptyObject : this.repeated ? this.defaultValue = c.emptyArray : this.defaultValue = this.typeDefault, this.parent instanceof d && (this.parent.ctor.prototype[this.name] = this.defaultValue), a.prototype.resolve.call(this);
|
|
6425
6426
|
}, e.prototype._inferLegacyProtoFeatures = function(i) {
|
|
6426
6427
|
if (i !== "proto2" && i !== "proto3")
|
|
6427
6428
|
return {};
|
|
@@ -6432,7 +6433,7 @@ function requireField() {
|
|
|
6432
6433
|
}
|
|
6433
6434
|
return this.getOption("packed") === !0 ? t.repeated_field_encoding = "PACKED" : this.getOption("packed") === !1 && (t.repeated_field_encoding = "EXPANDED"), t;
|
|
6434
6435
|
}, e.prototype._resolveFeatures = function(i) {
|
|
6435
|
-
return
|
|
6436
|
+
return a.prototype._resolveFeatures.call(this, this._edition || i);
|
|
6436
6437
|
}, e.d = function(i, t, l, s) {
|
|
6437
6438
|
return typeof t == "function" ? t = c.decorateType(t).name : t && typeof t == "object" && (t = c.decorateEnum(t).name), function(o, p) {
|
|
6438
6439
|
c.decorateType(o.constructor).add(new e(p, i, t, l, { default: s }));
|
|
@@ -6445,11 +6446,11 @@ var oneof, hasRequiredOneof;
|
|
|
6445
6446
|
function requireOneof() {
|
|
6446
6447
|
if (hasRequiredOneof) return oneof;
|
|
6447
6448
|
hasRequiredOneof = 1, oneof = c;
|
|
6448
|
-
var
|
|
6449
|
-
((c.prototype = Object.create(
|
|
6449
|
+
var a = requireObject();
|
|
6450
|
+
((c.prototype = Object.create(a.prototype)).constructor = c).className = "OneOf";
|
|
6450
6451
|
var f = requireField(), h = requireUtil();
|
|
6451
6452
|
function c(n, e, r, i) {
|
|
6452
|
-
if (Array.isArray(e) || (r = e, e = void 0),
|
|
6453
|
+
if (Array.isArray(e) || (r = e, e = void 0), a.call(this, n, r), !(e === void 0 || Array.isArray(e)))
|
|
6453
6454
|
throw TypeError("fieldNames must be an Array");
|
|
6454
6455
|
this.oneof = e || [], this.fieldsArray = [], this.comment = i;
|
|
6455
6456
|
}
|
|
@@ -6483,7 +6484,7 @@ function requireOneof() {
|
|
|
6483
6484
|
throw Error(e + " is not a member of " + this);
|
|
6484
6485
|
return this.fieldsArray.splice(r, 1), r = this.oneof.indexOf(e.name), r > -1 && this.oneof.splice(r, 1), e.partOf = null, this;
|
|
6485
6486
|
}, c.prototype.onAdd = function(e) {
|
|
6486
|
-
|
|
6487
|
+
a.prototype.onAdd.call(this, e);
|
|
6487
6488
|
for (var r = this, i = 0; i < this.oneof.length; ++i) {
|
|
6488
6489
|
var t = e.get(this.oneof[i]);
|
|
6489
6490
|
t && !t.partOf && (t.partOf = r, r.fieldsArray.push(t));
|
|
@@ -6492,7 +6493,7 @@ function requireOneof() {
|
|
|
6492
6493
|
}, c.prototype.onRemove = function(e) {
|
|
6493
6494
|
for (var r = 0, i; r < this.fieldsArray.length; ++r)
|
|
6494
6495
|
(i = this.fieldsArray[r]).parent && i.parent.remove(i);
|
|
6495
|
-
|
|
6496
|
+
a.prototype.onRemove.call(this, e);
|
|
6496
6497
|
}, Object.defineProperty(c.prototype, "isProto3Optional", {
|
|
6497
6498
|
get: function() {
|
|
6498
6499
|
if (this.fieldsArray == null || this.fieldsArray.length !== 1)
|
|
@@ -6515,7 +6516,7 @@ var object, hasRequiredObject;
|
|
|
6515
6516
|
function requireObject() {
|
|
6516
6517
|
if (hasRequiredObject) return object;
|
|
6517
6518
|
hasRequiredObject = 1, object = r, r.className = "ReflectionObject";
|
|
6518
|
-
const
|
|
6519
|
+
const a = requireOneof();
|
|
6519
6520
|
var f = requireUtil(), h, c = { enum_type: "OPEN", field_presence: "EXPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY", enforce_naming_style: "STYLE2024", default_symbol_visibility: "EXPORT_TOP_LEVEL" }, d = { enum_type: "OPEN", field_presence: "EXPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY", enforce_naming_style: "STYLE_LEGACY", default_symbol_visibility: "EXPORT_ALL" }, n = { enum_type: "CLOSED", field_presence: "EXPLICIT", json_format: "LEGACY_BEST_EFFORT", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "EXPANDED", utf8_validation: "NONE", enforce_naming_style: "STYLE_LEGACY", default_symbol_visibility: "EXPORT_ALL" }, e = { enum_type: "OPEN", field_presence: "IMPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY", enforce_naming_style: "STYLE_LEGACY", default_symbol_visibility: "EXPORT_ALL" };
|
|
6520
6521
|
function r(i, t) {
|
|
6521
6522
|
if (!f.isString(i))
|
|
@@ -6588,9 +6589,9 @@ function requireObject() {
|
|
|
6588
6589
|
this._features = Object.assign(l, s || {}), this._featuresResolved = !0;
|
|
6589
6590
|
return;
|
|
6590
6591
|
}
|
|
6591
|
-
if (this.partOf instanceof
|
|
6592
|
-
var
|
|
6593
|
-
this._features = Object.assign(
|
|
6592
|
+
if (this.partOf instanceof a) {
|
|
6593
|
+
var u = Object.assign({}, this.partOf._features);
|
|
6594
|
+
this._features = Object.assign(u, s || {});
|
|
6594
6595
|
} else if (!this.declaringField) if (this.parent) {
|
|
6595
6596
|
var o = Object.assign({}, this.parent._features);
|
|
6596
6597
|
this._features = Object.assign(o, s || {});
|
|
@@ -6607,25 +6608,25 @@ function requireObject() {
|
|
|
6607
6608
|
return this.options || (this.options = {}), /^features\\./.test(t) ? f.setProperty(this.options, t, l, s) : (!s || this.options[t] === void 0) && (this.getOption(t) !== l && (this.resolved = !1), this.options[t] = l), this;
|
|
6608
6609
|
}, r.prototype.setParsedOption = function(t, l, s) {
|
|
6609
6610
|
this.parsedOptions || (this.parsedOptions = []);
|
|
6610
|
-
var
|
|
6611
|
+
var u = this.parsedOptions;
|
|
6611
6612
|
if (s) {
|
|
6612
|
-
var o =
|
|
6613
|
+
var o = u.find(function(E) {
|
|
6613
6614
|
return Object.prototype.hasOwnProperty.call(E, t);
|
|
6614
6615
|
});
|
|
6615
6616
|
if (o) {
|
|
6616
6617
|
var p = o[t];
|
|
6617
6618
|
f.setProperty(p, s, l);
|
|
6618
6619
|
} else
|
|
6619
|
-
o = {}, o[t] = f.setProperty({}, s, l),
|
|
6620
|
+
o = {}, o[t] = f.setProperty({}, s, l), u.push(o);
|
|
6620
6621
|
} else {
|
|
6621
6622
|
var y = {};
|
|
6622
|
-
y[t] = l,
|
|
6623
|
+
y[t] = l, u.push(y);
|
|
6623
6624
|
}
|
|
6624
6625
|
return this;
|
|
6625
6626
|
}, r.prototype.setOptions = function(t, l) {
|
|
6626
6627
|
if (t)
|
|
6627
|
-
for (var s = Object.keys(t),
|
|
6628
|
-
this.setOption(s[
|
|
6628
|
+
for (var s = Object.keys(t), u = 0; u < s.length; ++u)
|
|
6629
|
+
this.setOption(s[u], t[s[u]], l);
|
|
6629
6630
|
return this;
|
|
6630
6631
|
}, r.prototype.toString = function() {
|
|
6631
6632
|
var t = this.constructor.className, l = this.fullName;
|
|
@@ -6641,18 +6642,18 @@ var _enum, hasRequired_enum;
|
|
|
6641
6642
|
function require_enum() {
|
|
6642
6643
|
if (hasRequired_enum) return _enum;
|
|
6643
6644
|
hasRequired_enum = 1, _enum = c;
|
|
6644
|
-
var
|
|
6645
|
-
((c.prototype = Object.create(
|
|
6645
|
+
var a = requireObject();
|
|
6646
|
+
((c.prototype = Object.create(a.prototype)).constructor = c).className = "Enum";
|
|
6646
6647
|
var f = requireNamespace(), h = requireUtil();
|
|
6647
6648
|
function c(d, n, e, r, i, t) {
|
|
6648
|
-
if (
|
|
6649
|
+
if (a.call(this, d, e), n && typeof n != "object")
|
|
6649
6650
|
throw TypeError("values must be an object");
|
|
6650
6651
|
if (this.valuesById = {}, this.values = Object.create(this.valuesById), this.comment = r, this.comments = i || {}, this.valuesOptions = t, this._valuesFeatures = {}, this.reserved = void 0, n)
|
|
6651
6652
|
for (var l = Object.keys(n), s = 0; s < l.length; ++s)
|
|
6652
6653
|
typeof n[l[s]] == "number" && (this.valuesById[this.values[l[s]] = n[l[s]]] = l[s]);
|
|
6653
6654
|
}
|
|
6654
6655
|
return c.prototype._resolveFeatures = function(n) {
|
|
6655
|
-
return n = this._edition || n,
|
|
6656
|
+
return n = this._edition || n, a.prototype._resolveFeatures.call(this, n), Object.keys(this.values).forEach((e) => {
|
|
6656
6657
|
var r = Object.assign({}, this._features);
|
|
6657
6658
|
this._valuesFeatures[e] = Object.assign(r, this.valuesOptions && this.valuesOptions[e] && this.valuesOptions[e].features);
|
|
6658
6659
|
}), this;
|
|
@@ -6712,7 +6713,7 @@ var encoder_1, hasRequiredEncoder;
|
|
|
6712
6713
|
function requireEncoder() {
|
|
6713
6714
|
if (hasRequiredEncoder) return encoder_1;
|
|
6714
6715
|
hasRequiredEncoder = 1, encoder_1 = d;
|
|
6715
|
-
var
|
|
6716
|
+
var a = require_enum(), f = requireTypes(), h = requireUtil();
|
|
6716
6717
|
function c(n, e, r, i) {
|
|
6717
6718
|
return e.delimited ? n("types[%i].encode(%s,w.uint32(%i)).uint32(%i)", r, i, (e.id << 3 | 3) >>> 0, (e.id << 3 | 4) >>> 0) : n("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", r, i, (e.id << 3 | 2) >>> 0);
|
|
6718
6719
|
}
|
|
@@ -6721,8 +6722,8 @@ function requireEncoder() {
|
|
|
6721
6722
|
/* initializes */
|
|
6722
6723
|
n.fieldsArray.slice().sort(h.compareFieldsById)
|
|
6723
6724
|
), r = 0; r < t.length; ++r) {
|
|
6724
|
-
var l = t[r].resolve(), s = n._fieldsArray.indexOf(l),
|
|
6725
|
-
i = "m" + h.safeProp(l.name), l.map ? (e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", i, l.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){", i)("w.uint32(%i).fork().uint32(%i).%s(ks[i])", (l.id << 3 | 2) >>> 0, 8 | f.mapKey[l.keyType], l.keyType), o === void 0 ? e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", s, i) : e(".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | o,
|
|
6725
|
+
var l = t[r].resolve(), s = n._fieldsArray.indexOf(l), u = l.resolvedType instanceof a ? "int32" : l.type, o = f.basic[u];
|
|
6726
|
+
i = "m" + h.safeProp(l.name), l.map ? (e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", i, l.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){", i)("w.uint32(%i).fork().uint32(%i).%s(ks[i])", (l.id << 3 | 2) >>> 0, 8 | f.mapKey[l.keyType], l.keyType), o === void 0 ? e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", s, i) : e(".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | o, u, i), e("}")("}")) : l.repeated ? (e("if(%s!=null&&%s.length){", i, i), l.packed && f.packed[u] !== void 0 ? e("w.uint32(%i).fork()", (l.id << 3 | 2) >>> 0)("for(var i=0;i<%s.length;++i)", i)("w.%s(%s[i])", u, i)("w.ldelim()") : (e("for(var i=0;i<%s.length;++i)", i), o === void 0 ? c(e, l, s, i + "[i]") : e("w.uint32(%i).%s(%s[i])", (l.id << 3 | o) >>> 0, u, i)), e("}")) : (l.optional && e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", i, l.name), o === void 0 ? c(e, l, s, i) : e("w.uint32(%i).%s(%s)", (l.id << 3 | o) >>> 0, u, i));
|
|
6726
6727
|
}
|
|
6727
6728
|
return e("return w");
|
|
6728
6729
|
}
|
|
@@ -6732,22 +6733,22 @@ var hasRequiredIndexLight;
|
|
|
6732
6733
|
function requireIndexLight() {
|
|
6733
6734
|
if (hasRequiredIndexLight) return indexLight.exports;
|
|
6734
6735
|
hasRequiredIndexLight = 1;
|
|
6735
|
-
var
|
|
6736
|
-
|
|
6736
|
+
var a = indexLight.exports = requireIndexMinimal();
|
|
6737
|
+
a.build = "light";
|
|
6737
6738
|
function f(c, d, n) {
|
|
6738
|
-
return typeof d == "function" ? (n = d, d = new
|
|
6739
|
+
return typeof d == "function" ? (n = d, d = new a.Root()) : d || (d = new a.Root()), d.load(c, n);
|
|
6739
6740
|
}
|
|
6740
|
-
|
|
6741
|
+
a.load = f;
|
|
6741
6742
|
function h(c, d) {
|
|
6742
|
-
return d || (d = new
|
|
6743
|
+
return d || (d = new a.Root()), d.loadSync(c);
|
|
6743
6744
|
}
|
|
6744
|
-
return
|
|
6745
|
+
return a.loadSync = h, a.encoder = requireEncoder(), a.decoder = requireDecoder(), a.verifier = requireVerifier(), a.converter = requireConverter(), a.ReflectionObject = requireObject(), a.Namespace = requireNamespace(), a.Root = requireRoot(), a.Enum = require_enum(), a.Type = requireType(), a.Field = requireField(), a.OneOf = requireOneof(), a.MapField = requireMapfield(), a.Service = requireService(), a.Method = requireMethod(), a.Message = requireMessage(), a.wrappers = requireWrappers(), a.types = requireTypes(), a.util = requireUtil(), a.ReflectionObject._configure(a.Root), a.Namespace._configure(a.Type, a.Service, a.Enum), a.Root._configure(a.Type), a.Field._configure(a.Type), indexLight.exports;
|
|
6745
6746
|
}
|
|
6746
6747
|
var tokenize_1, hasRequiredTokenize;
|
|
6747
6748
|
function requireTokenize() {
|
|
6748
6749
|
if (hasRequiredTokenize) return tokenize_1;
|
|
6749
6750
|
hasRequiredTokenize = 1, tokenize_1 = l;
|
|
6750
|
-
var
|
|
6751
|
+
var a = /[\\s{}=;:[\\],'"()<>]/g, f = /(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)")/g, h = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g, c = /^ *[*/]+ */, d = /^\\s*\\*?\\/*/, n = /\\n/g, e = /\\s/, r = /\\\\(.?)/g, i = {
|
|
6751
6752
|
0: "\\0",
|
|
6752
6753
|
r: "\\r",
|
|
6753
6754
|
n: \`
|
|
@@ -6755,7 +6756,7 @@ function requireTokenize() {
|
|
|
6755
6756
|
t: " "
|
|
6756
6757
|
};
|
|
6757
6758
|
function t(s) {
|
|
6758
|
-
return s.replace(r, function(
|
|
6759
|
+
return s.replace(r, function(u, o) {
|
|
6759
6760
|
switch (o) {
|
|
6760
6761
|
case "\\\\":
|
|
6761
6762
|
case "":
|
|
@@ -6766,7 +6767,7 @@ function requireTokenize() {
|
|
|
6766
6767
|
});
|
|
6767
6768
|
}
|
|
6768
6769
|
l.unescape = t;
|
|
6769
|
-
function l(s,
|
|
6770
|
+
function l(s, u) {
|
|
6770
6771
|
s = s.toString();
|
|
6771
6772
|
var o = 0, p = s.length, y = 1, E = 0, v = {}, m = [], _ = null;
|
|
6772
6773
|
function A(k) {
|
|
@@ -6789,7 +6790,7 @@ function requireTokenize() {
|
|
|
6789
6790
|
lineEmpty: !1,
|
|
6790
6791
|
leading: F
|
|
6791
6792
|
}, H;
|
|
6792
|
-
|
|
6793
|
+
u ? H = 2 : H = 3;
|
|
6793
6794
|
var D = k - H, $;
|
|
6794
6795
|
do
|
|
6795
6796
|
if (--D < 0 || ($ = s.charAt(D)) === \`
|
|
@@ -6798,9 +6799,9 @@ function requireTokenize() {
|
|
|
6798
6799
|
break;
|
|
6799
6800
|
}
|
|
6800
6801
|
while ($ === " " || $ === " ");
|
|
6801
|
-
for (var
|
|
6802
|
-
|
|
6803
|
-
W.text =
|
|
6802
|
+
for (var Y = s.substring(k, P).split(n), z = 0; z < Y.length; ++z)
|
|
6803
|
+
Y[z] = Y[z].replace(u ? d : c, "").trim();
|
|
6804
|
+
W.text = Y.join(\`
|
|
6804
6805
|
\`).trim(), v[y] = W, E = y;
|
|
6805
6806
|
}
|
|
6806
6807
|
function K(k) {
|
|
@@ -6830,7 +6831,7 @@ function requireTokenize() {
|
|
|
6830
6831
|
if (++o === p)
|
|
6831
6832
|
throw A("comment");
|
|
6832
6833
|
if (C(o) === "/")
|
|
6833
|
-
if (
|
|
6834
|
+
if (u) {
|
|
6834
6835
|
if (W = o, H = !1, K(o - 1)) {
|
|
6835
6836
|
H = !0;
|
|
6836
6837
|
do
|
|
@@ -6848,7 +6849,7 @@ function requireTokenize() {
|
|
|
6848
6849
|
++o, H && (j(W, o - 1, D), D = !0), ++y, k = !0;
|
|
6849
6850
|
}
|
|
6850
6851
|
else if ((F = C(o)) === "*") {
|
|
6851
|
-
W = o + 1, H =
|
|
6852
|
+
W = o + 1, H = u || C(W) === "*";
|
|
6852
6853
|
do {
|
|
6853
6854
|
if (F === \`
|
|
6854
6855
|
\` && ++y, ++o === p)
|
|
@@ -6861,10 +6862,10 @@ function requireTokenize() {
|
|
|
6861
6862
|
}
|
|
6862
6863
|
} while (k);
|
|
6863
6864
|
var $ = o;
|
|
6864
|
-
|
|
6865
|
-
var
|
|
6866
|
-
if (!
|
|
6867
|
-
for (; $ < p && !
|
|
6865
|
+
a.lastIndex = 0;
|
|
6866
|
+
var Y = a.test(C($++));
|
|
6867
|
+
if (!Y)
|
|
6868
|
+
for (; $ < p && !a.test(C($)); )
|
|
6868
6869
|
++$;
|
|
6869
6870
|
var z = s.substring(o, o = $);
|
|
6870
6871
|
return (z === '"' || z === "'") && (_ = z), z;
|
|
@@ -6891,7 +6892,7 @@ function requireTokenize() {
|
|
|
6891
6892
|
}
|
|
6892
6893
|
function T(k) {
|
|
6893
6894
|
var P = null, F;
|
|
6894
|
-
return k === void 0 ? (F = v[y - 1], delete v[y - 1], F && (
|
|
6895
|
+
return k === void 0 ? (F = v[y - 1], delete v[y - 1], F && (u || F.type === "*" || F.lineEmpty) && (P = F.leading ? F.text : null)) : (E < k && J(), F = v[k], delete v[k], F && !F.lineEmpty && (u || F.type === "/") && (P = F.leading ? null : F.text)), P;
|
|
6895
6896
|
}
|
|
6896
6897
|
return Object.defineProperty({
|
|
6897
6898
|
next: L,
|
|
@@ -6911,14 +6912,14 @@ var parse_1, hasRequiredParse;
|
|
|
6911
6912
|
function requireParse() {
|
|
6912
6913
|
if (hasRequiredParse) return parse_1;
|
|
6913
6914
|
hasRequiredParse = 1, parse_1 = I, I.filename = null, I.defaults = { keepCase: !1 };
|
|
6914
|
-
var
|
|
6915
|
+
var a = requireTokenize(), f = requireRoot(), h = requireType(), c = requireField(), d = requireMapfield(), n = requireOneof(), e = require_enum(), r = requireService(), i = requireMethod(), t = requireObject(), l = requireTypes(), s = requireUtil(), u = /^[1-9][0-9]*$/, o = /^-?[1-9][0-9]*$/, p = /^0[x][0-9a-fA-F]+$/, y = /^-?0[x][0-9a-fA-F]+$/, E = /^0[0-7]+$/, v = /^-?0[0-7]+$/, m = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, _ = /^[a-zA-Z_][a-zA-Z_0-9]*$/, A = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
|
|
6915
6916
|
function I(C, j, K) {
|
|
6916
6917
|
j instanceof f || (K = j, j = new f()), K || (K = I.defaults);
|
|
6917
|
-
var B = K.preferTrailingComment || !1, L =
|
|
6918
|
+
var B = K.preferTrailingComment || !1, L = a(C, K.alternateCommentMode || !1), S = L.next, J = L.push, M = L.peek, T = L.skip, k = L.cmnt, P = !0, F, W, H, D = "proto2", $ = j, Y = [], z = {}, ae = K.keepCase ? function(R) {
|
|
6918
6919
|
return R;
|
|
6919
6920
|
} : s.camelCase;
|
|
6920
6921
|
function he() {
|
|
6921
|
-
|
|
6922
|
+
Y.forEach((R) => {
|
|
6922
6923
|
R._edition = D, Object.keys(z).forEach((g) => {
|
|
6923
6924
|
R.getOption(g) === void 0 && R.setOption(g, z[g], !0);
|
|
6924
6925
|
});
|
|
@@ -7010,7 +7011,7 @@ function requireParse() {
|
|
|
7010
7011
|
case "0":
|
|
7011
7012
|
return 0;
|
|
7012
7013
|
}
|
|
7013
|
-
if (
|
|
7014
|
+
if (u.test(R))
|
|
7014
7015
|
return O * parseInt(R, 10);
|
|
7015
7016
|
if (p.test(R))
|
|
7016
7017
|
return O * parseInt(R, 16);
|
|
@@ -7118,15 +7119,15 @@ function requireParse() {
|
|
|
7118
7119
|
throw N(w);
|
|
7119
7120
|
/* eslint-disable no-fallthrough */
|
|
7120
7121
|
case "repeated":
|
|
7121
|
-
|
|
7122
|
+
X(O, w);
|
|
7122
7123
|
break;
|
|
7123
7124
|
case "optional":
|
|
7124
7125
|
if (D === "proto3")
|
|
7125
|
-
|
|
7126
|
+
X(O, "proto3_optional");
|
|
7126
7127
|
else {
|
|
7127
7128
|
if (D !== "proto2")
|
|
7128
7129
|
throw N(w);
|
|
7129
|
-
|
|
7130
|
+
X(O, "optional");
|
|
7130
7131
|
}
|
|
7131
7132
|
break;
|
|
7132
7133
|
case "oneof":
|
|
@@ -7141,12 +7142,12 @@ function requireParse() {
|
|
|
7141
7142
|
default:
|
|
7142
7143
|
if (D === "proto2" || !A.test(w))
|
|
7143
7144
|
throw N(w);
|
|
7144
|
-
J(w),
|
|
7145
|
+
J(w), X(O, "optional");
|
|
7145
7146
|
break;
|
|
7146
7147
|
}
|
|
7147
|
-
}), R.add(O), R === $ &&
|
|
7148
|
+
}), R.add(O), R === $ && Y.push(O);
|
|
7148
7149
|
}
|
|
7149
|
-
function
|
|
7150
|
+
function X(R, g, O) {
|
|
7150
7151
|
var b = S();
|
|
7151
7152
|
if (b === "group") {
|
|
7152
7153
|
_e(R, g);
|
|
@@ -7173,7 +7174,7 @@ function requireParse() {
|
|
|
7173
7174
|
q.setOption("proto3_optional", !0), x.add(q), R.add(x);
|
|
7174
7175
|
} else
|
|
7175
7176
|
R.add(q);
|
|
7176
|
-
R === $ &&
|
|
7177
|
+
R === $ && Y.push(q);
|
|
7177
7178
|
}
|
|
7178
7179
|
function _e(R, g) {
|
|
7179
7180
|
if (D >= 2023)
|
|
@@ -7193,10 +7194,10 @@ function requireParse() {
|
|
|
7193
7194
|
break;
|
|
7194
7195
|
case "required":
|
|
7195
7196
|
case "repeated":
|
|
7196
|
-
|
|
7197
|
+
X(q, U);
|
|
7197
7198
|
break;
|
|
7198
7199
|
case "optional":
|
|
7199
|
-
D === "proto3" ?
|
|
7200
|
+
D === "proto3" ? X(q, "proto3_optional") : X(q, "optional");
|
|
7200
7201
|
break;
|
|
7201
7202
|
case "message":
|
|
7202
7203
|
ne(q, U);
|
|
@@ -7257,7 +7258,7 @@ function requireParse() {
|
|
|
7257
7258
|
throw N(g, "name");
|
|
7258
7259
|
var O = new n(ae(g));
|
|
7259
7260
|
Z(O, function(w) {
|
|
7260
|
-
w === "option" ? (Q(O, w), T(";")) : (J(w),
|
|
7261
|
+
w === "option" ? (Q(O, w), T(";")) : (J(w), X(O, "optional"));
|
|
7261
7262
|
}), R.add(O);
|
|
7262
7263
|
}
|
|
7263
7264
|
function de(R, g) {
|
|
@@ -7275,7 +7276,7 @@ function requireParse() {
|
|
|
7275
7276
|
default:
|
|
7276
7277
|
Oe(O, w);
|
|
7277
7278
|
}
|
|
7278
|
-
}), R.add(O), R === $ &&
|
|
7279
|
+
}), R.add(O), R === $ && Y.push(O);
|
|
7279
7280
|
}
|
|
7280
7281
|
function Oe(R, g) {
|
|
7281
7282
|
if (!_.test(g))
|
|
@@ -7377,7 +7378,7 @@ function requireParse() {
|
|
|
7377
7378
|
we(O, w);
|
|
7378
7379
|
else
|
|
7379
7380
|
throw N(w);
|
|
7380
|
-
}), R.add(O), R === $ &&
|
|
7381
|
+
}), R.add(O), R === $ && Y.push(O);
|
|
7381
7382
|
}
|
|
7382
7383
|
function we(R, g) {
|
|
7383
7384
|
var O = k(), b = g;
|
|
@@ -7403,15 +7404,15 @@ function requireParse() {
|
|
|
7403
7404
|
switch (w) {
|
|
7404
7405
|
case "required":
|
|
7405
7406
|
case "repeated":
|
|
7406
|
-
|
|
7407
|
+
X(R, w, O);
|
|
7407
7408
|
break;
|
|
7408
7409
|
case "optional":
|
|
7409
|
-
D === "proto3" ?
|
|
7410
|
+
D === "proto3" ? X(R, "proto3_optional", O) : X(R, "optional", O);
|
|
7410
7411
|
break;
|
|
7411
7412
|
default:
|
|
7412
7413
|
if (D === "proto2" || !A.test(w))
|
|
7413
7414
|
throw N(w);
|
|
7414
|
-
J(w),
|
|
7415
|
+
J(w), X(R, "optional", O);
|
|
7415
7416
|
break;
|
|
7416
7417
|
}
|
|
7417
7418
|
});
|
|
@@ -7461,9 +7462,9 @@ var common_1, hasRequiredCommon;
|
|
|
7461
7462
|
function requireCommon() {
|
|
7462
7463
|
if (hasRequiredCommon) return common_1;
|
|
7463
7464
|
hasRequiredCommon = 1, common_1 = f;
|
|
7464
|
-
var
|
|
7465
|
+
var a = /\\/|\\./;
|
|
7465
7466
|
function f(c, d) {
|
|
7466
|
-
|
|
7467
|
+
a.test(c) || (c = "google/protobuf/" + c + ".proto", d = { nested: { google: { nested: { protobuf: { nested: d } } } } }), f[c] = d;
|
|
7467
7468
|
}
|
|
7468
7469
|
f("any", {
|
|
7469
7470
|
/**
|
|
@@ -7780,34 +7781,34 @@ var hasRequiredSrc;
|
|
|
7780
7781
|
function requireSrc() {
|
|
7781
7782
|
if (hasRequiredSrc) return src.exports;
|
|
7782
7783
|
hasRequiredSrc = 1;
|
|
7783
|
-
var
|
|
7784
|
-
return
|
|
7784
|
+
var a = src.exports = requireIndexLight();
|
|
7785
|
+
return a.build = "full", a.tokenize = requireTokenize(), a.parse = requireParse(), a.common = requireCommon(), a.Root._configure(a.Type, a.parse, a.common), src.exports;
|
|
7785
7786
|
}
|
|
7786
7787
|
var protobufjs, hasRequiredProtobufjs;
|
|
7787
7788
|
function requireProtobufjs() {
|
|
7788
7789
|
return hasRequiredProtobufjs || (hasRequiredProtobufjs = 1, protobufjs = requireSrc()), protobufjs;
|
|
7789
7790
|
}
|
|
7790
|
-
var protobufjsExports = requireProtobufjs(), StateStreamErrorCode = /* @__PURE__ */ ((
|
|
7791
|
-
const DEFAULT_MAX_RECONNECT_ATTEMPTS = 5, DEFAULT_MAX_AUTH_ATTEMPTS = 5, nested = { BSB_State: { nested: { StateUpdate: { oneofs: { state: { oneof: ["deviceName", "power", "brightness", "audioVolume", "wifi", "updateState", "updateCheck", "timezone", "matter", "frame", "input", "timer", "ble", "autoUpdateState"] } }, fields: { deviceName: { type: "BSB_State.DeviceName", id: 1 }, power: { type: "BSB_State.Power", id: 2 }, brightness: { type: "BSB_State.Brightness", id: 3 }, audioVolume: { type: "BSB_State.AudioVolume", id: 4 }, wifi: { type: "BSB_State.Wifi", id: 5 }, updateState: { type: "BSB_Update.UpdateState", id: 6 }, updateCheck: { type: "BSB_Update.CheckState", id: 7 }, timezone: { type: "BSB_State.Timezone", id: 8 }, matter: { type: "BSB_State.Matter", id: 9 }, frame: { type: "BSB_Frame.Frame", id: 10 }, input: { type: "BSB_Input.InputEvent", id: 11 }, timer: { type: "BSB_Timer.Timer", id: 12 }, ble: { type: "BSB_State.Ble.Ble", id: 13 }, autoUpdateState: { type: "BSB_Update.AutoUpdateState", id: 14 } } }, State: { oneofs: { _error: { oneof: ["error"] } }, fields: { timestamp: { type: "fixed64", id: 1 }, updates: { rule: "repeated", type: "StateUpdate", id: 2 }, error: { type: "BSB_Error.Error", id: 3, options: { proto3_optional: !0 } } } }, DeviceName: { fields: { name: { type: "string", id: 1 } } }, BrightnessAutomatic: { fields: {} }, BrightnessManual: { fields: { brightness: { type: "uint32", id: 1 } } }, Brightness: { oneofs: { setting: { oneof: ["automatic", "manual"] } }, fields: { automatic: { type: "BrightnessAutomatic", id: 1 }, manual: { type: "BrightnessManual", id: 2 }, actualBrightness: { type: "uint32", id: 3 } } }, BatteryStatus: { values: { DISCHARGING: 0, CHARGING: 1, CHARGED: 2 } }, UnknownPowerState: { fields: {} }, PowerState: { fields: { batteryStatus: { type: "BatteryStatus", id: 1 }, batteryChargePercent: { type: "uint32", id: 2 }, batteryVoltageMv: { type: "uint32", id: 3 }, batteryCurrentMa: { type: "sint32", id: 4 }, usbVoltageMv: { type: "uint32", id: 5 } } }, Power: { oneofs: { state: { oneof: ["unknown", "known"] } }, fields: { unknown: { type: "UnknownPowerState", id: 1 }, known: { type: "PowerState", id: 2 } } }, AudioVolume: { fields: { volume: { type: "uint32", id: 1 } } }, WifiConnectionStatus: { values: { CONNECTED: 0, CONNECTING: 1, DISCONNECTING: 2, RECONNECTING: 3 } }, WifiSecurity: { values: { UNKNOWN: 0, OPEN: 1, WPA: 2, WPA2: 3, WEP: 4, WPA_WPA2: 5, WPA3: 6, WPA2_WPA3: 7 } }, IpConfigurationMethod: { values: { DHCP: 0, STATIC: 1 } }, IpProtocol: { values: { IPV4: 0, IPV6: 1 } }, WifiStateUnknown: { fields: {} }, WifiStateDisconnected: { fields: {} }, WifiStateConnected: { fields: { status: { type: "WifiConnectionStatus", id: 1 }, ssid: { type: "string", id: 2 }, bssid: { type: "string", id: 3 }, channel: { type: "uint32", id: 4 }, rssi: { type: "sint32", id: 5 }, security: { type: "WifiSecurity", id: 6 } } }, IpAddress: { fields: { protocol: { type: "IpProtocol", id: 1 }, method: { type: "IpConfigurationMethod", id: 2 }, address: { type: "string", id: 3 }, gateway: { type: "string", id: 4 }, netmask: { type: "string", id: 5 } } }, Wifi: { oneofs: { wifiState: { oneof: ["unknown", "disconnected", "connected"] } }, fields: { unknown: { type: "WifiStateUnknown", id: 1 }, disconnected: { type: "WifiStateDisconnected", id: 2 }, connected: { type: "WifiStateConnected", id: 3 }, ipAddresses: { rule: "repeated", type: "IpAddress", id: 4 } } }, Timezone: { fields: { name: { type: "string", id: 1 }, offset: { type: "sint32", id: 2 }, abbr: { type: "string", id: 3 } } }, MatterCommissioningStatus: { values: { NEVER_STARTED: 0, STARTED: 1, COMPLETED_SUCCESSFULLY: 2, FAILED: 3 } }, MatterCommissioningState: { fields: { status: { type: "MatterCommissioningStatus", id: 1 }, timestamp: { type: "fixed64", id: 2 } } }, Matter: { fields: { fabricCount: { type: "uint32", id: 1 }, state: { type: "MatterCommissioningState", id: 2 } } }, Ble: { nested: { ServiceStatus: { values: { RESET: 0, INITIALIZATION: 1, READY: 2, ADVERTISING: 3, CONNECTABLE: 4, CONNECTED: 5, ERROR: 6 } }, Ble: { oneofs: { _remoteAddress: { oneof: ["remoteAddress"] } }, fields: { status: { type: "ServiceStatus", id: 1 }, remoteAddress: { type: "string", id: 2, options: { proto3_optional: !0 } } } } } } } }, BSB_Update: { nested: { UpdateEvent: { values: { SESSION_START: 0, SESSION_STOP: 1, ACTION_BEGIN: 2, ACTION_DONE: 3, DETAIL_CHANGE: 4, ACTION_PROGRESS: 5, EVENT_NONE: 6 } }, UpdateAction: { values: { DOWNLOAD: 0, SHA_VERIFICATION: 1, UNPACK: 2, INSTALLATION_PREPARE: 3, INSTALLATION_APPLY: 4, ACTION_NONE: 5 } }, UpdateStatus: { values: { OK: 0, BATTERY_LOW: 1, BUSY: 2, DOWNLOAD_FAILURE: 3, DOWNLOAD_ABORT: 4, SHA_MISMATCH: 5, UNPACK_CREATE_STAGING_DIRECTORY_FAILURE: 6, UNPACK_ARCHIVE_OPEN_FAILURE: 7, UNPACK_ARCHIVE_UNPACK_FAILURE: 8, INSTALLATION_PREPARE_MANIFEST_NOT_FOUND: 9, INSTALLATION_PREPARE_MANIFEST_INVALID: 10, INSTALLATION_PREPARE_SESSION_CONFIG_SETUP_FAILURE: 11, INSTALLATION_PREPARE_POINTER_SETUP_FAILURE: 12, UNKNOWN_FAILURE: 13 } }, CheckError: { values: { NOT_AVAILABLE: 0, FAILURE: 1, IDLE: 2 } }, UpdateAvailable: { fields: { version: { type: "string", id: 1 } } }, UpdateUnavailable: { fields: { reason: { type: "CheckError", id: 1 } } }, UpdateState: { fields: { event: { type: "UpdateEvent", id: 1 }, action: { type: "UpdateAction", id: 2 }, status: { type: "UpdateStatus", id: 3 } } }, CheckState: { oneofs: { status: { oneof: ["available", "unavailable"] } }, fields: { available: { type: "UpdateAvailable", id: 1 }, unavailable: { type: "UpdateUnavailable", id: 2 } } }, AutoUpdateInterval: { fields: { start: { type: "uint32", id: 1 }, end: { type: "uint32", id: 2 } } }, AutoUpdateState: { fields: { enabled: { type: "bool", id: 1 }, interval: { type: "AutoUpdateInterval", id: 2 } } } } }, BSB_Frame: { nested: { Encoding: { values: { PLAIN: 0, RUN_LENGTH: 1, DEFLATE: 2, DEFLATE_RUN_LENGTH: 3 } }, PixelFormat: { values: { RGB888: 0, L8: 1, L4: 2 } }, Screen: { values: { FRONT: 0, BACK: 1 } }, Frame: { fields: { screen: { type: "Screen", id: 1 }, width: { type: "uint32", id: 2 }, height: { type: "uint32", id: 3 }, encoding: { type: "Encoding", id: 4 }, pixelFormat: { type: "PixelFormat", id: 5 }, data: { type: "bytes", id: 6 } } } } }, BSB_Timer: { nested: { Timer: { fields: { json: { type: "BSB_Util.Json", id: 1 } } } } }, BSB_Util: { nested: { Compression: { values: { PLAIN: 0, GZIP: 1 } }, Json: { fields: { compression: { type: "Compression", id: 1 }, data: { type: "bytes", id: 2 } } } } }, BSB_Input: { nested: { Button: { values: { OK: 0, BACK: 1, START: 2 } }, ButtonAction: { values: { PRESS: 0, RELEASE: 1 } }, SwitchPosition: { values: { BUSY: 0, CUSTOM: 1, OFF: 2, APPS: 3, SETTINGS: 4 } }, ButtonEvent: { fields: { button: { type: "Button", id: 1 }, action: { type: "ButtonAction", id: 2 } } }, SwitchEvent: { fields: { position: { type: "SwitchPosition", id: 1 } } }, EncoderEvent: { fields: { delta: { type: "sint32", id: 1 } } }, InputEvent: { oneofs: { event: { oneof: ["buttonEvent", "switchEvent", "encoderEvent"] } }, fields: { buttonEvent: { type: "ButtonEvent", id: 1 }, switchEvent: { type: "SwitchEvent", id: 2 }, encoderEvent: { type: "EncoderEvent", id: 3 } } } } }, BSB_Error: { nested: { Cause: { values: { RESOURCE_LIMIT: 0 } }, Severity: { values: { FATAL: 0, ERROR: 1, WARNING: 2 } }, Error: { fields: { cause: { type: "Cause", id: 1 }, severity: { type: "Severity", id: 2 } } } } } };
|
|
7791
|
+
var protobufjsExports = requireProtobufjs(), StateStreamErrorCode = /* @__PURE__ */ ((a) => (a.CONNECTION_FAILED = "CONNECTION_FAILED", a.RECONNECT_FAILED = "RECONNECT_FAILED", a.CONNECTION_LOST = "CONNECTION_LOST", a.CONNECTION_TIMEOUT = "CONNECTION_TIMEOUT", a.AUTH_FAILED = "AUTH_FAILED", a.AUTH_REFRESH_FAILED = "AUTH_REFRESH_FAILED", a.DEVICE_ERROR = "DEVICE_ERROR", a.DECODE_ERROR = "DECODE_ERROR", a.FRAME_PROCESS_ERROR = "FRAME_PROCESS_ERROR", a.STREAM_ALREADY_STARTED = "STREAM_ALREADY_STARTED", a.WORKER_INIT_FAILED = "WORKER_INIT_FAILED", a.UNKNOWN_ERROR = "UNKNOWN_ERROR", a))(StateStreamErrorCode || {}), ConnectionStatus = /* @__PURE__ */ ((a) => (a.DISCONNECTED = "DISCONNECTED", a.CONNECTING = "CONNECTING", a.CONNECTED = "CONNECTED", a.RECONNECTING = "RECONNECTING", a))(ConnectionStatus || {}), AuthStatus = /* @__PURE__ */ ((a) => (a.UNAUTHENTICATED = "UNAUTHENTICATED", a.AUTHENTICATING = "AUTHENTICATING", a.AUTHENTICATED = "AUTHENTICATED", a.REAUTHENTICATING = "REAUTHENTICATING", a.FAILED = "FAILED", a))(AuthStatus || {});
|
|
7792
|
+
const DEFAULT_MAX_RECONNECT_ATTEMPTS = 5, DEFAULT_MAX_AUTH_ATTEMPTS = 5, DEFAULT_DELAY_RECONNECT = 500, nested = { BSB_State: { nested: { StateUpdate: { oneofs: { state: { oneof: ["deviceName", "power", "brightness", "audioVolume", "wifi", "updateState", "updateCheck", "timezone", "matter", "frame", "input", "timer", "ble", "autoUpdateState"] } }, fields: { deviceName: { type: "BSB_State.DeviceName", id: 1 }, power: { type: "BSB_State.Power", id: 2 }, brightness: { type: "BSB_State.Brightness", id: 3 }, audioVolume: { type: "BSB_State.AudioVolume", id: 4 }, wifi: { type: "BSB_State.Wifi", id: 5 }, updateState: { type: "BSB_Update.UpdateState", id: 6 }, updateCheck: { type: "BSB_Update.CheckState", id: 7 }, timezone: { type: "BSB_State.Timezone", id: 8 }, matter: { type: "BSB_State.Matter", id: 9 }, frame: { type: "BSB_Frame.Frame", id: 10 }, input: { type: "BSB_Input.InputEvent", id: 11 }, timer: { type: "BSB_Timer.Timer", id: 12 }, ble: { type: "BSB_State.Ble.Ble", id: 13 }, autoUpdateState: { type: "BSB_Update.AutoUpdateState", id: 14 } } }, State: { oneofs: { _error: { oneof: ["error"] } }, fields: { timestamp: { type: "fixed64", id: 1 }, updates: { rule: "repeated", type: "StateUpdate", id: 2 }, error: { type: "BSB_Error.Error", id: 3, options: { proto3_optional: !0 } } } }, DeviceName: { fields: { name: { type: "string", id: 1 } } }, BrightnessAutomatic: { fields: {} }, BrightnessManual: { fields: { brightness: { type: "uint32", id: 1 } } }, Brightness: { oneofs: { setting: { oneof: ["automatic", "manual"] } }, fields: { automatic: { type: "BrightnessAutomatic", id: 1 }, manual: { type: "BrightnessManual", id: 2 }, actualBrightness: { type: "uint32", id: 3 } } }, BatteryStatus: { values: { DISCHARGING: 0, CHARGING: 1, CHARGED: 2 } }, UnknownPowerState: { fields: {} }, PowerState: { fields: { batteryStatus: { type: "BatteryStatus", id: 1 }, batteryChargePercent: { type: "uint32", id: 2 }, batteryVoltageMv: { type: "uint32", id: 3 }, batteryCurrentMa: { type: "sint32", id: 4 }, usbVoltageMv: { type: "uint32", id: 5 } } }, Power: { oneofs: { state: { oneof: ["unknown", "known"] } }, fields: { unknown: { type: "UnknownPowerState", id: 1 }, known: { type: "PowerState", id: 2 } } }, AudioVolume: { fields: { volume: { type: "uint32", id: 1 } } }, WifiConnectionStatus: { values: { CONNECTED: 0, CONNECTING: 1, DISCONNECTING: 2, RECONNECTING: 3 } }, WifiSecurity: { values: { UNKNOWN: 0, OPEN: 1, WPA: 2, WPA2: 3, WEP: 4, WPA_WPA2: 5, WPA3: 6, WPA2_WPA3: 7 } }, IpConfigurationMethod: { values: { DHCP: 0, STATIC: 1 } }, IpProtocol: { values: { IPV4: 0, IPV6: 1 } }, WifiStateUnknown: { fields: {} }, WifiStateDisconnected: { fields: {} }, WifiStateConnected: { fields: { status: { type: "WifiConnectionStatus", id: 1 }, ssid: { type: "string", id: 2 }, bssid: { type: "string", id: 3 }, channel: { type: "uint32", id: 4 }, rssi: { type: "sint32", id: 5 }, security: { type: "WifiSecurity", id: 6 } } }, IpAddress: { fields: { protocol: { type: "IpProtocol", id: 1 }, method: { type: "IpConfigurationMethod", id: 2 }, address: { type: "string", id: 3 }, gateway: { type: "string", id: 4 }, netmask: { type: "string", id: 5 } } }, Wifi: { oneofs: { wifiState: { oneof: ["unknown", "disconnected", "connected"] } }, fields: { unknown: { type: "WifiStateUnknown", id: 1 }, disconnected: { type: "WifiStateDisconnected", id: 2 }, connected: { type: "WifiStateConnected", id: 3 }, ipAddresses: { rule: "repeated", type: "IpAddress", id: 4 } } }, Timezone: { fields: { name: { type: "string", id: 1 }, offset: { type: "sint32", id: 2 }, abbr: { type: "string", id: 3 } } }, MatterCommissioningStatus: { values: { NEVER_STARTED: 0, STARTED: 1, COMPLETED_SUCCESSFULLY: 2, FAILED: 3 } }, MatterCommissioningState: { fields: { status: { type: "MatterCommissioningStatus", id: 1 }, timestamp: { type: "fixed64", id: 2 } } }, Matter: { fields: { fabricCount: { type: "uint32", id: 1 }, state: { type: "MatterCommissioningState", id: 2 } } }, Ble: { nested: { ServiceStatus: { values: { RESET: 0, INITIALIZATION: 1, READY: 2, ADVERTISING: 3, CONNECTABLE: 4, CONNECTED: 5, ERROR: 6 } }, Ble: { oneofs: { _remoteAddress: { oneof: ["remoteAddress"] } }, fields: { status: { type: "ServiceStatus", id: 1 }, remoteAddress: { type: "string", id: 2, options: { proto3_optional: !0 } } } } } } } }, BSB_Update: { nested: { UpdateEvent: { values: { SESSION_START: 0, SESSION_STOP: 1, ACTION_BEGIN: 2, ACTION_DONE: 3, DETAIL_CHANGE: 4, ACTION_PROGRESS: 5, EVENT_NONE: 6 } }, UpdateAction: { values: { DOWNLOAD: 0, SHA_VERIFICATION: 1, UNPACK: 2, INSTALLATION_PREPARE: 3, INSTALLATION_APPLY: 4, ACTION_NONE: 5 } }, UpdateStatus: { values: { OK: 0, BATTERY_LOW: 1, BUSY: 2, DOWNLOAD_FAILURE: 3, DOWNLOAD_ABORT: 4, SHA_MISMATCH: 5, UNPACK_CREATE_STAGING_DIRECTORY_FAILURE: 6, UNPACK_ARCHIVE_OPEN_FAILURE: 7, UNPACK_ARCHIVE_UNPACK_FAILURE: 8, INSTALLATION_PREPARE_MANIFEST_NOT_FOUND: 9, INSTALLATION_PREPARE_MANIFEST_INVALID: 10, INSTALLATION_PREPARE_SESSION_CONFIG_SETUP_FAILURE: 11, INSTALLATION_PREPARE_POINTER_SETUP_FAILURE: 12, UNKNOWN_FAILURE: 13 } }, CheckError: { values: { NOT_AVAILABLE: 0, FAILURE: 1, IDLE: 2 } }, UpdateAvailable: { fields: { version: { type: "string", id: 1 } } }, UpdateUnavailable: { fields: { reason: { type: "CheckError", id: 1 } } }, UpdateState: { fields: { event: { type: "UpdateEvent", id: 1 }, action: { type: "UpdateAction", id: 2 }, status: { type: "UpdateStatus", id: 3 } } }, CheckState: { oneofs: { status: { oneof: ["available", "unavailable"] } }, fields: { available: { type: "UpdateAvailable", id: 1 }, unavailable: { type: "UpdateUnavailable", id: 2 } } }, AutoUpdateInterval: { fields: { start: { type: "uint32", id: 1 }, end: { type: "uint32", id: 2 } } }, AutoUpdateState: { fields: { enabled: { type: "bool", id: 1 }, interval: { type: "AutoUpdateInterval", id: 2 } } } } }, BSB_Frame: { nested: { Encoding: { values: { PLAIN: 0, RUN_LENGTH: 1, DEFLATE: 2, DEFLATE_RUN_LENGTH: 3 } }, PixelFormat: { values: { RGB888: 0, L8: 1, L4: 2 } }, Screen: { values: { FRONT: 0, BACK: 1 } }, Frame: { fields: { screen: { type: "Screen", id: 1 }, width: { type: "uint32", id: 2 }, height: { type: "uint32", id: 3 }, encoding: { type: "Encoding", id: 4 }, pixelFormat: { type: "PixelFormat", id: 5 }, data: { type: "bytes", id: 6 } } } } }, BSB_Timer: { nested: { Timer: { fields: { json: { type: "BSB_Util.Json", id: 1 } } } } }, BSB_Util: { nested: { Compression: { values: { PLAIN: 0, GZIP: 1 } }, Json: { fields: { compression: { type: "Compression", id: 1 }, data: { type: "bytes", id: 2 } } } } }, BSB_Input: { nested: { Button: { values: { OK: 0, BACK: 1, START: 2 } }, ButtonAction: { values: { PRESS: 0, RELEASE: 1 } }, SwitchPosition: { values: { BUSY: 0, CUSTOM: 1, OFF: 2, APPS: 3, SETTINGS: 4 } }, ButtonEvent: { fields: { button: { type: "Button", id: 1 }, action: { type: "ButtonAction", id: 2 } } }, SwitchEvent: { fields: { position: { type: "SwitchPosition", id: 1 } } }, EncoderEvent: { fields: { delta: { type: "sint32", id: 1 } } }, InputEvent: { oneofs: { event: { oneof: ["buttonEvent", "switchEvent", "encoderEvent"] } }, fields: { buttonEvent: { type: "ButtonEvent", id: 1 }, switchEvent: { type: "SwitchEvent", id: 2 }, encoderEvent: { type: "EncoderEvent", id: 3 } } } } }, BSB_Error: { nested: { Cause: { values: { RESOURCE_LIMIT: 0 } }, Severity: { values: { FATAL: 0, ERROR: 1, WARNING: 2 } }, Error: { fields: { cause: { type: "Cause", id: 1 }, severity: { type: "Severity", id: 2 } } } } } };
|
|
7792
7793
|
var bundle = {
|
|
7793
7794
|
nested
|
|
7794
7795
|
};
|
|
7795
|
-
function decompressRLE(
|
|
7796
|
+
function decompressRLE(a, f) {
|
|
7796
7797
|
const h = [];
|
|
7797
|
-
for (let c = 0; c <
|
|
7798
|
-
const d =
|
|
7798
|
+
for (let c = 0; c < a.length; ) {
|
|
7799
|
+
const d = a[c++];
|
|
7799
7800
|
if (d === void 0) break;
|
|
7800
7801
|
const n = d & 127;
|
|
7801
7802
|
if (!n)
|
|
7802
7803
|
continue;
|
|
7803
7804
|
if (d & 128) {
|
|
7804
|
-
const r = n * f, i =
|
|
7805
|
+
const r = n * f, i = a.subarray(c, c + r);
|
|
7805
7806
|
for (let t = 0; t < i.length; t++)
|
|
7806
7807
|
h.push(i[t]);
|
|
7807
7808
|
c += r;
|
|
7808
7809
|
continue;
|
|
7809
7810
|
}
|
|
7810
|
-
const e =
|
|
7811
|
+
const e = a.subarray(c, c + f);
|
|
7811
7812
|
c += f;
|
|
7812
7813
|
for (let r = 0; r < n; r++)
|
|
7813
7814
|
for (let i = 0; i < f; i++)
|
|
@@ -7815,23 +7816,23 @@ function decompressRLE(u, f) {
|
|
|
7815
7816
|
}
|
|
7816
7817
|
return new Uint8Array(h);
|
|
7817
7818
|
}
|
|
7818
|
-
async function decompressDeflate(
|
|
7819
|
+
async function decompressDeflate(a) {
|
|
7819
7820
|
if (typeof DecompressionStream > "u")
|
|
7820
7821
|
throw new Error("DecompressionStream is not supported in this environment.");
|
|
7821
7822
|
try {
|
|
7822
7823
|
const f = new DecompressionStream("deflate"), h = f.writable.getWriter();
|
|
7823
|
-
h.write(
|
|
7824
|
+
h.write(a), h.close();
|
|
7824
7825
|
const d = await new Response(f.readable).arrayBuffer();
|
|
7825
7826
|
return new Uint8Array(d);
|
|
7826
7827
|
} catch (f) {
|
|
7827
7828
|
throw new Error(\`Deflate decompression failed: \${f instanceof Error ? f.message : String(f)}\`);
|
|
7828
7829
|
}
|
|
7829
7830
|
}
|
|
7830
|
-
function convertL4toRGBA(
|
|
7831
|
+
function convertL4toRGBA(a, f, h) {
|
|
7831
7832
|
const c = new Uint8ClampedArray(f * h * 4);
|
|
7832
7833
|
let d = 0;
|
|
7833
|
-
for (let n = 0; n <
|
|
7834
|
-
const e =
|
|
7834
|
+
for (let n = 0; n < a.length; n++) {
|
|
7835
|
+
const e = a[n], r = (e & 15) * 17, i = (e >> 4 & 15) * 17, t = [r, i];
|
|
7835
7836
|
for (const l of t)
|
|
7836
7837
|
if (d < f * h) {
|
|
7837
7838
|
const s = d * 4;
|
|
@@ -7840,28 +7841,28 @@ function convertL4toRGBA(u, f, h) {
|
|
|
7840
7841
|
}
|
|
7841
7842
|
return c;
|
|
7842
7843
|
}
|
|
7843
|
-
function convertL8toRGBA(
|
|
7844
|
-
const c = new Uint8ClampedArray(f * h * 4), d = Math.min(
|
|
7844
|
+
function convertL8toRGBA(a, f, h) {
|
|
7845
|
+
const c = new Uint8ClampedArray(f * h * 4), d = Math.min(a.length, f * h);
|
|
7845
7846
|
for (let n = 0; n < d; n++) {
|
|
7846
|
-
const e =
|
|
7847
|
+
const e = a[n], r = n * 4;
|
|
7847
7848
|
c[r] = e, c[r + 1] = e, c[r + 2] = e, c[r + 3] = 255;
|
|
7848
7849
|
}
|
|
7849
7850
|
return c;
|
|
7850
7851
|
}
|
|
7851
|
-
function convertRGB888toRGBA(
|
|
7852
|
+
function convertRGB888toRGBA(a, f, h) {
|
|
7852
7853
|
const c = new Uint8ClampedArray(f * h * 4), d = f * h;
|
|
7853
7854
|
for (let n = 0; n < d; n++) {
|
|
7854
7855
|
const e = n * 3, r = n * 4;
|
|
7855
|
-
e + 2 <
|
|
7856
|
+
e + 2 < a.length && (c[r] = a[e + 2], c[r + 1] = a[e + 1], c[r + 2] = a[e], c[r + 3] = 255);
|
|
7856
7857
|
}
|
|
7857
7858
|
return c;
|
|
7858
7859
|
}
|
|
7859
|
-
async function processFrame(
|
|
7860
|
-
if (!
|
|
7860
|
+
async function processFrame(a) {
|
|
7861
|
+
if (!a.data || !a.width || !a.height)
|
|
7861
7862
|
return null;
|
|
7862
|
-
let f =
|
|
7863
|
-
const h =
|
|
7864
|
-
switch (
|
|
7863
|
+
let f = a.data;
|
|
7864
|
+
const h = a.pixelFormat === 0 ? 3 : 1;
|
|
7865
|
+
switch (a.encoding) {
|
|
7865
7866
|
case 1:
|
|
7866
7867
|
f = decompressRLE(f, h);
|
|
7867
7868
|
break;
|
|
@@ -7872,24 +7873,24 @@ async function processFrame(u) {
|
|
|
7872
7873
|
f = await decompressDeflate(f), f = decompressRLE(f, h);
|
|
7873
7874
|
break;
|
|
7874
7875
|
}
|
|
7875
|
-
switch (
|
|
7876
|
+
switch (a.pixelFormat) {
|
|
7876
7877
|
case 2:
|
|
7877
|
-
return convertL4toRGBA(f,
|
|
7878
|
+
return convertL4toRGBA(f, a.width, a.height);
|
|
7878
7879
|
case 1:
|
|
7879
|
-
return convertL8toRGBA(f,
|
|
7880
|
+
return convertL8toRGBA(f, a.width, a.height);
|
|
7880
7881
|
case 0:
|
|
7881
|
-
return convertRGB888toRGBA(f,
|
|
7882
|
+
return convertRGB888toRGBA(f, a.width, a.height);
|
|
7882
7883
|
default:
|
|
7883
|
-
return new Uint8ClampedArray(
|
|
7884
|
+
return new Uint8ClampedArray(a.width * a.height * 4);
|
|
7884
7885
|
}
|
|
7885
7886
|
}
|
|
7886
|
-
const root = protobufjsExports.Root.fromJSON(bundle), StateType = root.lookupType("BSB_State.State"), AUTH_CODE = 3e3
|
|
7887
|
-
let maxAuthAttempts = DEFAULT_MAX_AUTH_ATTEMPTS, maxReconnectAttempts = DEFAULT_MAX_RECONNECT_ATTEMPTS, socket = null, isBinaryMode = !0, currentMode = "local", currentToken, currentAddr = "", retryCount = 0, authRetryCount = 0, isAuthReported = !1
|
|
7887
|
+
const root = protobufjsExports.Root.fromJSON(bundle), StateType = root.lookupType("BSB_State.State"), AUTH_CODE = 3e3;
|
|
7888
|
+
let maxAuthAttempts = DEFAULT_MAX_AUTH_ATTEMPTS, maxReconnectAttempts = DEFAULT_MAX_RECONNECT_ATTEMPTS, reconnectDelay = DEFAULT_DELAY_RECONNECT, socket = null, isBinaryMode = !0, currentMode = "local", currentToken, currentAddr = "", retryCount = 0, authRetryCount = 0, isAuthReported = !1;
|
|
7888
7889
|
const activePorts = /* @__PURE__ */ new Set(), subscriptions = /* @__PURE__ */ new Map();
|
|
7889
7890
|
let processingQueue = Promise.resolve();
|
|
7890
|
-
function broadcast(
|
|
7891
|
+
function broadcast(a) {
|
|
7891
7892
|
for (const f of activePorts)
|
|
7892
|
-
f.postMessage(
|
|
7893
|
+
f.postMessage(a);
|
|
7893
7894
|
}
|
|
7894
7895
|
function sendAuth() {
|
|
7895
7896
|
currentMode === "remote" && currentToken && (socket == null ? void 0 : socket.readyState) === WebSocket.OPEN && (broadcast({ type: "STATUS_UPDATE", auth: AuthStatus.AUTHENTICATING }), socket.send(JSON.stringify({ token: currentToken })));
|
|
@@ -7901,16 +7902,17 @@ function sendSubscriptions() {
|
|
|
7901
7902
|
})
|
|
7902
7903
|
);
|
|
7903
7904
|
}
|
|
7905
|
+
function stopSocket() {
|
|
7906
|
+
socket && (socket.onopen = null, socket.onmessage = null, socket.onerror = null, socket.onclose = null, socket.close(), socket = null);
|
|
7907
|
+
}
|
|
7904
7908
|
function stopAndCleanup() {
|
|
7905
|
-
|
|
7909
|
+
stopSocket(), subscriptions.clear(), activePorts.clear(), retryCount = 0, authRetryCount = 0, isAuthReported = !1;
|
|
7906
7910
|
}
|
|
7907
|
-
function connect(
|
|
7908
|
-
|
|
7909
|
-
const d = new URL(
|
|
7911
|
+
function connect(a, f, h = !0, c = "local") {
|
|
7912
|
+
stopSocket(), broadcast({ type: "STATUS_UPDATE", connection: ConnectionStatus.CONNECTING }), currentAddr = a, isBinaryMode = h, currentMode = c, currentToken = f, isAuthReported = !1;
|
|
7913
|
+
const d = new URL(a);
|
|
7910
7914
|
socket = new WebSocket(d.toString()), socket.binaryType = "arraybuffer", socket.onopen = () => {
|
|
7911
|
-
broadcast({ type: "CONNECTED" }), currentMode === "local" && (socket == null || socket.send(JSON.stringify({ enable: !0 }))), sendAuth(),
|
|
7912
|
-
retryCount = 0, authRetryCount = 0, console.log("[Worker] Connection stable. All retry counters reset.");
|
|
7913
|
-
}, 5e3), currentMode === "remote" && subscriptions.size > 0 && sendSubscriptions(), currentMode === "local" && broadcast({ type: "STATUS_UPDATE", auth: AuthStatus.AUTHENTICATED });
|
|
7915
|
+
broadcast({ type: "CONNECTED" }), currentMode === "local" && (socket == null || socket.send(JSON.stringify({ enable: !0 }))), sendAuth(), retryCount = 0, authRetryCount = 0, console.log("[Worker] Connection stable. All retry counters reset."), currentMode === "remote" && subscriptions.size > 0 && sendSubscriptions(), currentMode === "local" && broadcast({ type: "STATUS_UPDATE", auth: AuthStatus.AUTHENTICATED });
|
|
7914
7916
|
}, socket.onmessage = (n) => {
|
|
7915
7917
|
processingQueue = processingQueue.then(async () => {
|
|
7916
7918
|
try {
|
|
@@ -7929,19 +7931,19 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
7929
7931
|
defaults: !0
|
|
7930
7932
|
});
|
|
7931
7933
|
if (l.error) {
|
|
7932
|
-
const { cause: s, severity:
|
|
7933
|
-
if (s != null &&
|
|
7934
|
-
const o = root.lookupEnum("BSB_Error.Cause"), p = root.lookupEnum("BSB_Error.Severity"), y = o.valuesById[s] || "UNKNOWN", E = p.valuesById[
|
|
7934
|
+
const { cause: s, severity: u } = l.error;
|
|
7935
|
+
if (s != null && u != null) {
|
|
7936
|
+
const o = root.lookupEnum("BSB_Error.Cause"), p = root.lookupEnum("BSB_Error.Severity"), y = o.valuesById[s] || "UNKNOWN", E = p.valuesById[u] || "UNKNOWN";
|
|
7935
7937
|
if (broadcast({
|
|
7936
7938
|
type: "ERROR",
|
|
7937
7939
|
code: StateStreamErrorCode.DEVICE_ERROR,
|
|
7938
7940
|
message: \`Server reported \${E}: \${y}\`,
|
|
7939
7941
|
data: l.error
|
|
7940
|
-
}),
|
|
7942
|
+
}), u === p.values.FATAL) {
|
|
7941
7943
|
stopAndCleanup();
|
|
7942
7944
|
return;
|
|
7943
7945
|
}
|
|
7944
|
-
if (
|
|
7946
|
+
if (u === p.values.ERROR)
|
|
7945
7947
|
return;
|
|
7946
7948
|
} else
|
|
7947
7949
|
broadcast({
|
|
@@ -7953,17 +7955,17 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
7953
7955
|
}
|
|
7954
7956
|
if (l.updates)
|
|
7955
7957
|
for (const s of l.updates) {
|
|
7956
|
-
const
|
|
7957
|
-
if (
|
|
7958
|
+
const u = s.frame;
|
|
7959
|
+
if (u && u.data)
|
|
7958
7960
|
try {
|
|
7959
|
-
const o = await processFrame(
|
|
7960
|
-
o && (
|
|
7961
|
+
const o = await processFrame(u);
|
|
7962
|
+
o && (u.data = o);
|
|
7961
7963
|
} catch (o) {
|
|
7962
7964
|
broadcast({
|
|
7963
7965
|
type: "ERROR",
|
|
7964
7966
|
code: StateStreamErrorCode.FRAME_PROCESS_ERROR,
|
|
7965
7967
|
message: o instanceof Error ? o.message : String(o),
|
|
7966
|
-
data:
|
|
7968
|
+
data: u.data
|
|
7967
7969
|
});
|
|
7968
7970
|
}
|
|
7969
7971
|
}
|
|
@@ -7984,7 +7986,7 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
7984
7986
|
}, socket.onerror = () => {
|
|
7985
7987
|
broadcast({ type: "ERROR", code: StateStreamErrorCode.CONNECTION_FAILED, message: "WebSocket connection error" });
|
|
7986
7988
|
}, socket.onclose = (n) => {
|
|
7987
|
-
if (console.log("[Worker] Socket closed:", n),
|
|
7989
|
+
if (console.log("[Worker] Socket closed:", n), !socket || activePorts.size === 0) {
|
|
7988
7990
|
console.log("[Worker] Connection closed or no active ports. No retries.");
|
|
7989
7991
|
return;
|
|
7990
7992
|
}
|
|
@@ -7996,11 +7998,11 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
7996
7998
|
}));
|
|
7997
7999
|
return;
|
|
7998
8000
|
}
|
|
7999
|
-
if (
|
|
8001
|
+
if (n.code !== 1e3) {
|
|
8000
8002
|
if (retryCount < maxReconnectAttempts) {
|
|
8001
8003
|
retryCount++;
|
|
8002
|
-
|
|
8003
|
-
console.log(\`[Worker] Reconnecting (network code: \${n.code}) in \${e}ms... (Attempt \${retryCount}/\${maxReconnectAttempts})\`), broadcast({ type: "STATUS_UPDATE", connection: ConnectionStatus.RECONNECTING, connectionAttempts: retryCount }), setTimeout(() => {
|
|
8004
|
+
let e = Math.min(1e3 * retryCount, 5e3);
|
|
8005
|
+
reconnectDelay && (e = reconnectDelay), console.log(\`[Worker] Reconnecting (network code: \${n.code}) in \${e}ms... (Attempt \${retryCount}/\${maxReconnectAttempts})\`), broadcast({ type: "STATUS_UPDATE", connection: ConnectionStatus.RECONNECTING, connectionAttempts: retryCount }), setTimeout(() => {
|
|
8004
8006
|
activePorts.size > 0 && socket && connect(currentAddr, currentToken, isBinaryMode, currentMode);
|
|
8005
8007
|
}, e);
|
|
8006
8008
|
} else
|
|
@@ -8018,10 +8020,10 @@ function connect(u, f, h = !0, c = "local") {
|
|
|
8018
8020
|
});
|
|
8019
8021
|
};
|
|
8020
8022
|
}
|
|
8021
|
-
function handleCommand(
|
|
8022
|
-
switch (
|
|
8023
|
+
function handleCommand(a, f) {
|
|
8024
|
+
switch (a.type) {
|
|
8023
8025
|
case "START":
|
|
8024
|
-
maxAuthAttempts =
|
|
8026
|
+
maxAuthAttempts = a.maxAuthAttempts ?? DEFAULT_MAX_AUTH_ATTEMPTS, maxReconnectAttempts = a.maxReconnectAttempts ?? DEFAULT_MAX_RECONNECT_ATTEMPTS, reconnectDelay = a.reconnectDelay ?? DEFAULT_DELAY_RECONNECT, activePorts.add(f), socket && socket.readyState === WebSocket.OPEN && currentAddr === a.addr ? (f.postMessage({ type: "CONNECTED" }), f.postMessage({ type: "STATUS_UPDATE", auth: AuthStatus.AUTHENTICATED })) : connect(a.addr, a.token, a.isBinary, a.mode);
|
|
8025
8027
|
break;
|
|
8026
8028
|
case "STOP":
|
|
8027
8029
|
activePorts.delete(f);
|
|
@@ -8031,38 +8033,38 @@ function handleCommand(u, f) {
|
|
|
8031
8033
|
break;
|
|
8032
8034
|
case "UPDATE_TOKEN":
|
|
8033
8035
|
const h = currentToken;
|
|
8034
|
-
if (currentToken =
|
|
8036
|
+
if (currentToken = a.token, currentMode === "remote") {
|
|
8035
8037
|
const e = socket && socket.readyState === WebSocket.OPEN;
|
|
8036
|
-
if (e && h ===
|
|
8038
|
+
if (e && h === a.token)
|
|
8037
8039
|
return;
|
|
8038
|
-
e ? sendAuth() : h !==
|
|
8040
|
+
e ? sendAuth() : h !== a.token && currentAddr && activePorts.size > 0 && connect(currentAddr, currentToken, isBinaryMode, currentMode);
|
|
8039
8041
|
}
|
|
8040
8042
|
break;
|
|
8041
8043
|
case "SUBSCRIBE":
|
|
8042
|
-
let c = subscriptions.get(
|
|
8043
|
-
c || (c = /* @__PURE__ */ new Set(), subscriptions.set(
|
|
8044
|
+
let c = subscriptions.get(a.guid);
|
|
8045
|
+
c || (c = /* @__PURE__ */ new Set(), subscriptions.set(a.guid, c));
|
|
8044
8046
|
const d = c.size === 0;
|
|
8045
|
-
c.add(f), d && (socket == null ? void 0 : socket.readyState) === WebSocket.OPEN && currentMode === "remote" && socket.send(JSON.stringify({ subscribe: [
|
|
8047
|
+
c.add(f), d && (socket == null ? void 0 : socket.readyState) === WebSocket.OPEN && currentMode === "remote" && socket.send(JSON.stringify({ subscribe: [a.guid] }));
|
|
8046
8048
|
break;
|
|
8047
8049
|
case "UNSUBSCRIBE":
|
|
8048
|
-
const n = subscriptions.get(
|
|
8049
|
-
n && (n.delete(f), n.size === 0 && (subscriptions.delete(
|
|
8050
|
+
const n = subscriptions.get(a.guid);
|
|
8051
|
+
n && (n.delete(f), n.size === 0 && (subscriptions.delete(a.guid), (socket == null ? void 0 : socket.readyState) === WebSocket.OPEN && currentMode === "remote" && socket.send(JSON.stringify({ unsubscribe: [a.guid] }))));
|
|
8050
8052
|
break;
|
|
8051
8053
|
}
|
|
8052
8054
|
}
|
|
8053
8055
|
if ("SharedWorkerGlobalScope" in self) {
|
|
8054
|
-
const
|
|
8055
|
-
|
|
8056
|
+
const a = self;
|
|
8057
|
+
a.onconnect = (f) => {
|
|
8056
8058
|
const h = f.ports[0];
|
|
8057
8059
|
h && (h.onmessage = (c) => handleCommand(c.data, h), h.start());
|
|
8058
8060
|
};
|
|
8059
8061
|
} else {
|
|
8060
|
-
const
|
|
8061
|
-
|
|
8062
|
-
handleCommand(f.data,
|
|
8062
|
+
const a = self;
|
|
8063
|
+
a.onmessage = (f) => {
|
|
8064
|
+
handleCommand(f.data, a);
|
|
8063
8065
|
};
|
|
8064
8066
|
}
|
|
8065
|
-
`;function ye(e){return new SharedWorker("data:text/javascript;charset=utf-8,"+encodeURIComponent(he),{type:"module",name:e==null?void 0:e.name})}const E=class E{constructor(n,t){u(this,"addr");u(this,"token");u(this,"isBinary");u(this,"connectTimeout");u(this,"dataTimeout");u(this,"maxReconnectAttempts");u(this,"maxAuthAttempts");u(this,"worker",null);u(this,"connectionTimer",null);u(this,"dataTimer",null);u(this,"_status");u(this,"dataCallback");u(this,"rawDataCallback");u(this,"errorCallback");u(this,"statusCallback");this.addr=n.addr||"",this.token=n.token,this.isBinary=n.isBinary??!0,this.connectTimeout=(t==null?void 0:t.timeout)??5e3,this.dataTimeout=(t==null?void 0:t.dataTimeout)??15e3,this.maxReconnectAttempts=(t==null?void 0:t.maxReconnectAttempts)??de,this.maxAuthAttempts=k,this._status={main:{status:d.IDLE},connection:{status:y.DISCONNECTED},auth:{status:v.UNAUTHENTICATED},data:{status:g.NONE},worker:{status:b.OFF}}}get status(){return this._status}resolveProtocol(n){let t=n.trim();if(t.startsWith("https://"))return t.replace("https://","wss://");if(t.startsWith("http://"))return t.replace("http://","ws://");if(t.startsWith("wss://")||t.startsWith("ws://"))return t;let r="ws:";return typeof window<"u"&&window.location.protocol==="https:"&&(r="wss:"),`${r}//${t}`}start({dataCallback:n,rawDataCallback:t,errorCallback:r,statusCallback:i}){if(this._status.main.status===d.STARTING||this._status.main.status===d.RUNNING){const o=new h(c.STREAM_ALREADY_STARTED,"StateStream is already running. Call stop() before starting again.");if(i&&i({...this._status,main:{...this._status.main,lastError:o}}),r)r(o);else throw o;return}this.dataCallback=n,this.rawDataCallback=t,this.errorCallback=r,this.statusCallback=i,this.updateStatusComponent("main",{status:d.STARTING,lastError:void 0});try{this.ensureWorker(),this.sendCommand({type:"START",addr:this.normalizeUrl(this.addr),token:this.token,isBinary:this.isBinary,mode:this.streamMode,maxReconnectAttempts:this.maxReconnectAttempts,maxAuthAttempts:this.maxAuthAttempts}),this.clearConnectionTimer(),this.connectionTimer=setTimeout(()=>{const o=new h(c.CONNECTION_TIMEOUT,`Connection timed out after ${this.connectTimeout}ms`);this.mapErrorToStatus(o),this.errorCallback&&this.errorCallback(o),this.stop()},this.connectTimeout)}catch(o){const s=o instanceof h?o:new h(c.UNKNOWN_ERROR,String(o));this.errorCallback&&this.errorCallback(s)}}stop(){this.clearConnectionTimer(),this.clearDataTimer(),!(this._status.main.status===d.IDLE||this._status.main.status===d.STOPPED)&&(this.updateStatusComponent("main",{status:d.STOPPED}),this.updateStatusComponent("connection",{status:y.DISCONNECTED}),this.sendCommand({type:"STOP"}),this.clearCallbacks())}destroy(){this.stop(),this.worker&&(this.worker.terminate?this.worker.terminate():"close"in this.worker.port&&this.worker.port.close(),this.worker=null)}clearCallbacks(){this.dataCallback=void 0,this.rawDataCallback=void 0,this.errorCallback=void 0,this.statusCallback=void 0}sendToken(n){this.token=n,this.sendCommand({type:"UPDATE_TOKEN",token:n})}sendCommand(n){this.worker&&this.worker.port.postMessage(n)}ensureWorker(){if(this.worker||typeof window>"u")return;const n=btoa(this.addr);try{if(this.updateStatusComponent("worker",{status:b.INITIALIZING,lastError:void 0}),window.SharedWorker){const t=new ye({name:n});this.worker={port:t.port},t.port.onmessage=r=>{this.handleWorkerMessage(r.data)},t.port.start()}else{const t=new pe;this.worker={port:t,terminate:()=>t.terminate()},t.onmessage=r=>{this.handleWorkerMessage(r.data)}}this.updateStatusComponent("worker",{status:b.READY})}catch(t){const r=new h(c.WORKER_INIT_FAILED,`Failed to initialize worker: ${String(t)}`);throw this.updateStatusComponent("worker",{status:b.ERROR,lastError:r}),this.updateStatusComponent("main",{status:d.FAILED,lastError:r}),r}}handleWorkerMessage(n){switch(n.type){case"DATA":this.resetDataTimer(),this.dataCallback&&this.dataCallback(this.normalizeState(n.data));break;case"RAW_DATA":this.resetDataTimer(),this.rawDataCallback&&this.rawDataCallback(n.data);break;case"CONNECTED":this.clearConnectionTimer(),this.updateStatusComponent("connection",{status:y.CONNECTED}),this.streamMode==="local"&&this.updateStatusComponent("main",{status:d.RUNNING});break;case"STATUS_UPDATE":if(n.connection){const t={status:n.connection,attempts:n.connection===y.RECONNECTING?n.connectionAttempts:void 0};this.updateStatusComponent("connection",t)}if(n.auth){const t={status:n.auth,attempts:n.auth===v.REAUTHENTICATING?n.authAttempts:void 0};this.updateStatusComponent("auth",t),n.auth===v.AUTHENTICATED&&this.updateStatusComponent("main",{status:d.RUNNING})}break;case"ERROR":{this.clearConnectionTimer();const t=new h(n.code,n.message,n.data);this.mapErrorToStatus(t),this.errorCallback&&this.errorCallback(t);break}case"TOKEN_EXPIRED":this.updateStatusComponent("auth",{status:v.AUTHENTICATING}),this.handleTokenExpiredInternal();break;case"DISCONNECTED":this.updateStatusComponent("connection",{status:y.DISCONNECTED});break}}mapErrorToStatus(n){const t=n.code;(t===c.CONNECTION_FAILED||t===c.CONNECTION_LOST||t===c.RECONNECT_FAILED||t===c.CONNECTION_TIMEOUT)&&(this.updateStatusComponent("connection",{status:y.DISCONNECTED,lastError:n}),this.updateStatusComponent("main",{status:d.FAILED,lastError:n})),(t===c.AUTH_FAILED||t===c.AUTH_REFRESH_FAILED)&&(this.updateStatusComponent("auth",{status:v.FAILED,lastError:n}),this.updateStatusComponent("main",{status:d.FAILED,lastError:n})),(t===c.DEVICE_ERROR||t===c.DECODE_ERROR)&&this.updateStatusComponent("main",{lastError:n})}updateStatusComponent(n,t){const i={...this._status[n],...t};Object.keys(i).forEach(o=>{i[o]===void 0&&delete i[o]}),this._status[n]=i,this.statusCallback&&this.statusCallback({...this._status})}clearConnectionTimer(){this.connectionTimer&&(clearTimeout(this.connectionTimer),this.connectionTimer=null)}resetDataTimer(){this.clearDataTimer(),this._status.data.status!==g.ACTIVE?this.updateStatusComponent("data",{status:g.ACTIVE,lastActivity:Date.now()}):this._status.data.lastActivity=Date.now(),this.dataTimer=setTimeout(()=>{this.updateStatusComponent("data",{status:g.STALE})},this.dataTimeout)}clearDataTimer(){this.dataTimer&&(clearTimeout(this.dataTimer),this.dataTimer=null)}normalizeState(n){let t,r;"bar_id"in n&&"state"in n?(t=n.state,r=n.bar_id):t=n;let i=t.updates;return i&&(i=i.map(o=>{const s=Object.keys(o).find(l=>o[l]!=null);return{...o,state:s}})),{...t,updates:i,bar_id:r}}async handleTokenExpiredInternal(){const n=this.addr;let t=E.tokenRefreshPromises.get(n);if(!t&&this.onTokenExpired&&(t=(async()=>{try{const i=this.onTokenExpired();return i instanceof Promise?await i:""}finally{E.tokenRefreshPromises.delete(n)}})(),E.tokenRefreshPromises.set(n,t)),t){const r=await t;r&&this.sendToken(r)}}};u(E,"tokenRefreshPromises",new Map);let T=E;class me extends T{constructor(t={},r){let i=t.addr;i||(typeof window<"u"?i=window.location.origin:i="10.0.4.20");super({isBinary:!0,...t,addr:i},r);u(this,"streamMode","local")}normalizeUrl(t){const r=this.resolveProtocol(t),i=new URL(r);return(i.pathname==="/"||!i.pathname)&&(i.pathname="/api/status/ws"),this.token&&i.searchParams.set("x-api-token",this.token),i.toString()}}class ve extends T{constructor(t,r){super({isBinary:!1,...t},r);u(this,"streamMode","remote");u(this,"tokenProvider");u(this,"maxAuthAttempts");this.tokenProvider=t.tokenProvider,this.maxAuthAttempts=(r==null?void 0:r.maxAuthAttempts)??k}subscribe(t){this.sendCommand({type:"SUBSCRIBE",guid:t})}unsubscribe(t){this.sendCommand({type:"UNSUBSCRIBE",guid:t})}normalizeUrl(t){return this.resolveProtocol(t)}onTokenExpired(){if(this.tokenProvider)return this.tokenProvider().then(t=>(this.sendToken(t),t)).catch(t=>{const r=`Failed to refresh token: ${t.message}`;throw this.errorCallback&&this.errorCallback(new h(c.AUTH_REFRESH_FAILED,r)),t})}}exports.BSB_State=void 0;(e=>{(n=>{n[n.DISCHARGING=0]="DISCHARGING",n[n.CHARGING=1]="CHARGING",n[n.CHARGED=2]="CHARGED"})(e.BatteryStatus||(e.BatteryStatus={})),(n=>{n[n.CONNECTED=0]="CONNECTED",n[n.CONNECTING=1]="CONNECTING",n[n.DISCONNECTING=2]="DISCONNECTING",n[n.RECONNECTING=3]="RECONNECTING"})(e.WifiConnectionStatus||(e.WifiConnectionStatus={})),(n=>{n[n.UNKNOWN=0]="UNKNOWN",n[n.OPEN=1]="OPEN",n[n.WPA=2]="WPA",n[n.WPA2=3]="WPA2",n[n.WEP=4]="WEP",n[n.WPA_WPA2=5]="WPA_WPA2",n[n.WPA3=6]="WPA3",n[n.WPA2_WPA3=7]="WPA2_WPA3"})(e.WifiSecurity||(e.WifiSecurity={})),(n=>{n[n.DHCP=0]="DHCP",n[n.STATIC=1]="STATIC"})(e.IpConfigurationMethod||(e.IpConfigurationMethod={})),(n=>{n[n.IPV4=0]="IPV4",n[n.IPV6=1]="IPV6"})(e.IpProtocol||(e.IpProtocol={})),(n=>{n[n.NEVER_STARTED=0]="NEVER_STARTED",n[n.STARTED=1]="STARTED",n[n.COMPLETED_SUCCESSFULLY=2]="COMPLETED_SUCCESSFULLY",n[n.FAILED=3]="FAILED"})(e.MatterCommissioningStatus||(e.MatterCommissioningStatus={})),(n=>{(t=>{t[t.RESET=0]="RESET",t[t.INITIALIZATION=1]="INITIALIZATION",t[t.READY=2]="READY",t[t.ADVERTISING=3]="ADVERTISING",t[t.CONNECTABLE=4]="CONNECTABLE",t[t.CONNECTED=5]="CONNECTED",t[t.ERROR=6]="ERROR"})(n.ServiceStatus||(n.ServiceStatus={}))})(e.Ble||(e.Ble={}))})(exports.BSB_State||(exports.BSB_State={}));exports.BSB_Update=void 0;(e=>{(n=>{n[n.SESSION_START=0]="SESSION_START",n[n.SESSION_STOP=1]="SESSION_STOP",n[n.ACTION_BEGIN=2]="ACTION_BEGIN",n[n.ACTION_DONE=3]="ACTION_DONE",n[n.DETAIL_CHANGE=4]="DETAIL_CHANGE",n[n.ACTION_PROGRESS=5]="ACTION_PROGRESS",n[n.EVENT_NONE=6]="EVENT_NONE"})(e.UpdateEvent||(e.UpdateEvent={})),(n=>{n[n.DOWNLOAD=0]="DOWNLOAD",n[n.SHA_VERIFICATION=1]="SHA_VERIFICATION",n[n.UNPACK=2]="UNPACK",n[n.INSTALLATION_PREPARE=3]="INSTALLATION_PREPARE",n[n.INSTALLATION_APPLY=4]="INSTALLATION_APPLY",n[n.ACTION_NONE=5]="ACTION_NONE"})(e.UpdateAction||(e.UpdateAction={})),(n=>{n[n.OK=0]="OK",n[n.BATTERY_LOW=1]="BATTERY_LOW",n[n.BUSY=2]="BUSY",n[n.DOWNLOAD_FAILURE=3]="DOWNLOAD_FAILURE",n[n.DOWNLOAD_ABORT=4]="DOWNLOAD_ABORT",n[n.SHA_MISMATCH=5]="SHA_MISMATCH",n[n.UNPACK_CREATE_STAGING_DIRECTORY_FAILURE=6]="UNPACK_CREATE_STAGING_DIRECTORY_FAILURE",n[n.UNPACK_ARCHIVE_OPEN_FAILURE=7]="UNPACK_ARCHIVE_OPEN_FAILURE",n[n.UNPACK_ARCHIVE_UNPACK_FAILURE=8]="UNPACK_ARCHIVE_UNPACK_FAILURE",n[n.INSTALLATION_PREPARE_MANIFEST_NOT_FOUND=9]="INSTALLATION_PREPARE_MANIFEST_NOT_FOUND",n[n.INSTALLATION_PREPARE_MANIFEST_INVALID=10]="INSTALLATION_PREPARE_MANIFEST_INVALID",n[n.INSTALLATION_PREPARE_SESSION_CONFIG_SETUP_FAILURE=11]="INSTALLATION_PREPARE_SESSION_CONFIG_SETUP_FAILURE",n[n.INSTALLATION_PREPARE_POINTER_SETUP_FAILURE=12]="INSTALLATION_PREPARE_POINTER_SETUP_FAILURE",n[n.UNKNOWN_FAILURE=13]="UNKNOWN_FAILURE"})(e.UpdateStatus||(e.UpdateStatus={})),(n=>{n[n.NOT_AVAILABLE=0]="NOT_AVAILABLE",n[n.FAILURE=1]="FAILURE",n[n.IDLE=2]="IDLE"})(e.CheckError||(e.CheckError={}))})(exports.BSB_Update||(exports.BSB_Update={}));exports.BSB_Frame=void 0;(e=>{(n=>{n[n.PLAIN=0]="PLAIN",n[n.RUN_LENGTH=1]="RUN_LENGTH",n[n.DEFLATE=2]="DEFLATE",n[n.DEFLATE_RUN_LENGTH=3]="DEFLATE_RUN_LENGTH"})(e.Encoding||(e.Encoding={})),(n=>{n[n.RGB888=0]="RGB888",n[n.L8=1]="L8",n[n.L4=2]="L4"})(e.PixelFormat||(e.PixelFormat={})),(n=>{n[n.FRONT=0]="FRONT",n[n.BACK=1]="BACK"})(e.Screen||(e.Screen={}))})(exports.BSB_Frame||(exports.BSB_Frame={}));exports.BSB_Util=void 0;(e=>{(n=>{n[n.PLAIN=0]="PLAIN",n[n.GZIP=1]="GZIP"})(e.Compression||(e.Compression={}))})(exports.BSB_Util||(exports.BSB_Util={}));exports.BSB_Input=void 0;(e=>{(n=>{n[n.OK=0]="OK",n[n.BACK=1]="BACK",n[n.START=2]="START"})(e.Button||(e.Button={})),(n=>{n[n.PRESS=0]="PRESS",n[n.RELEASE=1]="RELEASE"})(e.ButtonAction||(e.ButtonAction={})),(n=>{n[n.BUSY=0]="BUSY",n[n.CUSTOM=1]="CUSTOM",n[n.OFF=2]="OFF",n[n.APPS=3]="APPS",n[n.SETTINGS=4]="SETTINGS"})(e.SwitchPosition||(e.SwitchPosition={}))})(exports.BSB_Input||(exports.BSB_Input={}));exports.BSB_Error=void 0;(e=>{(n=>{n[n.RESOURCE_LIMIT=0]="RESOURCE_LIMIT"})(e.Cause||(e.Cause={})),(n=>{n[n.FATAL=0]="FATAL",n[n.ERROR=1]="ERROR",n[n.WARNING=2]="WARNING"})(e.Severity||(e.Severity={}))})(exports.BSB_Error||(exports.BSB_Error={}));const _=class _{constructor(){u(this,"gl",null);u(this,"program",null);u(this,"texture",null);u(this,"vs",`#version 300 es
|
|
8067
|
+
`;function me(e){return new SharedWorker("data:text/javascript;charset=utf-8,"+encodeURIComponent(ye),{type:"module",name:e==null?void 0:e.name})}const E=class E{constructor(n,t){u(this,"addr");u(this,"token");u(this,"isBinary");u(this,"connectTimeout");u(this,"dataTimeout");u(this,"maxReconnectAttempts");u(this,"maxAuthAttempts");u(this,"reconnectDelay");u(this,"worker",null);u(this,"connectionTimer",null);u(this,"dataTimer",null);u(this,"_status");u(this,"dataCallback");u(this,"rawDataCallback");u(this,"errorCallback");u(this,"statusCallback");this.addr=n.addr||"",this.token=n.token,this.isBinary=n.isBinary??!0,this.connectTimeout=(t==null?void 0:t.timeout)??5e3,this.dataTimeout=(t==null?void 0:t.dataTimeout)??15e3,this.maxReconnectAttempts=(t==null?void 0:t.maxReconnectAttempts)??de,this.maxAuthAttempts=k,this.reconnectDelay=(t==null?void 0:t.reconnectDelay)??pe,this._status={main:{status:d.IDLE},connection:{status:y.DISCONNECTED},auth:{status:v.UNAUTHENTICATED},data:{status:g.NONE},worker:{status:b.OFF}}}get status(){return this._status}resolveProtocol(n){let t=n.trim();if(t.startsWith("https://"))return t.replace("https://","wss://");if(t.startsWith("http://"))return t.replace("http://","ws://");if(t.startsWith("wss://")||t.startsWith("ws://"))return t;let r="ws:";return typeof window<"u"&&window.location.protocol==="https:"&&(r="wss:"),`${r}//${t}`}start({dataCallback:n,rawDataCallback:t,errorCallback:r,statusCallback:i}){if(this._status.main.status===d.STARTING||this._status.main.status===d.RUNNING){const o=new h(c.STREAM_ALREADY_STARTED,"StateStream is already running. Call stop() before starting again.");if(i&&i({...this._status,main:{...this._status.main,lastError:o}}),r)r(o);else throw o;return}this.dataCallback=n,this.rawDataCallback=t,this.errorCallback=r,this.statusCallback=i,this.updateStatusComponent("main",{status:d.STARTING,lastError:void 0});try{this.ensureWorker(),this.sendCommand({type:"START",addr:this.normalizeUrl(this.addr),token:this.token,isBinary:this.isBinary,mode:this.streamMode,maxReconnectAttempts:this.maxReconnectAttempts,maxAuthAttempts:this.maxAuthAttempts,reconnectDelay:this.reconnectDelay}),this.clearConnectionTimer(),this.connectionTimer=setTimeout(()=>{const o=new h(c.CONNECTION_TIMEOUT,`Connection timed out after ${this.connectTimeout}ms`);this.mapErrorToStatus(o),this.errorCallback&&this.errorCallback(o),this.stop()},this.connectTimeout)}catch(o){const s=o instanceof h?o:new h(c.UNKNOWN_ERROR,String(o));this.errorCallback&&this.errorCallback(s)}}stop(){this.clearConnectionTimer(),this.clearDataTimer(),!(this._status.main.status===d.IDLE||this._status.main.status===d.STOPPED)&&(this.updateStatusComponent("main",{status:d.STOPPED}),this.updateStatusComponent("connection",{status:y.DISCONNECTED}),this.sendCommand({type:"STOP"}),this.clearCallbacks())}destroy(){this.stop(),this.worker&&(this.worker.terminate?this.worker.terminate():"close"in this.worker.port&&this.worker.port.close(),this.worker=null)}clearCallbacks(){this.dataCallback=void 0,this.rawDataCallback=void 0,this.errorCallback=void 0,this.statusCallback=void 0}sendToken(n){this.token=n,this.sendCommand({type:"UPDATE_TOKEN",token:n})}sendCommand(n){this.worker&&this.worker.port.postMessage(n)}ensureWorker(){if(this.worker||typeof window>"u")return;const n=btoa(this.addr);try{if(this.updateStatusComponent("worker",{status:b.INITIALIZING,lastError:void 0}),window.SharedWorker){const t=new me({name:n});this.worker={port:t.port},t.port.onmessage=r=>{this.handleWorkerMessage(r.data)},t.port.start()}else{const t=new he;this.worker={port:t,terminate:()=>t.terminate()},t.onmessage=r=>{this.handleWorkerMessage(r.data)}}this.updateStatusComponent("worker",{status:b.READY})}catch(t){const r=new h(c.WORKER_INIT_FAILED,`Failed to initialize worker: ${String(t)}`);throw this.updateStatusComponent("worker",{status:b.ERROR,lastError:r}),this.updateStatusComponent("main",{status:d.FAILED,lastError:r}),r}}handleWorkerMessage(n){switch(n.type){case"DATA":this.resetDataTimer(),this.dataCallback&&this.dataCallback(this.normalizeState(n.data));break;case"RAW_DATA":this.resetDataTimer(),this.rawDataCallback&&this.rawDataCallback(n.data);break;case"CONNECTED":this.clearConnectionTimer(),this.updateStatusComponent("connection",{status:y.CONNECTED}),this.streamMode==="local"&&this.updateStatusComponent("main",{status:d.RUNNING});break;case"STATUS_UPDATE":if(n.connection){const t={status:n.connection,attempts:n.connection===y.RECONNECTING?n.connectionAttempts:void 0};this.updateStatusComponent("connection",t)}if(n.auth){const t={status:n.auth,attempts:n.auth===v.REAUTHENTICATING?n.authAttempts:void 0};this.updateStatusComponent("auth",t),n.auth===v.AUTHENTICATED&&this.updateStatusComponent("main",{status:d.RUNNING})}break;case"ERROR":{this.clearConnectionTimer();const t=new h(n.code,n.message,n.data);this.mapErrorToStatus(t),this.errorCallback&&this.errorCallback(t);break}case"TOKEN_EXPIRED":this.updateStatusComponent("auth",{status:v.AUTHENTICATING}),this.handleTokenExpiredInternal();break;case"DISCONNECTED":this.updateStatusComponent("connection",{status:y.DISCONNECTED});break}}mapErrorToStatus(n){const t=n.code;(t===c.CONNECTION_FAILED||t===c.CONNECTION_LOST||t===c.RECONNECT_FAILED||t===c.CONNECTION_TIMEOUT)&&(this.updateStatusComponent("connection",{status:y.DISCONNECTED,lastError:n}),this.updateStatusComponent("main",{status:d.FAILED,lastError:n})),(t===c.AUTH_FAILED||t===c.AUTH_REFRESH_FAILED)&&(this.updateStatusComponent("auth",{status:v.FAILED,lastError:n}),this.updateStatusComponent("main",{status:d.FAILED,lastError:n})),(t===c.DEVICE_ERROR||t===c.DECODE_ERROR)&&this.updateStatusComponent("main",{lastError:n})}updateStatusComponent(n,t){const i={...this._status[n],...t};Object.keys(i).forEach(o=>{i[o]===void 0&&delete i[o]}),this._status[n]=i,this.statusCallback&&this.statusCallback({...this._status})}clearConnectionTimer(){this.connectionTimer&&(clearTimeout(this.connectionTimer),this.connectionTimer=null)}resetDataTimer(){this.clearDataTimer(),this._status.data.status!==g.ACTIVE?this.updateStatusComponent("data",{status:g.ACTIVE,lastActivity:Date.now()}):this._status.data.lastActivity=Date.now(),this.dataTimer=setTimeout(()=>{this.updateStatusComponent("data",{status:g.STALE})},this.dataTimeout)}clearDataTimer(){this.dataTimer&&(clearTimeout(this.dataTimer),this.dataTimer=null)}normalizeState(n){let t,r;"bar_id"in n&&"state"in n?(t=n.state,r=n.bar_id):t=n;let i=t.updates;return i&&(i=i.map(o=>{const s=Object.keys(o).find(l=>o[l]!=null);return{...o,state:s}})),{...t,updates:i,bar_id:r}}async handleTokenExpiredInternal(){const n=this.addr;let t=E.tokenRefreshPromises.get(n);if(!t&&this.onTokenExpired&&(t=(async()=>{try{const i=this.onTokenExpired();return i instanceof Promise?await i:""}finally{E.tokenRefreshPromises.delete(n)}})(),E.tokenRefreshPromises.set(n,t)),t){const r=await t;r&&this.sendToken(r)}}};u(E,"tokenRefreshPromises",new Map);let T=E;class ve extends T{constructor(t={},r){let i=t.addr;i||(typeof window<"u"?i=window.location.origin:i="10.0.4.20");super({isBinary:!0,...t,addr:i},r);u(this,"streamMode","local")}normalizeUrl(t){const r=this.resolveProtocol(t),i=new URL(r);return(i.pathname==="/"||!i.pathname)&&(i.pathname="/api/status/ws"),this.token&&i.searchParams.set("x-api-token",this.token),i.toString()}}class ge extends T{constructor(t,r){super({isBinary:!1,...t},r);u(this,"streamMode","remote");u(this,"tokenProvider");u(this,"maxAuthAttempts");this.tokenProvider=t.tokenProvider,this.maxAuthAttempts=(r==null?void 0:r.maxAuthAttempts)??k}subscribe(t){this.sendCommand({type:"SUBSCRIBE",guid:t})}unsubscribe(t){this.sendCommand({type:"UNSUBSCRIBE",guid:t})}normalizeUrl(t){return this.resolveProtocol(t)}onTokenExpired(){if(this.tokenProvider)return this.tokenProvider().then(t=>(this.sendToken(t),t)).catch(t=>{const r=`Failed to refresh token: ${t.message}`;throw this.errorCallback&&this.errorCallback(new h(c.AUTH_REFRESH_FAILED,r)),t})}}exports.BSB_State=void 0;(e=>{(n=>{n[n.DISCHARGING=0]="DISCHARGING",n[n.CHARGING=1]="CHARGING",n[n.CHARGED=2]="CHARGED"})(e.BatteryStatus||(e.BatteryStatus={})),(n=>{n[n.CONNECTED=0]="CONNECTED",n[n.CONNECTING=1]="CONNECTING",n[n.DISCONNECTING=2]="DISCONNECTING",n[n.RECONNECTING=3]="RECONNECTING"})(e.WifiConnectionStatus||(e.WifiConnectionStatus={})),(n=>{n[n.UNKNOWN=0]="UNKNOWN",n[n.OPEN=1]="OPEN",n[n.WPA=2]="WPA",n[n.WPA2=3]="WPA2",n[n.WEP=4]="WEP",n[n.WPA_WPA2=5]="WPA_WPA2",n[n.WPA3=6]="WPA3",n[n.WPA2_WPA3=7]="WPA2_WPA3"})(e.WifiSecurity||(e.WifiSecurity={})),(n=>{n[n.DHCP=0]="DHCP",n[n.STATIC=1]="STATIC"})(e.IpConfigurationMethod||(e.IpConfigurationMethod={})),(n=>{n[n.IPV4=0]="IPV4",n[n.IPV6=1]="IPV6"})(e.IpProtocol||(e.IpProtocol={})),(n=>{n[n.NEVER_STARTED=0]="NEVER_STARTED",n[n.STARTED=1]="STARTED",n[n.COMPLETED_SUCCESSFULLY=2]="COMPLETED_SUCCESSFULLY",n[n.FAILED=3]="FAILED"})(e.MatterCommissioningStatus||(e.MatterCommissioningStatus={})),(n=>{(t=>{t[t.RESET=0]="RESET",t[t.INITIALIZATION=1]="INITIALIZATION",t[t.READY=2]="READY",t[t.ADVERTISING=3]="ADVERTISING",t[t.CONNECTABLE=4]="CONNECTABLE",t[t.CONNECTED=5]="CONNECTED",t[t.ERROR=6]="ERROR"})(n.ServiceStatus||(n.ServiceStatus={}))})(e.Ble||(e.Ble={}))})(exports.BSB_State||(exports.BSB_State={}));exports.BSB_Update=void 0;(e=>{(n=>{n[n.SESSION_START=0]="SESSION_START",n[n.SESSION_STOP=1]="SESSION_STOP",n[n.ACTION_BEGIN=2]="ACTION_BEGIN",n[n.ACTION_DONE=3]="ACTION_DONE",n[n.DETAIL_CHANGE=4]="DETAIL_CHANGE",n[n.ACTION_PROGRESS=5]="ACTION_PROGRESS",n[n.EVENT_NONE=6]="EVENT_NONE"})(e.UpdateEvent||(e.UpdateEvent={})),(n=>{n[n.DOWNLOAD=0]="DOWNLOAD",n[n.SHA_VERIFICATION=1]="SHA_VERIFICATION",n[n.UNPACK=2]="UNPACK",n[n.INSTALLATION_PREPARE=3]="INSTALLATION_PREPARE",n[n.INSTALLATION_APPLY=4]="INSTALLATION_APPLY",n[n.ACTION_NONE=5]="ACTION_NONE"})(e.UpdateAction||(e.UpdateAction={})),(n=>{n[n.OK=0]="OK",n[n.BATTERY_LOW=1]="BATTERY_LOW",n[n.BUSY=2]="BUSY",n[n.DOWNLOAD_FAILURE=3]="DOWNLOAD_FAILURE",n[n.DOWNLOAD_ABORT=4]="DOWNLOAD_ABORT",n[n.SHA_MISMATCH=5]="SHA_MISMATCH",n[n.UNPACK_CREATE_STAGING_DIRECTORY_FAILURE=6]="UNPACK_CREATE_STAGING_DIRECTORY_FAILURE",n[n.UNPACK_ARCHIVE_OPEN_FAILURE=7]="UNPACK_ARCHIVE_OPEN_FAILURE",n[n.UNPACK_ARCHIVE_UNPACK_FAILURE=8]="UNPACK_ARCHIVE_UNPACK_FAILURE",n[n.INSTALLATION_PREPARE_MANIFEST_NOT_FOUND=9]="INSTALLATION_PREPARE_MANIFEST_NOT_FOUND",n[n.INSTALLATION_PREPARE_MANIFEST_INVALID=10]="INSTALLATION_PREPARE_MANIFEST_INVALID",n[n.INSTALLATION_PREPARE_SESSION_CONFIG_SETUP_FAILURE=11]="INSTALLATION_PREPARE_SESSION_CONFIG_SETUP_FAILURE",n[n.INSTALLATION_PREPARE_POINTER_SETUP_FAILURE=12]="INSTALLATION_PREPARE_POINTER_SETUP_FAILURE",n[n.UNKNOWN_FAILURE=13]="UNKNOWN_FAILURE"})(e.UpdateStatus||(e.UpdateStatus={})),(n=>{n[n.NOT_AVAILABLE=0]="NOT_AVAILABLE",n[n.FAILURE=1]="FAILURE",n[n.IDLE=2]="IDLE"})(e.CheckError||(e.CheckError={}))})(exports.BSB_Update||(exports.BSB_Update={}));exports.BSB_Frame=void 0;(e=>{(n=>{n[n.PLAIN=0]="PLAIN",n[n.RUN_LENGTH=1]="RUN_LENGTH",n[n.DEFLATE=2]="DEFLATE",n[n.DEFLATE_RUN_LENGTH=3]="DEFLATE_RUN_LENGTH"})(e.Encoding||(e.Encoding={})),(n=>{n[n.RGB888=0]="RGB888",n[n.L8=1]="L8",n[n.L4=2]="L4"})(e.PixelFormat||(e.PixelFormat={})),(n=>{n[n.FRONT=0]="FRONT",n[n.BACK=1]="BACK"})(e.Screen||(e.Screen={}))})(exports.BSB_Frame||(exports.BSB_Frame={}));exports.BSB_Util=void 0;(e=>{(n=>{n[n.PLAIN=0]="PLAIN",n[n.GZIP=1]="GZIP"})(e.Compression||(e.Compression={}))})(exports.BSB_Util||(exports.BSB_Util={}));exports.BSB_Input=void 0;(e=>{(n=>{n[n.OK=0]="OK",n[n.BACK=1]="BACK",n[n.START=2]="START"})(e.Button||(e.Button={})),(n=>{n[n.PRESS=0]="PRESS",n[n.RELEASE=1]="RELEASE"})(e.ButtonAction||(e.ButtonAction={})),(n=>{n[n.BUSY=0]="BUSY",n[n.CUSTOM=1]="CUSTOM",n[n.OFF=2]="OFF",n[n.APPS=3]="APPS",n[n.SETTINGS=4]="SETTINGS"})(e.SwitchPosition||(e.SwitchPosition={}))})(exports.BSB_Input||(exports.BSB_Input={}));exports.BSB_Error=void 0;(e=>{(n=>{n[n.RESOURCE_LIMIT=0]="RESOURCE_LIMIT"})(e.Cause||(e.Cause={})),(n=>{n[n.FATAL=0]="FATAL",n[n.ERROR=1]="ERROR",n[n.WARNING=2]="WARNING"})(e.Severity||(e.Severity={}))})(exports.BSB_Error||(exports.BSB_Error={}));const _=class _{constructor(){u(this,"gl",null);u(this,"program",null);u(this,"texture",null);u(this,"vs",`#version 300 es
|
|
8066
8068
|
in vec2 position;
|
|
8067
8069
|
out vec2 v_uv;
|
|
8068
8070
|
void main() {
|
|
@@ -8102,4 +8104,4 @@ if ("SharedWorkerGlobalScope" in self) {
|
|
|
8102
8104
|
if (mask < 0.001) discard;
|
|
8103
8105
|
outColor = vec4(finalColor, color.a * mask);
|
|
8104
8106
|
}
|
|
8105
|
-
`);if(_.instance)return _.instance;_.instance=this}init(){if(this.gl||typeof window>"u")return;const t=document.createElement("canvas").getContext("webgl2",{antialias:!0,alpha:!0,preserveDrawingBuffer:!0});if(!t)throw new Error("WebGL 2.0 not supported");this.gl=t,this.program=this.createProgram(this.vs,this.fs);const r=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,r),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW);const i=t.getAttribLocation(this.program,"position");t.enableVertexAttribArray(i),t.vertexAttribPointer(i,2,t.FLOAT,!1,0,0),this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)}render(n,t,r,i){const{pixelSize:o=.85,radius:s=.5,darkThreshold:l=.04}=i,a=this.gl;a.viewport(0,0,a.canvas.width,a.canvas.height),a.useProgram(this.program),a.bindTexture(a.TEXTURE_2D,this.texture),a.texImage2D(a.TEXTURE_2D,0,a.RGBA8,t,r,0,a.RGBA,a.UNSIGNED_BYTE,n),a.uniform2f(a.getUniformLocation(this.program,"u_dataRes"),t,r),a.uniform2f(a.getUniformLocation(this.program,"u_canvasRes"),a.canvas.width,a.canvas.height),a.uniform1f(a.getUniformLocation(this.program,"u_pixelSize"),o),a.uniform1f(a.getUniformLocation(this.program,"u_radius"),s),a.uniform1f(a.getUniformLocation(this.program,"u_darkThreshold"),l),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),a.enable(a.BLEND),a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA),a.drawArrays(a.TRIANGLES,0,6)}renderFrame(n,t,r,i,o={}){if(this.init(),typeof window>"u"||!this.gl)return;(this.gl.canvas.width!==n.width||this.gl.canvas.height!==n.height)&&(this.gl.canvas.width=n.width,this.gl.canvas.height=n.height),this.render(t,r,i,o);const s=n.getContext("2d");s&&(s.clearRect(0,0,n.width,n.height),s.drawImage(this.gl.canvas,0,0))}createProgram(n,t){const r=this.gl,i=(s,l)=>{const a=r.createShader(s);if(r.shaderSource(a,l),r.compileShader(a),!r.getShaderParameter(a,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(a)||"Shader Error");return a},o=r.createProgram();return r.attachShader(o,i(r.VERTEX_SHADER,n)),r.attachShader(o,i(r.FRAGMENT_SHADER,t)),r.linkProgram(o),o}};u(_,"instance",null);let S=_;const
|
|
8107
|
+
`);if(_.instance)return _.instance;_.instance=this}init(){if(this.gl||typeof window>"u")return;const t=document.createElement("canvas").getContext("webgl2",{antialias:!0,alpha:!0,preserveDrawingBuffer:!0});if(!t)throw new Error("WebGL 2.0 not supported");this.gl=t,this.program=this.createProgram(this.vs,this.fs);const r=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,r),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW);const i=t.getAttribLocation(this.program,"position");t.enableVertexAttribArray(i),t.vertexAttribPointer(i,2,t.FLOAT,!1,0,0),this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)}render(n,t,r,i){const{pixelSize:o=.85,radius:s=.5,darkThreshold:l=.04}=i,a=this.gl;a.viewport(0,0,a.canvas.width,a.canvas.height),a.useProgram(this.program),a.bindTexture(a.TEXTURE_2D,this.texture),a.texImage2D(a.TEXTURE_2D,0,a.RGBA8,t,r,0,a.RGBA,a.UNSIGNED_BYTE,n),a.uniform2f(a.getUniformLocation(this.program,"u_dataRes"),t,r),a.uniform2f(a.getUniformLocation(this.program,"u_canvasRes"),a.canvas.width,a.canvas.height),a.uniform1f(a.getUniformLocation(this.program,"u_pixelSize"),o),a.uniform1f(a.getUniformLocation(this.program,"u_radius"),s),a.uniform1f(a.getUniformLocation(this.program,"u_darkThreshold"),l),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),a.enable(a.BLEND),a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA),a.drawArrays(a.TRIANGLES,0,6)}renderFrame(n,t,r,i,o={}){if(this.init(),typeof window>"u"||!this.gl)return;(this.gl.canvas.width!==n.width||this.gl.canvas.height!==n.height)&&(this.gl.canvas.width=n.width,this.gl.canvas.height=n.height),this.render(t,r,i,o);const s=n.getContext("2d");s&&(s.clearRect(0,0,n.width,n.height),s.drawImage(this.gl.canvas,0,0))}createProgram(n,t){const r=this.gl,i=(s,l)=>{const a=r.createShader(s);if(r.shaderSource(a,l),r.compileShader(a),!r.getShaderParameter(a,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(a)||"Shader Error");return a},o=r.createProgram();return r.attachShader(o,i(r.VERTEX_SHADER,n)),r.attachShader(o,i(r.FRAGMENT_SHADER,t)),r.linkProgram(o),o}};u(_,"instance",null);let S=_;const be=new S;exports.AuthStatus=v;exports.BusyBar=C;exports.ConnectionStatus=y;exports.DataStatus=g;exports.LEDRenderer=be;exports.LocalStateStream=ve;exports.RemoteStateStream=ge;exports.StateStreamError=h;exports.StateStreamErrorCode=c;exports.StreamLifecycle=d;exports.WorkerStatus=b;
|