@milaboratories/pl-client 2.5.4 → 2.5.6
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.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/src/core/ll_client.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var Cr=Object.defineProperty;var Dr=(a,e,t)=>e in a?Cr(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var p=(a,e,t)=>Dr(a,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@milaboratories/ts-helpers"),h=require("@protobuf-ts/runtime-rpc"),i=require("@protobuf-ts/runtime"),E=require("@grpc/grpc-js"),Or=require("@protobuf-ts/grpc-transport"),qr=require("denque"),sr=require("undici"),Kr=require("node:dns/promises"),Vr=require("cacheable-lookup"),ye=require("node:crypto"),vr=require("node:timers/promises"),jr=require("lru-cache"),F=require("node:fs"),Hr=require("canonicalize"),Gr=require("yaml"),Jr=require("node:os"),zr=require("node:path");function he(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const wn=he(vr),W=he(F),pr=he(Jr),Sn=he(zr),U=0n;function A(a){return a===U}function B(a){return a!==U}function ue(a){if(!B(a))throw new Error("null resource id");return a}function Yr(a){return a!==0n}function Xr(a,e){return{name:a,version:e}}function Zr(a){return`${a.name}:${a.version}`}function Qr(a,e){return a.name===e.name&&a.version===e.version}function bn(a){const{id:e,originalResourceId:t,kind:r,type:n,data:s,error:u,inputsLocked:l,outputsLocked:c,resourceReady:o,final:d}=a;return{id:e,originalResourceId:t,kind:r,type:n,data:s,error:u,inputsLocked:l,outputsLocked:c,resourceReady:o,final:d}}const ei=a=>Buffer.from(JSON.stringify(a)),ti=a=>JSON.parse(g.notEmpty(a.data).toString());function Pn(a,e){return g.notEmpty(a.fields.find(t=>t.name===e))}const Cn=1n<<63n,fr=1n<<62n,ni=0x3fffffffffffffffn,yr=24n,Dn=16777215,ge=4294967295,ri=BigInt(ge),ii=BigInt(Dn);function Rn(a){return(a&Cn)!==0n}function N(a){return(a&fr)!==0n}function On(a,e,t){if(e>Dn||t>ge||e<0||t<=0)throw Error("wrong local id or tx id");return(a?Cn:0n)|fr|BigInt(e)|BigInt(t)<<yr}function hr(a,e){return(a?Cn:0n)|e}function qn(a){return Number(a>>yr&ri)}function si(a,e){if(N(a)&&qn(a)!==e)throw Error("local id from another transaction, globalize id before leaking it from the transaction")}function z(a){return A(a)?"XX:0x0":N(a)?(Rn(a)?"R":"N")+"L:0x"+(ii&a).toString(16)+"[0x"+qn(a).toString(16)+"]":(Rn(a)?"R":"N")+"G:0x"+(ni&a).toString(16)}const oi=/^(?:(?<xx>XX)|(?<rn>[XRN])(?<lg>[XLG])):0x(?<rid>[0-9a-fA-F]+)(?:\[0x(?<txid>[0-9a-fA-F]+)])?$/;function ai(a){const e=a.match(oi);if(e===null)return;const{xx:t,rn:r,lg:n,rid:s,txid:u}=e.groups;return t?U:n==="L"?On(r==="R",Number.parseInt(s,16),Number.parseInt(u,16)):hr(r==="R",BigInt("0x"+s))}function li(a){if(N(a))throw new Error(`Local resource id: ${z(a)}`);if(A(a))throw new Error("Null resource id.");return a}function ci(a){return JSON.stringify(a,(e,t)=>typeof t=="bigint"?z(t):t)}class ui extends i.MessageType{constructor(){super("google.protobuf.Duration",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}internalJsonWrite(e,t){let r=i.PbLong.from(e.seconds).toNumber();if(r>315576e6||r<-315576e6)throw new Error("Duration value out of range.");let n=e.seconds.toString();if(r===0&&e.nanos<0&&(n="-"+n),e.nanos!==0){let s=Math.abs(e.nanos).toString();s="0".repeat(9-s.length)+s,s.substring(3)==="000000"?s=s.substring(0,3):s.substring(6)==="000"&&(s=s.substring(0,6)),n+="."+s}return n+"s"}internalJsonRead(e,t,r){if(typeof e!="string")throw new Error("Unable to parse Duration from JSON "+i.typeofJsonValue(e)+". Expected string.");let n=e.match(/^(-?)([0-9]+)(?:\.([0-9]+))?s/);if(n===null)throw new Error("Unable to parse Duration from JSON string. Invalid format.");r||(r=this.create());let[,s,u,l]=n,c=i.PbLong.from(s+u);if(c.toNumber()>315576e6||c.toNumber()<-315576e6)throw new Error("Unable to parse Duration from JSON string. Value out of range.");if(r.seconds=c.toBigInt(),typeof l=="string"){let o=s+l+"0".repeat(9-l.length);r.nanos=parseInt(o)}return r}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.seconds=0n,t.nanos=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.seconds=e.int64().toBigInt();break;case 2:s.nanos=e.int32();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.seconds!==0n&&t.tag(1,i.WireType.Varint).int64(e.seconds),e.nanos!==0&&t.tag(2,i.WireType.Varint).int32(e.nanos);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const w=new ui;var T=(a=>(a[a.INVALID=0]="INVALID",a[a.INPUT=1]="INPUT",a[a.OUTPUT=2]="OUTPUT",a[a.SERVICE=6]="SERVICE",a[a.ONE_TIME_WRITABLE=4]="ONE_TIME_WRITABLE",a[a.DYNAMIC=3]="DYNAMIC",a[a.MULTIPLE_TIMES_WRITABLE=5]="MULTIPLE_TIMES_WRITABLE",a))(T||{});class di extends i.MessageType{constructor(){super("MiLaboratories.PL.Base.ResourceType",[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.name="",t.version="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.name=e.string();break;case 2:s.version=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.name!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.name),e.version!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.version);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const f=new di;class pi extends i.MessageType{constructor(){super("MiLaboratories.PL.Base.FieldRef",[{no:2,name:"resource_id",kind:"scalar",T:4,L:0},{no:3,name:"field_name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.fieldName="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.resourceId=e.uint64().toBigInt();break;case 3:s.fieldName=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.resourceId),e.fieldName!==""&&t.tag(3,i.WireType.LengthDelimited).string(e.fieldName);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const y=new pi;class fi extends i.MessageType{constructor(){super("MiLaboratories.PL.RTypes.Number",[{no:1,name:"int32",kind:"scalar",oneof:"value",T:5},{no:2,name:"uint32",kind:"scalar",oneof:"value",T:13},{no:3,name:"int64",kind:"scalar",oneof:"value",T:3,L:0},{no:4,name:"uint64",kind:"scalar",oneof:"value",T:4,L:0},{no:5,name:"float",kind:"scalar",oneof:"value",T:2},{no:6,name:"double",kind:"scalar",oneof:"value",T:1}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.value={oneofKind:void 0},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.value={oneofKind:"int32",int32:e.int32()};break;case 2:s.value={oneofKind:"uint32",uint32:e.uint32()};break;case 3:s.value={oneofKind:"int64",int64:e.int64().toBigInt()};break;case 4:s.value={oneofKind:"uint64",uint64:e.uint64().toBigInt()};break;case 5:s.value={oneofKind:"float",float:e.float()};break;case 6:s.value={oneofKind:"double",double:e.double()};break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.value.oneofKind==="int32"&&t.tag(1,i.WireType.Varint).int32(e.value.int32),e.value.oneofKind==="uint32"&&t.tag(2,i.WireType.Varint).uint32(e.value.uint32),e.value.oneofKind==="int64"&&t.tag(3,i.WireType.Varint).int64(e.value.int64),e.value.oneofKind==="uint64"&&t.tag(4,i.WireType.Varint).uint64(e.value.uint64),e.value.oneofKind==="float"&&t.tag(5,i.WireType.Bit32).float(e.value.float),e.value.oneofKind==="double"&&t.tag(6,i.WireType.Bit64).double(e.value.double);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new fi;class yi extends i.MessageType{constructor(){super("MiLaboratories.PL.RTypes.ControllerSettings",[{no:1,name:"type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.type);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new yi;class hi extends i.MessageType{constructor(){super("MiLaboratories.PL.RTypes.SubscriptionSettings",[{no:1,name:"blocking",kind:"scalar",T:8},{no:2,name:"randomizer",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.blocking=!1,t.randomizer=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.blocking=e.bool();break;case 2:s.randomizer=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.blocking!==!1&&t.tag(1,i.WireType.Varint).bool(e.blocking),e.randomizer!==0n&&t.tag(2,i.WireType.Varint).uint64(e.randomizer);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new hi;class gi extends i.MessageType{constructor(){super("MiLaboratories.PL.RTypes.NotificationFilter",[{no:1,name:"resource_type",kind:"message",oneof:"resourceFilter",T:()=>f},{no:7,name:"resource_id",kind:"scalar",oneof:"resourceFilter",T:4,L:0},{no:8,name:"event_filter",kind:"message",T:()=>Pe},{no:9,name:"payload",kind:"message",T:()=>O}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceFilter={oneofKind:void 0},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceFilter={oneofKind:"resourceType",resourceType:f.internalBinaryRead(e,e.uint32(),r,s.resourceFilter.resourceType)};break;case 7:s.resourceFilter={oneofKind:"resourceId",resourceId:e.uint64().toBigInt()};break;case 8:s.eventFilter=Pe.internalBinaryRead(e,e.uint32(),r,s.eventFilter);break;case 9:s.payload=O.internalBinaryRead(e,e.uint32(),r,s.payload);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceFilter.oneofKind==="resourceType"&&f.internalBinaryWrite(e.resourceFilter.resourceType,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.resourceFilter.oneofKind==="resourceId"&&t.tag(7,i.WireType.Varint).uint64(e.resourceFilter.resourceId),e.eventFilter&&Pe.internalBinaryWrite(e.eventFilter,t.tag(8,i.WireType.LengthDelimited).fork(),r).join(),e.payload&&O.internalBinaryWrite(e.payload,t.tag(9,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const b=new gi;class Ti extends i.MessageType{constructor(){super("MiLaboratories.PL.RTypes.NotificationFilter.EventFilter",[{no:1,name:"all",kind:"scalar",opt:!0,T:8},{no:2,name:"resource_created",kind:"scalar",opt:!0,T:8},{no:3,name:"resource_deleted",kind:"scalar",opt:!0,T:8},{no:5,name:"resource_ready",kind:"scalar",opt:!0,T:8},{no:6,name:"resource_duplicate",kind:"scalar",opt:!0,T:8},{no:16,name:"resource_error",kind:"scalar",opt:!0,T:8},{no:13,name:"inputs_locked",kind:"scalar",opt:!0,T:8},{no:14,name:"outputs_locked",kind:"scalar",opt:!0,T:8},{no:12,name:"field_created",kind:"scalar",opt:!0,T:8},{no:17,name:"field_got_error",kind:"scalar",opt:!0,T:8},{no:7,name:"input_set",kind:"scalar",opt:!0,T:8},{no:8,name:"all_inputs_set",kind:"scalar",opt:!0,T:8},{no:9,name:"output_set",kind:"scalar",opt:!0,T:8},{no:10,name:"all_outputs_set",kind:"scalar",opt:!0,T:8},{no:15,name:"generic_otw_set",kind:"scalar",opt:!0,T:8},{no:11,name:"dynamic_changed",kind:"scalar",opt:!0,T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.all=e.bool();break;case 2:s.resourceCreated=e.bool();break;case 3:s.resourceDeleted=e.bool();break;case 5:s.resourceReady=e.bool();break;case 6:s.resourceDuplicate=e.bool();break;case 16:s.resourceError=e.bool();break;case 13:s.inputsLocked=e.bool();break;case 14:s.outputsLocked=e.bool();break;case 12:s.fieldCreated=e.bool();break;case 17:s.fieldGotError=e.bool();break;case 7:s.inputSet=e.bool();break;case 8:s.allInputsSet=e.bool();break;case 9:s.outputSet=e.bool();break;case 10:s.allOutputsSet=e.bool();break;case 15:s.genericOtwSet=e.bool();break;case 11:s.dynamicChanged=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.all!==void 0&&t.tag(1,i.WireType.Varint).bool(e.all),e.resourceCreated!==void 0&&t.tag(2,i.WireType.Varint).bool(e.resourceCreated),e.resourceDeleted!==void 0&&t.tag(3,i.WireType.Varint).bool(e.resourceDeleted),e.resourceReady!==void 0&&t.tag(5,i.WireType.Varint).bool(e.resourceReady),e.resourceDuplicate!==void 0&&t.tag(6,i.WireType.Varint).bool(e.resourceDuplicate),e.resourceError!==void 0&&t.tag(16,i.WireType.Varint).bool(e.resourceError),e.inputsLocked!==void 0&&t.tag(13,i.WireType.Varint).bool(e.inputsLocked),e.outputsLocked!==void 0&&t.tag(14,i.WireType.Varint).bool(e.outputsLocked),e.fieldCreated!==void 0&&t.tag(12,i.WireType.Varint).bool(e.fieldCreated),e.fieldGotError!==void 0&&t.tag(17,i.WireType.Varint).bool(e.fieldGotError),e.inputSet!==void 0&&t.tag(7,i.WireType.Varint).bool(e.inputSet),e.allInputsSet!==void 0&&t.tag(8,i.WireType.Varint).bool(e.allInputsSet),e.outputSet!==void 0&&t.tag(9,i.WireType.Varint).bool(e.outputSet),e.allOutputsSet!==void 0&&t.tag(10,i.WireType.Varint).bool(e.allOutputsSet),e.genericOtwSet!==void 0&&t.tag(15,i.WireType.Varint).bool(e.genericOtwSet),e.dynamicChanged!==void 0&&t.tag(11,i.WireType.Varint).bool(e.dynamicChanged);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Pe=new Ti;class ki extends i.MessageType{constructor(){super("MiLaboratories.PL.RTypes.NotificationFilter.Payload",[{no:1,name:"values",kind:"map",K:9,V:{kind:"scalar",T:12}}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.values={},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:this.binaryReadMap1(s.values,e,r);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap1(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=t.bytes();break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.RTypes.NotificationFilter.Payload.values")}}e[u??""]=l??new Uint8Array(0)}internalBinaryWrite(e,t,r){for(let s of globalThis.Object.keys(e.values))t.tag(1,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s).tag(2,i.WireType.LengthDelimited).bytes(e.values[s]).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const O=new ki;class mi extends i.MessageType{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const e=this.create(),t=Date.now();return e.seconds=i.PbLong.from(Math.floor(t/1e3)).toBigInt(),e.nanos=t%1e3*1e6,e}toDate(e){return new Date(i.PbLong.from(e.seconds).toNumber()*1e3+Math.ceil(e.nanos/1e6))}fromDate(e){const t=this.create(),r=e.getTime();return t.seconds=i.PbLong.from(Math.floor(r/1e3)).toBigInt(),t.nanos=r%1e3*1e6,t}internalJsonWrite(e,t){let r=i.PbLong.from(e.seconds).toNumber()*1e3;if(r<Date.parse("0001-01-01T00:00:00Z")||r>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(e.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let n="Z";if(e.nanos>0){let s=(e.nanos+1e9).toString().substring(1);s.substring(3)==="000000"?n="."+s.substring(0,3)+"Z":s.substring(6)==="000"?n="."+s.substring(0,6)+"Z":n="."+s+"Z"}return new Date(r).toISOString().replace(".000Z",n)}internalJsonRead(e,t,r){if(typeof e!="string")throw new Error("Unable to parse Timestamp from JSON "+i.typeofJsonValue(e)+".");let n=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!n)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let s=Date.parse(n[1]+"-"+n[2]+"-"+n[3]+"T"+n[4]+":"+n[5]+":"+n[6]+(n[8]?n[8]:"Z"));if(Number.isNaN(s))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return r||(r=this.create()),r.seconds=i.PbLong.from(s/1e3).toBigInt(),r.nanos=0,n[7]&&(r.nanos=parseInt("1"+n[7]+"0".repeat(9-n[7].length))-1e9),r}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.seconds=0n,t.nanos=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.seconds=e.int64().toBigInt();break;case 2:s.nanos=e.int32();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.seconds!==0n&&t.tag(1,i.WireType.Varint).int64(e.seconds),e.nanos!==0&&t.tag(2,i.WireType.Varint).int32(e.nanos);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const $=new mi;var de=(a=>(a[a.INVALID=0]="INVALID",a[a.STRUCTURAL=1]="STRUCTURAL",a[a.VALUE=2]="VALUE",a))(de||{}),j=(a=>(a[a.INVALID=0]="INVALID",a[a.EMPTY=1]="EMPTY",a[a.ASSIGNED=2]="ASSIGNED",a[a.RESOLVED=3]="RESOLVED",a))(j||{});class wi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Tx",[{no:1,name:"is_valid",kind:"scalar",T:8},{no:2,name:"id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.isValid=!1,t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.isValid=e.bool();break;case 2:s.id=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.isValid!==!1&&t.tag(1,i.WireType.Varint).bool(e.isValid),e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Re=new wi;class bi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Resource",[{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"kind",kind:"enum",T:()=>["MiLaboratories.PL.API.Resource.Kind",de,"KIND_"]},{no:4,name:"type",kind:"message",T:()=>f},{no:5,name:"data",kind:"scalar",T:12},{no:6,name:"fields",kind:"message",repeat:1,T:()=>m},{no:7,name:"has_errors",kind:"scalar",T:8},{no:8,name:"inputs_locked",kind:"scalar",T:8},{no:9,name:"outputs_locked",kind:"scalar",T:8},{no:14,name:"resource_ready",kind:"scalar",T:8},{no:15,name:"is_final",kind:"scalar",T:8},{no:10,name:"original_resource_id",kind:"scalar",T:4,L:0},{no:11,name:"parent_resource_id",kind:"scalar",T:4,L:0},{no:12,name:"created_time",kind:"message",T:()=>$},{no:13,name:"deleted_time",kind:"message",T:()=>$}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,t.kind=0,t.data=new Uint8Array(0),t.fields=[],t.hasErrors=!1,t.inputsLocked=!1,t.outputsLocked=!1,t.resourceReady=!1,t.isFinal=!1,t.originalResourceId=0n,t.parentResourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.id=e.uint64().toBigInt();break;case 3:s.kind=e.int32();break;case 4:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 5:s.data=e.bytes();break;case 6:s.fields.push(m.internalBinaryRead(e,e.uint32(),r));break;case 7:s.hasErrors=e.bool();break;case 8:s.inputsLocked=e.bool();break;case 9:s.outputsLocked=e.bool();break;case 14:s.resourceReady=e.bool();break;case 15:s.isFinal=e.bool();break;case 10:s.originalResourceId=e.uint64().toBigInt();break;case 11:s.parentResourceId=e.uint64().toBigInt();break;case 12:s.createdTime=$.internalBinaryRead(e,e.uint32(),r,s.createdTime);break;case 13:s.deletedTime=$.internalBinaryRead(e,e.uint32(),r,s.deletedTime);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.kind!==0&&t.tag(3,i.WireType.Varint).int32(e.kind),e.type&&f.internalBinaryWrite(e.type,t.tag(4,i.WireType.LengthDelimited).fork(),r).join(),e.data.length&&t.tag(5,i.WireType.LengthDelimited).bytes(e.data);for(let s=0;s<e.fields.length;s++)m.internalBinaryWrite(e.fields[s],t.tag(6,i.WireType.LengthDelimited).fork(),r).join();e.hasErrors!==!1&&t.tag(7,i.WireType.Varint).bool(e.hasErrors),e.inputsLocked!==!1&&t.tag(8,i.WireType.Varint).bool(e.inputsLocked),e.outputsLocked!==!1&&t.tag(9,i.WireType.Varint).bool(e.outputsLocked),e.resourceReady!==!1&&t.tag(14,i.WireType.Varint).bool(e.resourceReady),e.isFinal!==!1&&t.tag(15,i.WireType.Varint).bool(e.isFinal),e.originalResourceId!==0n&&t.tag(10,i.WireType.Varint).uint64(e.originalResourceId),e.parentResourceId!==0n&&t.tag(11,i.WireType.Varint).uint64(e.parentResourceId),e.createdTime&&$.internalBinaryWrite(e.createdTime,t.tag(12,i.WireType.LengthDelimited).fork(),r).join(),e.deletedTime&&$.internalBinaryWrite(e.deletedTime,t.tag(13,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const I=new bi;class Pi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Field",[{no:1,name:"id",kind:"message",T:()=>y},{no:2,name:"type",kind:"enum",T:()=>["MiLaboratories.PL.Base.FieldType",T]},{no:5,name:"value",kind:"scalar",T:4,L:0},{no:7,name:"value_status",kind:"enum",T:()=>["MiLaboratories.PL.API.Field.ValueStatus",j]},{no:8,name:"value_is_final",kind:"scalar",T:8},{no:6,name:"error",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type=0,t.value=0n,t.valueStatus=0,t.valueIsFinal=!1,t.error=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=y.internalBinaryRead(e,e.uint32(),r,s.id);break;case 2:s.type=e.int32();break;case 5:s.value=e.uint64().toBigInt();break;case 7:s.valueStatus=e.int32();break;case 8:s.valueIsFinal=e.bool();break;case 6:s.error=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id&&y.internalBinaryWrite(e.id,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.type!==0&&t.tag(2,i.WireType.Varint).int32(e.type),e.value!==0n&&t.tag(5,i.WireType.Varint).uint64(e.value),e.valueStatus!==0&&t.tag(7,i.WireType.Varint).int32(e.valueStatus),e.valueIsFinal!==!1&&t.tag(8,i.WireType.Varint).bool(e.valueIsFinal),e.error!==0n&&t.tag(6,i.WireType.Varint).uint64(e.error);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const m=new Pi;class Ri extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Notification",[{no:1,name:"subscription_id",kind:"scalar",T:4,L:0},{no:2,name:"event_id",kind:"scalar",T:4,L:0},{no:3,name:"resource_id",kind:"scalar",T:4,L:0},{no:4,name:"resource_type",kind:"message",T:()=>f},{no:5,name:"events",kind:"message",T:()=>Ie},{no:6,name:"field_changes",kind:"map",K:9,V:{kind:"message",T:()=>X}},{no:7,name:"payload",kind:"message",T:()=>O},{no:8,name:"filter_name",kind:"scalar",T:9},{no:9,name:"tx_span",kind:"message",T:()=>_e}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptionId=0n,t.eventId=0n,t.resourceId=0n,t.fieldChanges={},t.filterName="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptionId=e.uint64().toBigInt();break;case 2:s.eventId=e.uint64().toBigInt();break;case 3:s.resourceId=e.uint64().toBigInt();break;case 4:s.resourceType=f.internalBinaryRead(e,e.uint32(),r,s.resourceType);break;case 5:s.events=Ie.internalBinaryRead(e,e.uint32(),r,s.events);break;case 6:this.binaryReadMap6(s.fieldChanges,e,r);break;case 7:s.payload=O.internalBinaryRead(e,e.uint32(),r,s.payload);break;case 8:s.filterName=e.string();break;case 9:s.txSpan=_e.internalBinaryRead(e,e.uint32(),r,s.txSpan);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap6(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=X.internalBinaryRead(t,t.uint32(),r);break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.Notification.field_changes")}}e[u??""]=l??X.create()}internalBinaryWrite(e,t,r){e.subscriptionId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscriptionId),e.eventId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.eventId),e.resourceId!==0n&&t.tag(3,i.WireType.Varint).uint64(e.resourceId),e.resourceType&&f.internalBinaryWrite(e.resourceType,t.tag(4,i.WireType.LengthDelimited).fork(),r).join(),e.events&&Ie.internalBinaryWrite(e.events,t.tag(5,i.WireType.LengthDelimited).fork(),r).join();for(let s of globalThis.Object.keys(e.fieldChanges))t.tag(6,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s),t.tag(2,i.WireType.LengthDelimited).fork(),X.internalBinaryWrite(e.fieldChanges[s],t,r),t.join().join();e.payload&&O.internalBinaryWrite(e.payload,t.tag(7,i.WireType.LengthDelimited).fork(),r).join(),e.filterName!==""&&t.tag(8,i.WireType.LengthDelimited).string(e.filterName),e.txSpan&&_e.internalBinaryWrite(e.txSpan,t.tag(9,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const q=new Ri;class Ii extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Notification.Events",[{no:1,name:"resource_created",kind:"scalar",T:8},{no:2,name:"resource_deleted",kind:"scalar",T:8},{no:4,name:"resource_ready",kind:"scalar",T:8},{no:5,name:"resource_duplicate",kind:"scalar",T:8},{no:15,name:"resource_error",kind:"scalar",T:8},{no:12,name:"inputs_locked",kind:"scalar",T:8},{no:13,name:"outputs_locked",kind:"scalar",T:8},{no:11,name:"field_created",kind:"scalar",T:8},{no:16,name:"field_got_error",kind:"scalar",T:8},{no:6,name:"input_set",kind:"scalar",T:8},{no:7,name:"all_inputs_set",kind:"scalar",T:8},{no:8,name:"output_set",kind:"scalar",T:8},{no:9,name:"all_outputs_set",kind:"scalar",T:8},{no:14,name:"generic_otw_set",kind:"scalar",T:8},{no:10,name:"dynamic_changed",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceCreated=!1,t.resourceDeleted=!1,t.resourceReady=!1,t.resourceDuplicate=!1,t.resourceError=!1,t.inputsLocked=!1,t.outputsLocked=!1,t.fieldCreated=!1,t.fieldGotError=!1,t.inputSet=!1,t.allInputsSet=!1,t.outputSet=!1,t.allOutputsSet=!1,t.genericOtwSet=!1,t.dynamicChanged=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceCreated=e.bool();break;case 2:s.resourceDeleted=e.bool();break;case 4:s.resourceReady=e.bool();break;case 5:s.resourceDuplicate=e.bool();break;case 15:s.resourceError=e.bool();break;case 12:s.inputsLocked=e.bool();break;case 13:s.outputsLocked=e.bool();break;case 11:s.fieldCreated=e.bool();break;case 16:s.fieldGotError=e.bool();break;case 6:s.inputSet=e.bool();break;case 7:s.allInputsSet=e.bool();break;case 8:s.outputSet=e.bool();break;case 9:s.allOutputsSet=e.bool();break;case 14:s.genericOtwSet=e.bool();break;case 10:s.dynamicChanged=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceCreated!==!1&&t.tag(1,i.WireType.Varint).bool(e.resourceCreated),e.resourceDeleted!==!1&&t.tag(2,i.WireType.Varint).bool(e.resourceDeleted),e.resourceReady!==!1&&t.tag(4,i.WireType.Varint).bool(e.resourceReady),e.resourceDuplicate!==!1&&t.tag(5,i.WireType.Varint).bool(e.resourceDuplicate),e.resourceError!==!1&&t.tag(15,i.WireType.Varint).bool(e.resourceError),e.inputsLocked!==!1&&t.tag(12,i.WireType.Varint).bool(e.inputsLocked),e.outputsLocked!==!1&&t.tag(13,i.WireType.Varint).bool(e.outputsLocked),e.fieldCreated!==!1&&t.tag(11,i.WireType.Varint).bool(e.fieldCreated),e.fieldGotError!==!1&&t.tag(16,i.WireType.Varint).bool(e.fieldGotError),e.inputSet!==!1&&t.tag(6,i.WireType.Varint).bool(e.inputSet),e.allInputsSet!==!1&&t.tag(7,i.WireType.Varint).bool(e.allInputsSet),e.outputSet!==!1&&t.tag(8,i.WireType.Varint).bool(e.outputSet),e.allOutputsSet!==!1&&t.tag(9,i.WireType.Varint).bool(e.allOutputsSet),e.genericOtwSet!==!1&&t.tag(14,i.WireType.Varint).bool(e.genericOtwSet),e.dynamicChanged!==!1&&t.tag(10,i.WireType.Varint).bool(e.dynamicChanged);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ie=new Ii;class _i extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Notification.FieldChange",[{no:1,name:"old",kind:"message",T:()=>m},{no:2,name:"new",kind:"message",T:()=>m}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.old=m.internalBinaryRead(e,e.uint32(),r,s.old);break;case 2:s.new=m.internalBinaryRead(e,e.uint32(),r,s.new);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.old&&m.internalBinaryWrite(e.old,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.new&&m.internalBinaryWrite(e.new,t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const X=new _i;class Ai extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SpanInfo",[{no:1,name:"path",kind:"scalar",T:9},{no:2,name:"carrier",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.path="",t.carrier={},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.path=e.string();break;case 2:this.binaryReadMap2(s.carrier,e,r);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap2(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=t.string();break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.SpanInfo.carrier")}}e[u??""]=l??""}internalBinaryWrite(e,t,r){e.path!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.path);for(let s of globalThis.Object.keys(e.carrier))t.tag(2,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s).tag(2,i.WireType.LengthDelimited).string(e.carrier[s]).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const _e=new Ai;class Li extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Subscription",[{no:1,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"blocking",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,t.blocking=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint64().toBigInt();break;case 3:s.blocking=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(1,i.WireType.Varint).uint64(e.id),e.blocking!==!1&&t.tag(3,i.WireType.Varint).bool(e.blocking);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ae=new Li;class Fi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Controller",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"subscriptionID",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.id=0n,t.subscriptionID=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=e.string();break;case 2:s.id=e.uint64().toBigInt();break;case 3:s.subscriptionID=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.type),e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.subscriptionID!==0n&&t.tag(3,i.WireType.Varint).uint64(e.subscriptionID);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Le=new Fi;class Wi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceSchema",[{no:1,name:"type",kind:"message",T:()=>f},{no:2,name:"fields",kind:"message",repeat:1,T:()=>Fe}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.fields=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 2:s.fields.push(Fe.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type&&f.internalBinaryWrite(e.type,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();for(let s=0;s<e.fields.length;s++)Fe.internalBinaryWrite(e.fields[s],t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const K=new Wi;class Ui extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldSchema",[{no:1,name:"type",kind:"enum",T:()=>["MiLaboratories.PL.Base.FieldType",T]},{no:2,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type=0,t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=e.int32();break;case 2:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type!==0&&t.tag(1,i.WireType.Varint).int32(e.type),e.name!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Fe=new Ui;class Bi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPIFeature",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"feature_name",kind:"scalar",T:9},{no:3,name:"resource_type",kind:"message",T:()=>f},{no:4,name:"endpoint",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.featureName="",t.endpoint="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:s.featureName=e.string();break;case 3:s.resourceType=f.internalBinaryRead(e,e.uint32(),r,s.resourceType);break;case 4:s.endpoint=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType),e.featureName!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.featureName),e.resourceType&&f.internalBinaryWrite(e.resourceType,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.endpoint!==""&&t.tag(4,i.WireType.LengthDelimited).string(e.endpoint);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const We=new Bi;class Ni extends i.MessageType{constructor(){super("google.protobuf.Any",[{no:1,name:"type_url",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:12}])}pack(e,t){return{typeUrl:this.typeNameToUrl(t.typeName),value:t.toBinary(e)}}unpack(e,t,r){if(!this.contains(e,t))throw new Error("Cannot unpack google.protobuf.Any with typeUrl '"+e.typeUrl+"' as "+t.typeName+".");return t.fromBinary(e.value,r)}contains(e,t){if(!e.typeUrl.length)return!1;let r=typeof t=="string"?t:t.typeName,n=this.typeUrlToName(e.typeUrl);return r===n}internalJsonWrite(e,t){var c;if(e.typeUrl==="")return{};let r=this.typeUrlToName(e.typeUrl),n=i.jsonWriteOptions(t),s=(c=n.typeRegistry)==null?void 0:c.find(o=>o.typeName===r);if(!s)throw new globalThis.Error("Unable to convert google.protobuf.Any with typeUrl '"+e.typeUrl+"' to JSON. The specified type "+r+" is not available in the type registry.");let u=s.fromBinary(e.value,{readUnknownField:!1}),l=s.internalJsonWrite(u,n);return(r.startsWith("google.protobuf.")||!i.isJsonObject(l))&&(l={value:l}),l["@type"]=e.typeUrl,l}internalJsonRead(e,t,r){var l;if(!i.isJsonObject(e))throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON "+i.typeofJsonValue(e)+".");if(typeof e["@type"]!="string"||e["@type"]=="")return this.create();let n=this.typeUrlToName(e["@type"]),s=(l=t==null?void 0:t.typeRegistry)==null?void 0:l.find(c=>c.typeName==n);if(!s)throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON. The specified type "+n+" is not available in the type registry.");let u;if(n.startsWith("google.protobuf.")&&e.hasOwnProperty("value"))u=s.fromJson(e.value,t);else{let c=Object.assign({},e);delete c["@type"],u=s.fromJson(c,t)}return r===void 0&&(r=this.create()),r.typeUrl=e["@type"],r.value=s.toBinary(u),r}typeNameToUrl(e){if(!e.length)throw new Error("invalid type name: "+e);return"type.googleapis.com/"+e}typeUrlToName(e){if(!e.length)throw new Error("invalid type url: "+e);let t=e.lastIndexOf("/"),r=t>0?e.substring(t+1):e;if(!r.length)throw new Error("invalid type url: "+e);return r}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.typeUrl="",t.value=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.typeUrl=e.string();break;case 2:s.value=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.typeUrl!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.typeUrl),e.value.length&&t.tag(2,i.WireType.LengthDelimited).bytes(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ue=new Ni;class Mi extends i.MessageType{constructor(){super("google.rpc.Status",[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"details",kind:"message",repeat:1,T:()=>Ue}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.code=0,t.message="",t.details=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.code=e.int32();break;case 2:s.message=e.string();break;case 3:s.details.push(Ue.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.code!==0&&t.tag(1,i.WireType.Varint).int32(e.code),e.message!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.message);for(let s=0;s<e.details.length;s++)Ue.internalBinaryWrite(e.details[s],t.tag(3,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Be=new Mi;var pe=(a=>(a[a.INVALID=0]="INVALID",a[a.WRITABLE=1]="WRITABLE",a[a.NOT_WRITABLE=2]="NOT_WRITABLE",a))(pe||{});class xi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new xi;class Ei extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.ClientMessage",[{no:1,name:"request_id",kind:"scalar",T:13},{no:11,name:"tx_open",kind:"message",oneof:"request",T:()=>Me},{no:12,name:"tx_commit",kind:"message",oneof:"request",T:()=>Ee},{no:13,name:"tx_discard",kind:"message",oneof:"request",T:()=>Se},{no:58,name:"resource_create_root",kind:"message",oneof:"request",T:()=>dt},{no:57,name:"resource_remove",kind:"message",oneof:"request",T:()=>ft},{no:51,name:"resource_create_struct",kind:"message",oneof:"request",T:()=>De},{no:62,name:"resource_create_ephemeral",kind:"message",oneof:"request",T:()=>qe},{no:52,name:"resource_create_value",kind:"message",oneof:"request",T:()=>je},{no:63,name:"resource_get_value_id",kind:"message",oneof:"request",T:()=>Ge},{no:64,name:"resource_create_singleton",kind:"message",oneof:"request",T:()=>ze},{no:65,name:"resource_get_singleton",kind:"message",oneof:"request",T:()=>Xe},{no:59,name:"resource_create_child",kind:"message",oneof:"request",T:()=>Ve},{no:53,name:"resource_lock_inputs",kind:"message",oneof:"request",T:()=>Qe},{no:56,name:"resource_lock_outputs",kind:"message",oneof:"request",T:()=>tt},{no:54,name:"resource_exists",kind:"message",oneof:"request",T:()=>rt},{no:55,name:"resource_get",kind:"message",oneof:"request",T:()=>at},{no:61,name:"resource_set_error",kind:"message",oneof:"request",T:()=>st},{no:60,name:"resource_list_by_type",kind:"message",oneof:"request",T:()=>ct},{no:66,name:"resource_name_set",kind:"message",oneof:"request",T:()=>ht},{no:67,name:"resource_name_get",kind:"message",oneof:"request",T:()=>Tt},{no:68,name:"resource_name_exists",kind:"message",oneof:"request",T:()=>mt},{no:69,name:"resource_name_delete",kind:"message",oneof:"request",T:()=>bt},{no:101,name:"field_create",kind:"message",oneof:"request",T:()=>Rt},{no:107,name:"field_exists",kind:"message",oneof:"request",T:()=>_t},{no:102,name:"field_set",kind:"message",oneof:"request",T:()=>Lt},{no:105,name:"field_set_error",kind:"message",oneof:"request",T:()=>Wt},{no:103,name:"field_get",kind:"message",oneof:"request",T:()=>Bt},{no:104,name:"field_reset",kind:"message",oneof:"request",T:()=>Mt},{no:106,name:"field_remove",kind:"message",oneof:"request",T:()=>Et},{no:111,name:"subscription_create",kind:"message",oneof:"request",T:()=>qt},{no:112,name:"subscription_attach_filter",kind:"message",oneof:"request",T:()=>te},{no:113,name:"subscription_detach_filter",kind:"message",oneof:"request",T:()=>re},{no:115,name:"subscription_create_filter",kind:"message",oneof:"request",T:()=>Vt},{no:154,name:"notification_get",kind:"message",oneof:"request",T:()=>Q},{no:155,name:"notification_ack",kind:"message",oneof:"request",T:()=>St},{no:156,name:"notification_discard",kind:"message",oneof:"request",T:()=>Dt},{no:200,name:"resource_key_value_set",kind:"message",oneof:"request",T:()=>zt},{no:201,name:"resource_key_value_get",kind:"message",oneof:"request",T:()=>Xt},{no:202,name:"resource_key_value_get_if_exists",kind:"message",oneof:"request",T:()=>Qt},{no:203,name:"resource_key_value_set_flag",kind:"message",oneof:"request",T:()=>rn},{no:204,name:"resource_key_value_get_flag",kind:"message",oneof:"request",T:()=>S},{no:205,name:"resource_key_value_get_flag_if_exists",kind:"message",oneof:"request",T:()=>S},{no:206,name:"resource_key_value_delete",kind:"message",oneof:"request",T:()=>tn},{no:207,name:"resource_key_value_list",kind:"message",oneof:"request",T:()=>Ht},{no:250,name:"controller_key_value_set",kind:"message",oneof:"request",T:()=>on},{no:251,name:"controller_key_value_get",kind:"message",oneof:"request",T:()=>ln},{no:252,name:"controller_key_value_get_if_exists",kind:"message",oneof:"request",T:()=>un},{no:300,name:"cache_set_to_field",kind:"message",oneof:"request",T:()=>pn},{no:301,name:"cache_delete_expired_records",kind:"message",oneof:"request",T:()=>yn},{no:350,name:"controller_features_set",kind:"message",oneof:"request",T:()=>se},{no:351,name:"controller_features_clear",kind:"message",oneof:"request",T:()=>ae}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.requestId=0,t.request={oneofKind:void 0},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.requestId=e.uint32();break;case 11:s.request={oneofKind:"txOpen",txOpen:Me.internalBinaryRead(e,e.uint32(),r,s.request.txOpen)};break;case 12:s.request={oneofKind:"txCommit",txCommit:Ee.internalBinaryRead(e,e.uint32(),r,s.request.txCommit)};break;case 13:s.request={oneofKind:"txDiscard",txDiscard:Se.internalBinaryRead(e,e.uint32(),r,s.request.txDiscard)};break;case 58:s.request={oneofKind:"resourceCreateRoot",resourceCreateRoot:dt.internalBinaryRead(e,e.uint32(),r,s.request.resourceCreateRoot)};break;case 57:s.request={oneofKind:"resourceRemove",resourceRemove:ft.internalBinaryRead(e,e.uint32(),r,s.request.resourceRemove)};break;case 51:s.request={oneofKind:"resourceCreateStruct",resourceCreateStruct:De.internalBinaryRead(e,e.uint32(),r,s.request.resourceCreateStruct)};break;case 62:s.request={oneofKind:"resourceCreateEphemeral",resourceCreateEphemeral:qe.internalBinaryRead(e,e.uint32(),r,s.request.resourceCreateEphemeral)};break;case 52:s.request={oneofKind:"resourceCreateValue",resourceCreateValue:je.internalBinaryRead(e,e.uint32(),r,s.request.resourceCreateValue)};break;case 63:s.request={oneofKind:"resourceGetValueId",resourceGetValueId:Ge.internalBinaryRead(e,e.uint32(),r,s.request.resourceGetValueId)};break;case 64:s.request={oneofKind:"resourceCreateSingleton",resourceCreateSingleton:ze.internalBinaryRead(e,e.uint32(),r,s.request.resourceCreateSingleton)};break;case 65:s.request={oneofKind:"resourceGetSingleton",resourceGetSingleton:Xe.internalBinaryRead(e,e.uint32(),r,s.request.resourceGetSingleton)};break;case 59:s.request={oneofKind:"resourceCreateChild",resourceCreateChild:Ve.internalBinaryRead(e,e.uint32(),r,s.request.resourceCreateChild)};break;case 53:s.request={oneofKind:"resourceLockInputs",resourceLockInputs:Qe.internalBinaryRead(e,e.uint32(),r,s.request.resourceLockInputs)};break;case 56:s.request={oneofKind:"resourceLockOutputs",resourceLockOutputs:tt.internalBinaryRead(e,e.uint32(),r,s.request.resourceLockOutputs)};break;case 54:s.request={oneofKind:"resourceExists",resourceExists:rt.internalBinaryRead(e,e.uint32(),r,s.request.resourceExists)};break;case 55:s.request={oneofKind:"resourceGet",resourceGet:at.internalBinaryRead(e,e.uint32(),r,s.request.resourceGet)};break;case 61:s.request={oneofKind:"resourceSetError",resourceSetError:st.internalBinaryRead(e,e.uint32(),r,s.request.resourceSetError)};break;case 60:s.request={oneofKind:"resourceListByType",resourceListByType:ct.internalBinaryRead(e,e.uint32(),r,s.request.resourceListByType)};break;case 66:s.request={oneofKind:"resourceNameSet",resourceNameSet:ht.internalBinaryRead(e,e.uint32(),r,s.request.resourceNameSet)};break;case 67:s.request={oneofKind:"resourceNameGet",resourceNameGet:Tt.internalBinaryRead(e,e.uint32(),r,s.request.resourceNameGet)};break;case 68:s.request={oneofKind:"resourceNameExists",resourceNameExists:mt.internalBinaryRead(e,e.uint32(),r,s.request.resourceNameExists)};break;case 69:s.request={oneofKind:"resourceNameDelete",resourceNameDelete:bt.internalBinaryRead(e,e.uint32(),r,s.request.resourceNameDelete)};break;case 101:s.request={oneofKind:"fieldCreate",fieldCreate:Rt.internalBinaryRead(e,e.uint32(),r,s.request.fieldCreate)};break;case 107:s.request={oneofKind:"fieldExists",fieldExists:_t.internalBinaryRead(e,e.uint32(),r,s.request.fieldExists)};break;case 102:s.request={oneofKind:"fieldSet",fieldSet:Lt.internalBinaryRead(e,e.uint32(),r,s.request.fieldSet)};break;case 105:s.request={oneofKind:"fieldSetError",fieldSetError:Wt.internalBinaryRead(e,e.uint32(),r,s.request.fieldSetError)};break;case 103:s.request={oneofKind:"fieldGet",fieldGet:Bt.internalBinaryRead(e,e.uint32(),r,s.request.fieldGet)};break;case 104:s.request={oneofKind:"fieldReset",fieldReset:Mt.internalBinaryRead(e,e.uint32(),r,s.request.fieldReset)};break;case 106:s.request={oneofKind:"fieldRemove",fieldRemove:Et.internalBinaryRead(e,e.uint32(),r,s.request.fieldRemove)};break;case 111:s.request={oneofKind:"subscriptionCreate",subscriptionCreate:qt.internalBinaryRead(e,e.uint32(),r,s.request.subscriptionCreate)};break;case 112:s.request={oneofKind:"subscriptionAttachFilter",subscriptionAttachFilter:te.internalBinaryRead(e,e.uint32(),r,s.request.subscriptionAttachFilter)};break;case 113:s.request={oneofKind:"subscriptionDetachFilter",subscriptionDetachFilter:re.internalBinaryRead(e,e.uint32(),r,s.request.subscriptionDetachFilter)};break;case 115:s.request={oneofKind:"subscriptionCreateFilter",subscriptionCreateFilter:Vt.internalBinaryRead(e,e.uint32(),r,s.request.subscriptionCreateFilter)};break;case 154:s.request={oneofKind:"notificationGet",notificationGet:Q.internalBinaryRead(e,e.uint32(),r,s.request.notificationGet)};break;case 155:s.request={oneofKind:"notificationAck",notificationAck:St.internalBinaryRead(e,e.uint32(),r,s.request.notificationAck)};break;case 156:s.request={oneofKind:"notificationDiscard",notificationDiscard:Dt.internalBinaryRead(e,e.uint32(),r,s.request.notificationDiscard)};break;case 200:s.request={oneofKind:"resourceKeyValueSet",resourceKeyValueSet:zt.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueSet)};break;case 201:s.request={oneofKind:"resourceKeyValueGet",resourceKeyValueGet:Xt.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueGet)};break;case 202:s.request={oneofKind:"resourceKeyValueGetIfExists",resourceKeyValueGetIfExists:Qt.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueGetIfExists)};break;case 203:s.request={oneofKind:"resourceKeyValueSetFlag",resourceKeyValueSetFlag:rn.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueSetFlag)};break;case 204:s.request={oneofKind:"resourceKeyValueGetFlag",resourceKeyValueGetFlag:S.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueGetFlag)};break;case 205:s.request={oneofKind:"resourceKeyValueGetFlagIfExists",resourceKeyValueGetFlagIfExists:S.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueGetFlagIfExists)};break;case 206:s.request={oneofKind:"resourceKeyValueDelete",resourceKeyValueDelete:tn.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueDelete)};break;case 207:s.request={oneofKind:"resourceKeyValueList",resourceKeyValueList:Ht.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueList)};break;case 250:s.request={oneofKind:"controllerKeyValueSet",controllerKeyValueSet:on.internalBinaryRead(e,e.uint32(),r,s.request.controllerKeyValueSet)};break;case 251:s.request={oneofKind:"controllerKeyValueGet",controllerKeyValueGet:ln.internalBinaryRead(e,e.uint32(),r,s.request.controllerKeyValueGet)};break;case 252:s.request={oneofKind:"controllerKeyValueGetIfExists",controllerKeyValueGetIfExists:un.internalBinaryRead(e,e.uint32(),r,s.request.controllerKeyValueGetIfExists)};break;case 300:s.request={oneofKind:"cacheSetToField",cacheSetToField:pn.internalBinaryRead(e,e.uint32(),r,s.request.cacheSetToField)};break;case 301:s.request={oneofKind:"cacheDeleteExpiredRecords",cacheDeleteExpiredRecords:yn.internalBinaryRead(e,e.uint32(),r,s.request.cacheDeleteExpiredRecords)};break;case 350:s.request={oneofKind:"controllerFeaturesSet",controllerFeaturesSet:se.internalBinaryRead(e,e.uint32(),r,s.request.controllerFeaturesSet)};break;case 351:s.request={oneofKind:"controllerFeaturesClear",controllerFeaturesClear:ae.internalBinaryRead(e,e.uint32(),r,s.request.controllerFeaturesClear)};break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.requestId!==0&&t.tag(1,i.WireType.Varint).uint32(e.requestId),e.request.oneofKind==="txOpen"&&Me.internalBinaryWrite(e.request.txOpen,t.tag(11,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="txCommit"&&Ee.internalBinaryWrite(e.request.txCommit,t.tag(12,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="txDiscard"&&Se.internalBinaryWrite(e.request.txDiscard,t.tag(13,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceCreateRoot"&&dt.internalBinaryWrite(e.request.resourceCreateRoot,t.tag(58,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceRemove"&&ft.internalBinaryWrite(e.request.resourceRemove,t.tag(57,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceCreateStruct"&&De.internalBinaryWrite(e.request.resourceCreateStruct,t.tag(51,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceCreateEphemeral"&&qe.internalBinaryWrite(e.request.resourceCreateEphemeral,t.tag(62,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceCreateValue"&&je.internalBinaryWrite(e.request.resourceCreateValue,t.tag(52,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceGetValueId"&&Ge.internalBinaryWrite(e.request.resourceGetValueId,t.tag(63,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceCreateSingleton"&&ze.internalBinaryWrite(e.request.resourceCreateSingleton,t.tag(64,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceGetSingleton"&&Xe.internalBinaryWrite(e.request.resourceGetSingleton,t.tag(65,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceCreateChild"&&Ve.internalBinaryWrite(e.request.resourceCreateChild,t.tag(59,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceLockInputs"&&Qe.internalBinaryWrite(e.request.resourceLockInputs,t.tag(53,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceLockOutputs"&&tt.internalBinaryWrite(e.request.resourceLockOutputs,t.tag(56,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceExists"&&rt.internalBinaryWrite(e.request.resourceExists,t.tag(54,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceGet"&&at.internalBinaryWrite(e.request.resourceGet,t.tag(55,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceSetError"&&st.internalBinaryWrite(e.request.resourceSetError,t.tag(61,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceListByType"&&ct.internalBinaryWrite(e.request.resourceListByType,t.tag(60,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceNameSet"&&ht.internalBinaryWrite(e.request.resourceNameSet,t.tag(66,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceNameGet"&&Tt.internalBinaryWrite(e.request.resourceNameGet,t.tag(67,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceNameExists"&&mt.internalBinaryWrite(e.request.resourceNameExists,t.tag(68,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceNameDelete"&&bt.internalBinaryWrite(e.request.resourceNameDelete,t.tag(69,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldCreate"&&Rt.internalBinaryWrite(e.request.fieldCreate,t.tag(101,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldExists"&&_t.internalBinaryWrite(e.request.fieldExists,t.tag(107,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldSet"&&Lt.internalBinaryWrite(e.request.fieldSet,t.tag(102,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldSetError"&&Wt.internalBinaryWrite(e.request.fieldSetError,t.tag(105,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldGet"&&Bt.internalBinaryWrite(e.request.fieldGet,t.tag(103,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldReset"&&Mt.internalBinaryWrite(e.request.fieldReset,t.tag(104,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldRemove"&&Et.internalBinaryWrite(e.request.fieldRemove,t.tag(106,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="subscriptionCreate"&&qt.internalBinaryWrite(e.request.subscriptionCreate,t.tag(111,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="subscriptionAttachFilter"&&te.internalBinaryWrite(e.request.subscriptionAttachFilter,t.tag(112,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="subscriptionDetachFilter"&&re.internalBinaryWrite(e.request.subscriptionDetachFilter,t.tag(113,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="subscriptionCreateFilter"&&Vt.internalBinaryWrite(e.request.subscriptionCreateFilter,t.tag(115,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="notificationGet"&&Q.internalBinaryWrite(e.request.notificationGet,t.tag(154,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="notificationAck"&&St.internalBinaryWrite(e.request.notificationAck,t.tag(155,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="notificationDiscard"&&Dt.internalBinaryWrite(e.request.notificationDiscard,t.tag(156,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueSet"&&zt.internalBinaryWrite(e.request.resourceKeyValueSet,t.tag(200,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueGet"&&Xt.internalBinaryWrite(e.request.resourceKeyValueGet,t.tag(201,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueGetIfExists"&&Qt.internalBinaryWrite(e.request.resourceKeyValueGetIfExists,t.tag(202,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueSetFlag"&&rn.internalBinaryWrite(e.request.resourceKeyValueSetFlag,t.tag(203,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueGetFlag"&&S.internalBinaryWrite(e.request.resourceKeyValueGetFlag,t.tag(204,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueGetFlagIfExists"&&S.internalBinaryWrite(e.request.resourceKeyValueGetFlagIfExists,t.tag(205,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueDelete"&&tn.internalBinaryWrite(e.request.resourceKeyValueDelete,t.tag(206,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueList"&&Ht.internalBinaryWrite(e.request.resourceKeyValueList,t.tag(207,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="controllerKeyValueSet"&&on.internalBinaryWrite(e.request.controllerKeyValueSet,t.tag(250,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="controllerKeyValueGet"&&ln.internalBinaryWrite(e.request.controllerKeyValueGet,t.tag(251,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="controllerKeyValueGetIfExists"&&un.internalBinaryWrite(e.request.controllerKeyValueGetIfExists,t.tag(252,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="cacheSetToField"&&pn.internalBinaryWrite(e.request.cacheSetToField,t.tag(300,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="cacheDeleteExpiredRecords"&&yn.internalBinaryWrite(e.request.cacheDeleteExpiredRecords,t.tag(301,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="controllerFeaturesSet"&&se.internalBinaryWrite(e.request.controllerFeaturesSet,t.tag(350,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="controllerFeaturesClear"&&ae.internalBinaryWrite(e.request.controllerFeaturesClear,t.tag(351,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const $i=new Ei;class Si extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.ServerMessage",[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"multi_message",kind:"message",T:()=>Ne},{no:11,name:"tx_open",kind:"message",oneof:"response",T:()=>xe},{no:12,name:"tx_commit",kind:"message",oneof:"response",T:()=>$e},{no:13,name:"tx_discard",kind:"message",oneof:"response",T:()=>Ce},{no:58,name:"resource_create_root",kind:"message",oneof:"response",T:()=>pt},{no:57,name:"resource_remove",kind:"message",oneof:"response",T:()=>yt},{no:51,name:"resource_create_struct",kind:"message",oneof:"response",T:()=>Oe},{no:62,name:"resource_create_ephemeral",kind:"message",oneof:"response",T:()=>Ke},{no:52,name:"resource_create_value",kind:"message",oneof:"response",T:()=>He},{no:63,name:"resource_get_value_id",kind:"message",oneof:"response",T:()=>Je},{no:64,name:"resource_create_singleton",kind:"message",oneof:"response",T:()=>Ye},{no:65,name:"resource_get_singleton",kind:"message",oneof:"response",T:()=>Ze},{no:59,name:"resource_create_child",kind:"message",oneof:"response",T:()=>ve},{no:53,name:"resource_lock_inputs",kind:"message",oneof:"response",T:()=>et},{no:56,name:"resource_lock_outputs",kind:"message",oneof:"response",T:()=>nt},{no:54,name:"resource_exists",kind:"message",oneof:"response",T:()=>it},{no:55,name:"resource_get",kind:"message",oneof:"response",T:()=>lt},{no:61,name:"resource_set_error",kind:"message",oneof:"response",T:()=>ot},{no:60,name:"resource_list_by_type",kind:"message",oneof:"response",T:()=>ut},{no:66,name:"resource_name_set",kind:"message",oneof:"response",T:()=>gt},{no:67,name:"resource_name_get",kind:"message",oneof:"response",T:()=>kt},{no:68,name:"resource_name_exists",kind:"message",oneof:"response",T:()=>wt},{no:69,name:"resource_name_delete",kind:"message",oneof:"response",T:()=>Pt},{no:101,name:"field_create",kind:"message",oneof:"response",T:()=>It},{no:107,name:"field_exists",kind:"message",oneof:"response",T:()=>At},{no:102,name:"field_set",kind:"message",oneof:"response",T:()=>Ft},{no:105,name:"field_set_error",kind:"message",oneof:"response",T:()=>Ut},{no:103,name:"field_get",kind:"message",oneof:"response",T:()=>Nt},{no:104,name:"field_reset",kind:"message",oneof:"response",T:()=>xt},{no:106,name:"field_remove",kind:"message",oneof:"response",T:()=>$t},{no:111,name:"subscription_create",kind:"message",oneof:"response",T:()=>Kt},{no:115,name:"subscription_create_filter",kind:"message",oneof:"response",T:()=>vt},{no:112,name:"subscription_attach_filter",kind:"message",oneof:"response",T:()=>ne},{no:113,name:"subscription_detach_filter",kind:"message",oneof:"response",T:()=>ie},{no:154,name:"notification_get",kind:"message",oneof:"response",T:()=>ee},{no:155,name:"notification_ack",kind:"message",oneof:"response",T:()=>Ct},{no:156,name:"notification_discard",kind:"message",oneof:"response",T:()=>Ot},{no:200,name:"resource_key_value_set",kind:"message",oneof:"response",T:()=>Yt},{no:201,name:"resource_key_value_get",kind:"message",oneof:"response",T:()=>Zt},{no:202,name:"resource_key_value_get_if_exists",kind:"message",oneof:"response",T:()=>en},{no:203,name:"resource_key_value_set_flag",kind:"message",oneof:"response",T:()=>sn},{no:204,name:"resource_key_value_get_flag",kind:"message",oneof:"response",T:()=>C},{no:205,name:"resource_key_value_get_flag_if_exists",kind:"message",oneof:"response",T:()=>C},{no:206,name:"resource_key_value_delete",kind:"message",oneof:"response",T:()=>nn},{no:207,name:"resource_key_value_list",kind:"message",oneof:"response",T:()=>Gt},{no:250,name:"controller_key_value_set",kind:"message",oneof:"response",T:()=>an},{no:251,name:"controller_key_value_get",kind:"message",oneof:"response",T:()=>cn},{no:252,name:"controller_key_value_get_if_exists",kind:"message",oneof:"response",T:()=>dn},{no:300,name:"cache_set_to_field",kind:"message",oneof:"response",T:()=>fn},{no:301,name:"cache_delete_expired_records",kind:"message",oneof:"response",T:()=>hn},{no:350,name:"controller_features_set",kind:"message",oneof:"response",T:()=>oe},{no:351,name:"controller_features_clear",kind:"message",oneof:"response",T:()=>le},{no:3,name:"error",kind:"message",T:()=>Be}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.requestId=0,t.response={oneofKind:void 0},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.requestId=e.uint32();break;case 2:s.multiMessage=Ne.internalBinaryRead(e,e.uint32(),r,s.multiMessage);break;case 11:s.response={oneofKind:"txOpen",txOpen:xe.internalBinaryRead(e,e.uint32(),r,s.response.txOpen)};break;case 12:s.response={oneofKind:"txCommit",txCommit:$e.internalBinaryRead(e,e.uint32(),r,s.response.txCommit)};break;case 13:s.response={oneofKind:"txDiscard",txDiscard:Ce.internalBinaryRead(e,e.uint32(),r,s.response.txDiscard)};break;case 58:s.response={oneofKind:"resourceCreateRoot",resourceCreateRoot:pt.internalBinaryRead(e,e.uint32(),r,s.response.resourceCreateRoot)};break;case 57:s.response={oneofKind:"resourceRemove",resourceRemove:yt.internalBinaryRead(e,e.uint32(),r,s.response.resourceRemove)};break;case 51:s.response={oneofKind:"resourceCreateStruct",resourceCreateStruct:Oe.internalBinaryRead(e,e.uint32(),r,s.response.resourceCreateStruct)};break;case 62:s.response={oneofKind:"resourceCreateEphemeral",resourceCreateEphemeral:Ke.internalBinaryRead(e,e.uint32(),r,s.response.resourceCreateEphemeral)};break;case 52:s.response={oneofKind:"resourceCreateValue",resourceCreateValue:He.internalBinaryRead(e,e.uint32(),r,s.response.resourceCreateValue)};break;case 63:s.response={oneofKind:"resourceGetValueId",resourceGetValueId:Je.internalBinaryRead(e,e.uint32(),r,s.response.resourceGetValueId)};break;case 64:s.response={oneofKind:"resourceCreateSingleton",resourceCreateSingleton:Ye.internalBinaryRead(e,e.uint32(),r,s.response.resourceCreateSingleton)};break;case 65:s.response={oneofKind:"resourceGetSingleton",resourceGetSingleton:Ze.internalBinaryRead(e,e.uint32(),r,s.response.resourceGetSingleton)};break;case 59:s.response={oneofKind:"resourceCreateChild",resourceCreateChild:ve.internalBinaryRead(e,e.uint32(),r,s.response.resourceCreateChild)};break;case 53:s.response={oneofKind:"resourceLockInputs",resourceLockInputs:et.internalBinaryRead(e,e.uint32(),r,s.response.resourceLockInputs)};break;case 56:s.response={oneofKind:"resourceLockOutputs",resourceLockOutputs:nt.internalBinaryRead(e,e.uint32(),r,s.response.resourceLockOutputs)};break;case 54:s.response={oneofKind:"resourceExists",resourceExists:it.internalBinaryRead(e,e.uint32(),r,s.response.resourceExists)};break;case 55:s.response={oneofKind:"resourceGet",resourceGet:lt.internalBinaryRead(e,e.uint32(),r,s.response.resourceGet)};break;case 61:s.response={oneofKind:"resourceSetError",resourceSetError:ot.internalBinaryRead(e,e.uint32(),r,s.response.resourceSetError)};break;case 60:s.response={oneofKind:"resourceListByType",resourceListByType:ut.internalBinaryRead(e,e.uint32(),r,s.response.resourceListByType)};break;case 66:s.response={oneofKind:"resourceNameSet",resourceNameSet:gt.internalBinaryRead(e,e.uint32(),r,s.response.resourceNameSet)};break;case 67:s.response={oneofKind:"resourceNameGet",resourceNameGet:kt.internalBinaryRead(e,e.uint32(),r,s.response.resourceNameGet)};break;case 68:s.response={oneofKind:"resourceNameExists",resourceNameExists:wt.internalBinaryRead(e,e.uint32(),r,s.response.resourceNameExists)};break;case 69:s.response={oneofKind:"resourceNameDelete",resourceNameDelete:Pt.internalBinaryRead(e,e.uint32(),r,s.response.resourceNameDelete)};break;case 101:s.response={oneofKind:"fieldCreate",fieldCreate:It.internalBinaryRead(e,e.uint32(),r,s.response.fieldCreate)};break;case 107:s.response={oneofKind:"fieldExists",fieldExists:At.internalBinaryRead(e,e.uint32(),r,s.response.fieldExists)};break;case 102:s.response={oneofKind:"fieldSet",fieldSet:Ft.internalBinaryRead(e,e.uint32(),r,s.response.fieldSet)};break;case 105:s.response={oneofKind:"fieldSetError",fieldSetError:Ut.internalBinaryRead(e,e.uint32(),r,s.response.fieldSetError)};break;case 103:s.response={oneofKind:"fieldGet",fieldGet:Nt.internalBinaryRead(e,e.uint32(),r,s.response.fieldGet)};break;case 104:s.response={oneofKind:"fieldReset",fieldReset:xt.internalBinaryRead(e,e.uint32(),r,s.response.fieldReset)};break;case 106:s.response={oneofKind:"fieldRemove",fieldRemove:$t.internalBinaryRead(e,e.uint32(),r,s.response.fieldRemove)};break;case 111:s.response={oneofKind:"subscriptionCreate",subscriptionCreate:Kt.internalBinaryRead(e,e.uint32(),r,s.response.subscriptionCreate)};break;case 115:s.response={oneofKind:"subscriptionCreateFilter",subscriptionCreateFilter:vt.internalBinaryRead(e,e.uint32(),r,s.response.subscriptionCreateFilter)};break;case 112:s.response={oneofKind:"subscriptionAttachFilter",subscriptionAttachFilter:ne.internalBinaryRead(e,e.uint32(),r,s.response.subscriptionAttachFilter)};break;case 113:s.response={oneofKind:"subscriptionDetachFilter",subscriptionDetachFilter:ie.internalBinaryRead(e,e.uint32(),r,s.response.subscriptionDetachFilter)};break;case 154:s.response={oneofKind:"notificationGet",notificationGet:ee.internalBinaryRead(e,e.uint32(),r,s.response.notificationGet)};break;case 155:s.response={oneofKind:"notificationAck",notificationAck:Ct.internalBinaryRead(e,e.uint32(),r,s.response.notificationAck)};break;case 156:s.response={oneofKind:"notificationDiscard",notificationDiscard:Ot.internalBinaryRead(e,e.uint32(),r,s.response.notificationDiscard)};break;case 200:s.response={oneofKind:"resourceKeyValueSet",resourceKeyValueSet:Yt.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueSet)};break;case 201:s.response={oneofKind:"resourceKeyValueGet",resourceKeyValueGet:Zt.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueGet)};break;case 202:s.response={oneofKind:"resourceKeyValueGetIfExists",resourceKeyValueGetIfExists:en.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueGetIfExists)};break;case 203:s.response={oneofKind:"resourceKeyValueSetFlag",resourceKeyValueSetFlag:sn.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueSetFlag)};break;case 204:s.response={oneofKind:"resourceKeyValueGetFlag",resourceKeyValueGetFlag:C.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueGetFlag)};break;case 205:s.response={oneofKind:"resourceKeyValueGetFlagIfExists",resourceKeyValueGetFlagIfExists:C.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueGetFlagIfExists)};break;case 206:s.response={oneofKind:"resourceKeyValueDelete",resourceKeyValueDelete:nn.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueDelete)};break;case 207:s.response={oneofKind:"resourceKeyValueList",resourceKeyValueList:Gt.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueList)};break;case 250:s.response={oneofKind:"controllerKeyValueSet",controllerKeyValueSet:an.internalBinaryRead(e,e.uint32(),r,s.response.controllerKeyValueSet)};break;case 251:s.response={oneofKind:"controllerKeyValueGet",controllerKeyValueGet:cn.internalBinaryRead(e,e.uint32(),r,s.response.controllerKeyValueGet)};break;case 252:s.response={oneofKind:"controllerKeyValueGetIfExists",controllerKeyValueGetIfExists:dn.internalBinaryRead(e,e.uint32(),r,s.response.controllerKeyValueGetIfExists)};break;case 300:s.response={oneofKind:"cacheSetToField",cacheSetToField:fn.internalBinaryRead(e,e.uint32(),r,s.response.cacheSetToField)};break;case 301:s.response={oneofKind:"cacheDeleteExpiredRecords",cacheDeleteExpiredRecords:hn.internalBinaryRead(e,e.uint32(),r,s.response.cacheDeleteExpiredRecords)};break;case 350:s.response={oneofKind:"controllerFeaturesSet",controllerFeaturesSet:oe.internalBinaryRead(e,e.uint32(),r,s.response.controllerFeaturesSet)};break;case 351:s.response={oneofKind:"controllerFeaturesClear",controllerFeaturesClear:le.internalBinaryRead(e,e.uint32(),r,s.response.controllerFeaturesClear)};break;case 3:s.error=Be.internalBinaryRead(e,e.uint32(),r,s.error);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.requestId!==0&&t.tag(1,i.WireType.Varint).uint32(e.requestId),e.multiMessage&&Ne.internalBinaryWrite(e.multiMessage,t.tag(2,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="txOpen"&&xe.internalBinaryWrite(e.response.txOpen,t.tag(11,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="txCommit"&&$e.internalBinaryWrite(e.response.txCommit,t.tag(12,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="txDiscard"&&Ce.internalBinaryWrite(e.response.txDiscard,t.tag(13,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceCreateRoot"&&pt.internalBinaryWrite(e.response.resourceCreateRoot,t.tag(58,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceRemove"&&yt.internalBinaryWrite(e.response.resourceRemove,t.tag(57,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceCreateStruct"&&Oe.internalBinaryWrite(e.response.resourceCreateStruct,t.tag(51,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceCreateEphemeral"&&Ke.internalBinaryWrite(e.response.resourceCreateEphemeral,t.tag(62,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceCreateValue"&&He.internalBinaryWrite(e.response.resourceCreateValue,t.tag(52,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceGetValueId"&&Je.internalBinaryWrite(e.response.resourceGetValueId,t.tag(63,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceCreateSingleton"&&Ye.internalBinaryWrite(e.response.resourceCreateSingleton,t.tag(64,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceGetSingleton"&&Ze.internalBinaryWrite(e.response.resourceGetSingleton,t.tag(65,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceCreateChild"&&ve.internalBinaryWrite(e.response.resourceCreateChild,t.tag(59,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceLockInputs"&&et.internalBinaryWrite(e.response.resourceLockInputs,t.tag(53,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceLockOutputs"&&nt.internalBinaryWrite(e.response.resourceLockOutputs,t.tag(56,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceExists"&&it.internalBinaryWrite(e.response.resourceExists,t.tag(54,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceGet"&<.internalBinaryWrite(e.response.resourceGet,t.tag(55,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceSetError"&&ot.internalBinaryWrite(e.response.resourceSetError,t.tag(61,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceListByType"&&ut.internalBinaryWrite(e.response.resourceListByType,t.tag(60,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceNameSet"&>.internalBinaryWrite(e.response.resourceNameSet,t.tag(66,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceNameGet"&&kt.internalBinaryWrite(e.response.resourceNameGet,t.tag(67,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceNameExists"&&wt.internalBinaryWrite(e.response.resourceNameExists,t.tag(68,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceNameDelete"&&Pt.internalBinaryWrite(e.response.resourceNameDelete,t.tag(69,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldCreate"&&It.internalBinaryWrite(e.response.fieldCreate,t.tag(101,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldExists"&&At.internalBinaryWrite(e.response.fieldExists,t.tag(107,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldSet"&&Ft.internalBinaryWrite(e.response.fieldSet,t.tag(102,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldSetError"&&Ut.internalBinaryWrite(e.response.fieldSetError,t.tag(105,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldGet"&&Nt.internalBinaryWrite(e.response.fieldGet,t.tag(103,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldReset"&&xt.internalBinaryWrite(e.response.fieldReset,t.tag(104,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldRemove"&&$t.internalBinaryWrite(e.response.fieldRemove,t.tag(106,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="subscriptionCreate"&&Kt.internalBinaryWrite(e.response.subscriptionCreate,t.tag(111,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="subscriptionCreateFilter"&&vt.internalBinaryWrite(e.response.subscriptionCreateFilter,t.tag(115,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="subscriptionAttachFilter"&&ne.internalBinaryWrite(e.response.subscriptionAttachFilter,t.tag(112,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="subscriptionDetachFilter"&&ie.internalBinaryWrite(e.response.subscriptionDetachFilter,t.tag(113,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="notificationGet"&&ee.internalBinaryWrite(e.response.notificationGet,t.tag(154,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="notificationAck"&&Ct.internalBinaryWrite(e.response.notificationAck,t.tag(155,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="notificationDiscard"&&Ot.internalBinaryWrite(e.response.notificationDiscard,t.tag(156,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueSet"&&Yt.internalBinaryWrite(e.response.resourceKeyValueSet,t.tag(200,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueGet"&&Zt.internalBinaryWrite(e.response.resourceKeyValueGet,t.tag(201,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueGetIfExists"&&en.internalBinaryWrite(e.response.resourceKeyValueGetIfExists,t.tag(202,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueSetFlag"&&sn.internalBinaryWrite(e.response.resourceKeyValueSetFlag,t.tag(203,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueGetFlag"&&C.internalBinaryWrite(e.response.resourceKeyValueGetFlag,t.tag(204,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueGetFlagIfExists"&&C.internalBinaryWrite(e.response.resourceKeyValueGetFlagIfExists,t.tag(205,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueDelete"&&nn.internalBinaryWrite(e.response.resourceKeyValueDelete,t.tag(206,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueList"&&Gt.internalBinaryWrite(e.response.resourceKeyValueList,t.tag(207,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="controllerKeyValueSet"&&an.internalBinaryWrite(e.response.controllerKeyValueSet,t.tag(250,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="controllerKeyValueGet"&&cn.internalBinaryWrite(e.response.controllerKeyValueGet,t.tag(251,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="controllerKeyValueGetIfExists"&&dn.internalBinaryWrite(e.response.controllerKeyValueGetIfExists,t.tag(252,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="cacheSetToField"&&fn.internalBinaryWrite(e.response.cacheSetToField,t.tag(300,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="cacheDeleteExpiredRecords"&&hn.internalBinaryWrite(e.response.cacheDeleteExpiredRecords,t.tag(301,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="controllerFeaturesSet"&&oe.internalBinaryWrite(e.response.controllerFeaturesSet,t.tag(350,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="controllerFeaturesClear"&&le.internalBinaryWrite(e.response.controllerFeaturesClear,t.tag(351,i.WireType.LengthDelimited).fork(),r).join(),e.error&&Be.internalBinaryWrite(e.error,t.tag(3,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ci=new Si;class Di extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.ServerMessage.Multi",[{no:1,name:"id",kind:"scalar",T:13},{no:2,name:"is_last",kind:"scalar",T:8},{no:3,name:"is_empty",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0,t.isLast=!1,t.isEmpty=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint32();break;case 2:s.isLast=e.bool();break;case 3:s.isEmpty=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0&&t.tag(1,i.WireType.Varint).uint32(e.id),e.isLast!==!1&&t.tag(2,i.WireType.Varint).bool(e.isLast),e.isEmpty!==!1&&t.tag(3,i.WireType.Varint).bool(e.isEmpty);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ne=new Di;class Oi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Open",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Oi;class qi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Open.Request",[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"writable",kind:"enum",T:()=>["MiLaboratories.PL.API.TxAPI.Open.Request.WritableTx",pe]}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.name="",t.writable=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.name=e.string();break;case 2:s.writable=e.int32();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.name!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.name),e.writable!==0&&t.tag(2,i.WireType.Varint).int32(e.writable);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Me=new qi;class Ki extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Open.Response",[{no:1,name:"tx",kind:"message",T:()=>Re}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.tx=Re.internalBinaryRead(e,e.uint32(),r,s.tx);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.tx&&Re.internalBinaryWrite(e.tx,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const xe=new Ki;class Vi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Commit",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Vi;class vi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Commit.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ee=new vi;class ji extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Commit.Response",[{no:1,name:"success",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.success=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.success=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.success!==!1&&t.tag(1,i.WireType.Varint).bool(e.success);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const $e=new ji;class Hi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Discard",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Hi;class Gi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Discard.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Se=new Gi;class Ji extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Discard.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ce=new Ji;class zi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Sync",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new zi;class Yi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Sync.Request",[{no:1,name:"tx_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.txId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.txId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.txId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.txId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Xi=new Yi;class Zi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Sync.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Qi=new Zi;class es extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new es;class ts extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateStruct",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ts;class ns extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateStruct.Request",[{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"type",kind:"message",T:()=>f},{no:4,name:"data",kind:"scalar",opt:!0,T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.id=e.uint64().toBigInt();break;case 3:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 4:s.data=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.type&&f.internalBinaryWrite(e.type,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.data!==void 0&&t.tag(4,i.WireType.LengthDelimited).bytes(e.data);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const De=new ns;class rs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateStruct.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Oe=new rs;class is extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateEphemeral",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new is;class ss extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateEphemeral.Request",[{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"type",kind:"message",T:()=>f},{no:4,name:"data",kind:"scalar",opt:!0,T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.id=e.uint64().toBigInt();break;case 3:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 4:s.data=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.type&&f.internalBinaryWrite(e.type,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.data!==void 0&&t.tag(4,i.WireType.LengthDelimited).bytes(e.data);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const qe=new ss;class os extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateEphemeral.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ke=new os;class as extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateChild",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new as;class ls extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateChild.Request",[{no:1,name:"id",kind:"scalar",T:4,L:0},{no:2,name:"type",kind:"message",T:()=>f},{no:3,name:"parent_field",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint64().toBigInt();break;case 2:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 3:s.parentField=y.internalBinaryRead(e,e.uint32(),r,s.parentField);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(1,i.WireType.Varint).uint64(e.id),e.type&&f.internalBinaryWrite(e.type,t.tag(2,i.WireType.LengthDelimited).fork(),r).join(),e.parentField&&y.internalBinaryWrite(e.parentField,t.tag(3,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ve=new ls;class cs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateChild.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ve=new cs;class us extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateValue",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new us;class ds extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateValue.Request",[{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"type",kind:"message",T:()=>f},{no:6,name:"data",kind:"scalar",T:12},{no:7,name:"error_if_exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,t.data=new Uint8Array(0),t.errorIfExists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.id=e.uint64().toBigInt();break;case 3:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 6:s.data=e.bytes();break;case 7:s.errorIfExists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.type&&f.internalBinaryWrite(e.type,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.data.length&&t.tag(6,i.WireType.LengthDelimited).bytes(e.data),e.errorIfExists!==!1&&t.tag(7,i.WireType.Varint).bool(e.errorIfExists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const je=new ds;class ps extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateValue.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const He=new ps;class fs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.GetValueID",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new fs;class ys extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.GetValueID.Request",[{no:1,name:"type",kind:"message",T:()=>f},{no:2,name:"data",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.data=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 2:s.data=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type&&f.internalBinaryWrite(e.type,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.data.length&&t.tag(2,i.WireType.LengthDelimited).bytes(e.data);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ge=new ys;class hs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.GetValueID.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Je=new hs;class gs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateSingleton",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new gs;class Ts extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateSingleton.Request",[{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"type",kind:"message",T:()=>f},{no:6,name:"data",kind:"scalar",T:12},{no:7,name:"error_if_exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,t.data=new Uint8Array(0),t.errorIfExists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.id=e.uint64().toBigInt();break;case 3:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 6:s.data=e.bytes();break;case 7:s.errorIfExists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.type&&f.internalBinaryWrite(e.type,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.data.length&&t.tag(6,i.WireType.LengthDelimited).bytes(e.data),e.errorIfExists!==!1&&t.tag(7,i.WireType.Varint).bool(e.errorIfExists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ze=new Ts;class ks extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateSingleton.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ye=new ks;class ms extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.GetSingleton",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ms;class ws extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.GetSingleton.Request",[{no:1,name:"type",kind:"message",T:()=>f},{no:2,name:"data",kind:"scalar",T:12},{no:3,name:"load_fields",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.data=new Uint8Array(0),t.loadFields=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 2:s.data=e.bytes();break;case 3:s.loadFields=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type&&f.internalBinaryWrite(e.type,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.data.length&&t.tag(2,i.WireType.LengthDelimited).bytes(e.data),e.loadFields!==!1&&t.tag(3,i.WireType.Varint).bool(e.loadFields);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Xe=new ws;class bs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.GetSingleton.Response",[{no:1,name:"resource",kind:"message",T:()=>I}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resource=I.internalBinaryRead(e,e.uint32(),r,s.resource);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resource&&I.internalBinaryWrite(e.resource,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ze=new bs;class Ps extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.LockInputs",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ps;class Rs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.LockInputs.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Qe=new Rs;class Is extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.LockInputs.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const et=new Is;class _s extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.LockOutputs",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new _s;class As extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.LockOutputs.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const tt=new As;class Ls extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.LockOutputs.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const nt=new Ls;class Fs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Exists",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Fs;class Ws extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Exists.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const rt=new Ws;class Us extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Exists.Response",[{no:1,name:"exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.exists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.exists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.exists!==!1&&t.tag(1,i.WireType.Varint).bool(e.exists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const it=new Us;class Bs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.SetError",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Bs;class Ns extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.SetError.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"error_resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.errorResourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.errorResourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.errorResourceId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.errorResourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const st=new Ns;class Ms extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.SetError.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ot=new Ms;class xs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new xs;class Es extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Get.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"load_fields",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.loadFields=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.loadFields=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.loadFields!==!1&&t.tag(2,i.WireType.Varint).bool(e.loadFields);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const at=new Es;class $s extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Get.Response",[{no:1,name:"resource",kind:"message",T:()=>I}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resource=I.internalBinaryRead(e,e.uint32(),r,s.resource);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resource&&I.internalBinaryWrite(e.resource,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const lt=new $s;class Ss extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.List",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ss;class Cs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.List.ByType",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Cs;class Ds extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.List.ByType.Request",[{no:1,name:"resource_type",kind:"message",T:()=>f}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceType=f.internalBinaryRead(e,e.uint32(),r,s.resourceType);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceType&&f.internalBinaryWrite(e.resourceType,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ct=new Ds;class Os extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.List.ByType.Response",[{no:1,name:"resources",kind:"map",K:4,V:{kind:"message",T:()=>I}}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resources={},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:this.binaryReadMap1(s.resources,e,r);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap1(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.uint64().toString();break;case 2:l=I.internalBinaryRead(t,t.uint32(),r);break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.ResourceAPI.List.ByType.Response.resources")}}e[u??"0"]=l??I.create()}internalBinaryWrite(e,t,r){for(let s of globalThis.Object.keys(e.resources))t.tag(1,i.WireType.LengthDelimited).fork().tag(1,i.WireType.Varint).uint64(s),t.tag(2,i.WireType.LengthDelimited).fork(),I.internalBinaryWrite(e.resources[s],t,r),t.join().join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ut=new Os;class qs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateRoot",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new qs;class Ks extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateRoot.Request",[{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"type",kind:"message",T:()=>f}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.id=e.uint64().toBigInt();break;case 3:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.type&&f.internalBinaryWrite(e.type,t.tag(3,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const dt=new Ks;class Vs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateRoot.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const pt=new Vs;class vs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Remove",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new vs;class js extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Remove.Request",[{no:1,name:"id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(1,i.WireType.Varint).uint64(e.id);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ft=new js;class Hs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Remove.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const yt=new Hs;class Gs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Gs;class Js extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Set",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Js;class zs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Set.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.name!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ht=new zs;class Ys extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Set.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const gt=new Ys;class Xs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Xs;class Zs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Get.Request",[{no:1,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.name!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Tt=new Zs;class Qs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Get.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const kt=new Qs;class eo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Exists",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new eo;class to extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Exists.Request",[{no:1,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.name!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const mt=new to;class no extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Exists.Response",[{no:1,name:"exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.exists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.exists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.exists!==!1&&t.tag(1,i.WireType.Varint).bool(e.exists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const wt=new no;class ro extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Delete",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ro;class io extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Delete.Request",[{no:1,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.name!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const bt=new io;class so extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Delete.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Pt=new so;class oo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new oo;class ao extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Create",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ao;class lo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Create.Request",[{no:1,name:"type",kind:"enum",T:()=>["MiLaboratories.PL.Base.FieldType",T]},{no:2,name:"id",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=e.int32();break;case 2:s.id=y.internalBinaryRead(e,e.uint32(),r,s.id);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type!==0&&t.tag(1,i.WireType.Varint).int32(e.type),e.id&&y.internalBinaryWrite(e.id,t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Rt=new lo;class co extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Create.Response",[{no:1,name:"global_id",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.globalId=y.internalBinaryRead(e,e.uint32(),r,s.globalId);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.globalId&&y.internalBinaryWrite(e.globalId,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const It=new co;class uo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Exists",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new uo;class po extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Exists.Request",[{no:1,name:"field",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=y.internalBinaryRead(e,e.uint32(),r,s.field);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&y.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const _t=new po;class fo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Exists.Response",[{no:1,name:"exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.exists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.exists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.exists!==!1&&t.tag(1,i.WireType.Varint).bool(e.exists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const At=new fo;class yo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Set",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new yo;class ho extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Set.Request",[{no:1,name:"field",kind:"message",T:()=>y},{no:2,name:"value",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=y.internalBinaryRead(e,e.uint32(),r,s.field);break;case 2:s.value=y.internalBinaryRead(e,e.uint32(),r,s.value);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&y.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.value&&y.internalBinaryWrite(e.value,t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Lt=new ho;class go extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Set.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ft=new go;class To extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.SetError",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new To;class ko extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.SetError.Request",[{no:1,name:"field",kind:"message",T:()=>y},{no:2,name:"err_resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.errResourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=y.internalBinaryRead(e,e.uint32(),r,s.field);break;case 2:s.errResourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&y.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.errResourceId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.errResourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Wt=new ko;class mo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.SetError.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ut=new mo;class wo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new wo;class bo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Get.Request",[{no:1,name:"field",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=y.internalBinaryRead(e,e.uint32(),r,s.field);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&y.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Bt=new bo;class Po extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Get.Response",[{no:1,name:"field",kind:"message",T:()=>m}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=m.internalBinaryRead(e,e.uint32(),r,s.field);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&m.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Nt=new Po;class Ro extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Reset",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ro;class Io extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Reset.Request",[{no:1,name:"field",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=y.internalBinaryRead(e,e.uint32(),r,s.field);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&y.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Mt=new Io;class _o extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Reset.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const xt=new _o;class Ao extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Remove",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ao;class Lo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Remove.Request",[{no:1,name:"field",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=y.internalBinaryRead(e,e.uint32(),r,s.field);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&y.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Et=new Lo;class Fo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Remove.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const $t=new Fo;class Wo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Wo;class Uo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Uo;class Bo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Get.Request",[{no:1,name:"subscription",kind:"scalar",T:4,L:0},{no:2,name:"max_notifications",kind:"scalar",T:13}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscription=0n,t.maxNotifications=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscription=e.uint64().toBigInt();break;case 2:s.maxNotifications=e.uint32();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscription!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscription),e.maxNotifications!==0&&t.tag(2,i.WireType.Varint).uint32(e.maxNotifications);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Q=new Bo;class No extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Get.Response",[{no:1,name:"notifications",kind:"message",repeat:1,T:()=>q}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.notifications=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.notifications.push(q.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){for(let s=0;s<e.notifications.length;s++)q.internalBinaryWrite(e.notifications[s],t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ee=new No;class Mo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Ack",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Mo;class xo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Ack.Request",[{no:1,name:"subscription_id",kind:"scalar",T:4,L:0},{no:2,name:"event_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptionId=0n,t.eventId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptionId=e.uint64().toBigInt();break;case 2:s.eventId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscriptionId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscriptionId),e.eventId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.eventId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const St=new xo;class Eo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Ack.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ct=new Eo;class $o extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Discard",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new $o;class So extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Discard.Request",[{no:1,name:"subscription_id",kind:"scalar",T:4,L:0},{no:2,name:"event_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptionId=0n,t.eventId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptionId=e.uint64().toBigInt();break;case 2:s.eventId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscriptionId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscriptionId),e.eventId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.eventId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Dt=new So;class Co extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Discard.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ot=new Co;class Do extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Do;class Oo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.CreateSubscription",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Oo;class qo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.CreateSubscription.Request",[{no:1,name:"id",kind:"scalar",T:4,L:0},{no:2,name:"blocking",kind:"scalar",T:8},{no:3,name:"gc",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,t.blocking=!1,t.gc=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint64().toBigInt();break;case 2:s.blocking=e.bool();break;case 3:s.gc=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(1,i.WireType.Varint).uint64(e.id),e.blocking!==!1&&t.tag(2,i.WireType.Varint).bool(e.blocking),e.gc!==!1&&t.tag(3,i.WireType.Varint).bool(e.gc);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const qt=new qo;class Ko extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.CreateSubscription.Response",[{no:1,name:"subscription_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptionId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptionId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscriptionId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscriptionId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Kt=new Ko;class Vo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.CreateFilter",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Vo;class vo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.CreateFilter.Request",[{no:1,name:"id",kind:"scalar",T:4,L:0},{no:2,name:"filter",kind:"message",T:()=>b}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint64().toBigInt();break;case 2:s.filter=b.internalBinaryRead(e,e.uint32(),r,s.filter);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(1,i.WireType.Varint).uint64(e.id),e.filter&&b.internalBinaryWrite(e.filter,t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Vt=new vo;class jo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.CreateFilter.Response",[{no:1,name:"filter_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.filterId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.filterId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.filterId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.filterId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const vt=new jo;class Ho extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.ListSubscriptions",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ho;class Go extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.ListSubscriptions.SubscriptionInfo",[{no:1,name:"subscription",kind:"message",T:()=>Ae},{no:2,name:"last_read_time",kind:"scalar",T:4,L:0},{no:3,name:"notification_queue_size",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.lastReadTime=0n,t.notificationQueueSize=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscription=Ae.internalBinaryRead(e,e.uint32(),r,s.subscription);break;case 2:s.lastReadTime=e.uint64().toBigInt();break;case 3:s.notificationQueueSize=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscription&&Ae.internalBinaryWrite(e.subscription,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.lastReadTime!==0n&&t.tag(2,i.WireType.Varint).uint64(e.lastReadTime),e.notificationQueueSize!==0n&&t.tag(3,i.WireType.Varint).uint64(e.notificationQueueSize);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const jt=new Go;class Jo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.ListSubscriptions.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Jo;class zo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.ListSubscriptions.Response",[{no:1,name:"subscriptions",kind:"message",repeat:1,T:()=>jt}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptions=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptions.push(jt.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){for(let s=0;s<e.subscriptions.length;s++)jt.internalBinaryWrite(e.subscriptions[s],t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new zo;class Yo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.AttachFilter",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Yo;class Xo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.AttachFilter.Request",[{no:1,name:"subscription_id",kind:"scalar",T:4,L:0},{no:2,name:"filter_name",kind:"scalar",T:9},{no:3,name:"filter_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptionId=0n,t.filterName="",t.filterId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptionId=e.uint64().toBigInt();break;case 2:s.filterName=e.string();break;case 3:s.filterId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscriptionId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscriptionId),e.filterName!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.filterName),e.filterId!==0n&&t.tag(3,i.WireType.Varint).uint64(e.filterId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const te=new Xo;class Zo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.AttachFilter.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ne=new Zo;class Qo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.DetachFilter",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Qo;class ea extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.DetachFilter.Request",[{no:1,name:"subscription_id",kind:"scalar",T:4,L:0},{no:2,name:"filter_name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptionId=0n,t.filterName="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptionId=e.uint64().toBigInt();break;case 2:s.filterName=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscriptionId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscriptionId),e.filterName!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.filterName);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const re=new ea;class ta extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.DetachFilter.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ie=new ta;class na extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new na;class ra extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Register",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ra;class ia extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Register.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"filters",kind:"map",K:9,V:{kind:"message",T:()=>b}},{no:3,name:"resource_schemas",kind:"message",repeat:1,T:()=>K}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.filters={},t.resourceSchemas=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:this.binaryReadMap2(s.filters,e,r);break;case 3:s.resourceSchemas.push(K.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap2(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=b.internalBinaryRead(t,t.uint32(),r);break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.ControllerAPI.Register.Request.filters")}}e[u??""]=l??b.create()}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);for(let s of globalThis.Object.keys(e.filters))t.tag(2,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s),t.tag(2,i.WireType.LengthDelimited).fork(),b.internalBinaryWrite(e.filters[s],t,r),t.join().join();for(let s=0;s<e.resourceSchemas.length;s++)K.internalBinaryWrite(e.resourceSchemas[s],t.tag(3,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const sa=new ia;class oa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Register.Response",[{no:1,name:"controller_id",kind:"scalar",T:4,L:0},{no:2,name:"subscription_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerId=0n,t.subscriptionId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerId=e.uint64().toBigInt();break;case 2:s.subscriptionId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.controllerId),e.subscriptionId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.subscriptionId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const aa=new oa;class la extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Exists",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new la;class ca extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Exists.Request",[{no:1,name:"controller_type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ua=new ca;class da extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Exists.Response",[{no:1,name:"exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.exists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.exists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.exists!==!1&&t.tag(1,i.WireType.Varint).bool(e.exists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const pa=new da;class fa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Update",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new fa;class ya extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Update.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"filters",kind:"map",K:9,V:{kind:"message",T:()=>b}},{no:3,name:"resource_schemas",kind:"message",repeat:1,T:()=>K}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.filters={},t.resourceSchemas=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:this.binaryReadMap2(s.filters,e,r);break;case 3:s.resourceSchemas.push(K.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap2(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=b.internalBinaryRead(t,t.uint32(),r);break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.ControllerAPI.Update.Request.filters")}}e[u??""]=l??b.create()}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);for(let s of globalThis.Object.keys(e.filters))t.tag(2,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s),t.tag(2,i.WireType.LengthDelimited).fork(),b.internalBinaryWrite(e.filters[s],t,r),t.join().join();for(let s=0;s<e.resourceSchemas.length;s++)K.internalBinaryWrite(e.resourceSchemas[s],t.tag(3,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ha=new ya;class ga extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Update.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ta=new ga;class ka extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Deregister",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ka;class ma extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Deregister.Request",[{no:1,name:"controller_type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const wa=new ma;class ba extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Deregister.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Pa=new ba;class Ra extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Create",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ra;class Ia extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Create.Request",[{no:1,name:"id",kind:"scalar",T:4,L:0},{no:2,name:"controller_type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,t.controllerType="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint64().toBigInt();break;case 2:s.controllerType=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(1,i.WireType.Varint).uint64(e.id),e.controllerType!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.controllerType);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const _a=new Ia;class Aa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Create.Response",[{no:1,name:"controller_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.controllerId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const La=new Aa;class Fa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Fa;class Wa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Get.Request",[{no:1,name:"controller_type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ua=new Wa;class Ba extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Get.Response",[{no:1,name:"controller",kind:"message",T:()=>Le}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controller=Le.internalBinaryRead(e,e.uint32(),r,s.controller);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controller&&Le.internalBinaryWrite(e.controller,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Na=new Ba;class Ma extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.AttachSubscription",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ma;class xa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.AttachSubscription.Request",[{no:1,name:"controller_id",kind:"scalar",T:4,L:0},{no:2,name:"subscription_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerId=0n,t.subscriptionId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerId=e.uint64().toBigInt();break;case 2:s.subscriptionId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.controllerId),e.subscriptionId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.subscriptionId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ea=new xa;class $a extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.AttachSubscription.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Sa=new $a;class Ca extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.GetNotifications",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ca;class Da extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.GetNotifications.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"max_notifications",kind:"scalar",T:13}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.maxNotifications=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:s.maxNotifications=e.uint32();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType),e.maxNotifications!==0&&t.tag(2,i.WireType.Varint).uint32(e.maxNotifications);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Oa=new Da;class qa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.GetNotifications.Response",[{no:1,name:"notifications",kind:"message",repeat:1,T:()=>q}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.notifications=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.notifications.push(q.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){for(let s=0;s<e.notifications.length;s++)q.internalBinaryWrite(e.notifications[s],t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ka=new qa;class Va extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.WriteAliasesAndUrls",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Va;class va extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.WriteAliasesAndUrls.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"aliases_to_urls",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.aliasesToUrls={},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:this.binaryReadMap2(s.aliasesToUrls,e,r);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap2(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=t.string();break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.ControllerAPI.WriteAliasesAndUrls.Request.aliases_to_urls")}}e[u??""]=l??""}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);for(let s of globalThis.Object.keys(e.aliasesToUrls))t.tag(2,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s).tag(2,i.WireType.LengthDelimited).string(e.aliasesToUrls[s]).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ja=new va;class Ha extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.WriteAliasesAndUrls.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ga=new Ha;class Ja extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.GetUrl",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ja;class za extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.GetUrl.Request",[{no:1,name:"controller_alias",kind:"scalar",T:9},{no:2,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerAlias="",t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerAlias=e.string();break;case 2:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerAlias!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerAlias),e.resourceId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ya=new za;class Xa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.GetUrl.Response",[{no:2,name:"controller_url",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerUrl="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.controllerUrl=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerUrl!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.controllerUrl);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Za=new Xa;class Qa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.RemoveAliasesAndUrls",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Qa;class el extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.RemoveAliasesAndUrls.Request",[{no:1,name:"controller_type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const tl=new el;class nl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.RemoveAliasesAndUrls.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const rl=new nl;class il extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.SetFeatures",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new il;class sl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.SetFeatures.Request",[{no:2,name:"features",kind:"message",repeat:1,T:()=>We}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.features=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.features.push(We.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){for(let s=0;s<e.features.length;s++)We.internalBinaryWrite(e.features[s],t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const se=new sl;class ol extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.SetFeatures.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const oe=new ol;class al extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.ClearFeatures",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new al;class ll extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.ClearFeatures.Request",[{no:1,name:"controller_type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ae=new ll;class cl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.ClearFeatures.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const le=new cl;class ul extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ul;class dl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.List",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new dl;class pl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.List.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"start_from",kind:"scalar",T:9},{no:3,name:"limit",kind:"scalar",T:13}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.startFrom="",t.limit=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.startFrom=e.string();break;case 3:s.limit=e.uint32();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.startFrom!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.startFrom),e.limit!==0&&t.tag(3,i.WireType.Varint).uint32(e.limit);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ht=new pl;class fl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.List.Response",[{no:1,name:"record",kind:"message",T:()=>Jt},{no:4,name:"next",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.next="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.record=Jt.internalBinaryRead(e,e.uint32(),r,s.record);break;case 4:s.next=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.record&&Jt.internalBinaryWrite(e.record,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.next!==""&&t.tag(4,i.WireType.LengthDelimited).string(e.next);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Gt=new fl;class yl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.List.Response.KV",[{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"value",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.key="",t.value=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.key=e.string();break;case 3:s.value=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key),e.value.length&&t.tag(3,i.WireType.LengthDelimited).bytes(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Jt=new yl;class hl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Set",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new hl;class gl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Set.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"value",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.key="",t.value=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.key=e.string();break;case 3:s.value=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key),e.value.length&&t.tag(3,i.WireType.LengthDelimited).bytes(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const zt=new gl;class Tl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Set.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Yt=new Tl;class kl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new kl;class ml extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Get.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"key",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.key="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.key=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Xt=new ml;class wl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Get.Response",[{no:1,name:"value",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.value=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.value=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.value.length&&t.tag(1,i.WireType.LengthDelimited).bytes(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Zt=new wl;class bl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.GetIfExists",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new bl;class Pl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.GetIfExists.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"key",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.key="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.key=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Qt=new Pl;class Rl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.GetIfExists.Response",[{no:1,name:"value",kind:"scalar",T:12},{no:2,name:"exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.value=new Uint8Array(0),t.exists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.value=e.bytes();break;case 2:s.exists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.value.length&&t.tag(1,i.WireType.LengthDelimited).bytes(e.value),e.exists!==!1&&t.tag(2,i.WireType.Varint).bool(e.exists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const en=new Rl;class Il extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Delete",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Il;class _l extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Delete.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"key",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.key="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.key=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const tn=new _l;class Al extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Delete.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const nn=new Al;class Ll extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.SetFlag",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ll;class Fl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.SetFlag.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"value",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.key="",t.value=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.key=e.string();break;case 3:s.value=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key),e.value!==!1&&t.tag(3,i.WireType.Varint).bool(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const rn=new Fl;class Wl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.SetFlag.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const sn=new Wl;class Ul extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.GetFlag",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ul;class Bl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.GetFlag.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"key",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.key="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.key=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const S=new Bl;class Nl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.GetFlag.Response",[{no:1,name:"value",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.value=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.value=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.value!==!1&&t.tag(1,i.WireType.Varint).bool(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const C=new Nl;class Ml extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ml;class xl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.Set",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new xl;class El extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.Set.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"value",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.key="",t.value=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:s.key=e.string();break;case 3:s.value=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key),e.value.length&&t.tag(3,i.WireType.LengthDelimited).bytes(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const on=new El;class $l extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.Set.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const an=new $l;class Sl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Sl;class Cl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.Get.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.key="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:s.key=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ln=new Cl;class Dl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.Get.Response",[{no:1,name:"value",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.value=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.value=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.value.length&&t.tag(1,i.WireType.LengthDelimited).bytes(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const cn=new Dl;class Ol extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.GetIfExists",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ol;class ql extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.GetIfExists.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.key="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:s.key=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const un=new ql;class Kl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.GetIfExists.Response",[{no:1,name:"value",kind:"scalar",T:12},{no:2,name:"exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.value=new Uint8Array(0),t.exists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.value=e.bytes();break;case 2:s.exists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.value.length&&t.tag(1,i.WireType.LengthDelimited).bytes(e.value),e.exists!==!1&&t.tag(2,i.WireType.Varint).bool(e.exists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const dn=new Kl;class Vl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Vl;class vl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI.SetToField",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new vl;class jl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI.SetToField.Request",[{no:1,name:"id",kind:"message",T:()=>y},{no:2,name:"period",kind:"message",T:()=>w}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=y.internalBinaryRead(e,e.uint32(),r,s.id);break;case 2:s.period=w.internalBinaryRead(e,e.uint32(),r,s.period);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id&&y.internalBinaryWrite(e.id,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.period&&w.internalBinaryWrite(e.period,t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const pn=new jl;class Hl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI.SetToField.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const fn=new Hl;class Gl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI.DeleteExpiredRecords",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Gl;class Jl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI.DeleteExpiredRecords.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const yn=new Jl;class zl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI.DeleteExpiredRecords.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const hn=new zl;class Yl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Yl;class Xl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Xl;class Zl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Create",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Zl;class Ql extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Create.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:3,name:"timeout",kind:"message",T:()=>w},{no:4,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 3:s.timeout=w.internalBinaryRead(e,e.uint32(),r,s.timeout);break;case 4:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.timeout&&w.internalBinaryWrite(e.timeout,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.name!==""&&t.tag(4,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ec=new Ql;class tc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Create.Response",[{no:1,name:"lease_id",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.leaseId=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.leaseId=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.leaseId.length&&t.tag(1,i.WireType.LengthDelimited).bytes(e.leaseId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const nc=new tc;class rc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Update",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new rc;class ic extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Update.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"lease_id",kind:"scalar",T:12},{no:3,name:"timeout",kind:"message",T:()=>w},{no:4,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.leaseId=new Uint8Array(0),t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.leaseId=e.bytes();break;case 3:s.timeout=w.internalBinaryRead(e,e.uint32(),r,s.timeout);break;case 4:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.leaseId.length&&t.tag(2,i.WireType.LengthDelimited).bytes(e.leaseId),e.timeout&&w.internalBinaryWrite(e.timeout,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.name!==""&&t.tag(4,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const sc=new ic;class oc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Update.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ac=new oc;class lc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Release",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new lc;class cc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Release.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"lease_id",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.leaseId=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.leaseId=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.leaseId.length&&t.tag(2,i.WireType.LengthDelimited).bytes(e.leaseId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const uc=new cc;class dc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Release.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const pc=new dc;class fc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new fc;class yc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.ListMethods",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new yc;class hc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.ListMethods.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const gc=new hc;class Tc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.ListMethods.Response",[{no:1,name:"methods",kind:"message",repeat:1,T:()=>gn}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.methods=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.methods.push(gn.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){for(let s=0;s<e.methods.length;s++)gn.internalBinaryWrite(e.methods[s],t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const kc=new Tc;class mc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.ListMethods.MethodInfo",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"info",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.name="",t.info={},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=e.string();break;case 2:s.name=e.string();break;case 3:this.binaryReadMap3(s.info,e,r);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap3(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=t.string();break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.AuthAPI.ListMethods.MethodInfo.info")}}e[u??""]=l??""}internalBinaryWrite(e,t,r){e.type!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.type),e.name!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.name);for(let s of globalThis.Object.keys(e.info))t.tag(3,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s).tag(2,i.WireType.LengthDelimited).string(e.info[s]).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const gn=new mc;class wc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.GetJWTToken",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new wc;class bc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.GetJWTToken.Request",[{no:1,name:"expiration",kind:"message",T:()=>w}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.expiration=w.internalBinaryRead(e,e.uint32(),r,s.expiration);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.expiration&&w.internalBinaryWrite(e.expiration,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Pc=new bc;class Rc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.GetJWTToken.Response",[{no:1,name:"token",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.token="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.token=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.token!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.token);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ic=new Rc;class _c extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MiscAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new _c;class Ac extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MiscAPI.ListResourceTypes",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ac;class Lc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MiscAPI.ListResourceTypes.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Fc=new Lc;class Wc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MiscAPI.ListResourceTypes.Response",[{no:1,name:"types",kind:"message",repeat:1,T:()=>f}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.types=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.types.push(f.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){for(let s=0;s<e.types.length;s++)f.internalBinaryWrite(e.types[s],t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Uc=new Wc;class Bc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MaintenanceAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Bc;class Nc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MaintenanceAPI.Ping",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Nc;class Mc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MaintenanceAPI.Ping.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const xc=new Mc;class Ec extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MaintenanceAPI.Ping.Response",[{no:1,name:"core_version",kind:"scalar",T:9},{no:2,name:"core_full_version",kind:"scalar",T:9},{no:3,name:"server_info",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.coreVersion="",t.coreFullVersion="",t.serverInfo="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.coreVersion=e.string();break;case 2:s.coreFullVersion=e.string();break;case 3:s.serverInfo=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.coreVersion!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.coreVersion),e.coreFullVersion!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.coreFullVersion),e.serverInfo!==""&&t.tag(3,i.WireType.LengthDelimited).string(e.serverInfo);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const $c=new Ec,Tn=new h.ServiceType("MiLaboratories.PL.API.Platform",[{name:"Tx",serverStreaming:!0,clientStreaming:!0,options:{},I:$i,O:Ci},{name:"TxSync",options:{},I:Xi,O:Qi},{name:"SubscriptionAttachFilter",options:{},I:te,O:ne},{name:"SubscriptionDetachFilter",options:{},I:re,O:ie},{name:"NotificationsGet",options:{},I:Q,O:ee},{name:"ControllerRegister",options:{},I:sa,O:aa},{name:"ControllerDeregister",options:{},I:wa,O:Pa},{name:"ControllerCreate",options:{},I:_a,O:La},{name:"ControllerExists",options:{},I:ua,O:pa},{name:"ControllerGet",options:{},I:Ua,O:Na},{name:"ControllerUpdate",options:{},I:ha,O:Ta},{name:"ControllerAttachSubscription",options:{},I:Ea,O:Sa},{name:"GetControllerNotifications",options:{},I:Oa,O:Ka},{name:"WriteControllerAliasesAndUrls",options:{},I:ja,O:Ga},{name:"RemoveControllerAliasesAndUrls",options:{},I:tl,O:rl},{name:"GetControllerUrl",options:{},I:Ya,O:Za},{name:"ControllerSetFeatures",options:{},I:se,O:oe},{name:"ControllerClearFeatures",options:{},I:ae,O:le},{name:"LeaseResource",options:{},I:ec,O:nc},{name:"UpdateLease",options:{},I:sc,O:ac},{name:"ReleaseLease",options:{},I:uc,O:pc},{name:"AuthMethods",options:{},I:gc,O:kc},{name:"GetJWTToken",options:{},I:Pc,O:Ic},{name:"ListResourceTypes",options:{},I:Fc,O:Uc},{name:"Ping",options:{},I:xc,O:$c}]);function Sc(a){return a instanceof ArrayBuffer||ArrayBuffer.isView(a)}function Cc(a){if(typeof a=="string")return Buffer.from(a);if(Sc(a))return a;throw new Error(`Unexpected type: ${a}`)}function Kn(a,e=!1){return a instanceof Gn||a.name=="RpcError"&&a.code=="UNAVAILABLE"?!0:a.cause!==void 0&&!e?Kn(a.cause,!0):!1}function Vn(a,e=!1){return a instanceof me||a.name=="RpcError"&&a.code=="UNAUTHENTICATED"?!0:a.cause!==void 0&&!e?Vn(a.cause,!0):!1}function vn(a,e=!1){return a instanceof g.Aborted||a.name=="AbortError"||a.code=="ABORT_ERR"||a.name=="RpcError"&&(a.code=="CANCELLED"||a.code=="DEADLINE_EXCEEDED")?!0:a.cause!==void 0&&!e?vn(a.cause,!0):!1}const Te=5;class jn extends Error{constructor(e){super(`code=${e.code} ${e.message}`),this.status=e}}function gr(a){throw new ke({code:Te,message:a,details:[]})}class ke extends jn{constructor(e){super(e)}}class Tr extends jn{constructor(e){super(e)}}function Hn(a,e=!1){return a.name=="RpcError"&&a.code=="NOT_FOUND"?!0:a.cause!==void 0&&!e?Hn(a.cause,!0):a instanceof ke&&a.status.code===Te}class me extends Error{constructor(e){super("LoginFailed: "+e)}}class Gn extends Error{constructor(e){super("Disconnected: "+e)}}function kr(a,e=!1){throw Vn(a)?new me(a.message):Kn(a)?new Gn(a.message):vn(a)?new g.Aborted(a):e?new Error(a.message,{cause:a}):a}const mr="resourceError";function Dc(a){return a.deletedTime!==void 0&&a.deletedTime.seconds!==0n}function or(a){var e;return Dc(a)&&gr("resource deleted"),{id:a.id,originalResourceId:a.originalResourceId,type:g.notEmpty(a.type),data:a.data,inputsLocked:a.inputsLocked,outputsLocked:a.outputsLocked,resourceReady:a.resourceReady,kind:Oc(a.kind),error:qc(a),final:a.isFinal,fields:(e=a.fields)==null?void 0:e.filter(t=>t.id.fieldName!==mr).map(wr)}}function Oc(a){switch(a){case de.STRUCTURAL:return"Structural";case de.VALUE:return"Value"}throw new Error("invalid ResourceKind: "+a)}function qc(a){const e=a.fields.find(t=>{var r;return((r=t==null?void 0:t.id)==null?void 0:r.fieldName)===mr});return(e==null?void 0:e.error)??U}function wr(a){var e;return{name:g.notEmpty((e=a.id)==null?void 0:e.fieldName),type:Kc(a.type),status:Vc(a.valueStatus),value:a.value,error:a.error,valueIsFinal:a.valueIsFinal}}function Kc(a){switch(a){case T.INPUT:return"Input";case T.OUTPUT:return"Output";case T.SERVICE:return"Service";case T.ONE_TIME_WRITABLE:return"OTW";case T.DYNAMIC:return"Dynamic";case T.MULTIPLE_TIMES_WRITABLE:return"MTW";default:throw new Error("invalid FieldType: "+a)}}function Vc(a){switch(a){case j.EMPTY:return"Empty";case j.ASSIGNED:return"Assigned";case j.RESOLVED:return"Resolved";default:throw new Error("invalid FieldStatus: "+a)}}function vc(a){switch(a){case"Input":return T.INPUT;case"Output":return T.OUTPUT;case"Dynamic":return T.DYNAMIC;case"Service":return T.SERVICE;case"MTW":return T.MULTIPLE_TIMES_WRITABLE;case"OTW":return T.ONE_TIME_WRITABLE;default:return g.assertNever(a)}}function jc(a){return a.hasOwnProperty("resourceId")&&a.hasOwnProperty("fieldName")}function br(a){return typeof a=="bigint"||a.hasOwnProperty("globalId")&&a.hasOwnProperty("localId")}function Jn(a){return M(a.resourceId)}function M(a){return a.hasOwnProperty("globalId")&&a.hasOwnProperty("localId")}function R(a){return Jn(a)?{resourceId:a.resourceId.localId,fieldName:a.fieldName}:a}async function Hc(a){return Jn(a)?{resourceId:await a.resourceId.globalId,fieldName:a.fieldName}:a}function k(a){return M(a)?a.localId:a}async function Pr(a){return M(a)?await a.globalId:a}function we(a,e){return{resourceId:a,fieldName:e}}class zn extends Error{}async function Z(a){try{return await a()}catch(e){if(Hn(e))return;throw e}}const L=class L{constructor(e,t,r,n,s,u){p(this,"globalTxId");p(this,"localTxId",L.nextLocalTxId());p(this,"txOpenTimestamp",Date.now());p(this,"localResourceIdCounter",0);p(this,"_completed",!1);p(this,"pendingVoidOps",[]);p(this,"globalTxIdWasAwaited",!1);this.ll=e,this.name=t,this.writable=r,this._clientRoot=n,this.finalPredicate=s,this.sharedResourceDataCache=u,this.globalTxId=this.sendSingleAndParse({oneofKind:"txOpen",txOpen:{name:t,writable:r?pe.WRITABLE:pe.NOT_WRITABLE}},l=>{var c;return g.notEmpty((c=l.txOpen.tx)==null?void 0:c.id)}),this.globalTxId.catch(l=>{this.globalTxIdWasAwaited||console.warn(l)})}async drainAndAwaitPendingOps(){if(this.pendingVoidOps.length===0)return;const e=this.pendingVoidOps;this.pendingVoidOps=[],await Promise.all(e)}async sendSingleAndParse(e,t){const r=this.ll.send(e,!1);try{await this.drainAndAwaitPendingOps()}finally{return t(await r)}}async sendMultiAndParse(e,t){const r=this.ll.send(e,!0);try{await this.drainAndAwaitPendingOps()}finally{return t(await r)}}async sendVoidSync(e){await this.ll.send(e,!1)}sendVoidAsync(e){this.pendingVoidOps.push(this.sendVoidSync(e))}checkTxOpen(){if(this._completed)throw new Error("Transaction already closed")}get completed(){return this._completed}async commit(){if(this.checkTxOpen(),this._completed=!0,this.writable){const e=this.sendSingleAndParse({oneofKind:"txCommit",txCommit:{}},r=>r.txCommit.success),t=this.ll.complete();if(await this.drainAndAwaitPendingOps(),!await e)throw new zn;await t,await this.ll.await()}else{const e=this.ll.complete();await this.drainAndAwaitPendingOps(),await e,await this.ll.await()}}async discard(){this.checkTxOpen(),this._completed=!0;const e=this.sendVoidSync({oneofKind:"txDiscard",txDiscard:{}}),t=this.ll.complete();await this.drainAndAwaitPendingOps(),await e,await t,await this.ll.await()}get clientRoot(){return ue(this._clientRoot)}createSingleton(e,t,r=!1){const n=this.nextLocalResourceId(!1);return{globalId:this.sendSingleAndParse({oneofKind:"resourceCreateSingleton",resourceCreateSingleton:{type:t,id:n,data:Buffer.from(e),errorIfExists:r}},u=>u.resourceCreateSingleton.resourceId),localId:n}}async getSingleton(e,t=!0){return await this.sendSingleAndParse({oneofKind:"resourceGetSingleton",resourceGetSingleton:{data:Buffer.from(e),loadFields:t}},r=>or(g.notEmpty(r.resourceGetSingleton.resource)))}createResource(e,t,r){const n=this.nextLocalResourceId(e);return{globalId:this.sendSingleAndParse(t(n),u=>r(u)),localId:n}}createRoot(e){return this.createResource(!0,t=>({oneofKind:"resourceCreateRoot",resourceCreateRoot:{type:e,id:t}}),t=>t.resourceCreateRoot.resourceId)}createStruct(e,t){return this.createResource(!1,r=>({oneofKind:"resourceCreateStruct",resourceCreateStruct:{type:e,id:r,data:t===void 0?void 0:typeof t=="string"?Buffer.from(t):t}}),r=>r.resourceCreateStruct.resourceId)}createEphemeral(e,t){return this.createResource(!1,r=>({oneofKind:"resourceCreateEphemeral",resourceCreateEphemeral:{type:e,id:r,data:t===void 0?void 0:typeof t=="string"?Buffer.from(t):t}}),r=>r.resourceCreateEphemeral.resourceId)}createValue(e,t,r=!1){return this.createResource(!1,n=>({oneofKind:"resourceCreateValue",resourceCreateValue:{type:e,id:n,data:typeof t=="string"?Buffer.from(t):t,errorIfExists:r}}),n=>n.resourceCreateValue.resourceId)}setResourceName(e,t){this.sendVoidAsync({oneofKind:"resourceNameSet",resourceNameSet:{resourceId:k(t),name:e}})}deleteResourceName(e){this.sendVoidAsync({oneofKind:"resourceNameDelete",resourceNameDelete:{name:e}})}async getResourceByName(e){return await this.sendSingleAndParse({oneofKind:"resourceNameGet",resourceNameGet:{name:e}},t=>ue(t.resourceNameGet.resourceId))}async checkResourceNameExists(e){return await this.sendSingleAndParse({oneofKind:"resourceNameExists",resourceNameExists:{name:e}},t=>t.resourceNameExists.exists)}removeResource(e){this.sendVoidAsync({oneofKind:"resourceRemove",resourceRemove:{id:e}})}async resourceExists(e){return await this.sendSingleAndParse({oneofKind:"resourceExists",resourceExists:{resourceId:e}},t=>t.resourceExists.exists)}async getResourceData(e,t=!0,r=!1){if(!r&&!M(e)&&!N(e)){const s=this.sharedResourceDataCache.get(e);if(s&&s.cacheTxOpenTimestamp<this.txOpenTimestamp)if(t){if(s.data)return s.data}else return s.basicData}const n=await this.sendSingleAndParse({oneofKind:"resourceGet",resourceGet:{resourceId:k(e),loadFields:t}},s=>or(g.notEmpty(s.resourceGet.resource)));if(!M(e)&&!N(e)&&this.finalPredicate(n)){const s=this.sharedResourceDataCache.get(e);s?t&&!s.data&&(s.data=n,s.cacheTxOpenTimestamp=this.txOpenTimestamp):t?this.sharedResourceDataCache.set(e,{basicData:bn(n),data:n,cacheTxOpenTimestamp:this.txOpenTimestamp}):this.sharedResourceDataCache.set(e,{basicData:bn(n),data:void 0,cacheTxOpenTimestamp:this.txOpenTimestamp})}return n}async getResourceDataIfExists(e,t=!0){const r=await Z(async()=>await this.getResourceData(e,t,!0));return r===void 0&&!M(e)&&!N(e)&&this.sharedResourceDataCache.delete(e),r}lockInputs(e){this.sendVoidAsync({oneofKind:"resourceLockInputs",resourceLockInputs:{resourceId:k(e)}})}lockOutputs(e){this.sendVoidAsync({oneofKind:"resourceLockOutputs",resourceLockOutputs:{resourceId:k(e)}})}lock(e){this.lockInputs(e),this.lockOutputs(e)}createField(e,t,r){this.sendVoidAsync({oneofKind:"fieldCreate",fieldCreate:{type:vc(t),id:R(e)}}),r!==void 0&&this.setField(e,r)}async fieldExists(e){return await this.sendSingleAndParse({oneofKind:"fieldExists",fieldExists:{field:R(e)}},t=>t.fieldExists.exists)}setField(e,t){br(t)?this.sendVoidAsync({oneofKind:"fieldSet",fieldSet:{field:R(e),value:{resourceId:k(t),fieldName:""}}}):this.sendVoidAsync({oneofKind:"fieldSet",fieldSet:{field:R(e),value:R(t)}})}setFieldError(e,t){this.sendVoidAsync({oneofKind:"fieldSetError",fieldSetError:{field:R(e),errResourceId:k(t)}})}async getField(e){return await this.sendSingleAndParse({oneofKind:"fieldGet",fieldGet:{field:R(e)}},t=>wr(g.notEmpty(t.fieldGet.field)))}async getFieldIfExists(e){return Z(async()=>await this.getField(e))}resetField(e){this.sendVoidAsync({oneofKind:"fieldReset",fieldReset:{field:R(e)}})}removeField(e){this.sendVoidAsync({oneofKind:"fieldRemove",fieldRemove:{field:R(e)}})}async listKeyValues(e){return await this.sendMultiAndParse({oneofKind:"resourceKeyValueList",resourceKeyValueList:{resourceId:k(e),startFrom:"",limit:0}},t=>t.map(r=>r.resourceKeyValueList.record))}async listKeyValuesString(e){return(await this.listKeyValues(e)).map(({key:t,value:r})=>({key:t,value:Buffer.from(r).toString()}))}async listKeyValuesIfResourceExists(e){return Z(async()=>await this.listKeyValues(e))}async listKeyValuesStringIfResourceExists(e){return Z(async()=>await this.listKeyValuesString(e))}setKValue(e,t,r){this.sendVoidAsync({oneofKind:"resourceKeyValueSet",resourceKeyValueSet:{resourceId:k(e),key:t,value:Cc(r)}})}deleteKValue(e,t){this.sendVoidAsync({oneofKind:"resourceKeyValueDelete",resourceKeyValueDelete:{resourceId:k(e),key:t}})}async getKValue(e,t){return await this.sendSingleAndParse({oneofKind:"resourceKeyValueGet",resourceKeyValueGet:{resourceId:k(e),key:t}},r=>r.resourceKeyValueGet.value)}async getKValueString(e,t){return Buffer.from(await this.getKValue(e,t)).toString()}async getKValueJson(e,t){return JSON.parse(await this.getKValueString(e,t))}async getKValueIfExists(e,t){return await this.sendSingleAndParse({oneofKind:"resourceKeyValueGetIfExists",resourceKeyValueGetIfExists:{resourceId:k(e),key:t}},r=>r.resourceKeyValueGetIfExists.exists?r.resourceKeyValueGetIfExists.value:void 0)}async getKValueStringIfExists(e,t){const r=await this.getKValueIfExists(e,t);return r===void 0?void 0:Buffer.from(r).toString()}async getKValueJsonIfExists(e,t){const r=await this.getKValueString(e,t);if(r!==void 0)return JSON.parse(r)}getFutureFieldValue(e,t,r){const n=Buffer.from(JSON.stringify({fieldName:t,fieldType:r})),s=this.createEphemeral({name:"json/getField",version:"1"},n);return this.setField({resourceId:s,fieldName:"resource"},e),{resourceId:s,fieldName:"result"}}async getGlobalTxId(){return this.globalTxIdWasAwaited=!0,await this.globalTxId}async complete(){if(this._completed)return;this._completed=!0;const e=this.ll.complete();await this.drainAndAwaitPendingOps(),await e}async await(){await this.ll.await()}nextLocalResourceId(e){return On(e,++this.localResourceIdCounter,this.localTxId)}static nextLocalTxId(){return L.localTxIdCounter++,L.localTxIdCounter===ge&&(L.localTxIdCounter=1),L.localTxIdCounter}};p(L,"localTxIdCounter",0);let fe=L;function P(a,e){return{name:a,version:e}}const In=P("ClientRoot","1"),Gc=P("StructTest","1"),Jc=P("ValueTest","1"),Rr=P("json/string","1"),Ir=P("json/bool","1"),_r=P("json/object","1"),Ar=P("json/array","1"),Lr=P("json/number","1"),Fr=P("json/null","1"),Yn=P("EphStdMap","1"),Xn=P("StdMap","1");function zc(a){return a.createValue(Fr,Buffer.from(JSON.stringify(null)))}function Yc(a,e){return a.createValue(Ir,Buffer.from(JSON.stringify(e)))}function Xc(a,e){return a.createValue(Lr,Buffer.from(JSON.stringify(e)))}function Zc(a,e){return a.createValue(Rr,Buffer.from(JSON.stringify(e)))}function Qc(a,e){return a.createValue(Ar,Buffer.from(JSON.stringify(e)))}function eu(a,e){return a.createValue(_r,Buffer.from(JSON.stringify(e)))}function Zn(a,e){return[a,e]}function Wr(a,e){return e===void 0?Object.entries(a):e.map(t=>Zn(t,a[t]))}function tu(a,e,t,r){const n=r??(t?Yn:Xn),s=t?a.createEphemeral(n):a.createStruct(n);for(const[u,l]of Array.isArray(e)?e:Wr(e))a.createField(we(s,u),"Input",l);return a.lock(s),s}function nu(a,e,t,r,n=""){return Object.fromEntries(t.map(s=>Zn(s,a.getFutureFieldValue(e,`${n}${s}`,r))))}const Ur=Xn,Br=Yn,be="ref";function ru(a,e){const t=a.createStruct(Ur),r=we(t,be);return a.createField(r,"Input",e),a.lock(t),t}function iu(a,e){const t=a.createEphemeral(Br),r=we(t,be);return a.createField(r,"Input",e),a.lock(t),t}function su(a,e){return a.getFutureFieldValue(e,be,"Input")}const ou=Object.freeze(Object.defineProperty({__proto__:null,ClientRoot:In,EphHolder:Br,EphStdMap:Yn,Holder:Ur,HolderRefField:be,JsonArray:Ar,JsonBool:Ir,JsonNull:Fr,JsonNumber:Lr,JsonObject:_r,JsonString:Rr,StdMap:Xn,StructTestResource:Gc,ValueTestResource:Jc,createPlArray:Qc,createPlBool:Yc,createPlMap:tu,createPlNull:zc,createPlNumber:Xc,createPlObject:eu,createPlString:Zc,futureRecord:nu,plEntries:Wr,plEntry:Zn,unwrapHolder:su,wrapInEphHolder:iu,wrapInHolder:ru},Symbol.toStringTag,{value:"Module"})),_n=2e3,An=3e4,Ln=31*24*60*60,Fn=12*24*60*60,Wn=35e6,Un="exponential",Bn=10,Nn=4,Mn=2,xn=50,En=.3;function _(a){if(!a)return;const e=Number(a);if(e===Number.NaN)throw new Error(`Can't parse number: ${a}`);return e}function J(a,e={}){if(a.indexOf("://")===-1)return{hostAndPort:a,ssl:!1,defaultRequestTimeout:_n,defaultTransactionTimeout:An,authTTLSeconds:Ln,authMaxRefreshSeconds:Fn,txDelay:0,forceSync:!1,maxCacheBytes:Wn,retryBackoffAlgorithm:Un,retryMaxAttempts:Bn,retryInitialDelay:Nn,retryExponentialBackoffMultiplier:Mn,retryLinearBackoffStep:xn,retryJitter:En,...e};const t=new URL(a);if(t.protocol!=="https:"&&t.protocol!=="http:"&&t.protocol!=="grpc:"&&t.protocol!=="tls:")throw new Error(`Unexpected URL schema: ${t.protocol}`);if(t.pathname!=="/"&&t.pathname!=="")throw new Error(`Unexpected URL path: ${t.pathname}`);return{hostAndPort:t.host,alternativeRoot:t.searchParams.get("alternative-root")??void 0,ssl:t.protocol==="https:"||t.protocol==="tls:",defaultRequestTimeout:_(t.searchParams.get("request-timeout"))??_n,defaultTransactionTimeout:_(t.searchParams.get("tx-timeout"))??An,authTTLSeconds:Ln,authMaxRefreshSeconds:Fn,grpcProxy:t.searchParams.get("grpc-proxy")??void 0,httpProxy:t.searchParams.get("http-proxy")??void 0,user:t.username===""?void 0:t.username,password:t.password===""?void 0:t.password,txDelay:_(t.searchParams.get("tx-delay"))??0,forceSync:!!t.searchParams.get("force-sync"),maxCacheBytes:_(t.searchParams.get("max-cache-bytes"))??Wn,retryBackoffAlgorithm:t.searchParams.get("retry-backoff-algorithm")??Un,retryMaxAttempts:_(t.searchParams.get("retry-max-attempts"))??Bn,retryInitialDelay:_(t.searchParams.get("retry-initial-delay"))??Nn,retryExponentialBackoffMultiplier:_(t.searchParams.get("retry-exp-backoff-multiplier"))??Mn,retryLinearBackoffStep:_(t.searchParams.get("retry-linear-backoff-step"))??xn,retryJitter:_(t.searchParams.get("retry-backoff-jitter"))??En,...e}}const au={};class lu{constructor(e){p(this,"typeName",Tn.typeName);p(this,"methods",Tn.methods);p(this,"options",Tn.options);this._transport=e}tx(e){const t=this.methods[0],r=this._transport.mergeOptions(e);return h.stackIntercept("duplex",this._transport,t,r)}txSync(e,t){const r=this.methods[1],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}subscriptionAttachFilter(e,t){const r=this.methods[2],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}subscriptionDetachFilter(e,t){const r=this.methods[3],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}notificationsGet(e,t){const r=this.methods[4],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerRegister(e,t){const r=this.methods[5],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerDeregister(e,t){const r=this.methods[6],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerCreate(e,t){const r=this.methods[7],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerExists(e,t){const r=this.methods[8],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerGet(e,t){const r=this.methods[9],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerUpdate(e,t){const r=this.methods[10],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerAttachSubscription(e,t){const r=this.methods[11],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}getControllerNotifications(e,t){const r=this.methods[12],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}writeControllerAliasesAndUrls(e,t){const r=this.methods[13],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}removeControllerAliasesAndUrls(e,t){const r=this.methods[14],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}getControllerUrl(e,t){const r=this.methods[15],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerSetFeatures(e,t){const r=this.methods[16],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerClearFeatures(e,t){const r=this.methods[17],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}leaseResource(e,t){const r=this.methods[18],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}updateLease(e,t){const r=this.methods[19],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}releaseLease(e,t){const r=this.methods[20],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}authMethods(e,t){const r=this.methods[21],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}getJWTToken(e,t){const r=this.methods[22],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}listResourceTypes(e,t){const r=this.methods[23],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}ping(e,t){const r=this.methods[24],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}}function cu(a,e,t,r){return{kind:a,expectMultiResponse:e,resolve:t,reject:r}}function uu(a){return a.code===Te}class v extends Error{constructor(e){super("Rethrow error, you should never see this one."),this.rethrowLambda=e}}class du{constructor(e){p(this,"stream");p(this,"abortController",new AbortController);p(this,"requestIdxCounter",0);p(this,"responseHandlerQueue",new qr);p(this,"localResourceIdCounter",0n);p(this,"closed",!1);p(this,"completed",!1);p(this,"errorFactory");p(this,"openTimestamp",Date.now());p(this,"incomingProcessorResult");p(this,"_completed",!1);this.stream=e(this.abortController.signal),this.incomingProcessorResult=this.incomingEventProcessor()}assignErrorFactoryIfNotSet(e,t){return t!==void 0&&t(new v(e)),this.errorFactory||(this.errorFactory=e),e}async incomingEventProcessor(){var n;let e=-1,t,r;try{for await(const s of this.stream.responses){if(t===void 0){if(t=this.responseHandlerQueue.shift(),t===void 0){this.assignErrorFactoryIfNotSet(()=>{throw new Error("orphan incoming message")});break}t.expectMultiResponse&&(r=[]),e++}if(s.requestId!==e){const u=`out of order messages, ${s.requestId} !== ${e}`;this.assignErrorFactoryIfNotSet(()=>{throw new Error(u)});break}if(s.error!==void 0){const u=s.error;if(uu(u)){if(t.reject(new v(()=>{throw new ke(u)})),t=void 0,s.multiMessage!==void 0&&!s.multiMessage.isLast){this.assignErrorFactoryIfNotSet(()=>{throw new Error("Unexpected message sequence.")});break}continue}else{this.assignErrorFactoryIfNotSet(()=>{throw new Tr(u)},t.reject),t=void 0;break}}if(t.kind!==s.response.oneofKind&&((n=s==null?void 0:s.multiMessage)==null?void 0:n.isEmpty)!==!0){const u=`inconsistent request response types: ${t.kind} !== ${s.response.oneofKind}`;this.assignErrorFactoryIfNotSet(()=>{throw new Error(u)},t.reject),t=void 0;break}if(t.expectMultiResponse!==(s.multiMessage!==void 0)){const u=`inconsistent multi state: ${t.expectMultiResponse} !== ${s.multiMessage!==void 0}`;this.assignErrorFactoryIfNotSet(()=>{throw new Error(u)},t.reject),t=void 0;break}if(s.multiMessage!==void 0){if(!s.multiMessage.isEmpty){if(s.multiMessage.id!==r.length+1){const u=`inconsistent multi id: ${s.multiMessage.id} !== ${r.length+1}`;this.assignErrorFactoryIfNotSet(()=>{throw new Error(u)},t.reject),t=void 0;break}r.push(s.response)}s.multiMessage.isLast&&(t.resolve(r),r=void 0,t=void 0)}else t.resolve(s.response),t=void 0}}catch(s){return this.assignErrorFactoryIfNotSet(()=>{kr(s,!0)},t==null?void 0:t.reject)}finally{await this.close()}return null}async close(){if(!this.closed){for(this.closed=!0;;){const e=this.responseHandlerQueue.shift();if(!e)break;this.errorFactory?e.reject(new v(this.errorFactory)):e.reject(new Error("no reply"))}await this.stream.requests.complete()}}abort(e){this.assignErrorFactoryIfNotSet(()=>{throw new Error("transaction aborted",{cause:e})}),this.abortController.abort(e)}async await(){const e=await this.incomingProcessorResult;e!==null&&e()}async send(e,t){if(this.errorFactory)return Promise.reject(new v(this.errorFactory));if(this.closed)return Promise.reject(new Error("Transaction already closed"));const r=new Promise((n,s)=>{this.responseHandlerQueue.push(cu(e.oneofKind,t,n,s))});await this.stream.requests.send({requestId:this.requestIdxCounter++,request:e});try{return await r}catch(n){throw n instanceof v&&n.rethrowLambda(),new Error("Error while waiting for response",{cause:n})}}async complete(){this._completed||(this._completed=!0,await this.stream.requests.complete())}}function Qn(a){return JSON.parse(Buffer.from(a.split(".")[1],"base64").toString())}function V(a,e){if(a.jwtToken===void 0)return;const{exp:t,iat:r}=Qn(a.jwtToken);return Math.min((r+t)/2,r+e)*1e3}function pu(a){return a.jwtToken===void 0?void 0:Qn(a.jwtToken).exp*1e3}class er{constructor(e,t={}){p(this,"conf");p(this,"authInformation");p(this,"onAuthUpdate");p(this,"onAuthError");p(this,"onAuthRefreshProblem");p(this,"refreshTimestamp");p(this,"_status","OK");p(this,"statusListener");p(this,"grpcTransport");p(this,"grpcPl");p(this,"httpDispatcher");p(this,"authRefreshInProgress",!1);this.conf=typeof e=="string"?J(e):e;const r=[],{auth:n,statusListener:s}=t;n!==void 0&&(this.refreshTimestamp=V(n.authInformation,this.conf.authMaxRefreshSeconds),r.push(this.createAuthInterceptor()),this.authInformation=n.authInformation,this.onAuthUpdate=n.onUpdate,this.onAuthRefreshProblem=n.onUpdateError,this.onAuthError=n.onAuthError),r.push(this.createErrorInterceptor());const u={host:this.conf.hostAndPort,timeout:this.conf.defaultRequestTimeout,channelCredentials:this.conf.ssl?E.ChannelCredentials.createSsl():E.ChannelCredentials.createInsecure(),clientOptions:{"grpc.keepalive_time_ms":3e4,interceptors:r}};this.conf.grpcProxy?process.env.grpc_proxy=this.conf.grpcProxy:delete process.env.grpc_proxy,this.grpcTransport=new Or.GrpcTransport(u),this.grpcPl=new lu(this.grpcTransport);const l=new Vr({resolver:new Kr.Resolver({tries:10})}),c={headersTimeout:3e3,keepAliveTimeout:3e3,keepAliveMaxTimeout:6e4,maxRedirections:6,connect:{lookup:l.lookup.bind(l)}};this.conf.httpProxy!==void 0?this.httpDispatcher=new sr.ProxyAgent({uri:this.conf.httpProxy,...c}):this.httpDispatcher=new sr.Agent(c),s!==void 0&&(this.statusListener=s,s(this._status))}get authenticated(){return this.authInformation!==void 0}get authUser(){var e,t;if(!this.authenticated)throw new Error("Client is not authenticated");return(e=this.authInformation)!=null&&e.jwtToken?Qn((t=this.authInformation)==null?void 0:t.jwtToken).user.login:null}updateStatus(e){process.nextTick(()=>{this._status!==e&&(this._status=e,this.statusListener!==void 0&&this.statusListener(this._status),this.onAuthError!==void 0&&this.onAuthError())})}get status(){return this._status}refreshAuthInformationIfNeeded(){this.refreshTimestamp===void 0||Date.now()<this.refreshTimestamp||this.authRefreshInProgress||this._status==="Unauthenticated"||(this.authRefreshInProgress=!0,(async()=>{try{const e=await this.grpcPl.getJWTToken({expiration:{seconds:BigInt(this.conf.authTTLSeconds),nanos:0}}).response;this.authInformation={jwtToken:e.token},this.refreshTimestamp=V(this.authInformation,this.conf.authMaxRefreshSeconds),this.onAuthUpdate&&this.onAuthUpdate(this.authInformation)}catch(e){this.onAuthRefreshProblem&&this.onAuthRefreshProblem(e)}finally{this.authRefreshInProgress=!1}})())}createErrorInterceptor(){return(e,t)=>new E.InterceptingCall(t(e),{start:(r,n,s)=>{s(r,{onReceiveStatus:(u,l)=>{u.code==E.status.UNAUTHENTICATED&&this.updateStatus("Unauthenticated"),u.code==E.status.UNAVAILABLE&&this.updateStatus("Disconnected"),l(u)}})}})}createAuthInterceptor(){return(e,t)=>new E.InterceptingCall(t(e),{start:(r,n,s)=>{var u;((u=this.authInformation)==null?void 0:u.jwtToken)!==void 0&&(r.set("authorization","Bearer "+this.authInformation.jwtToken),this.refreshAuthInformationIfNeeded()),s(r,n)}})}createTx(e={}){return new du(t=>{let r=t;return e.abortSignal&&(r=AbortSignal.any([r,e.abortSignal])),this.grpcPl.tx({abort:r,timeout:e.timeout??this.conf.defaultTransactionTimeout})})}async close(){this.grpcTransport.close(),await this.httpDispatcher.destroy()}}function ce(a){return a.resourceReady||B(a.originalResourceId)||B(a.error)}function fu(a){if(!ce(a)||!a.outputsLocked)return!1;if(a.fields===void 0)return!0;for(const e of a.fields)if(A(e.error)&&(A(e.value)||!e.valueIsFinal))return!1;return!0}const ar=new Set,Nr=a=>{switch(a.type.name){case"StreamManager":if(!ce(a))return!1;if(a.fields===void 0||B(a.error))return!0;const e=Pn(a,"downloadable");return Pn(a,"stream").value===e.value;case"StdMap":case"std/map":case"EphStdMap":case"PFrame":case"BContext":case"BlockPackCustom":case"BinaryMap":case"BinaryValue":case"BlobMap":case"BResolveSingle":case"BResolveSingleNoResult":case"BQueryResult":case"TengoTemplate":case"TengoLib":case"SoftwareInfo":case"Dummy":return ce(a);case"json/resourceError":return a.type.version==="1";case"json/object":case"json/string":case"json/array":case"json/number":case"BContextEnd":case"Frontend/FromUrl":case"Frontend/FromFolder":case"BObjectSpec":case"Blob":case"LSProvider":return!0;case"UserProject":case"Projects":case"ClientRoot":return!1;default:if(a.type.name.startsWith("Blob/"))return!0;if(a.type.name.startsWith("BlobUpload/")||a.type.name.startsWith("BlobIndex/"))return fu(a);if(a.type.name.startsWith("PColumnData/"))return ce(a);ar.has(a.type.name)||(console.log("UNKNOWN RESOURCE TYPE: "+a.type.name),ar.add(a.type.name))}return!1},kn={sync:!1},yu="AnonymousRoot";function lr(a){return`alternative_root_${a}`}class Y{constructor(e,t,r={}){p(this,"ll");p(this,"drivers",new Map);p(this,"txDelay");p(this,"forceSync");p(this,"defaultRetryOptions");p(this,"_clientRoot",U);p(this,"_serverInfo");p(this,"finalPredicate");p(this,"resourceDataCache");this.ll=new er(e,{auth:t,...r});const n=this.ll.conf;switch(this.txDelay=n.txDelay,this.forceSync=n.forceSync,this.finalPredicate=r.finalPredicate??Nr,this.resourceDataCache=new jr.LRUCache({maxSize:n.maxCacheBytes,sizeCalculation:s=>{var u;return(((u=s.basicData.data)==null?void 0:u.length)??0)+64}}),n.retryBackoffAlgorithm){case"exponential":this.defaultRetryOptions={type:"exponentialBackoff",initialDelay:n.retryInitialDelay,maxAttempts:n.retryMaxAttempts,backoffMultiplier:n.retryExponentialBackoffMultiplier,jitter:n.retryJitter};break;case"linear":this.defaultRetryOptions={type:"linearBackoff",initialDelay:n.retryInitialDelay,maxAttempts:n.retryMaxAttempts,backoffStep:n.retryLinearBackoffStep,jitter:n.retryJitter};break;default:g.assertNever(n.retryBackoffAlgorithm)}}async ping(){return(await this.ll.grpcPl.ping({})).response}get conf(){return this.ll.conf}get httpDispatcher(){return this.ll.httpDispatcher}get initialized(){return!A(this._clientRoot)}checkInitialized(){if(!this.initialized)throw new Error("Client not initialized")}get clientRoot(){return this.checkInitialized(),ue(this._clientRoot)}get serverInfo(){return this.checkInitialized(),this._serverInfo}async init(){if(this.initialized)throw new Error("Already initialized");const e=this.ll.authUser,t=e===null?yu:ye.createHash("sha256").update(e).digest("hex");this._serverInfo=await this.ping(),this._clientRoot=await this._withTx("initialization",!0,U,async r=>{let n;if(await r.checkResourceNameExists(t)?n=await r.getResourceByName(t):(n=r.createRoot(In),r.setResourceName(t,n)),this.conf.alternativeRoot===void 0)return await r.commit(),await Pr(n);{const s={resourceId:n,fieldName:lr(this.conf.alternativeRoot)},u=r.createEphemeral(In);return r.lock(u),r.createField(s,"Dynamic"),r.setField(s,u),await r.commit(),await u.globalId}})}async deleteAlternativeRoot(e){if(this.checkInitialized(),this.ll.conf.alternativeRoot!==void 0)throw new Error("Initialized with alternative root.");return await this.withWriteTx("delete-alternative-root",async t=>{const r={resourceId:t.clientRoot,fieldName:lr(e)},n=t.fieldExists(r);return t.removeField(r),await t.commit(),await n})}async _withTx(e,t,r,n,s){let u=g.createRetryState((s==null?void 0:s.retryOptions)??this.defaultRetryOptions);for(;;){const l=this.ll.createTx(s),c=new fe(l,e,t,r,this.finalPredicate,this.resourceDataCache);let o=!1,d,rr;try{d=await n(c),o=!0}catch(ir){if(!(ir instanceof zn))throw ir}finally{await c.complete(),await c.await(),rr=await c.getGlobalTxId()}if(o)return((s==null?void 0:s.sync)===void 0?this.forceSync:s!=null&&s.sync)&&await this.ll.grpcPl.txSync({txId:rr}),t&&this.txDelay>0&&await wn.setTimeout(this.txDelay,void 0,{signal:s==null?void 0:s.abortSignal}),d;await wn.setTimeout(u.nextDelay,void 0,{signal:s==null?void 0:s.abortSignal}),u=g.nextRetryStateOrError(u)}}async withTx(e,t,r,n={}){return this.checkInitialized(),await this._withTx(e,t,this.clientRoot,r,{...n,...kn})}async withWriteTx(e,t,r={}){return await this.withTx(e,!0,t,{...r,...kn})}async withReadTx(e,t,r={}){return await this.withTx(e,!1,t,{...r,...kn})}getDriver(e){const t=this.drivers.get(e.name);if(t!==void 0)return t;const r=e.init(this,this.ll.grpcTransport,this.ll.httpDispatcher);return this.drivers.set(e.name,r),r}async close(){await this.ll.close()}static async init(e,t,r={}){const n=new Y(e,t,r);return await n.init(),n}}function hu(a,e){return e=e??{},e.meta=e.meta??{},e.meta.resourceType=`${a.name}:${a.version}`,e}class tr{constructor(e){p(this,"ll");this.ll=new er(e)}async ping(){return(await this.ll.grpcPl.ping({})).response}async authMethods(){return(await this.ll.grpcPl.authMethods({})).response}async requireAuth(){return(await this.authMethods()).methods.length>0}async login(e,t){try{const r=await this.ll.grpcPl.getJWTToken({expiration:{seconds:BigInt(this.ll.conf.authTTLSeconds),nanos:0}},{meta:{authorization:"Basic "+Buffer.from(e+":"+t).toString("base64")}}).response,n=g.notEmpty(r.token);if(n==="")throw new Error("empty token");return{jwtToken:n}}catch(r){throw r.code==="UNAUTHENTICATED"?new me(r.message):new Error(r)}}}const gu="pl.json",Tu=Sn.join(pr.homedir(),".pl.json"),ku="pl.yaml",mu=Sn.join(pr.homedir(),".pl.yaml"),wu=[gu,ku,Tu,mu],H=".pl_auth.json",bu=["grpcProxy","httpProxy","user","password","alternativeRoot","defaultTransactionTimeout","defaultRequestTimeout","authTTLSeconds","authMaxRefreshSeconds"];function Mr(){for(const a of wu)if(F.existsSync(a)){const e=F.readFileSync(a,{encoding:"utf-8"});return a.endsWith("json")?[JSON.parse(e),a]:[Gr.parse(e),a]}}function Pu(a,e){return t=>{F.writeFileSync(H,Buffer.from(JSON.stringify({confHash:a,authInformation:t,expiration:V(t,e)})),"utf8")}}const cr=()=>{F.rmSync(H)};async function Ru(){let a;if(process.env.PL_ADDRESS!==void 0)a=J(process.env.PL_ADDRESS);else{const r=Mr();if(r!==void 0){const[n,s]=r,u=g.notEmpty(n.address,`no pl address in file: ${s}`);a=J(u);for(const l of bu)n[l]!==void 0&&(a[l]=n[l])}}if(a===void 0)throw new Error("Can't find configuration to create default platform client.");process.env.PL_USER!==void 0&&(a.user=process.env.PL_USER),process.env.PL_PASSWORD!==void 0&&(a.user=process.env.PL_PASSWORD);const e=ye.createHash("sha256").update(Buffer.from(Hr(a))).digest("base64");let t;if(F.existsSync(H)){const r=JSON.parse(F.readFileSync(H,{encoding:"utf-8"}));r.confHash===e&&r.expiration>Date.now()&&(t=r.authInformation)}if(t===void 0){const r=new tr(a);if(await r.requireAuth()){if(a.user===void 0||a.password===void 0)throw new Error("No auth information for found to authenticate with PL server.");t=await r.login(a.user,a.password)}else t={};F.writeFileSync(H,Buffer.from(JSON.stringify({confHash:e,authInformation:t,expiration:V(t,a.authMaxRefreshSeconds)})),"utf8")}return await Y.init(a,{authInformation:t,onUpdate:r=>Pu(e,a.authMaxRefreshSeconds),onUpdateError:cr,onAuthError:cr})}async function Iu(a,e){const t={valueId:e.value,errorId:e.error,error:""};if(B(e.error)){const r=await a.getResourceData(e.error,!0);t.error=JSON.parse(g.notEmpty(r.data).toString())}return t}class D extends Error{}const _u={failOnError:!0,onlyFinal:!1};class xr{constructor(e,t,r){this.tx=e,this.data=t,this.path=r}final(){if(!this.data.final)throw new D;return this}async requireNoError(){return A(this.data.error)?this:(await this.tx.throwError(this.data.error,this.path),this)}getFieldData(e,t){const r=this.data.fields.find(n=>n.name===e);if(r!==void 0){if(t!==void 0&&r.type!==t)throw new Error(`Unexpected field type. Expected ${t}, found ${r.type}`);return r}throw(t==="Input"||t==="Service")&&this.data.inputsLocked||t==="Output"&&this.data.outputsLocked?new Error(`Field "${e}" not found. Expected type: ${t}, state: ${this.data}`):new D}async get(e,t={}){const{expectedType:r,failOnError:n,onlyFinal:s}={..._u,...t},u=[...this.path,e],l=this.getFieldData(e,r);if(B(l.error)&&(n||A(l.value))&&await this.tx.throwError(l.error,u),A(l.value))throw new D;return await this.tx.get(l.value,n,u)}async getMulti(e,...t){return await Promise.all(t.map(r=>this.get(r,e)))}async getMultiObj(e,...t){return Object.fromEntries(await Promise.all(t.map(async r=>[r,await this.get(r,e)])))}async getAllFinal(e={}){return await this.getMultiObj(e,...this.data.fields.filter(t=>t.valueIsFinal||B(t.error)).map(t=>t.name))}async getKValue(e){const t=await this.tx.tx.getKValueStringIfExists(this.data.id,e);if(t===void 0)throw new D;return t}async getKValueObj(e){return JSON.parse(await this.getKValue(e))}}class Er{constructor(e){this.tx=e}async get(e,t=!0,r=[]){const n=await this.tx.getResourceData(e,!0),s=new xr(this,n,[...r,z(e)]);return t&&await s.requireNoError(),s}async throwError(e,t=[]){const r=await this.get(e);let n=Buffer.from(g.notEmpty(r.data.data)).toString();throw new Error(`${t.join(" -> ")} = ${n}`)}}const $r={type:"linearBackoff",jitter:0,maxAttempts:100,backoffStep:10,initialDelay:10};async function Au(a,e,t=$r,r="polling"){let n=g.createRetryState(t);for(;;){try{return await a.withReadTx(r,async s=>await e(new Er(s)))}catch(s){if(!(s instanceof D))throw s}await wn.setTimeout(n.nextDelay),n=g.nextRetryStateOrError(n)}}const G="test_config.json";let mn;function x(){return mn===void 0&&(mn=Sn.resolve(".test_auth.json")),mn}function Sr(){let a={};if(W.existsSync(G)&&(a=JSON.parse(W.readFileSync(G,{encoding:"utf-8"}))),process.env.PL_ADDRESS!==void 0&&(a.address=process.env.PL_ADDRESS),process.env.PL_TEST_USER!==void 0&&(a.test_user=process.env.PL_TEST_USER),process.env.PL_TEST_PASSWORD!==void 0&&(a.test_password=process.env.PL_TEST_PASSWORD),process.env.PL_TEST_PROXY!==void 0&&(a.test_proxy=process.env.PL_TEST_PROXY),a.address===void 0)throw new Error(`can't resolve platform address (checked ${G} file and PL_ADDRESS environment var)`);return a}function ur(a){return e=>{const t=x(),r=x()+ye.randomUUID();W.writeFileSync(r,Buffer.from(JSON.stringify({conf:a,authInformation:e,expiration:V(e,24*60*60)})),"utf8"),W.renameSync(r,t)}}const dr=()=>{console.warn(`Removing: ${x()}`),W.rmSync(x())};async function nr(){const a=Sr();let e;if(W.existsSync(x()))try{const s=JSON.parse(W.readFileSync(x(),{encoding:"utf-8"}));s.conf.address===a.address&&s.conf.test_user===a.test_user&&s.conf.test_password===a.test_password&&s.expiration>Date.now()&&(e=s.authInformation)}catch{W.rmSync(x())}const t=J(a.address),r=new tr(t),n=await r.requireAuth();if(!n&&(a.test_user!==void 0||a.test_password!==void 0))throw new Error(`Server require no auth, but test user name or test password are provided via (${G}) or env variables: PL_TEST_USER and PL_TEST_PASSWORD`);if(n&&(a.test_user===void 0||a.test_password===void 0))throw new Error(`No auth information found in config (${G}) or env variables: PL_TEST_USER and PL_TEST_PASSWORD`);return e===void 0&&(n?e=await r.login(a.test_user,a.test_password):e={},ur(a)(e)),{conf:t,auth:{authInformation:e,onUpdate:ur(a),onAuthError:dr,onUpdateError:dr}}}async function Lu(a={}){const{conf:e,auth:t}=await nr();return new er({...e,...a},{auth:t})}async function $n(a){const{conf:e,auth:t}=await nr();if(a!==void 0&&e.alternativeRoot!==void 0)throw new Error("test pl address configured with alternative root");return await Y.init({...e,alternativeRoot:a},t)}async function Fu(a){const e=`test_${Date.now()}_${ye.randomUUID()}`;let t=U;try{const r=await $n(e);t=r.clientRoot;const n=await a(r);return await(await $n()).deleteAlternativeRoot(e),n}catch(r){throw console.log(`ALTERNATIVE ROOT: ${e} (${z(t)})`),new Error(r.message,{cause:r})}}const Wu=Object.freeze(Object.defineProperty({__proto__:null,getTestClient:$n,getTestClientConf:nr,getTestConfig:Sr,getTestLLClient:Lu,withTempRoot:Fu},Symbol.toStringTag,{value:"Module"}));exports.AnonymousAuthInformation=au;exports.ContinuePolling=D;exports.DEFAULT_AUTH_MAX_REFRESH=Fn;exports.DEFAULT_MAX_CACHE_BYTES=Wn;exports.DEFAULT_REQUEST_TIMEOUT=_n;exports.DEFAULT_RETRY_BACKOFF_ALGORITHM=Un;exports.DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER=Mn;exports.DEFAULT_RETRY_INITIAL_DELAY=Nn;exports.DEFAULT_RETRY_JITTER=En;exports.DEFAULT_RETRY_LINEAR_BACKOFF_STEP=xn;exports.DEFAULT_RETRY_MAX_ATTEMPTS=Bn;exports.DEFAULT_TOKEN_TTL_SECONDS=Ln;exports.DEFAULT_TX_TIMEOUT=An;exports.DefaultFinalResourceDataPredicate=Nr;exports.DefaultPollingRetryOptions=$r;exports.DisconnectedError=Gn;exports.MaxLocalId=Dn;exports.MaxTxId=ge;exports.NullResourceId=U;exports.Pl=ou;exports.PlClient=Y;exports.PlError=jn;exports.PlErrorCodeNotFound=Te;exports.PlTransaction=fe;exports.PollResourceAccessor=xr;exports.PollTxAccessor=Er;exports.RecoverablePlError=ke;exports.TestHelpers=Wu;exports.TxCommitConflict=zn;exports.UnauthenticatedError=me;exports.UnauthenticatedPlClient=tr;exports.UnrecoverablePlError=Tr;exports.addRTypeToMetadata=hu;exports.bigintToResourceId=li;exports.checkLocalityOfResourceId=si;exports.createGlobalResourceId=hr;exports.createLocalResourceId=On;exports.defaultPlClient=Ru;exports.ensureResourceIdNotNull=ue;exports.expirationFromAuthInformation=pu;exports.extractBasicResourceData=bn;exports.extractTxId=qn;exports.field=we;exports.getField=Pn;exports.inferAuthRefreshTime=V;exports.isAnyResourceId=Yr;exports.isConnectionProblem=Kn;exports.isField=jc;exports.isFieldRef=Jn;exports.isLocalResourceId=N;exports.isNotFoundError=Hn;exports.isNotNullResourceId=B;exports.isNullResourceId=A;exports.isResource=br;exports.isResourceRef=M;exports.isRootResourceId=Rn;exports.isTimeoutOrCancelError=vn;exports.isUnauthenticated=Vn;exports.jsonToData=ei;exports.plAddressToConfig=J;exports.poll=Au;exports.resDataToJson=ti;exports.resourceIdFromString=ai;exports.resourceIdToString=z;exports.resourceType=Xr;exports.resourceTypeToString=Zr;exports.resourceTypesEqual=Qr;exports.rethrowMeaningfulError=kr;exports.stringifyWithResourceId=ci;exports.throwPlNotFoundError=gr;exports.toFieldId=R;exports.toGlobalFieldId=Hc;exports.toGlobalResourceId=Pr;exports.toResourceId=k;exports.tryGetFileConfig=Mr;exports.valErr=Iu;
|
|
1
|
+
"use strict";var Cr=Object.defineProperty;var Dr=(a,e,t)=>e in a?Cr(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var p=(a,e,t)=>Dr(a,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@milaboratories/ts-helpers"),h=require("@protobuf-ts/runtime-rpc"),i=require("@protobuf-ts/runtime"),E=require("@grpc/grpc-js"),Or=require("@protobuf-ts/grpc-transport"),qr=require("denque"),sr=require("undici"),Kr=require("node:dns/promises"),Vr=require("cacheable-lookup"),ye=require("node:crypto"),vr=require("node:timers/promises"),jr=require("lru-cache"),F=require("node:fs"),Hr=require("canonicalize"),Gr=require("yaml"),Jr=require("node:os"),zr=require("node:path");function he(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const wn=he(vr),W=he(F),pr=he(Jr),Sn=he(zr),U=0n;function A(a){return a===U}function B(a){return a!==U}function ue(a){if(!B(a))throw new Error("null resource id");return a}function Yr(a){return a!==0n}function Xr(a,e){return{name:a,version:e}}function Zr(a){return`${a.name}:${a.version}`}function Qr(a,e){return a.name===e.name&&a.version===e.version}function bn(a){const{id:e,originalResourceId:t,kind:r,type:n,data:s,error:u,inputsLocked:l,outputsLocked:c,resourceReady:o,final:d}=a;return{id:e,originalResourceId:t,kind:r,type:n,data:s,error:u,inputsLocked:l,outputsLocked:c,resourceReady:o,final:d}}const ei=a=>Buffer.from(JSON.stringify(a)),ti=a=>JSON.parse(g.notEmpty(a.data).toString());function Pn(a,e){return g.notEmpty(a.fields.find(t=>t.name===e))}const Cn=1n<<63n,fr=1n<<62n,ni=0x3fffffffffffffffn,yr=24n,Dn=16777215,ge=4294967295,ri=BigInt(ge),ii=BigInt(Dn);function Rn(a){return(a&Cn)!==0n}function N(a){return(a&fr)!==0n}function On(a,e,t){if(e>Dn||t>ge||e<0||t<=0)throw Error("wrong local id or tx id");return(a?Cn:0n)|fr|BigInt(e)|BigInt(t)<<yr}function hr(a,e){return(a?Cn:0n)|e}function qn(a){return Number(a>>yr&ri)}function si(a,e){if(N(a)&&qn(a)!==e)throw Error("local id from another transaction, globalize id before leaking it from the transaction")}function z(a){return A(a)?"XX:0x0":N(a)?(Rn(a)?"R":"N")+"L:0x"+(ii&a).toString(16)+"[0x"+qn(a).toString(16)+"]":(Rn(a)?"R":"N")+"G:0x"+(ni&a).toString(16)}const oi=/^(?:(?<xx>XX)|(?<rn>[XRN])(?<lg>[XLG])):0x(?<rid>[0-9a-fA-F]+)(?:\[0x(?<txid>[0-9a-fA-F]+)])?$/;function ai(a){const e=a.match(oi);if(e===null)return;const{xx:t,rn:r,lg:n,rid:s,txid:u}=e.groups;return t?U:n==="L"?On(r==="R",Number.parseInt(s,16),Number.parseInt(u,16)):hr(r==="R",BigInt("0x"+s))}function li(a){if(N(a))throw new Error(`Local resource id: ${z(a)}`);if(A(a))throw new Error("Null resource id.");return a}function ci(a){return JSON.stringify(a,(e,t)=>typeof t=="bigint"?z(t):t)}class ui extends i.MessageType{constructor(){super("google.protobuf.Duration",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}internalJsonWrite(e,t){let r=i.PbLong.from(e.seconds).toNumber();if(r>315576e6||r<-315576e6)throw new Error("Duration value out of range.");let n=e.seconds.toString();if(r===0&&e.nanos<0&&(n="-"+n),e.nanos!==0){let s=Math.abs(e.nanos).toString();s="0".repeat(9-s.length)+s,s.substring(3)==="000000"?s=s.substring(0,3):s.substring(6)==="000"&&(s=s.substring(0,6)),n+="."+s}return n+"s"}internalJsonRead(e,t,r){if(typeof e!="string")throw new Error("Unable to parse Duration from JSON "+i.typeofJsonValue(e)+". Expected string.");let n=e.match(/^(-?)([0-9]+)(?:\.([0-9]+))?s/);if(n===null)throw new Error("Unable to parse Duration from JSON string. Invalid format.");r||(r=this.create());let[,s,u,l]=n,c=i.PbLong.from(s+u);if(c.toNumber()>315576e6||c.toNumber()<-315576e6)throw new Error("Unable to parse Duration from JSON string. Value out of range.");if(r.seconds=c.toBigInt(),typeof l=="string"){let o=s+l+"0".repeat(9-l.length);r.nanos=parseInt(o)}return r}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.seconds=0n,t.nanos=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.seconds=e.int64().toBigInt();break;case 2:s.nanos=e.int32();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.seconds!==0n&&t.tag(1,i.WireType.Varint).int64(e.seconds),e.nanos!==0&&t.tag(2,i.WireType.Varint).int32(e.nanos);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const w=new ui;var T=(a=>(a[a.INVALID=0]="INVALID",a[a.INPUT=1]="INPUT",a[a.OUTPUT=2]="OUTPUT",a[a.SERVICE=6]="SERVICE",a[a.ONE_TIME_WRITABLE=4]="ONE_TIME_WRITABLE",a[a.DYNAMIC=3]="DYNAMIC",a[a.MULTIPLE_TIMES_WRITABLE=5]="MULTIPLE_TIMES_WRITABLE",a))(T||{});class di extends i.MessageType{constructor(){super("MiLaboratories.PL.Base.ResourceType",[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.name="",t.version="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.name=e.string();break;case 2:s.version=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.name!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.name),e.version!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.version);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const f=new di;class pi extends i.MessageType{constructor(){super("MiLaboratories.PL.Base.FieldRef",[{no:2,name:"resource_id",kind:"scalar",T:4,L:0},{no:3,name:"field_name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.fieldName="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.resourceId=e.uint64().toBigInt();break;case 3:s.fieldName=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.resourceId),e.fieldName!==""&&t.tag(3,i.WireType.LengthDelimited).string(e.fieldName);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const y=new pi;class fi extends i.MessageType{constructor(){super("MiLaboratories.PL.RTypes.Number",[{no:1,name:"int32",kind:"scalar",oneof:"value",T:5},{no:2,name:"uint32",kind:"scalar",oneof:"value",T:13},{no:3,name:"int64",kind:"scalar",oneof:"value",T:3,L:0},{no:4,name:"uint64",kind:"scalar",oneof:"value",T:4,L:0},{no:5,name:"float",kind:"scalar",oneof:"value",T:2},{no:6,name:"double",kind:"scalar",oneof:"value",T:1}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.value={oneofKind:void 0},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.value={oneofKind:"int32",int32:e.int32()};break;case 2:s.value={oneofKind:"uint32",uint32:e.uint32()};break;case 3:s.value={oneofKind:"int64",int64:e.int64().toBigInt()};break;case 4:s.value={oneofKind:"uint64",uint64:e.uint64().toBigInt()};break;case 5:s.value={oneofKind:"float",float:e.float()};break;case 6:s.value={oneofKind:"double",double:e.double()};break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.value.oneofKind==="int32"&&t.tag(1,i.WireType.Varint).int32(e.value.int32),e.value.oneofKind==="uint32"&&t.tag(2,i.WireType.Varint).uint32(e.value.uint32),e.value.oneofKind==="int64"&&t.tag(3,i.WireType.Varint).int64(e.value.int64),e.value.oneofKind==="uint64"&&t.tag(4,i.WireType.Varint).uint64(e.value.uint64),e.value.oneofKind==="float"&&t.tag(5,i.WireType.Bit32).float(e.value.float),e.value.oneofKind==="double"&&t.tag(6,i.WireType.Bit64).double(e.value.double);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new fi;class yi extends i.MessageType{constructor(){super("MiLaboratories.PL.RTypes.ControllerSettings",[{no:1,name:"type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.type);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new yi;class hi extends i.MessageType{constructor(){super("MiLaboratories.PL.RTypes.SubscriptionSettings",[{no:1,name:"blocking",kind:"scalar",T:8},{no:2,name:"randomizer",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.blocking=!1,t.randomizer=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.blocking=e.bool();break;case 2:s.randomizer=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.blocking!==!1&&t.tag(1,i.WireType.Varint).bool(e.blocking),e.randomizer!==0n&&t.tag(2,i.WireType.Varint).uint64(e.randomizer);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new hi;class gi extends i.MessageType{constructor(){super("MiLaboratories.PL.RTypes.NotificationFilter",[{no:1,name:"resource_type",kind:"message",oneof:"resourceFilter",T:()=>f},{no:7,name:"resource_id",kind:"scalar",oneof:"resourceFilter",T:4,L:0},{no:8,name:"event_filter",kind:"message",T:()=>Pe},{no:9,name:"payload",kind:"message",T:()=>O}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceFilter={oneofKind:void 0},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceFilter={oneofKind:"resourceType",resourceType:f.internalBinaryRead(e,e.uint32(),r,s.resourceFilter.resourceType)};break;case 7:s.resourceFilter={oneofKind:"resourceId",resourceId:e.uint64().toBigInt()};break;case 8:s.eventFilter=Pe.internalBinaryRead(e,e.uint32(),r,s.eventFilter);break;case 9:s.payload=O.internalBinaryRead(e,e.uint32(),r,s.payload);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceFilter.oneofKind==="resourceType"&&f.internalBinaryWrite(e.resourceFilter.resourceType,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.resourceFilter.oneofKind==="resourceId"&&t.tag(7,i.WireType.Varint).uint64(e.resourceFilter.resourceId),e.eventFilter&&Pe.internalBinaryWrite(e.eventFilter,t.tag(8,i.WireType.LengthDelimited).fork(),r).join(),e.payload&&O.internalBinaryWrite(e.payload,t.tag(9,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const b=new gi;class Ti extends i.MessageType{constructor(){super("MiLaboratories.PL.RTypes.NotificationFilter.EventFilter",[{no:1,name:"all",kind:"scalar",opt:!0,T:8},{no:2,name:"resource_created",kind:"scalar",opt:!0,T:8},{no:3,name:"resource_deleted",kind:"scalar",opt:!0,T:8},{no:5,name:"resource_ready",kind:"scalar",opt:!0,T:8},{no:6,name:"resource_duplicate",kind:"scalar",opt:!0,T:8},{no:16,name:"resource_error",kind:"scalar",opt:!0,T:8},{no:13,name:"inputs_locked",kind:"scalar",opt:!0,T:8},{no:14,name:"outputs_locked",kind:"scalar",opt:!0,T:8},{no:12,name:"field_created",kind:"scalar",opt:!0,T:8},{no:17,name:"field_got_error",kind:"scalar",opt:!0,T:8},{no:7,name:"input_set",kind:"scalar",opt:!0,T:8},{no:8,name:"all_inputs_set",kind:"scalar",opt:!0,T:8},{no:9,name:"output_set",kind:"scalar",opt:!0,T:8},{no:10,name:"all_outputs_set",kind:"scalar",opt:!0,T:8},{no:15,name:"generic_otw_set",kind:"scalar",opt:!0,T:8},{no:11,name:"dynamic_changed",kind:"scalar",opt:!0,T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.all=e.bool();break;case 2:s.resourceCreated=e.bool();break;case 3:s.resourceDeleted=e.bool();break;case 5:s.resourceReady=e.bool();break;case 6:s.resourceDuplicate=e.bool();break;case 16:s.resourceError=e.bool();break;case 13:s.inputsLocked=e.bool();break;case 14:s.outputsLocked=e.bool();break;case 12:s.fieldCreated=e.bool();break;case 17:s.fieldGotError=e.bool();break;case 7:s.inputSet=e.bool();break;case 8:s.allInputsSet=e.bool();break;case 9:s.outputSet=e.bool();break;case 10:s.allOutputsSet=e.bool();break;case 15:s.genericOtwSet=e.bool();break;case 11:s.dynamicChanged=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.all!==void 0&&t.tag(1,i.WireType.Varint).bool(e.all),e.resourceCreated!==void 0&&t.tag(2,i.WireType.Varint).bool(e.resourceCreated),e.resourceDeleted!==void 0&&t.tag(3,i.WireType.Varint).bool(e.resourceDeleted),e.resourceReady!==void 0&&t.tag(5,i.WireType.Varint).bool(e.resourceReady),e.resourceDuplicate!==void 0&&t.tag(6,i.WireType.Varint).bool(e.resourceDuplicate),e.resourceError!==void 0&&t.tag(16,i.WireType.Varint).bool(e.resourceError),e.inputsLocked!==void 0&&t.tag(13,i.WireType.Varint).bool(e.inputsLocked),e.outputsLocked!==void 0&&t.tag(14,i.WireType.Varint).bool(e.outputsLocked),e.fieldCreated!==void 0&&t.tag(12,i.WireType.Varint).bool(e.fieldCreated),e.fieldGotError!==void 0&&t.tag(17,i.WireType.Varint).bool(e.fieldGotError),e.inputSet!==void 0&&t.tag(7,i.WireType.Varint).bool(e.inputSet),e.allInputsSet!==void 0&&t.tag(8,i.WireType.Varint).bool(e.allInputsSet),e.outputSet!==void 0&&t.tag(9,i.WireType.Varint).bool(e.outputSet),e.allOutputsSet!==void 0&&t.tag(10,i.WireType.Varint).bool(e.allOutputsSet),e.genericOtwSet!==void 0&&t.tag(15,i.WireType.Varint).bool(e.genericOtwSet),e.dynamicChanged!==void 0&&t.tag(11,i.WireType.Varint).bool(e.dynamicChanged);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Pe=new Ti;class ki extends i.MessageType{constructor(){super("MiLaboratories.PL.RTypes.NotificationFilter.Payload",[{no:1,name:"values",kind:"map",K:9,V:{kind:"scalar",T:12}}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.values={},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:this.binaryReadMap1(s.values,e,r);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap1(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=t.bytes();break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.RTypes.NotificationFilter.Payload.values")}}e[u??""]=l??new Uint8Array(0)}internalBinaryWrite(e,t,r){for(let s of globalThis.Object.keys(e.values))t.tag(1,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s).tag(2,i.WireType.LengthDelimited).bytes(e.values[s]).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const O=new ki;class mi extends i.MessageType{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const e=this.create(),t=Date.now();return e.seconds=i.PbLong.from(Math.floor(t/1e3)).toBigInt(),e.nanos=t%1e3*1e6,e}toDate(e){return new Date(i.PbLong.from(e.seconds).toNumber()*1e3+Math.ceil(e.nanos/1e6))}fromDate(e){const t=this.create(),r=e.getTime();return t.seconds=i.PbLong.from(Math.floor(r/1e3)).toBigInt(),t.nanos=r%1e3*1e6,t}internalJsonWrite(e,t){let r=i.PbLong.from(e.seconds).toNumber()*1e3;if(r<Date.parse("0001-01-01T00:00:00Z")||r>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(e.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let n="Z";if(e.nanos>0){let s=(e.nanos+1e9).toString().substring(1);s.substring(3)==="000000"?n="."+s.substring(0,3)+"Z":s.substring(6)==="000"?n="."+s.substring(0,6)+"Z":n="."+s+"Z"}return new Date(r).toISOString().replace(".000Z",n)}internalJsonRead(e,t,r){if(typeof e!="string")throw new Error("Unable to parse Timestamp from JSON "+i.typeofJsonValue(e)+".");let n=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!n)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let s=Date.parse(n[1]+"-"+n[2]+"-"+n[3]+"T"+n[4]+":"+n[5]+":"+n[6]+(n[8]?n[8]:"Z"));if(Number.isNaN(s))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return r||(r=this.create()),r.seconds=i.PbLong.from(s/1e3).toBigInt(),r.nanos=0,n[7]&&(r.nanos=parseInt("1"+n[7]+"0".repeat(9-n[7].length))-1e9),r}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.seconds=0n,t.nanos=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.seconds=e.int64().toBigInt();break;case 2:s.nanos=e.int32();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.seconds!==0n&&t.tag(1,i.WireType.Varint).int64(e.seconds),e.nanos!==0&&t.tag(2,i.WireType.Varint).int32(e.nanos);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const $=new mi;var de=(a=>(a[a.INVALID=0]="INVALID",a[a.STRUCTURAL=1]="STRUCTURAL",a[a.VALUE=2]="VALUE",a))(de||{}),j=(a=>(a[a.INVALID=0]="INVALID",a[a.EMPTY=1]="EMPTY",a[a.ASSIGNED=2]="ASSIGNED",a[a.RESOLVED=3]="RESOLVED",a))(j||{});class wi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Tx",[{no:1,name:"is_valid",kind:"scalar",T:8},{no:2,name:"id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.isValid=!1,t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.isValid=e.bool();break;case 2:s.id=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.isValid!==!1&&t.tag(1,i.WireType.Varint).bool(e.isValid),e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Re=new wi;class bi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Resource",[{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"kind",kind:"enum",T:()=>["MiLaboratories.PL.API.Resource.Kind",de,"KIND_"]},{no:4,name:"type",kind:"message",T:()=>f},{no:5,name:"data",kind:"scalar",T:12},{no:6,name:"fields",kind:"message",repeat:1,T:()=>m},{no:7,name:"has_errors",kind:"scalar",T:8},{no:8,name:"inputs_locked",kind:"scalar",T:8},{no:9,name:"outputs_locked",kind:"scalar",T:8},{no:14,name:"resource_ready",kind:"scalar",T:8},{no:15,name:"is_final",kind:"scalar",T:8},{no:10,name:"original_resource_id",kind:"scalar",T:4,L:0},{no:11,name:"parent_resource_id",kind:"scalar",T:4,L:0},{no:12,name:"created_time",kind:"message",T:()=>$},{no:13,name:"deleted_time",kind:"message",T:()=>$}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,t.kind=0,t.data=new Uint8Array(0),t.fields=[],t.hasErrors=!1,t.inputsLocked=!1,t.outputsLocked=!1,t.resourceReady=!1,t.isFinal=!1,t.originalResourceId=0n,t.parentResourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.id=e.uint64().toBigInt();break;case 3:s.kind=e.int32();break;case 4:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 5:s.data=e.bytes();break;case 6:s.fields.push(m.internalBinaryRead(e,e.uint32(),r));break;case 7:s.hasErrors=e.bool();break;case 8:s.inputsLocked=e.bool();break;case 9:s.outputsLocked=e.bool();break;case 14:s.resourceReady=e.bool();break;case 15:s.isFinal=e.bool();break;case 10:s.originalResourceId=e.uint64().toBigInt();break;case 11:s.parentResourceId=e.uint64().toBigInt();break;case 12:s.createdTime=$.internalBinaryRead(e,e.uint32(),r,s.createdTime);break;case 13:s.deletedTime=$.internalBinaryRead(e,e.uint32(),r,s.deletedTime);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.kind!==0&&t.tag(3,i.WireType.Varint).int32(e.kind),e.type&&f.internalBinaryWrite(e.type,t.tag(4,i.WireType.LengthDelimited).fork(),r).join(),e.data.length&&t.tag(5,i.WireType.LengthDelimited).bytes(e.data);for(let s=0;s<e.fields.length;s++)m.internalBinaryWrite(e.fields[s],t.tag(6,i.WireType.LengthDelimited).fork(),r).join();e.hasErrors!==!1&&t.tag(7,i.WireType.Varint).bool(e.hasErrors),e.inputsLocked!==!1&&t.tag(8,i.WireType.Varint).bool(e.inputsLocked),e.outputsLocked!==!1&&t.tag(9,i.WireType.Varint).bool(e.outputsLocked),e.resourceReady!==!1&&t.tag(14,i.WireType.Varint).bool(e.resourceReady),e.isFinal!==!1&&t.tag(15,i.WireType.Varint).bool(e.isFinal),e.originalResourceId!==0n&&t.tag(10,i.WireType.Varint).uint64(e.originalResourceId),e.parentResourceId!==0n&&t.tag(11,i.WireType.Varint).uint64(e.parentResourceId),e.createdTime&&$.internalBinaryWrite(e.createdTime,t.tag(12,i.WireType.LengthDelimited).fork(),r).join(),e.deletedTime&&$.internalBinaryWrite(e.deletedTime,t.tag(13,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const I=new bi;class Pi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Field",[{no:1,name:"id",kind:"message",T:()=>y},{no:2,name:"type",kind:"enum",T:()=>["MiLaboratories.PL.Base.FieldType",T]},{no:5,name:"value",kind:"scalar",T:4,L:0},{no:7,name:"value_status",kind:"enum",T:()=>["MiLaboratories.PL.API.Field.ValueStatus",j]},{no:8,name:"value_is_final",kind:"scalar",T:8},{no:6,name:"error",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type=0,t.value=0n,t.valueStatus=0,t.valueIsFinal=!1,t.error=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=y.internalBinaryRead(e,e.uint32(),r,s.id);break;case 2:s.type=e.int32();break;case 5:s.value=e.uint64().toBigInt();break;case 7:s.valueStatus=e.int32();break;case 8:s.valueIsFinal=e.bool();break;case 6:s.error=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id&&y.internalBinaryWrite(e.id,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.type!==0&&t.tag(2,i.WireType.Varint).int32(e.type),e.value!==0n&&t.tag(5,i.WireType.Varint).uint64(e.value),e.valueStatus!==0&&t.tag(7,i.WireType.Varint).int32(e.valueStatus),e.valueIsFinal!==!1&&t.tag(8,i.WireType.Varint).bool(e.valueIsFinal),e.error!==0n&&t.tag(6,i.WireType.Varint).uint64(e.error);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const m=new Pi;class Ri extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Notification",[{no:1,name:"subscription_id",kind:"scalar",T:4,L:0},{no:2,name:"event_id",kind:"scalar",T:4,L:0},{no:3,name:"resource_id",kind:"scalar",T:4,L:0},{no:4,name:"resource_type",kind:"message",T:()=>f},{no:5,name:"events",kind:"message",T:()=>Ie},{no:6,name:"field_changes",kind:"map",K:9,V:{kind:"message",T:()=>X}},{no:7,name:"payload",kind:"message",T:()=>O},{no:8,name:"filter_name",kind:"scalar",T:9},{no:9,name:"tx_span",kind:"message",T:()=>_e}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptionId=0n,t.eventId=0n,t.resourceId=0n,t.fieldChanges={},t.filterName="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptionId=e.uint64().toBigInt();break;case 2:s.eventId=e.uint64().toBigInt();break;case 3:s.resourceId=e.uint64().toBigInt();break;case 4:s.resourceType=f.internalBinaryRead(e,e.uint32(),r,s.resourceType);break;case 5:s.events=Ie.internalBinaryRead(e,e.uint32(),r,s.events);break;case 6:this.binaryReadMap6(s.fieldChanges,e,r);break;case 7:s.payload=O.internalBinaryRead(e,e.uint32(),r,s.payload);break;case 8:s.filterName=e.string();break;case 9:s.txSpan=_e.internalBinaryRead(e,e.uint32(),r,s.txSpan);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap6(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=X.internalBinaryRead(t,t.uint32(),r);break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.Notification.field_changes")}}e[u??""]=l??X.create()}internalBinaryWrite(e,t,r){e.subscriptionId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscriptionId),e.eventId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.eventId),e.resourceId!==0n&&t.tag(3,i.WireType.Varint).uint64(e.resourceId),e.resourceType&&f.internalBinaryWrite(e.resourceType,t.tag(4,i.WireType.LengthDelimited).fork(),r).join(),e.events&&Ie.internalBinaryWrite(e.events,t.tag(5,i.WireType.LengthDelimited).fork(),r).join();for(let s of globalThis.Object.keys(e.fieldChanges))t.tag(6,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s),t.tag(2,i.WireType.LengthDelimited).fork(),X.internalBinaryWrite(e.fieldChanges[s],t,r),t.join().join();e.payload&&O.internalBinaryWrite(e.payload,t.tag(7,i.WireType.LengthDelimited).fork(),r).join(),e.filterName!==""&&t.tag(8,i.WireType.LengthDelimited).string(e.filterName),e.txSpan&&_e.internalBinaryWrite(e.txSpan,t.tag(9,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const q=new Ri;class Ii extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Notification.Events",[{no:1,name:"resource_created",kind:"scalar",T:8},{no:2,name:"resource_deleted",kind:"scalar",T:8},{no:4,name:"resource_ready",kind:"scalar",T:8},{no:5,name:"resource_duplicate",kind:"scalar",T:8},{no:15,name:"resource_error",kind:"scalar",T:8},{no:12,name:"inputs_locked",kind:"scalar",T:8},{no:13,name:"outputs_locked",kind:"scalar",T:8},{no:11,name:"field_created",kind:"scalar",T:8},{no:16,name:"field_got_error",kind:"scalar",T:8},{no:6,name:"input_set",kind:"scalar",T:8},{no:7,name:"all_inputs_set",kind:"scalar",T:8},{no:8,name:"output_set",kind:"scalar",T:8},{no:9,name:"all_outputs_set",kind:"scalar",T:8},{no:14,name:"generic_otw_set",kind:"scalar",T:8},{no:10,name:"dynamic_changed",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceCreated=!1,t.resourceDeleted=!1,t.resourceReady=!1,t.resourceDuplicate=!1,t.resourceError=!1,t.inputsLocked=!1,t.outputsLocked=!1,t.fieldCreated=!1,t.fieldGotError=!1,t.inputSet=!1,t.allInputsSet=!1,t.outputSet=!1,t.allOutputsSet=!1,t.genericOtwSet=!1,t.dynamicChanged=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceCreated=e.bool();break;case 2:s.resourceDeleted=e.bool();break;case 4:s.resourceReady=e.bool();break;case 5:s.resourceDuplicate=e.bool();break;case 15:s.resourceError=e.bool();break;case 12:s.inputsLocked=e.bool();break;case 13:s.outputsLocked=e.bool();break;case 11:s.fieldCreated=e.bool();break;case 16:s.fieldGotError=e.bool();break;case 6:s.inputSet=e.bool();break;case 7:s.allInputsSet=e.bool();break;case 8:s.outputSet=e.bool();break;case 9:s.allOutputsSet=e.bool();break;case 14:s.genericOtwSet=e.bool();break;case 10:s.dynamicChanged=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceCreated!==!1&&t.tag(1,i.WireType.Varint).bool(e.resourceCreated),e.resourceDeleted!==!1&&t.tag(2,i.WireType.Varint).bool(e.resourceDeleted),e.resourceReady!==!1&&t.tag(4,i.WireType.Varint).bool(e.resourceReady),e.resourceDuplicate!==!1&&t.tag(5,i.WireType.Varint).bool(e.resourceDuplicate),e.resourceError!==!1&&t.tag(15,i.WireType.Varint).bool(e.resourceError),e.inputsLocked!==!1&&t.tag(12,i.WireType.Varint).bool(e.inputsLocked),e.outputsLocked!==!1&&t.tag(13,i.WireType.Varint).bool(e.outputsLocked),e.fieldCreated!==!1&&t.tag(11,i.WireType.Varint).bool(e.fieldCreated),e.fieldGotError!==!1&&t.tag(16,i.WireType.Varint).bool(e.fieldGotError),e.inputSet!==!1&&t.tag(6,i.WireType.Varint).bool(e.inputSet),e.allInputsSet!==!1&&t.tag(7,i.WireType.Varint).bool(e.allInputsSet),e.outputSet!==!1&&t.tag(8,i.WireType.Varint).bool(e.outputSet),e.allOutputsSet!==!1&&t.tag(9,i.WireType.Varint).bool(e.allOutputsSet),e.genericOtwSet!==!1&&t.tag(14,i.WireType.Varint).bool(e.genericOtwSet),e.dynamicChanged!==!1&&t.tag(10,i.WireType.Varint).bool(e.dynamicChanged);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ie=new Ii;class _i extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Notification.FieldChange",[{no:1,name:"old",kind:"message",T:()=>m},{no:2,name:"new",kind:"message",T:()=>m}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.old=m.internalBinaryRead(e,e.uint32(),r,s.old);break;case 2:s.new=m.internalBinaryRead(e,e.uint32(),r,s.new);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.old&&m.internalBinaryWrite(e.old,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.new&&m.internalBinaryWrite(e.new,t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const X=new _i;class Ai extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SpanInfo",[{no:1,name:"path",kind:"scalar",T:9},{no:2,name:"carrier",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.path="",t.carrier={},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.path=e.string();break;case 2:this.binaryReadMap2(s.carrier,e,r);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap2(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=t.string();break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.SpanInfo.carrier")}}e[u??""]=l??""}internalBinaryWrite(e,t,r){e.path!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.path);for(let s of globalThis.Object.keys(e.carrier))t.tag(2,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s).tag(2,i.WireType.LengthDelimited).string(e.carrier[s]).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const _e=new Ai;class Li extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Subscription",[{no:1,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"blocking",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,t.blocking=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint64().toBigInt();break;case 3:s.blocking=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(1,i.WireType.Varint).uint64(e.id),e.blocking!==!1&&t.tag(3,i.WireType.Varint).bool(e.blocking);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ae=new Li;class Fi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.Controller",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"subscriptionID",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.id=0n,t.subscriptionID=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=e.string();break;case 2:s.id=e.uint64().toBigInt();break;case 3:s.subscriptionID=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.type),e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.subscriptionID!==0n&&t.tag(3,i.WireType.Varint).uint64(e.subscriptionID);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Le=new Fi;class Wi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceSchema",[{no:1,name:"type",kind:"message",T:()=>f},{no:2,name:"fields",kind:"message",repeat:1,T:()=>Fe}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.fields=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 2:s.fields.push(Fe.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type&&f.internalBinaryWrite(e.type,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();for(let s=0;s<e.fields.length;s++)Fe.internalBinaryWrite(e.fields[s],t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const K=new Wi;class Ui extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldSchema",[{no:1,name:"type",kind:"enum",T:()=>["MiLaboratories.PL.Base.FieldType",T]},{no:2,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type=0,t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=e.int32();break;case 2:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type!==0&&t.tag(1,i.WireType.Varint).int32(e.type),e.name!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Fe=new Ui;class Bi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPIFeature",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"feature_name",kind:"scalar",T:9},{no:3,name:"resource_type",kind:"message",T:()=>f},{no:4,name:"endpoint",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.featureName="",t.endpoint="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:s.featureName=e.string();break;case 3:s.resourceType=f.internalBinaryRead(e,e.uint32(),r,s.resourceType);break;case 4:s.endpoint=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType),e.featureName!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.featureName),e.resourceType&&f.internalBinaryWrite(e.resourceType,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.endpoint!==""&&t.tag(4,i.WireType.LengthDelimited).string(e.endpoint);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const We=new Bi;class Ni extends i.MessageType{constructor(){super("google.protobuf.Any",[{no:1,name:"type_url",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:12}])}pack(e,t){return{typeUrl:this.typeNameToUrl(t.typeName),value:t.toBinary(e)}}unpack(e,t,r){if(!this.contains(e,t))throw new Error("Cannot unpack google.protobuf.Any with typeUrl '"+e.typeUrl+"' as "+t.typeName+".");return t.fromBinary(e.value,r)}contains(e,t){if(!e.typeUrl.length)return!1;let r=typeof t=="string"?t:t.typeName,n=this.typeUrlToName(e.typeUrl);return r===n}internalJsonWrite(e,t){var c;if(e.typeUrl==="")return{};let r=this.typeUrlToName(e.typeUrl),n=i.jsonWriteOptions(t),s=(c=n.typeRegistry)==null?void 0:c.find(o=>o.typeName===r);if(!s)throw new globalThis.Error("Unable to convert google.protobuf.Any with typeUrl '"+e.typeUrl+"' to JSON. The specified type "+r+" is not available in the type registry.");let u=s.fromBinary(e.value,{readUnknownField:!1}),l=s.internalJsonWrite(u,n);return(r.startsWith("google.protobuf.")||!i.isJsonObject(l))&&(l={value:l}),l["@type"]=e.typeUrl,l}internalJsonRead(e,t,r){var l;if(!i.isJsonObject(e))throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON "+i.typeofJsonValue(e)+".");if(typeof e["@type"]!="string"||e["@type"]=="")return this.create();let n=this.typeUrlToName(e["@type"]),s=(l=t==null?void 0:t.typeRegistry)==null?void 0:l.find(c=>c.typeName==n);if(!s)throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON. The specified type "+n+" is not available in the type registry.");let u;if(n.startsWith("google.protobuf.")&&e.hasOwnProperty("value"))u=s.fromJson(e.value,t);else{let c=Object.assign({},e);delete c["@type"],u=s.fromJson(c,t)}return r===void 0&&(r=this.create()),r.typeUrl=e["@type"],r.value=s.toBinary(u),r}typeNameToUrl(e){if(!e.length)throw new Error("invalid type name: "+e);return"type.googleapis.com/"+e}typeUrlToName(e){if(!e.length)throw new Error("invalid type url: "+e);let t=e.lastIndexOf("/"),r=t>0?e.substring(t+1):e;if(!r.length)throw new Error("invalid type url: "+e);return r}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.typeUrl="",t.value=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.typeUrl=e.string();break;case 2:s.value=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.typeUrl!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.typeUrl),e.value.length&&t.tag(2,i.WireType.LengthDelimited).bytes(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ue=new Ni;class Mi extends i.MessageType{constructor(){super("google.rpc.Status",[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"details",kind:"message",repeat:1,T:()=>Ue}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.code=0,t.message="",t.details=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.code=e.int32();break;case 2:s.message=e.string();break;case 3:s.details.push(Ue.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.code!==0&&t.tag(1,i.WireType.Varint).int32(e.code),e.message!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.message);for(let s=0;s<e.details.length;s++)Ue.internalBinaryWrite(e.details[s],t.tag(3,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Be=new Mi;var pe=(a=>(a[a.INVALID=0]="INVALID",a[a.WRITABLE=1]="WRITABLE",a[a.NOT_WRITABLE=2]="NOT_WRITABLE",a))(pe||{});class xi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new xi;class Ei extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.ClientMessage",[{no:1,name:"request_id",kind:"scalar",T:13},{no:11,name:"tx_open",kind:"message",oneof:"request",T:()=>Me},{no:12,name:"tx_commit",kind:"message",oneof:"request",T:()=>Ee},{no:13,name:"tx_discard",kind:"message",oneof:"request",T:()=>Se},{no:58,name:"resource_create_root",kind:"message",oneof:"request",T:()=>dt},{no:57,name:"resource_remove",kind:"message",oneof:"request",T:()=>ft},{no:51,name:"resource_create_struct",kind:"message",oneof:"request",T:()=>De},{no:62,name:"resource_create_ephemeral",kind:"message",oneof:"request",T:()=>qe},{no:52,name:"resource_create_value",kind:"message",oneof:"request",T:()=>je},{no:63,name:"resource_get_value_id",kind:"message",oneof:"request",T:()=>Ge},{no:64,name:"resource_create_singleton",kind:"message",oneof:"request",T:()=>ze},{no:65,name:"resource_get_singleton",kind:"message",oneof:"request",T:()=>Xe},{no:59,name:"resource_create_child",kind:"message",oneof:"request",T:()=>Ve},{no:53,name:"resource_lock_inputs",kind:"message",oneof:"request",T:()=>Qe},{no:56,name:"resource_lock_outputs",kind:"message",oneof:"request",T:()=>tt},{no:54,name:"resource_exists",kind:"message",oneof:"request",T:()=>rt},{no:55,name:"resource_get",kind:"message",oneof:"request",T:()=>at},{no:61,name:"resource_set_error",kind:"message",oneof:"request",T:()=>st},{no:60,name:"resource_list_by_type",kind:"message",oneof:"request",T:()=>ct},{no:66,name:"resource_name_set",kind:"message",oneof:"request",T:()=>ht},{no:67,name:"resource_name_get",kind:"message",oneof:"request",T:()=>Tt},{no:68,name:"resource_name_exists",kind:"message",oneof:"request",T:()=>mt},{no:69,name:"resource_name_delete",kind:"message",oneof:"request",T:()=>bt},{no:101,name:"field_create",kind:"message",oneof:"request",T:()=>Rt},{no:107,name:"field_exists",kind:"message",oneof:"request",T:()=>_t},{no:102,name:"field_set",kind:"message",oneof:"request",T:()=>Lt},{no:105,name:"field_set_error",kind:"message",oneof:"request",T:()=>Wt},{no:103,name:"field_get",kind:"message",oneof:"request",T:()=>Bt},{no:104,name:"field_reset",kind:"message",oneof:"request",T:()=>Mt},{no:106,name:"field_remove",kind:"message",oneof:"request",T:()=>Et},{no:111,name:"subscription_create",kind:"message",oneof:"request",T:()=>qt},{no:112,name:"subscription_attach_filter",kind:"message",oneof:"request",T:()=>te},{no:113,name:"subscription_detach_filter",kind:"message",oneof:"request",T:()=>re},{no:115,name:"subscription_create_filter",kind:"message",oneof:"request",T:()=>Vt},{no:154,name:"notification_get",kind:"message",oneof:"request",T:()=>Q},{no:155,name:"notification_ack",kind:"message",oneof:"request",T:()=>St},{no:156,name:"notification_discard",kind:"message",oneof:"request",T:()=>Dt},{no:200,name:"resource_key_value_set",kind:"message",oneof:"request",T:()=>zt},{no:201,name:"resource_key_value_get",kind:"message",oneof:"request",T:()=>Xt},{no:202,name:"resource_key_value_get_if_exists",kind:"message",oneof:"request",T:()=>Qt},{no:203,name:"resource_key_value_set_flag",kind:"message",oneof:"request",T:()=>rn},{no:204,name:"resource_key_value_get_flag",kind:"message",oneof:"request",T:()=>S},{no:205,name:"resource_key_value_get_flag_if_exists",kind:"message",oneof:"request",T:()=>S},{no:206,name:"resource_key_value_delete",kind:"message",oneof:"request",T:()=>tn},{no:207,name:"resource_key_value_list",kind:"message",oneof:"request",T:()=>Ht},{no:250,name:"controller_key_value_set",kind:"message",oneof:"request",T:()=>on},{no:251,name:"controller_key_value_get",kind:"message",oneof:"request",T:()=>ln},{no:252,name:"controller_key_value_get_if_exists",kind:"message",oneof:"request",T:()=>un},{no:300,name:"cache_set_to_field",kind:"message",oneof:"request",T:()=>pn},{no:301,name:"cache_delete_expired_records",kind:"message",oneof:"request",T:()=>yn},{no:350,name:"controller_features_set",kind:"message",oneof:"request",T:()=>se},{no:351,name:"controller_features_clear",kind:"message",oneof:"request",T:()=>ae}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.requestId=0,t.request={oneofKind:void 0},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.requestId=e.uint32();break;case 11:s.request={oneofKind:"txOpen",txOpen:Me.internalBinaryRead(e,e.uint32(),r,s.request.txOpen)};break;case 12:s.request={oneofKind:"txCommit",txCommit:Ee.internalBinaryRead(e,e.uint32(),r,s.request.txCommit)};break;case 13:s.request={oneofKind:"txDiscard",txDiscard:Se.internalBinaryRead(e,e.uint32(),r,s.request.txDiscard)};break;case 58:s.request={oneofKind:"resourceCreateRoot",resourceCreateRoot:dt.internalBinaryRead(e,e.uint32(),r,s.request.resourceCreateRoot)};break;case 57:s.request={oneofKind:"resourceRemove",resourceRemove:ft.internalBinaryRead(e,e.uint32(),r,s.request.resourceRemove)};break;case 51:s.request={oneofKind:"resourceCreateStruct",resourceCreateStruct:De.internalBinaryRead(e,e.uint32(),r,s.request.resourceCreateStruct)};break;case 62:s.request={oneofKind:"resourceCreateEphemeral",resourceCreateEphemeral:qe.internalBinaryRead(e,e.uint32(),r,s.request.resourceCreateEphemeral)};break;case 52:s.request={oneofKind:"resourceCreateValue",resourceCreateValue:je.internalBinaryRead(e,e.uint32(),r,s.request.resourceCreateValue)};break;case 63:s.request={oneofKind:"resourceGetValueId",resourceGetValueId:Ge.internalBinaryRead(e,e.uint32(),r,s.request.resourceGetValueId)};break;case 64:s.request={oneofKind:"resourceCreateSingleton",resourceCreateSingleton:ze.internalBinaryRead(e,e.uint32(),r,s.request.resourceCreateSingleton)};break;case 65:s.request={oneofKind:"resourceGetSingleton",resourceGetSingleton:Xe.internalBinaryRead(e,e.uint32(),r,s.request.resourceGetSingleton)};break;case 59:s.request={oneofKind:"resourceCreateChild",resourceCreateChild:Ve.internalBinaryRead(e,e.uint32(),r,s.request.resourceCreateChild)};break;case 53:s.request={oneofKind:"resourceLockInputs",resourceLockInputs:Qe.internalBinaryRead(e,e.uint32(),r,s.request.resourceLockInputs)};break;case 56:s.request={oneofKind:"resourceLockOutputs",resourceLockOutputs:tt.internalBinaryRead(e,e.uint32(),r,s.request.resourceLockOutputs)};break;case 54:s.request={oneofKind:"resourceExists",resourceExists:rt.internalBinaryRead(e,e.uint32(),r,s.request.resourceExists)};break;case 55:s.request={oneofKind:"resourceGet",resourceGet:at.internalBinaryRead(e,e.uint32(),r,s.request.resourceGet)};break;case 61:s.request={oneofKind:"resourceSetError",resourceSetError:st.internalBinaryRead(e,e.uint32(),r,s.request.resourceSetError)};break;case 60:s.request={oneofKind:"resourceListByType",resourceListByType:ct.internalBinaryRead(e,e.uint32(),r,s.request.resourceListByType)};break;case 66:s.request={oneofKind:"resourceNameSet",resourceNameSet:ht.internalBinaryRead(e,e.uint32(),r,s.request.resourceNameSet)};break;case 67:s.request={oneofKind:"resourceNameGet",resourceNameGet:Tt.internalBinaryRead(e,e.uint32(),r,s.request.resourceNameGet)};break;case 68:s.request={oneofKind:"resourceNameExists",resourceNameExists:mt.internalBinaryRead(e,e.uint32(),r,s.request.resourceNameExists)};break;case 69:s.request={oneofKind:"resourceNameDelete",resourceNameDelete:bt.internalBinaryRead(e,e.uint32(),r,s.request.resourceNameDelete)};break;case 101:s.request={oneofKind:"fieldCreate",fieldCreate:Rt.internalBinaryRead(e,e.uint32(),r,s.request.fieldCreate)};break;case 107:s.request={oneofKind:"fieldExists",fieldExists:_t.internalBinaryRead(e,e.uint32(),r,s.request.fieldExists)};break;case 102:s.request={oneofKind:"fieldSet",fieldSet:Lt.internalBinaryRead(e,e.uint32(),r,s.request.fieldSet)};break;case 105:s.request={oneofKind:"fieldSetError",fieldSetError:Wt.internalBinaryRead(e,e.uint32(),r,s.request.fieldSetError)};break;case 103:s.request={oneofKind:"fieldGet",fieldGet:Bt.internalBinaryRead(e,e.uint32(),r,s.request.fieldGet)};break;case 104:s.request={oneofKind:"fieldReset",fieldReset:Mt.internalBinaryRead(e,e.uint32(),r,s.request.fieldReset)};break;case 106:s.request={oneofKind:"fieldRemove",fieldRemove:Et.internalBinaryRead(e,e.uint32(),r,s.request.fieldRemove)};break;case 111:s.request={oneofKind:"subscriptionCreate",subscriptionCreate:qt.internalBinaryRead(e,e.uint32(),r,s.request.subscriptionCreate)};break;case 112:s.request={oneofKind:"subscriptionAttachFilter",subscriptionAttachFilter:te.internalBinaryRead(e,e.uint32(),r,s.request.subscriptionAttachFilter)};break;case 113:s.request={oneofKind:"subscriptionDetachFilter",subscriptionDetachFilter:re.internalBinaryRead(e,e.uint32(),r,s.request.subscriptionDetachFilter)};break;case 115:s.request={oneofKind:"subscriptionCreateFilter",subscriptionCreateFilter:Vt.internalBinaryRead(e,e.uint32(),r,s.request.subscriptionCreateFilter)};break;case 154:s.request={oneofKind:"notificationGet",notificationGet:Q.internalBinaryRead(e,e.uint32(),r,s.request.notificationGet)};break;case 155:s.request={oneofKind:"notificationAck",notificationAck:St.internalBinaryRead(e,e.uint32(),r,s.request.notificationAck)};break;case 156:s.request={oneofKind:"notificationDiscard",notificationDiscard:Dt.internalBinaryRead(e,e.uint32(),r,s.request.notificationDiscard)};break;case 200:s.request={oneofKind:"resourceKeyValueSet",resourceKeyValueSet:zt.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueSet)};break;case 201:s.request={oneofKind:"resourceKeyValueGet",resourceKeyValueGet:Xt.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueGet)};break;case 202:s.request={oneofKind:"resourceKeyValueGetIfExists",resourceKeyValueGetIfExists:Qt.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueGetIfExists)};break;case 203:s.request={oneofKind:"resourceKeyValueSetFlag",resourceKeyValueSetFlag:rn.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueSetFlag)};break;case 204:s.request={oneofKind:"resourceKeyValueGetFlag",resourceKeyValueGetFlag:S.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueGetFlag)};break;case 205:s.request={oneofKind:"resourceKeyValueGetFlagIfExists",resourceKeyValueGetFlagIfExists:S.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueGetFlagIfExists)};break;case 206:s.request={oneofKind:"resourceKeyValueDelete",resourceKeyValueDelete:tn.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueDelete)};break;case 207:s.request={oneofKind:"resourceKeyValueList",resourceKeyValueList:Ht.internalBinaryRead(e,e.uint32(),r,s.request.resourceKeyValueList)};break;case 250:s.request={oneofKind:"controllerKeyValueSet",controllerKeyValueSet:on.internalBinaryRead(e,e.uint32(),r,s.request.controllerKeyValueSet)};break;case 251:s.request={oneofKind:"controllerKeyValueGet",controllerKeyValueGet:ln.internalBinaryRead(e,e.uint32(),r,s.request.controllerKeyValueGet)};break;case 252:s.request={oneofKind:"controllerKeyValueGetIfExists",controllerKeyValueGetIfExists:un.internalBinaryRead(e,e.uint32(),r,s.request.controllerKeyValueGetIfExists)};break;case 300:s.request={oneofKind:"cacheSetToField",cacheSetToField:pn.internalBinaryRead(e,e.uint32(),r,s.request.cacheSetToField)};break;case 301:s.request={oneofKind:"cacheDeleteExpiredRecords",cacheDeleteExpiredRecords:yn.internalBinaryRead(e,e.uint32(),r,s.request.cacheDeleteExpiredRecords)};break;case 350:s.request={oneofKind:"controllerFeaturesSet",controllerFeaturesSet:se.internalBinaryRead(e,e.uint32(),r,s.request.controllerFeaturesSet)};break;case 351:s.request={oneofKind:"controllerFeaturesClear",controllerFeaturesClear:ae.internalBinaryRead(e,e.uint32(),r,s.request.controllerFeaturesClear)};break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.requestId!==0&&t.tag(1,i.WireType.Varint).uint32(e.requestId),e.request.oneofKind==="txOpen"&&Me.internalBinaryWrite(e.request.txOpen,t.tag(11,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="txCommit"&&Ee.internalBinaryWrite(e.request.txCommit,t.tag(12,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="txDiscard"&&Se.internalBinaryWrite(e.request.txDiscard,t.tag(13,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceCreateRoot"&&dt.internalBinaryWrite(e.request.resourceCreateRoot,t.tag(58,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceRemove"&&ft.internalBinaryWrite(e.request.resourceRemove,t.tag(57,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceCreateStruct"&&De.internalBinaryWrite(e.request.resourceCreateStruct,t.tag(51,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceCreateEphemeral"&&qe.internalBinaryWrite(e.request.resourceCreateEphemeral,t.tag(62,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceCreateValue"&&je.internalBinaryWrite(e.request.resourceCreateValue,t.tag(52,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceGetValueId"&&Ge.internalBinaryWrite(e.request.resourceGetValueId,t.tag(63,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceCreateSingleton"&&ze.internalBinaryWrite(e.request.resourceCreateSingleton,t.tag(64,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceGetSingleton"&&Xe.internalBinaryWrite(e.request.resourceGetSingleton,t.tag(65,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceCreateChild"&&Ve.internalBinaryWrite(e.request.resourceCreateChild,t.tag(59,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceLockInputs"&&Qe.internalBinaryWrite(e.request.resourceLockInputs,t.tag(53,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceLockOutputs"&&tt.internalBinaryWrite(e.request.resourceLockOutputs,t.tag(56,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceExists"&&rt.internalBinaryWrite(e.request.resourceExists,t.tag(54,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceGet"&&at.internalBinaryWrite(e.request.resourceGet,t.tag(55,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceSetError"&&st.internalBinaryWrite(e.request.resourceSetError,t.tag(61,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceListByType"&&ct.internalBinaryWrite(e.request.resourceListByType,t.tag(60,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceNameSet"&&ht.internalBinaryWrite(e.request.resourceNameSet,t.tag(66,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceNameGet"&&Tt.internalBinaryWrite(e.request.resourceNameGet,t.tag(67,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceNameExists"&&mt.internalBinaryWrite(e.request.resourceNameExists,t.tag(68,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceNameDelete"&&bt.internalBinaryWrite(e.request.resourceNameDelete,t.tag(69,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldCreate"&&Rt.internalBinaryWrite(e.request.fieldCreate,t.tag(101,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldExists"&&_t.internalBinaryWrite(e.request.fieldExists,t.tag(107,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldSet"&&Lt.internalBinaryWrite(e.request.fieldSet,t.tag(102,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldSetError"&&Wt.internalBinaryWrite(e.request.fieldSetError,t.tag(105,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldGet"&&Bt.internalBinaryWrite(e.request.fieldGet,t.tag(103,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldReset"&&Mt.internalBinaryWrite(e.request.fieldReset,t.tag(104,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="fieldRemove"&&Et.internalBinaryWrite(e.request.fieldRemove,t.tag(106,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="subscriptionCreate"&&qt.internalBinaryWrite(e.request.subscriptionCreate,t.tag(111,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="subscriptionAttachFilter"&&te.internalBinaryWrite(e.request.subscriptionAttachFilter,t.tag(112,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="subscriptionDetachFilter"&&re.internalBinaryWrite(e.request.subscriptionDetachFilter,t.tag(113,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="subscriptionCreateFilter"&&Vt.internalBinaryWrite(e.request.subscriptionCreateFilter,t.tag(115,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="notificationGet"&&Q.internalBinaryWrite(e.request.notificationGet,t.tag(154,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="notificationAck"&&St.internalBinaryWrite(e.request.notificationAck,t.tag(155,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="notificationDiscard"&&Dt.internalBinaryWrite(e.request.notificationDiscard,t.tag(156,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueSet"&&zt.internalBinaryWrite(e.request.resourceKeyValueSet,t.tag(200,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueGet"&&Xt.internalBinaryWrite(e.request.resourceKeyValueGet,t.tag(201,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueGetIfExists"&&Qt.internalBinaryWrite(e.request.resourceKeyValueGetIfExists,t.tag(202,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueSetFlag"&&rn.internalBinaryWrite(e.request.resourceKeyValueSetFlag,t.tag(203,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueGetFlag"&&S.internalBinaryWrite(e.request.resourceKeyValueGetFlag,t.tag(204,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueGetFlagIfExists"&&S.internalBinaryWrite(e.request.resourceKeyValueGetFlagIfExists,t.tag(205,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueDelete"&&tn.internalBinaryWrite(e.request.resourceKeyValueDelete,t.tag(206,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="resourceKeyValueList"&&Ht.internalBinaryWrite(e.request.resourceKeyValueList,t.tag(207,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="controllerKeyValueSet"&&on.internalBinaryWrite(e.request.controllerKeyValueSet,t.tag(250,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="controllerKeyValueGet"&&ln.internalBinaryWrite(e.request.controllerKeyValueGet,t.tag(251,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="controllerKeyValueGetIfExists"&&un.internalBinaryWrite(e.request.controllerKeyValueGetIfExists,t.tag(252,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="cacheSetToField"&&pn.internalBinaryWrite(e.request.cacheSetToField,t.tag(300,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="cacheDeleteExpiredRecords"&&yn.internalBinaryWrite(e.request.cacheDeleteExpiredRecords,t.tag(301,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="controllerFeaturesSet"&&se.internalBinaryWrite(e.request.controllerFeaturesSet,t.tag(350,i.WireType.LengthDelimited).fork(),r).join(),e.request.oneofKind==="controllerFeaturesClear"&&ae.internalBinaryWrite(e.request.controllerFeaturesClear,t.tag(351,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const $i=new Ei;class Si extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.ServerMessage",[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"multi_message",kind:"message",T:()=>Ne},{no:11,name:"tx_open",kind:"message",oneof:"response",T:()=>xe},{no:12,name:"tx_commit",kind:"message",oneof:"response",T:()=>$e},{no:13,name:"tx_discard",kind:"message",oneof:"response",T:()=>Ce},{no:58,name:"resource_create_root",kind:"message",oneof:"response",T:()=>pt},{no:57,name:"resource_remove",kind:"message",oneof:"response",T:()=>yt},{no:51,name:"resource_create_struct",kind:"message",oneof:"response",T:()=>Oe},{no:62,name:"resource_create_ephemeral",kind:"message",oneof:"response",T:()=>Ke},{no:52,name:"resource_create_value",kind:"message",oneof:"response",T:()=>He},{no:63,name:"resource_get_value_id",kind:"message",oneof:"response",T:()=>Je},{no:64,name:"resource_create_singleton",kind:"message",oneof:"response",T:()=>Ye},{no:65,name:"resource_get_singleton",kind:"message",oneof:"response",T:()=>Ze},{no:59,name:"resource_create_child",kind:"message",oneof:"response",T:()=>ve},{no:53,name:"resource_lock_inputs",kind:"message",oneof:"response",T:()=>et},{no:56,name:"resource_lock_outputs",kind:"message",oneof:"response",T:()=>nt},{no:54,name:"resource_exists",kind:"message",oneof:"response",T:()=>it},{no:55,name:"resource_get",kind:"message",oneof:"response",T:()=>lt},{no:61,name:"resource_set_error",kind:"message",oneof:"response",T:()=>ot},{no:60,name:"resource_list_by_type",kind:"message",oneof:"response",T:()=>ut},{no:66,name:"resource_name_set",kind:"message",oneof:"response",T:()=>gt},{no:67,name:"resource_name_get",kind:"message",oneof:"response",T:()=>kt},{no:68,name:"resource_name_exists",kind:"message",oneof:"response",T:()=>wt},{no:69,name:"resource_name_delete",kind:"message",oneof:"response",T:()=>Pt},{no:101,name:"field_create",kind:"message",oneof:"response",T:()=>It},{no:107,name:"field_exists",kind:"message",oneof:"response",T:()=>At},{no:102,name:"field_set",kind:"message",oneof:"response",T:()=>Ft},{no:105,name:"field_set_error",kind:"message",oneof:"response",T:()=>Ut},{no:103,name:"field_get",kind:"message",oneof:"response",T:()=>Nt},{no:104,name:"field_reset",kind:"message",oneof:"response",T:()=>xt},{no:106,name:"field_remove",kind:"message",oneof:"response",T:()=>$t},{no:111,name:"subscription_create",kind:"message",oneof:"response",T:()=>Kt},{no:115,name:"subscription_create_filter",kind:"message",oneof:"response",T:()=>vt},{no:112,name:"subscription_attach_filter",kind:"message",oneof:"response",T:()=>ne},{no:113,name:"subscription_detach_filter",kind:"message",oneof:"response",T:()=>ie},{no:154,name:"notification_get",kind:"message",oneof:"response",T:()=>ee},{no:155,name:"notification_ack",kind:"message",oneof:"response",T:()=>Ct},{no:156,name:"notification_discard",kind:"message",oneof:"response",T:()=>Ot},{no:200,name:"resource_key_value_set",kind:"message",oneof:"response",T:()=>Yt},{no:201,name:"resource_key_value_get",kind:"message",oneof:"response",T:()=>Zt},{no:202,name:"resource_key_value_get_if_exists",kind:"message",oneof:"response",T:()=>en},{no:203,name:"resource_key_value_set_flag",kind:"message",oneof:"response",T:()=>sn},{no:204,name:"resource_key_value_get_flag",kind:"message",oneof:"response",T:()=>C},{no:205,name:"resource_key_value_get_flag_if_exists",kind:"message",oneof:"response",T:()=>C},{no:206,name:"resource_key_value_delete",kind:"message",oneof:"response",T:()=>nn},{no:207,name:"resource_key_value_list",kind:"message",oneof:"response",T:()=>Gt},{no:250,name:"controller_key_value_set",kind:"message",oneof:"response",T:()=>an},{no:251,name:"controller_key_value_get",kind:"message",oneof:"response",T:()=>cn},{no:252,name:"controller_key_value_get_if_exists",kind:"message",oneof:"response",T:()=>dn},{no:300,name:"cache_set_to_field",kind:"message",oneof:"response",T:()=>fn},{no:301,name:"cache_delete_expired_records",kind:"message",oneof:"response",T:()=>hn},{no:350,name:"controller_features_set",kind:"message",oneof:"response",T:()=>oe},{no:351,name:"controller_features_clear",kind:"message",oneof:"response",T:()=>le},{no:3,name:"error",kind:"message",T:()=>Be}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.requestId=0,t.response={oneofKind:void 0},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.requestId=e.uint32();break;case 2:s.multiMessage=Ne.internalBinaryRead(e,e.uint32(),r,s.multiMessage);break;case 11:s.response={oneofKind:"txOpen",txOpen:xe.internalBinaryRead(e,e.uint32(),r,s.response.txOpen)};break;case 12:s.response={oneofKind:"txCommit",txCommit:$e.internalBinaryRead(e,e.uint32(),r,s.response.txCommit)};break;case 13:s.response={oneofKind:"txDiscard",txDiscard:Ce.internalBinaryRead(e,e.uint32(),r,s.response.txDiscard)};break;case 58:s.response={oneofKind:"resourceCreateRoot",resourceCreateRoot:pt.internalBinaryRead(e,e.uint32(),r,s.response.resourceCreateRoot)};break;case 57:s.response={oneofKind:"resourceRemove",resourceRemove:yt.internalBinaryRead(e,e.uint32(),r,s.response.resourceRemove)};break;case 51:s.response={oneofKind:"resourceCreateStruct",resourceCreateStruct:Oe.internalBinaryRead(e,e.uint32(),r,s.response.resourceCreateStruct)};break;case 62:s.response={oneofKind:"resourceCreateEphemeral",resourceCreateEphemeral:Ke.internalBinaryRead(e,e.uint32(),r,s.response.resourceCreateEphemeral)};break;case 52:s.response={oneofKind:"resourceCreateValue",resourceCreateValue:He.internalBinaryRead(e,e.uint32(),r,s.response.resourceCreateValue)};break;case 63:s.response={oneofKind:"resourceGetValueId",resourceGetValueId:Je.internalBinaryRead(e,e.uint32(),r,s.response.resourceGetValueId)};break;case 64:s.response={oneofKind:"resourceCreateSingleton",resourceCreateSingleton:Ye.internalBinaryRead(e,e.uint32(),r,s.response.resourceCreateSingleton)};break;case 65:s.response={oneofKind:"resourceGetSingleton",resourceGetSingleton:Ze.internalBinaryRead(e,e.uint32(),r,s.response.resourceGetSingleton)};break;case 59:s.response={oneofKind:"resourceCreateChild",resourceCreateChild:ve.internalBinaryRead(e,e.uint32(),r,s.response.resourceCreateChild)};break;case 53:s.response={oneofKind:"resourceLockInputs",resourceLockInputs:et.internalBinaryRead(e,e.uint32(),r,s.response.resourceLockInputs)};break;case 56:s.response={oneofKind:"resourceLockOutputs",resourceLockOutputs:nt.internalBinaryRead(e,e.uint32(),r,s.response.resourceLockOutputs)};break;case 54:s.response={oneofKind:"resourceExists",resourceExists:it.internalBinaryRead(e,e.uint32(),r,s.response.resourceExists)};break;case 55:s.response={oneofKind:"resourceGet",resourceGet:lt.internalBinaryRead(e,e.uint32(),r,s.response.resourceGet)};break;case 61:s.response={oneofKind:"resourceSetError",resourceSetError:ot.internalBinaryRead(e,e.uint32(),r,s.response.resourceSetError)};break;case 60:s.response={oneofKind:"resourceListByType",resourceListByType:ut.internalBinaryRead(e,e.uint32(),r,s.response.resourceListByType)};break;case 66:s.response={oneofKind:"resourceNameSet",resourceNameSet:gt.internalBinaryRead(e,e.uint32(),r,s.response.resourceNameSet)};break;case 67:s.response={oneofKind:"resourceNameGet",resourceNameGet:kt.internalBinaryRead(e,e.uint32(),r,s.response.resourceNameGet)};break;case 68:s.response={oneofKind:"resourceNameExists",resourceNameExists:wt.internalBinaryRead(e,e.uint32(),r,s.response.resourceNameExists)};break;case 69:s.response={oneofKind:"resourceNameDelete",resourceNameDelete:Pt.internalBinaryRead(e,e.uint32(),r,s.response.resourceNameDelete)};break;case 101:s.response={oneofKind:"fieldCreate",fieldCreate:It.internalBinaryRead(e,e.uint32(),r,s.response.fieldCreate)};break;case 107:s.response={oneofKind:"fieldExists",fieldExists:At.internalBinaryRead(e,e.uint32(),r,s.response.fieldExists)};break;case 102:s.response={oneofKind:"fieldSet",fieldSet:Ft.internalBinaryRead(e,e.uint32(),r,s.response.fieldSet)};break;case 105:s.response={oneofKind:"fieldSetError",fieldSetError:Ut.internalBinaryRead(e,e.uint32(),r,s.response.fieldSetError)};break;case 103:s.response={oneofKind:"fieldGet",fieldGet:Nt.internalBinaryRead(e,e.uint32(),r,s.response.fieldGet)};break;case 104:s.response={oneofKind:"fieldReset",fieldReset:xt.internalBinaryRead(e,e.uint32(),r,s.response.fieldReset)};break;case 106:s.response={oneofKind:"fieldRemove",fieldRemove:$t.internalBinaryRead(e,e.uint32(),r,s.response.fieldRemove)};break;case 111:s.response={oneofKind:"subscriptionCreate",subscriptionCreate:Kt.internalBinaryRead(e,e.uint32(),r,s.response.subscriptionCreate)};break;case 115:s.response={oneofKind:"subscriptionCreateFilter",subscriptionCreateFilter:vt.internalBinaryRead(e,e.uint32(),r,s.response.subscriptionCreateFilter)};break;case 112:s.response={oneofKind:"subscriptionAttachFilter",subscriptionAttachFilter:ne.internalBinaryRead(e,e.uint32(),r,s.response.subscriptionAttachFilter)};break;case 113:s.response={oneofKind:"subscriptionDetachFilter",subscriptionDetachFilter:ie.internalBinaryRead(e,e.uint32(),r,s.response.subscriptionDetachFilter)};break;case 154:s.response={oneofKind:"notificationGet",notificationGet:ee.internalBinaryRead(e,e.uint32(),r,s.response.notificationGet)};break;case 155:s.response={oneofKind:"notificationAck",notificationAck:Ct.internalBinaryRead(e,e.uint32(),r,s.response.notificationAck)};break;case 156:s.response={oneofKind:"notificationDiscard",notificationDiscard:Ot.internalBinaryRead(e,e.uint32(),r,s.response.notificationDiscard)};break;case 200:s.response={oneofKind:"resourceKeyValueSet",resourceKeyValueSet:Yt.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueSet)};break;case 201:s.response={oneofKind:"resourceKeyValueGet",resourceKeyValueGet:Zt.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueGet)};break;case 202:s.response={oneofKind:"resourceKeyValueGetIfExists",resourceKeyValueGetIfExists:en.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueGetIfExists)};break;case 203:s.response={oneofKind:"resourceKeyValueSetFlag",resourceKeyValueSetFlag:sn.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueSetFlag)};break;case 204:s.response={oneofKind:"resourceKeyValueGetFlag",resourceKeyValueGetFlag:C.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueGetFlag)};break;case 205:s.response={oneofKind:"resourceKeyValueGetFlagIfExists",resourceKeyValueGetFlagIfExists:C.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueGetFlagIfExists)};break;case 206:s.response={oneofKind:"resourceKeyValueDelete",resourceKeyValueDelete:nn.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueDelete)};break;case 207:s.response={oneofKind:"resourceKeyValueList",resourceKeyValueList:Gt.internalBinaryRead(e,e.uint32(),r,s.response.resourceKeyValueList)};break;case 250:s.response={oneofKind:"controllerKeyValueSet",controllerKeyValueSet:an.internalBinaryRead(e,e.uint32(),r,s.response.controllerKeyValueSet)};break;case 251:s.response={oneofKind:"controllerKeyValueGet",controllerKeyValueGet:cn.internalBinaryRead(e,e.uint32(),r,s.response.controllerKeyValueGet)};break;case 252:s.response={oneofKind:"controllerKeyValueGetIfExists",controllerKeyValueGetIfExists:dn.internalBinaryRead(e,e.uint32(),r,s.response.controllerKeyValueGetIfExists)};break;case 300:s.response={oneofKind:"cacheSetToField",cacheSetToField:fn.internalBinaryRead(e,e.uint32(),r,s.response.cacheSetToField)};break;case 301:s.response={oneofKind:"cacheDeleteExpiredRecords",cacheDeleteExpiredRecords:hn.internalBinaryRead(e,e.uint32(),r,s.response.cacheDeleteExpiredRecords)};break;case 350:s.response={oneofKind:"controllerFeaturesSet",controllerFeaturesSet:oe.internalBinaryRead(e,e.uint32(),r,s.response.controllerFeaturesSet)};break;case 351:s.response={oneofKind:"controllerFeaturesClear",controllerFeaturesClear:le.internalBinaryRead(e,e.uint32(),r,s.response.controllerFeaturesClear)};break;case 3:s.error=Be.internalBinaryRead(e,e.uint32(),r,s.error);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.requestId!==0&&t.tag(1,i.WireType.Varint).uint32(e.requestId),e.multiMessage&&Ne.internalBinaryWrite(e.multiMessage,t.tag(2,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="txOpen"&&xe.internalBinaryWrite(e.response.txOpen,t.tag(11,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="txCommit"&&$e.internalBinaryWrite(e.response.txCommit,t.tag(12,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="txDiscard"&&Ce.internalBinaryWrite(e.response.txDiscard,t.tag(13,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceCreateRoot"&&pt.internalBinaryWrite(e.response.resourceCreateRoot,t.tag(58,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceRemove"&&yt.internalBinaryWrite(e.response.resourceRemove,t.tag(57,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceCreateStruct"&&Oe.internalBinaryWrite(e.response.resourceCreateStruct,t.tag(51,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceCreateEphemeral"&&Ke.internalBinaryWrite(e.response.resourceCreateEphemeral,t.tag(62,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceCreateValue"&&He.internalBinaryWrite(e.response.resourceCreateValue,t.tag(52,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceGetValueId"&&Je.internalBinaryWrite(e.response.resourceGetValueId,t.tag(63,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceCreateSingleton"&&Ye.internalBinaryWrite(e.response.resourceCreateSingleton,t.tag(64,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceGetSingleton"&&Ze.internalBinaryWrite(e.response.resourceGetSingleton,t.tag(65,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceCreateChild"&&ve.internalBinaryWrite(e.response.resourceCreateChild,t.tag(59,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceLockInputs"&&et.internalBinaryWrite(e.response.resourceLockInputs,t.tag(53,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceLockOutputs"&&nt.internalBinaryWrite(e.response.resourceLockOutputs,t.tag(56,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceExists"&&it.internalBinaryWrite(e.response.resourceExists,t.tag(54,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceGet"&<.internalBinaryWrite(e.response.resourceGet,t.tag(55,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceSetError"&&ot.internalBinaryWrite(e.response.resourceSetError,t.tag(61,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceListByType"&&ut.internalBinaryWrite(e.response.resourceListByType,t.tag(60,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceNameSet"&>.internalBinaryWrite(e.response.resourceNameSet,t.tag(66,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceNameGet"&&kt.internalBinaryWrite(e.response.resourceNameGet,t.tag(67,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceNameExists"&&wt.internalBinaryWrite(e.response.resourceNameExists,t.tag(68,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceNameDelete"&&Pt.internalBinaryWrite(e.response.resourceNameDelete,t.tag(69,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldCreate"&&It.internalBinaryWrite(e.response.fieldCreate,t.tag(101,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldExists"&&At.internalBinaryWrite(e.response.fieldExists,t.tag(107,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldSet"&&Ft.internalBinaryWrite(e.response.fieldSet,t.tag(102,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldSetError"&&Ut.internalBinaryWrite(e.response.fieldSetError,t.tag(105,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldGet"&&Nt.internalBinaryWrite(e.response.fieldGet,t.tag(103,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldReset"&&xt.internalBinaryWrite(e.response.fieldReset,t.tag(104,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="fieldRemove"&&$t.internalBinaryWrite(e.response.fieldRemove,t.tag(106,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="subscriptionCreate"&&Kt.internalBinaryWrite(e.response.subscriptionCreate,t.tag(111,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="subscriptionCreateFilter"&&vt.internalBinaryWrite(e.response.subscriptionCreateFilter,t.tag(115,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="subscriptionAttachFilter"&&ne.internalBinaryWrite(e.response.subscriptionAttachFilter,t.tag(112,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="subscriptionDetachFilter"&&ie.internalBinaryWrite(e.response.subscriptionDetachFilter,t.tag(113,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="notificationGet"&&ee.internalBinaryWrite(e.response.notificationGet,t.tag(154,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="notificationAck"&&Ct.internalBinaryWrite(e.response.notificationAck,t.tag(155,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="notificationDiscard"&&Ot.internalBinaryWrite(e.response.notificationDiscard,t.tag(156,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueSet"&&Yt.internalBinaryWrite(e.response.resourceKeyValueSet,t.tag(200,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueGet"&&Zt.internalBinaryWrite(e.response.resourceKeyValueGet,t.tag(201,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueGetIfExists"&&en.internalBinaryWrite(e.response.resourceKeyValueGetIfExists,t.tag(202,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueSetFlag"&&sn.internalBinaryWrite(e.response.resourceKeyValueSetFlag,t.tag(203,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueGetFlag"&&C.internalBinaryWrite(e.response.resourceKeyValueGetFlag,t.tag(204,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueGetFlagIfExists"&&C.internalBinaryWrite(e.response.resourceKeyValueGetFlagIfExists,t.tag(205,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueDelete"&&nn.internalBinaryWrite(e.response.resourceKeyValueDelete,t.tag(206,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="resourceKeyValueList"&&Gt.internalBinaryWrite(e.response.resourceKeyValueList,t.tag(207,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="controllerKeyValueSet"&&an.internalBinaryWrite(e.response.controllerKeyValueSet,t.tag(250,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="controllerKeyValueGet"&&cn.internalBinaryWrite(e.response.controllerKeyValueGet,t.tag(251,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="controllerKeyValueGetIfExists"&&dn.internalBinaryWrite(e.response.controllerKeyValueGetIfExists,t.tag(252,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="cacheSetToField"&&fn.internalBinaryWrite(e.response.cacheSetToField,t.tag(300,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="cacheDeleteExpiredRecords"&&hn.internalBinaryWrite(e.response.cacheDeleteExpiredRecords,t.tag(301,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="controllerFeaturesSet"&&oe.internalBinaryWrite(e.response.controllerFeaturesSet,t.tag(350,i.WireType.LengthDelimited).fork(),r).join(),e.response.oneofKind==="controllerFeaturesClear"&&le.internalBinaryWrite(e.response.controllerFeaturesClear,t.tag(351,i.WireType.LengthDelimited).fork(),r).join(),e.error&&Be.internalBinaryWrite(e.error,t.tag(3,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ci=new Si;class Di extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.ServerMessage.Multi",[{no:1,name:"id",kind:"scalar",T:13},{no:2,name:"is_last",kind:"scalar",T:8},{no:3,name:"is_empty",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0,t.isLast=!1,t.isEmpty=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint32();break;case 2:s.isLast=e.bool();break;case 3:s.isEmpty=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0&&t.tag(1,i.WireType.Varint).uint32(e.id),e.isLast!==!1&&t.tag(2,i.WireType.Varint).bool(e.isLast),e.isEmpty!==!1&&t.tag(3,i.WireType.Varint).bool(e.isEmpty);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ne=new Di;class Oi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Open",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Oi;class qi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Open.Request",[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"writable",kind:"enum",T:()=>["MiLaboratories.PL.API.TxAPI.Open.Request.WritableTx",pe]}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.name="",t.writable=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.name=e.string();break;case 2:s.writable=e.int32();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.name!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.name),e.writable!==0&&t.tag(2,i.WireType.Varint).int32(e.writable);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Me=new qi;class Ki extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Open.Response",[{no:1,name:"tx",kind:"message",T:()=>Re}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.tx=Re.internalBinaryRead(e,e.uint32(),r,s.tx);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.tx&&Re.internalBinaryWrite(e.tx,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const xe=new Ki;class Vi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Commit",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Vi;class vi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Commit.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ee=new vi;class ji extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Commit.Response",[{no:1,name:"success",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.success=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.success=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.success!==!1&&t.tag(1,i.WireType.Varint).bool(e.success);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const $e=new ji;class Hi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Discard",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Hi;class Gi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Discard.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Se=new Gi;class Ji extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Discard.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ce=new Ji;class zi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Sync",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new zi;class Yi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Sync.Request",[{no:1,name:"tx_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.txId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.txId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.txId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.txId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Xi=new Yi;class Zi extends i.MessageType{constructor(){super("MiLaboratories.PL.API.TxAPI.Sync.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Qi=new Zi;class es extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new es;class ts extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateStruct",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ts;class ns extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateStruct.Request",[{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"type",kind:"message",T:()=>f},{no:4,name:"data",kind:"scalar",opt:!0,T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.id=e.uint64().toBigInt();break;case 3:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 4:s.data=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.type&&f.internalBinaryWrite(e.type,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.data!==void 0&&t.tag(4,i.WireType.LengthDelimited).bytes(e.data);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const De=new ns;class rs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateStruct.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Oe=new rs;class is extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateEphemeral",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new is;class ss extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateEphemeral.Request",[{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"type",kind:"message",T:()=>f},{no:4,name:"data",kind:"scalar",opt:!0,T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.id=e.uint64().toBigInt();break;case 3:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 4:s.data=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.type&&f.internalBinaryWrite(e.type,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.data!==void 0&&t.tag(4,i.WireType.LengthDelimited).bytes(e.data);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const qe=new ss;class os extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateEphemeral.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ke=new os;class as extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateChild",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new as;class ls extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateChild.Request",[{no:1,name:"id",kind:"scalar",T:4,L:0},{no:2,name:"type",kind:"message",T:()=>f},{no:3,name:"parent_field",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint64().toBigInt();break;case 2:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 3:s.parentField=y.internalBinaryRead(e,e.uint32(),r,s.parentField);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(1,i.WireType.Varint).uint64(e.id),e.type&&f.internalBinaryWrite(e.type,t.tag(2,i.WireType.LengthDelimited).fork(),r).join(),e.parentField&&y.internalBinaryWrite(e.parentField,t.tag(3,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ve=new ls;class cs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateChild.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ve=new cs;class us extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateValue",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new us;class ds extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateValue.Request",[{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"type",kind:"message",T:()=>f},{no:6,name:"data",kind:"scalar",T:12},{no:7,name:"error_if_exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,t.data=new Uint8Array(0),t.errorIfExists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.id=e.uint64().toBigInt();break;case 3:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 6:s.data=e.bytes();break;case 7:s.errorIfExists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.type&&f.internalBinaryWrite(e.type,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.data.length&&t.tag(6,i.WireType.LengthDelimited).bytes(e.data),e.errorIfExists!==!1&&t.tag(7,i.WireType.Varint).bool(e.errorIfExists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const je=new ds;class ps extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateValue.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const He=new ps;class fs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.GetValueID",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new fs;class ys extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.GetValueID.Request",[{no:1,name:"type",kind:"message",T:()=>f},{no:2,name:"data",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.data=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 2:s.data=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type&&f.internalBinaryWrite(e.type,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.data.length&&t.tag(2,i.WireType.LengthDelimited).bytes(e.data);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ge=new ys;class hs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.GetValueID.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Je=new hs;class gs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateSingleton",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new gs;class Ts extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateSingleton.Request",[{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"type",kind:"message",T:()=>f},{no:6,name:"data",kind:"scalar",T:12},{no:7,name:"error_if_exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,t.data=new Uint8Array(0),t.errorIfExists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.id=e.uint64().toBigInt();break;case 3:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 6:s.data=e.bytes();break;case 7:s.errorIfExists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.type&&f.internalBinaryWrite(e.type,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.data.length&&t.tag(6,i.WireType.LengthDelimited).bytes(e.data),e.errorIfExists!==!1&&t.tag(7,i.WireType.Varint).bool(e.errorIfExists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ze=new Ts;class ks extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateSingleton.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ye=new ks;class ms extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.GetSingleton",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ms;class ws extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.GetSingleton.Request",[{no:1,name:"type",kind:"message",T:()=>f},{no:2,name:"data",kind:"scalar",T:12},{no:3,name:"load_fields",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.data=new Uint8Array(0),t.loadFields=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;case 2:s.data=e.bytes();break;case 3:s.loadFields=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type&&f.internalBinaryWrite(e.type,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.data.length&&t.tag(2,i.WireType.LengthDelimited).bytes(e.data),e.loadFields!==!1&&t.tag(3,i.WireType.Varint).bool(e.loadFields);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Xe=new ws;class bs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.GetSingleton.Response",[{no:1,name:"resource",kind:"message",T:()=>I}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resource=I.internalBinaryRead(e,e.uint32(),r,s.resource);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resource&&I.internalBinaryWrite(e.resource,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ze=new bs;class Ps extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.LockInputs",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ps;class Rs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.LockInputs.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Qe=new Rs;class Is extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.LockInputs.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const et=new Is;class _s extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.LockOutputs",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new _s;class As extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.LockOutputs.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const tt=new As;class Ls extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.LockOutputs.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const nt=new Ls;class Fs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Exists",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Fs;class Ws extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Exists.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const rt=new Ws;class Us extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Exists.Response",[{no:1,name:"exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.exists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.exists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.exists!==!1&&t.tag(1,i.WireType.Varint).bool(e.exists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const it=new Us;class Bs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.SetError",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Bs;class Ns extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.SetError.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"error_resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.errorResourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.errorResourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.errorResourceId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.errorResourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const st=new Ns;class Ms extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.SetError.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ot=new Ms;class xs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new xs;class Es extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Get.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"load_fields",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.loadFields=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.loadFields=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.loadFields!==!1&&t.tag(2,i.WireType.Varint).bool(e.loadFields);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const at=new Es;class $s extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Get.Response",[{no:1,name:"resource",kind:"message",T:()=>I}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resource=I.internalBinaryRead(e,e.uint32(),r,s.resource);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resource&&I.internalBinaryWrite(e.resource,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const lt=new $s;class Ss extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.List",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ss;class Cs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.List.ByType",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Cs;class Ds extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.List.ByType.Request",[{no:1,name:"resource_type",kind:"message",T:()=>f}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceType=f.internalBinaryRead(e,e.uint32(),r,s.resourceType);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceType&&f.internalBinaryWrite(e.resourceType,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ct=new Ds;class Os extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.List.ByType.Response",[{no:1,name:"resources",kind:"map",K:4,V:{kind:"message",T:()=>I}}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resources={},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:this.binaryReadMap1(s.resources,e,r);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap1(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.uint64().toString();break;case 2:l=I.internalBinaryRead(t,t.uint32(),r);break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.ResourceAPI.List.ByType.Response.resources")}}e[u??"0"]=l??I.create()}internalBinaryWrite(e,t,r){for(let s of globalThis.Object.keys(e.resources))t.tag(1,i.WireType.LengthDelimited).fork().tag(1,i.WireType.Varint).uint64(s),t.tag(2,i.WireType.LengthDelimited).fork(),I.internalBinaryWrite(e.resources[s],t,r),t.join().join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ut=new Os;class qs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateRoot",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new qs;class Ks extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateRoot.Request",[{no:2,name:"id",kind:"scalar",T:4,L:0},{no:3,name:"type",kind:"message",T:()=>f}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.id=e.uint64().toBigInt();break;case 3:s.type=f.internalBinaryRead(e,e.uint32(),r,s.type);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(2,i.WireType.Varint).uint64(e.id),e.type&&f.internalBinaryWrite(e.type,t.tag(3,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const dt=new Ks;class Vs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.CreateRoot.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const pt=new Vs;class vs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Remove",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new vs;class js extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Remove.Request",[{no:1,name:"id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(1,i.WireType.Varint).uint64(e.id);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ft=new js;class Hs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Remove.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const yt=new Hs;class Gs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Gs;class Js extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Set",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Js;class zs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Set.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.name!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ht=new zs;class Ys extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Set.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const gt=new Ys;class Xs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Xs;class Zs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Get.Request",[{no:1,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.name!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Tt=new Zs;class Qs extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Get.Response",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const kt=new Qs;class eo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Exists",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new eo;class to extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Exists.Request",[{no:1,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.name!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const mt=new to;class no extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Exists.Response",[{no:1,name:"exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.exists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.exists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.exists!==!1&&t.tag(1,i.WireType.Varint).bool(e.exists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const wt=new no;class ro extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Delete",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ro;class io extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Delete.Request",[{no:1,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.name!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const bt=new io;class so extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceAPI.Name.Delete.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Pt=new so;class oo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new oo;class ao extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Create",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ao;class lo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Create.Request",[{no:1,name:"type",kind:"enum",T:()=>["MiLaboratories.PL.Base.FieldType",T]},{no:2,name:"id",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=e.int32();break;case 2:s.id=y.internalBinaryRead(e,e.uint32(),r,s.id);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.type!==0&&t.tag(1,i.WireType.Varint).int32(e.type),e.id&&y.internalBinaryWrite(e.id,t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Rt=new lo;class co extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Create.Response",[{no:1,name:"global_id",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.globalId=y.internalBinaryRead(e,e.uint32(),r,s.globalId);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.globalId&&y.internalBinaryWrite(e.globalId,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const It=new co;class uo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Exists",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new uo;class po extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Exists.Request",[{no:1,name:"field",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=y.internalBinaryRead(e,e.uint32(),r,s.field);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&y.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const _t=new po;class fo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Exists.Response",[{no:1,name:"exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.exists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.exists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.exists!==!1&&t.tag(1,i.WireType.Varint).bool(e.exists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const At=new fo;class yo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Set",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new yo;class ho extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Set.Request",[{no:1,name:"field",kind:"message",T:()=>y},{no:2,name:"value",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=y.internalBinaryRead(e,e.uint32(),r,s.field);break;case 2:s.value=y.internalBinaryRead(e,e.uint32(),r,s.value);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&y.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.value&&y.internalBinaryWrite(e.value,t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Lt=new ho;class go extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Set.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ft=new go;class To extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.SetError",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new To;class ko extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.SetError.Request",[{no:1,name:"field",kind:"message",T:()=>y},{no:2,name:"err_resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.errResourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=y.internalBinaryRead(e,e.uint32(),r,s.field);break;case 2:s.errResourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&y.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.errResourceId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.errResourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Wt=new ko;class mo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.SetError.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ut=new mo;class wo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new wo;class bo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Get.Request",[{no:1,name:"field",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=y.internalBinaryRead(e,e.uint32(),r,s.field);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&y.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Bt=new bo;class Po extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Get.Response",[{no:1,name:"field",kind:"message",T:()=>m}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=m.internalBinaryRead(e,e.uint32(),r,s.field);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&m.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Nt=new Po;class Ro extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Reset",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ro;class Io extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Reset.Request",[{no:1,name:"field",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=y.internalBinaryRead(e,e.uint32(),r,s.field);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&y.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Mt=new Io;class _o extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Reset.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const xt=new _o;class Ao extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Remove",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ao;class Lo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Remove.Request",[{no:1,name:"field",kind:"message",T:()=>y}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.field=y.internalBinaryRead(e,e.uint32(),r,s.field);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.field&&y.internalBinaryWrite(e.field,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Et=new Lo;class Fo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.FieldAPI.Remove.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const $t=new Fo;class Wo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Wo;class Uo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Uo;class Bo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Get.Request",[{no:1,name:"subscription",kind:"scalar",T:4,L:0},{no:2,name:"max_notifications",kind:"scalar",T:13}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscription=0n,t.maxNotifications=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscription=e.uint64().toBigInt();break;case 2:s.maxNotifications=e.uint32();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscription!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscription),e.maxNotifications!==0&&t.tag(2,i.WireType.Varint).uint32(e.maxNotifications);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Q=new Bo;class No extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Get.Response",[{no:1,name:"notifications",kind:"message",repeat:1,T:()=>q}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.notifications=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.notifications.push(q.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){for(let s=0;s<e.notifications.length;s++)q.internalBinaryWrite(e.notifications[s],t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ee=new No;class Mo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Ack",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Mo;class xo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Ack.Request",[{no:1,name:"subscription_id",kind:"scalar",T:4,L:0},{no:2,name:"event_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptionId=0n,t.eventId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptionId=e.uint64().toBigInt();break;case 2:s.eventId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscriptionId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscriptionId),e.eventId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.eventId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const St=new xo;class Eo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Ack.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ct=new Eo;class $o extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Discard",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new $o;class So extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Discard.Request",[{no:1,name:"subscription_id",kind:"scalar",T:4,L:0},{no:2,name:"event_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptionId=0n,t.eventId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptionId=e.uint64().toBigInt();break;case 2:s.eventId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscriptionId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscriptionId),e.eventId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.eventId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Dt=new So;class Co extends i.MessageType{constructor(){super("MiLaboratories.PL.API.NotificationAPI.Discard.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ot=new Co;class Do extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Do;class Oo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.CreateSubscription",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Oo;class qo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.CreateSubscription.Request",[{no:1,name:"id",kind:"scalar",T:4,L:0},{no:2,name:"blocking",kind:"scalar",T:8},{no:3,name:"gc",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,t.blocking=!1,t.gc=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint64().toBigInt();break;case 2:s.blocking=e.bool();break;case 3:s.gc=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(1,i.WireType.Varint).uint64(e.id),e.blocking!==!1&&t.tag(2,i.WireType.Varint).bool(e.blocking),e.gc!==!1&&t.tag(3,i.WireType.Varint).bool(e.gc);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const qt=new qo;class Ko extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.CreateSubscription.Response",[{no:1,name:"subscription_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptionId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptionId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscriptionId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscriptionId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Kt=new Ko;class Vo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.CreateFilter",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Vo;class vo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.CreateFilter.Request",[{no:1,name:"id",kind:"scalar",T:4,L:0},{no:2,name:"filter",kind:"message",T:()=>b}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint64().toBigInt();break;case 2:s.filter=b.internalBinaryRead(e,e.uint32(),r,s.filter);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(1,i.WireType.Varint).uint64(e.id),e.filter&&b.internalBinaryWrite(e.filter,t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Vt=new vo;class jo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.CreateFilter.Response",[{no:1,name:"filter_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.filterId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.filterId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.filterId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.filterId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const vt=new jo;class Ho extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.ListSubscriptions",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ho;class Go extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.ListSubscriptions.SubscriptionInfo",[{no:1,name:"subscription",kind:"message",T:()=>Ae},{no:2,name:"last_read_time",kind:"scalar",T:4,L:0},{no:3,name:"notification_queue_size",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.lastReadTime=0n,t.notificationQueueSize=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscription=Ae.internalBinaryRead(e,e.uint32(),r,s.subscription);break;case 2:s.lastReadTime=e.uint64().toBigInt();break;case 3:s.notificationQueueSize=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscription&&Ae.internalBinaryWrite(e.subscription,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.lastReadTime!==0n&&t.tag(2,i.WireType.Varint).uint64(e.lastReadTime),e.notificationQueueSize!==0n&&t.tag(3,i.WireType.Varint).uint64(e.notificationQueueSize);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const jt=new Go;class Jo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.ListSubscriptions.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Jo;class zo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.ListSubscriptions.Response",[{no:1,name:"subscriptions",kind:"message",repeat:1,T:()=>jt}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptions=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptions.push(jt.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){for(let s=0;s<e.subscriptions.length;s++)jt.internalBinaryWrite(e.subscriptions[s],t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new zo;class Yo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.AttachFilter",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Yo;class Xo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.AttachFilter.Request",[{no:1,name:"subscription_id",kind:"scalar",T:4,L:0},{no:2,name:"filter_name",kind:"scalar",T:9},{no:3,name:"filter_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptionId=0n,t.filterName="",t.filterId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptionId=e.uint64().toBigInt();break;case 2:s.filterName=e.string();break;case 3:s.filterId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscriptionId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscriptionId),e.filterName!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.filterName),e.filterId!==0n&&t.tag(3,i.WireType.Varint).uint64(e.filterId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const te=new Xo;class Zo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.AttachFilter.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ne=new Zo;class Qo extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.DetachFilter",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Qo;class ea extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.DetachFilter.Request",[{no:1,name:"subscription_id",kind:"scalar",T:4,L:0},{no:2,name:"filter_name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.subscriptionId=0n,t.filterName="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.subscriptionId=e.uint64().toBigInt();break;case 2:s.filterName=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.subscriptionId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.subscriptionId),e.filterName!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.filterName);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const re=new ea;class ta extends i.MessageType{constructor(){super("MiLaboratories.PL.API.SubscriptionAPI.DetachFilter.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ie=new ta;class na extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new na;class ra extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Register",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ra;class ia extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Register.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"filters",kind:"map",K:9,V:{kind:"message",T:()=>b}},{no:3,name:"resource_schemas",kind:"message",repeat:1,T:()=>K}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.filters={},t.resourceSchemas=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:this.binaryReadMap2(s.filters,e,r);break;case 3:s.resourceSchemas.push(K.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap2(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=b.internalBinaryRead(t,t.uint32(),r);break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.ControllerAPI.Register.Request.filters")}}e[u??""]=l??b.create()}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);for(let s of globalThis.Object.keys(e.filters))t.tag(2,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s),t.tag(2,i.WireType.LengthDelimited).fork(),b.internalBinaryWrite(e.filters[s],t,r),t.join().join();for(let s=0;s<e.resourceSchemas.length;s++)K.internalBinaryWrite(e.resourceSchemas[s],t.tag(3,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const sa=new ia;class oa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Register.Response",[{no:1,name:"controller_id",kind:"scalar",T:4,L:0},{no:2,name:"subscription_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerId=0n,t.subscriptionId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerId=e.uint64().toBigInt();break;case 2:s.subscriptionId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.controllerId),e.subscriptionId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.subscriptionId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const aa=new oa;class la extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Exists",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new la;class ca extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Exists.Request",[{no:1,name:"controller_type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ua=new ca;class da extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Exists.Response",[{no:1,name:"exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.exists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.exists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.exists!==!1&&t.tag(1,i.WireType.Varint).bool(e.exists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const pa=new da;class fa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Update",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new fa;class ya extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Update.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"filters",kind:"map",K:9,V:{kind:"message",T:()=>b}},{no:3,name:"resource_schemas",kind:"message",repeat:1,T:()=>K}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.filters={},t.resourceSchemas=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:this.binaryReadMap2(s.filters,e,r);break;case 3:s.resourceSchemas.push(K.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap2(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=b.internalBinaryRead(t,t.uint32(),r);break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.ControllerAPI.Update.Request.filters")}}e[u??""]=l??b.create()}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);for(let s of globalThis.Object.keys(e.filters))t.tag(2,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s),t.tag(2,i.WireType.LengthDelimited).fork(),b.internalBinaryWrite(e.filters[s],t,r),t.join().join();for(let s=0;s<e.resourceSchemas.length;s++)K.internalBinaryWrite(e.resourceSchemas[s],t.tag(3,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ha=new ya;class ga extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Update.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ta=new ga;class ka extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Deregister",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ka;class ma extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Deregister.Request",[{no:1,name:"controller_type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const wa=new ma;class ba extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Deregister.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Pa=new ba;class Ra extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Create",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ra;class Ia extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Create.Request",[{no:1,name:"id",kind:"scalar",T:4,L:0},{no:2,name:"controller_type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.id=0n,t.controllerType="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=e.uint64().toBigInt();break;case 2:s.controllerType=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id!==0n&&t.tag(1,i.WireType.Varint).uint64(e.id),e.controllerType!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.controllerType);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const _a=new Ia;class Aa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Create.Response",[{no:1,name:"controller_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.controllerId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const La=new Aa;class Fa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Fa;class Wa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Get.Request",[{no:1,name:"controller_type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ua=new Wa;class Ba extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.Get.Response",[{no:1,name:"controller",kind:"message",T:()=>Le}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controller=Le.internalBinaryRead(e,e.uint32(),r,s.controller);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controller&&Le.internalBinaryWrite(e.controller,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Na=new Ba;class Ma extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.AttachSubscription",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ma;class xa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.AttachSubscription.Request",[{no:1,name:"controller_id",kind:"scalar",T:4,L:0},{no:2,name:"subscription_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerId=0n,t.subscriptionId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerId=e.uint64().toBigInt();break;case 2:s.subscriptionId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.controllerId),e.subscriptionId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.subscriptionId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ea=new xa;class $a extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.AttachSubscription.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Sa=new $a;class Ca extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.GetNotifications",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ca;class Da extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.GetNotifications.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"max_notifications",kind:"scalar",T:13}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.maxNotifications=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:s.maxNotifications=e.uint32();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType),e.maxNotifications!==0&&t.tag(2,i.WireType.Varint).uint32(e.maxNotifications);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Oa=new Da;class qa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.GetNotifications.Response",[{no:1,name:"notifications",kind:"message",repeat:1,T:()=>q}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.notifications=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.notifications.push(q.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){for(let s=0;s<e.notifications.length;s++)q.internalBinaryWrite(e.notifications[s],t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ka=new qa;class Va extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.WriteAliasesAndUrls",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Va;class va extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.WriteAliasesAndUrls.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"aliases_to_urls",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.aliasesToUrls={},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:this.binaryReadMap2(s.aliasesToUrls,e,r);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap2(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=t.string();break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.ControllerAPI.WriteAliasesAndUrls.Request.aliases_to_urls")}}e[u??""]=l??""}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);for(let s of globalThis.Object.keys(e.aliasesToUrls))t.tag(2,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s).tag(2,i.WireType.LengthDelimited).string(e.aliasesToUrls[s]).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ja=new va;class Ha extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.WriteAliasesAndUrls.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ga=new Ha;class Ja extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.GetUrl",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ja;class za extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.GetUrl.Request",[{no:1,name:"controller_alias",kind:"scalar",T:9},{no:2,name:"resource_id",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerAlias="",t.resourceId=0n,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerAlias=e.string();break;case 2:s.resourceId=e.uint64().toBigInt();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerAlias!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerAlias),e.resourceId!==0n&&t.tag(2,i.WireType.Varint).uint64(e.resourceId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ya=new za;class Xa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.GetUrl.Response",[{no:2,name:"controller_url",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerUrl="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.controllerUrl=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerUrl!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.controllerUrl);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Za=new Xa;class Qa extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.RemoveAliasesAndUrls",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Qa;class el extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.RemoveAliasesAndUrls.Request",[{no:1,name:"controller_type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const tl=new el;class nl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.RemoveAliasesAndUrls.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const rl=new nl;class il extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.SetFeatures",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new il;class sl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.SetFeatures.Request",[{no:2,name:"features",kind:"message",repeat:1,T:()=>We}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.features=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.features.push(We.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){for(let s=0;s<e.features.length;s++)We.internalBinaryWrite(e.features[s],t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const se=new sl;class ol extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.SetFeatures.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const oe=new ol;class al extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.ClearFeatures",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new al;class ll extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.ClearFeatures.Request",[{no:1,name:"controller_type",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ae=new ll;class cl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerAPI.ClearFeatures.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const le=new cl;class ul extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new ul;class dl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.List",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new dl;class pl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.List.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"start_from",kind:"scalar",T:9},{no:3,name:"limit",kind:"scalar",T:13}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.startFrom="",t.limit=0,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.startFrom=e.string();break;case 3:s.limit=e.uint32();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.startFrom!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.startFrom),e.limit!==0&&t.tag(3,i.WireType.Varint).uint32(e.limit);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ht=new pl;class fl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.List.Response",[{no:1,name:"record",kind:"message",T:()=>Jt},{no:4,name:"next",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.next="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.record=Jt.internalBinaryRead(e,e.uint32(),r,s.record);break;case 4:s.next=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.record&&Jt.internalBinaryWrite(e.record,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.next!==""&&t.tag(4,i.WireType.LengthDelimited).string(e.next);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Gt=new fl;class yl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.List.Response.KV",[{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"value",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.key="",t.value=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 2:s.key=e.string();break;case 3:s.value=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key),e.value.length&&t.tag(3,i.WireType.LengthDelimited).bytes(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Jt=new yl;class hl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Set",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new hl;class gl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Set.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"value",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.key="",t.value=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.key=e.string();break;case 3:s.value=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key),e.value.length&&t.tag(3,i.WireType.LengthDelimited).bytes(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const zt=new gl;class Tl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Set.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Yt=new Tl;class kl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new kl;class ml extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Get.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"key",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.key="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.key=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Xt=new ml;class wl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Get.Response",[{no:1,name:"value",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.value=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.value=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.value.length&&t.tag(1,i.WireType.LengthDelimited).bytes(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Zt=new wl;class bl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.GetIfExists",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new bl;class Pl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.GetIfExists.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"key",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.key="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.key=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Qt=new Pl;class Rl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.GetIfExists.Response",[{no:1,name:"value",kind:"scalar",T:12},{no:2,name:"exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.value=new Uint8Array(0),t.exists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.value=e.bytes();break;case 2:s.exists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.value.length&&t.tag(1,i.WireType.LengthDelimited).bytes(e.value),e.exists!==!1&&t.tag(2,i.WireType.Varint).bool(e.exists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const en=new Rl;class Il extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Delete",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Il;class _l extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Delete.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"key",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.key="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.key=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const tn=new _l;class Al extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.Delete.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const nn=new Al;class Ll extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.SetFlag",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ll;class Fl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.SetFlag.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"value",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.key="",t.value=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.key=e.string();break;case 3:s.value=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key),e.value!==!1&&t.tag(3,i.WireType.Varint).bool(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const rn=new Fl;class Wl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.SetFlag.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const sn=new Wl;class Ul extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.GetFlag",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ul;class Bl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.GetFlag.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"key",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.key="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.key=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const S=new Bl;class Nl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ResourceKVAPI.GetFlag.Response",[{no:1,name:"value",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.value=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.value=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.value!==!1&&t.tag(1,i.WireType.Varint).bool(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const C=new Nl;class Ml extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ml;class xl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.Set",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new xl;class El extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.Set.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"value",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.key="",t.value=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:s.key=e.string();break;case 3:s.value=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key),e.value.length&&t.tag(3,i.WireType.LengthDelimited).bytes(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const on=new El;class $l extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.Set.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const an=new $l;class Sl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.Get",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Sl;class Cl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.Get.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.key="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:s.key=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ln=new Cl;class Dl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.Get.Response",[{no:1,name:"value",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.value=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.value=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.value.length&&t.tag(1,i.WireType.LengthDelimited).bytes(e.value);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const cn=new Dl;class Ol extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.GetIfExists",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ol;class ql extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.GetIfExists.Request",[{no:1,name:"controller_type",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.controllerType="",t.key="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.controllerType=e.string();break;case 2:s.key=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.controllerType!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.controllerType),e.key!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.key);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const un=new ql;class Kl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.ControllerKVAPI.GetIfExists.Response",[{no:1,name:"value",kind:"scalar",T:12},{no:2,name:"exists",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.value=new Uint8Array(0),t.exists=!1,e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.value=e.bytes();break;case 2:s.exists=e.bool();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.value.length&&t.tag(1,i.WireType.LengthDelimited).bytes(e.value),e.exists!==!1&&t.tag(2,i.WireType.Varint).bool(e.exists);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const dn=new Kl;class Vl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Vl;class vl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI.SetToField",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new vl;class jl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI.SetToField.Request",[{no:1,name:"id",kind:"message",T:()=>y},{no:2,name:"period",kind:"message",T:()=>w}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.id=y.internalBinaryRead(e,e.uint32(),r,s.id);break;case 2:s.period=w.internalBinaryRead(e,e.uint32(),r,s.period);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.id&&y.internalBinaryWrite(e.id,t.tag(1,i.WireType.LengthDelimited).fork(),r).join(),e.period&&w.internalBinaryWrite(e.period,t.tag(2,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const pn=new jl;class Hl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI.SetToField.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const fn=new Hl;class Gl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI.DeleteExpiredRecords",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Gl;class Jl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI.DeleteExpiredRecords.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const yn=new Jl;class zl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.CacheAPI.DeleteExpiredRecords.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const hn=new zl;class Yl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Yl;class Xl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Xl;class Zl extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Create",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Zl;class Ql extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Create.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:3,name:"timeout",kind:"message",T:()=>w},{no:4,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 3:s.timeout=w.internalBinaryRead(e,e.uint32(),r,s.timeout);break;case 4:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.timeout&&w.internalBinaryWrite(e.timeout,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.name!==""&&t.tag(4,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ec=new Ql;class tc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Create.Response",[{no:1,name:"lease_id",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.leaseId=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.leaseId=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.leaseId.length&&t.tag(1,i.WireType.LengthDelimited).bytes(e.leaseId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const nc=new tc;class rc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Update",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new rc;class ic extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Update.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"lease_id",kind:"scalar",T:12},{no:3,name:"timeout",kind:"message",T:()=>w},{no:4,name:"name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.leaseId=new Uint8Array(0),t.name="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.leaseId=e.bytes();break;case 3:s.timeout=w.internalBinaryRead(e,e.uint32(),r,s.timeout);break;case 4:s.name=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.leaseId.length&&t.tag(2,i.WireType.LengthDelimited).bytes(e.leaseId),e.timeout&&w.internalBinaryWrite(e.timeout,t.tag(3,i.WireType.LengthDelimited).fork(),r).join(),e.name!==""&&t.tag(4,i.WireType.LengthDelimited).string(e.name);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const sc=new ic;class oc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Update.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const ac=new oc;class lc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Release",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new lc;class cc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Release.Request",[{no:1,name:"resource_id",kind:"scalar",T:4,L:0},{no:2,name:"lease_id",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.resourceId=0n,t.leaseId=new Uint8Array(0),e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.resourceId=e.uint64().toBigInt();break;case 2:s.leaseId=e.bytes();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.resourceId!==0n&&t.tag(1,i.WireType.Varint).uint64(e.resourceId),e.leaseId.length&&t.tag(2,i.WireType.LengthDelimited).bytes(e.leaseId);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const uc=new cc;class dc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.LocksAPI.Lease.Release.Response",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const pc=new dc;class fc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new fc;class yc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.ListMethods",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new yc;class hc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.ListMethods.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const gc=new hc;class Tc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.ListMethods.Response",[{no:1,name:"methods",kind:"message",repeat:1,T:()=>gn}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.methods=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.methods.push(gn.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){for(let s=0;s<e.methods.length;s++)gn.internalBinaryWrite(e.methods[s],t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const kc=new Tc;class mc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.ListMethods.MethodInfo",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"info",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.type="",t.name="",t.info={},e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.type=e.string();break;case 2:s.name=e.string();break;case 3:this.binaryReadMap3(s.info,e,r);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}binaryReadMap3(e,t,r){let n=t.uint32(),s=t.pos+n,u,l;for(;t.pos<s;){let[c,o]=t.tag();switch(c){case 1:u=t.string();break;case 2:l=t.string();break;default:throw new globalThis.Error("unknown map entry field for field MiLaboratories.PL.API.AuthAPI.ListMethods.MethodInfo.info")}}e[u??""]=l??""}internalBinaryWrite(e,t,r){e.type!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.type),e.name!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.name);for(let s of globalThis.Object.keys(e.info))t.tag(3,i.WireType.LengthDelimited).fork().tag(1,i.WireType.LengthDelimited).string(s).tag(2,i.WireType.LengthDelimited).string(e.info[s]).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const gn=new mc;class wc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.GetJWTToken",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new wc;class bc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.GetJWTToken.Request",[{no:1,name:"expiration",kind:"message",T:()=>w}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.expiration=w.internalBinaryRead(e,e.uint32(),r,s.expiration);break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.expiration&&w.internalBinaryWrite(e.expiration,t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Pc=new bc;class Rc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.AuthAPI.GetJWTToken.Response",[{no:1,name:"token",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.token="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.token=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.token!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.token);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Ic=new Rc;class _c extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MiscAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new _c;class Ac extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MiscAPI.ListResourceTypes",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Ac;class Lc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MiscAPI.ListResourceTypes.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Fc=new Lc;class Wc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MiscAPI.ListResourceTypes.Response",[{no:1,name:"types",kind:"message",repeat:1,T:()=>f}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.types=[],e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.types.push(f.internalBinaryRead(e,e.uint32(),r));break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){for(let s=0;s<e.types.length;s++)f.internalBinaryWrite(e.types[s],t.tag(1,i.WireType.LengthDelimited).fork(),r).join();let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const Uc=new Wc;class Bc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MaintenanceAPI",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Bc;class Nc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MaintenanceAPI.Ping",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}new Nc;class Mc extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MaintenanceAPI.Ping.Request",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){return n??this.create()}internalBinaryWrite(e,t,r){let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const xc=new Mc;class Ec extends i.MessageType{constructor(){super("MiLaboratories.PL.API.MaintenanceAPI.Ping.Response",[{no:1,name:"core_version",kind:"scalar",T:9},{no:2,name:"core_full_version",kind:"scalar",T:9},{no:3,name:"server_info",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.coreVersion="",t.coreFullVersion="",t.serverInfo="",e!==void 0&&i.reflectionMergePartial(this,t,e),t}internalBinaryRead(e,t,r,n){let s=n??this.create(),u=e.pos+t;for(;e.pos<u;){let[l,c]=e.tag();switch(l){case 1:s.coreVersion=e.string();break;case 2:s.coreFullVersion=e.string();break;case 3:s.serverInfo=e.string();break;default:let o=r.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${l} (wire type ${c}) for ${this.typeName}`);let d=e.skip(c);o!==!1&&(o===!0?i.UnknownFieldHandler.onRead:o)(this.typeName,s,l,c,d)}}return s}internalBinaryWrite(e,t,r){e.coreVersion!==""&&t.tag(1,i.WireType.LengthDelimited).string(e.coreVersion),e.coreFullVersion!==""&&t.tag(2,i.WireType.LengthDelimited).string(e.coreFullVersion),e.serverInfo!==""&&t.tag(3,i.WireType.LengthDelimited).string(e.serverInfo);let n=r.writeUnknownFields;return n!==!1&&(n==!0?i.UnknownFieldHandler.onWrite:n)(this.typeName,e,t),t}}const $c=new Ec,Tn=new h.ServiceType("MiLaboratories.PL.API.Platform",[{name:"Tx",serverStreaming:!0,clientStreaming:!0,options:{},I:$i,O:Ci},{name:"TxSync",options:{},I:Xi,O:Qi},{name:"SubscriptionAttachFilter",options:{},I:te,O:ne},{name:"SubscriptionDetachFilter",options:{},I:re,O:ie},{name:"NotificationsGet",options:{},I:Q,O:ee},{name:"ControllerRegister",options:{},I:sa,O:aa},{name:"ControllerDeregister",options:{},I:wa,O:Pa},{name:"ControllerCreate",options:{},I:_a,O:La},{name:"ControllerExists",options:{},I:ua,O:pa},{name:"ControllerGet",options:{},I:Ua,O:Na},{name:"ControllerUpdate",options:{},I:ha,O:Ta},{name:"ControllerAttachSubscription",options:{},I:Ea,O:Sa},{name:"GetControllerNotifications",options:{},I:Oa,O:Ka},{name:"WriteControllerAliasesAndUrls",options:{},I:ja,O:Ga},{name:"RemoveControllerAliasesAndUrls",options:{},I:tl,O:rl},{name:"GetControllerUrl",options:{},I:Ya,O:Za},{name:"ControllerSetFeatures",options:{},I:se,O:oe},{name:"ControllerClearFeatures",options:{},I:ae,O:le},{name:"LeaseResource",options:{},I:ec,O:nc},{name:"UpdateLease",options:{},I:sc,O:ac},{name:"ReleaseLease",options:{},I:uc,O:pc},{name:"AuthMethods",options:{},I:gc,O:kc},{name:"GetJWTToken",options:{},I:Pc,O:Ic},{name:"ListResourceTypes",options:{},I:Fc,O:Uc},{name:"Ping",options:{},I:xc,O:$c}]);function Sc(a){return a instanceof ArrayBuffer||ArrayBuffer.isView(a)}function Cc(a){if(typeof a=="string")return Buffer.from(a);if(Sc(a))return a;throw new Error(`Unexpected type: ${a}`)}function Kn(a,e=!1){return a instanceof Gn||a.name=="RpcError"&&a.code=="UNAVAILABLE"?!0:a.cause!==void 0&&!e?Kn(a.cause,!0):!1}function Vn(a,e=!1){return a instanceof me||a.name=="RpcError"&&a.code=="UNAUTHENTICATED"?!0:a.cause!==void 0&&!e?Vn(a.cause,!0):!1}function vn(a,e=!1){return a instanceof g.Aborted||a.name=="AbortError"||a.code=="ABORT_ERR"||a.name=="RpcError"&&(a.code=="CANCELLED"||a.code=="DEADLINE_EXCEEDED")?!0:a.cause!==void 0&&!e?vn(a.cause,!0):!1}const Te=5;class jn extends Error{constructor(e){super(`code=${e.code} ${e.message}`),this.status=e}}function gr(a){throw new ke({code:Te,message:a,details:[]})}class ke extends jn{constructor(e){super(e)}}class Tr extends jn{constructor(e){super(e)}}function Hn(a,e=!1){return a.name=="RpcError"&&a.code=="NOT_FOUND"?!0:a.cause!==void 0&&!e?Hn(a.cause,!0):a instanceof ke&&a.status.code===Te}class me extends Error{constructor(e){super("LoginFailed: "+e)}}class Gn extends Error{constructor(e){super("Disconnected: "+e)}}function kr(a,e=!1){throw Vn(a)?new me(a.message):Kn(a)?new Gn(a.message):vn(a)?new g.Aborted(a):e?new Error(a.message,{cause:a}):a}const mr="resourceError";function Dc(a){return a.deletedTime!==void 0&&a.deletedTime.seconds!==0n}function or(a){var e;return Dc(a)&&gr("resource deleted"),{id:a.id,originalResourceId:a.originalResourceId,type:g.notEmpty(a.type),data:a.data,inputsLocked:a.inputsLocked,outputsLocked:a.outputsLocked,resourceReady:a.resourceReady,kind:Oc(a.kind),error:qc(a),final:a.isFinal,fields:(e=a.fields)==null?void 0:e.filter(t=>t.id.fieldName!==mr).map(wr)}}function Oc(a){switch(a){case de.STRUCTURAL:return"Structural";case de.VALUE:return"Value"}throw new Error("invalid ResourceKind: "+a)}function qc(a){const e=a.fields.find(t=>{var r;return((r=t==null?void 0:t.id)==null?void 0:r.fieldName)===mr});return(e==null?void 0:e.error)??U}function wr(a){var e;return{name:g.notEmpty((e=a.id)==null?void 0:e.fieldName),type:Kc(a.type),status:Vc(a.valueStatus),value:a.value,error:a.error,valueIsFinal:a.valueIsFinal}}function Kc(a){switch(a){case T.INPUT:return"Input";case T.OUTPUT:return"Output";case T.SERVICE:return"Service";case T.ONE_TIME_WRITABLE:return"OTW";case T.DYNAMIC:return"Dynamic";case T.MULTIPLE_TIMES_WRITABLE:return"MTW";default:throw new Error("invalid FieldType: "+a)}}function Vc(a){switch(a){case j.EMPTY:return"Empty";case j.ASSIGNED:return"Assigned";case j.RESOLVED:return"Resolved";default:throw new Error("invalid FieldStatus: "+a)}}function vc(a){switch(a){case"Input":return T.INPUT;case"Output":return T.OUTPUT;case"Dynamic":return T.DYNAMIC;case"Service":return T.SERVICE;case"MTW":return T.MULTIPLE_TIMES_WRITABLE;case"OTW":return T.ONE_TIME_WRITABLE;default:return g.assertNever(a)}}function jc(a){return a.hasOwnProperty("resourceId")&&a.hasOwnProperty("fieldName")}function br(a){return typeof a=="bigint"||a.hasOwnProperty("globalId")&&a.hasOwnProperty("localId")}function Jn(a){return M(a.resourceId)}function M(a){return a.hasOwnProperty("globalId")&&a.hasOwnProperty("localId")}function R(a){return Jn(a)?{resourceId:a.resourceId.localId,fieldName:a.fieldName}:a}async function Hc(a){return Jn(a)?{resourceId:await a.resourceId.globalId,fieldName:a.fieldName}:a}function k(a){return M(a)?a.localId:a}async function Pr(a){return M(a)?await a.globalId:a}function we(a,e){return{resourceId:a,fieldName:e}}class zn extends Error{}async function Z(a){try{return await a()}catch(e){if(Hn(e))return;throw e}}const L=class L{constructor(e,t,r,n,s,u){p(this,"globalTxId");p(this,"localTxId",L.nextLocalTxId());p(this,"txOpenTimestamp",Date.now());p(this,"localResourceIdCounter",0);p(this,"_completed",!1);p(this,"pendingVoidOps",[]);p(this,"globalTxIdWasAwaited",!1);this.ll=e,this.name=t,this.writable=r,this._clientRoot=n,this.finalPredicate=s,this.sharedResourceDataCache=u,this.globalTxId=this.sendSingleAndParse({oneofKind:"txOpen",txOpen:{name:t,writable:r?pe.WRITABLE:pe.NOT_WRITABLE}},l=>{var c;return g.notEmpty((c=l.txOpen.tx)==null?void 0:c.id)}),this.globalTxId.catch(l=>{this.globalTxIdWasAwaited||console.warn(l)})}async drainAndAwaitPendingOps(){if(this.pendingVoidOps.length===0)return;const e=this.pendingVoidOps;this.pendingVoidOps=[],await Promise.all(e)}async sendSingleAndParse(e,t){const r=this.ll.send(e,!1);try{await this.drainAndAwaitPendingOps()}finally{return t(await r)}}async sendMultiAndParse(e,t){const r=this.ll.send(e,!0);try{await this.drainAndAwaitPendingOps()}finally{return t(await r)}}async sendVoidSync(e){await this.ll.send(e,!1)}sendVoidAsync(e){this.pendingVoidOps.push(this.sendVoidSync(e))}checkTxOpen(){if(this._completed)throw new Error("Transaction already closed")}get completed(){return this._completed}async commit(){if(this.checkTxOpen(),this._completed=!0,this.writable){const e=this.sendSingleAndParse({oneofKind:"txCommit",txCommit:{}},r=>r.txCommit.success),t=this.ll.complete();if(await this.drainAndAwaitPendingOps(),!await e)throw new zn;await t,await this.ll.await()}else{const e=this.ll.complete();await this.drainAndAwaitPendingOps(),await e,await this.ll.await()}}async discard(){this.checkTxOpen(),this._completed=!0;const e=this.sendVoidSync({oneofKind:"txDiscard",txDiscard:{}}),t=this.ll.complete();await this.drainAndAwaitPendingOps(),await e,await t,await this.ll.await()}get clientRoot(){return ue(this._clientRoot)}createSingleton(e,t,r=!1){const n=this.nextLocalResourceId(!1);return{globalId:this.sendSingleAndParse({oneofKind:"resourceCreateSingleton",resourceCreateSingleton:{type:t,id:n,data:Buffer.from(e),errorIfExists:r}},u=>u.resourceCreateSingleton.resourceId),localId:n}}async getSingleton(e,t=!0){return await this.sendSingleAndParse({oneofKind:"resourceGetSingleton",resourceGetSingleton:{data:Buffer.from(e),loadFields:t}},r=>or(g.notEmpty(r.resourceGetSingleton.resource)))}createResource(e,t,r){const n=this.nextLocalResourceId(e);return{globalId:this.sendSingleAndParse(t(n),u=>r(u)),localId:n}}createRoot(e){return this.createResource(!0,t=>({oneofKind:"resourceCreateRoot",resourceCreateRoot:{type:e,id:t}}),t=>t.resourceCreateRoot.resourceId)}createStruct(e,t){return this.createResource(!1,r=>({oneofKind:"resourceCreateStruct",resourceCreateStruct:{type:e,id:r,data:t===void 0?void 0:typeof t=="string"?Buffer.from(t):t}}),r=>r.resourceCreateStruct.resourceId)}createEphemeral(e,t){return this.createResource(!1,r=>({oneofKind:"resourceCreateEphemeral",resourceCreateEphemeral:{type:e,id:r,data:t===void 0?void 0:typeof t=="string"?Buffer.from(t):t}}),r=>r.resourceCreateEphemeral.resourceId)}createValue(e,t,r=!1){return this.createResource(!1,n=>({oneofKind:"resourceCreateValue",resourceCreateValue:{type:e,id:n,data:typeof t=="string"?Buffer.from(t):t,errorIfExists:r}}),n=>n.resourceCreateValue.resourceId)}setResourceName(e,t){this.sendVoidAsync({oneofKind:"resourceNameSet",resourceNameSet:{resourceId:k(t),name:e}})}deleteResourceName(e){this.sendVoidAsync({oneofKind:"resourceNameDelete",resourceNameDelete:{name:e}})}async getResourceByName(e){return await this.sendSingleAndParse({oneofKind:"resourceNameGet",resourceNameGet:{name:e}},t=>ue(t.resourceNameGet.resourceId))}async checkResourceNameExists(e){return await this.sendSingleAndParse({oneofKind:"resourceNameExists",resourceNameExists:{name:e}},t=>t.resourceNameExists.exists)}removeResource(e){this.sendVoidAsync({oneofKind:"resourceRemove",resourceRemove:{id:e}})}async resourceExists(e){return await this.sendSingleAndParse({oneofKind:"resourceExists",resourceExists:{resourceId:e}},t=>t.resourceExists.exists)}async getResourceData(e,t=!0,r=!1){if(!r&&!M(e)&&!N(e)){const s=this.sharedResourceDataCache.get(e);if(s&&s.cacheTxOpenTimestamp<this.txOpenTimestamp)if(t){if(s.data)return s.data}else return s.basicData}const n=await this.sendSingleAndParse({oneofKind:"resourceGet",resourceGet:{resourceId:k(e),loadFields:t}},s=>or(g.notEmpty(s.resourceGet.resource)));if(!M(e)&&!N(e)&&this.finalPredicate(n)){const s=this.sharedResourceDataCache.get(e);s?t&&!s.data&&(s.data=n,s.cacheTxOpenTimestamp=this.txOpenTimestamp):t?this.sharedResourceDataCache.set(e,{basicData:bn(n),data:n,cacheTxOpenTimestamp:this.txOpenTimestamp}):this.sharedResourceDataCache.set(e,{basicData:bn(n),data:void 0,cacheTxOpenTimestamp:this.txOpenTimestamp})}return n}async getResourceDataIfExists(e,t=!0){const r=await Z(async()=>await this.getResourceData(e,t,!0));return r===void 0&&!M(e)&&!N(e)&&this.sharedResourceDataCache.delete(e),r}lockInputs(e){this.sendVoidAsync({oneofKind:"resourceLockInputs",resourceLockInputs:{resourceId:k(e)}})}lockOutputs(e){this.sendVoidAsync({oneofKind:"resourceLockOutputs",resourceLockOutputs:{resourceId:k(e)}})}lock(e){this.lockInputs(e),this.lockOutputs(e)}createField(e,t,r){this.sendVoidAsync({oneofKind:"fieldCreate",fieldCreate:{type:vc(t),id:R(e)}}),r!==void 0&&this.setField(e,r)}async fieldExists(e){return await this.sendSingleAndParse({oneofKind:"fieldExists",fieldExists:{field:R(e)}},t=>t.fieldExists.exists)}setField(e,t){br(t)?this.sendVoidAsync({oneofKind:"fieldSet",fieldSet:{field:R(e),value:{resourceId:k(t),fieldName:""}}}):this.sendVoidAsync({oneofKind:"fieldSet",fieldSet:{field:R(e),value:R(t)}})}setFieldError(e,t){this.sendVoidAsync({oneofKind:"fieldSetError",fieldSetError:{field:R(e),errResourceId:k(t)}})}async getField(e){return await this.sendSingleAndParse({oneofKind:"fieldGet",fieldGet:{field:R(e)}},t=>wr(g.notEmpty(t.fieldGet.field)))}async getFieldIfExists(e){return Z(async()=>await this.getField(e))}resetField(e){this.sendVoidAsync({oneofKind:"fieldReset",fieldReset:{field:R(e)}})}removeField(e){this.sendVoidAsync({oneofKind:"fieldRemove",fieldRemove:{field:R(e)}})}async listKeyValues(e){return await this.sendMultiAndParse({oneofKind:"resourceKeyValueList",resourceKeyValueList:{resourceId:k(e),startFrom:"",limit:0}},t=>t.map(r=>r.resourceKeyValueList.record))}async listKeyValuesString(e){return(await this.listKeyValues(e)).map(({key:t,value:r})=>({key:t,value:Buffer.from(r).toString()}))}async listKeyValuesIfResourceExists(e){return Z(async()=>await this.listKeyValues(e))}async listKeyValuesStringIfResourceExists(e){return Z(async()=>await this.listKeyValuesString(e))}setKValue(e,t,r){this.sendVoidAsync({oneofKind:"resourceKeyValueSet",resourceKeyValueSet:{resourceId:k(e),key:t,value:Cc(r)}})}deleteKValue(e,t){this.sendVoidAsync({oneofKind:"resourceKeyValueDelete",resourceKeyValueDelete:{resourceId:k(e),key:t}})}async getKValue(e,t){return await this.sendSingleAndParse({oneofKind:"resourceKeyValueGet",resourceKeyValueGet:{resourceId:k(e),key:t}},r=>r.resourceKeyValueGet.value)}async getKValueString(e,t){return Buffer.from(await this.getKValue(e,t)).toString()}async getKValueJson(e,t){return JSON.parse(await this.getKValueString(e,t))}async getKValueIfExists(e,t){return await this.sendSingleAndParse({oneofKind:"resourceKeyValueGetIfExists",resourceKeyValueGetIfExists:{resourceId:k(e),key:t}},r=>r.resourceKeyValueGetIfExists.exists?r.resourceKeyValueGetIfExists.value:void 0)}async getKValueStringIfExists(e,t){const r=await this.getKValueIfExists(e,t);return r===void 0?void 0:Buffer.from(r).toString()}async getKValueJsonIfExists(e,t){const r=await this.getKValueString(e,t);if(r!==void 0)return JSON.parse(r)}getFutureFieldValue(e,t,r){const n=Buffer.from(JSON.stringify({fieldName:t,fieldType:r})),s=this.createEphemeral({name:"json/getField",version:"1"},n);return this.setField({resourceId:s,fieldName:"resource"},e),{resourceId:s,fieldName:"result"}}async getGlobalTxId(){return this.globalTxIdWasAwaited=!0,await this.globalTxId}async complete(){if(this._completed)return;this._completed=!0;const e=this.ll.complete();await this.drainAndAwaitPendingOps(),await e}async await(){await this.ll.await()}nextLocalResourceId(e){return On(e,++this.localResourceIdCounter,this.localTxId)}static nextLocalTxId(){return L.localTxIdCounter++,L.localTxIdCounter===ge&&(L.localTxIdCounter=1),L.localTxIdCounter}};p(L,"localTxIdCounter",0);let fe=L;function P(a,e){return{name:a,version:e}}const In=P("ClientRoot","1"),Gc=P("StructTest","1"),Jc=P("ValueTest","1"),Rr=P("json/string","1"),Ir=P("json/bool","1"),_r=P("json/object","1"),Ar=P("json/array","1"),Lr=P("json/number","1"),Fr=P("json/null","1"),Yn=P("EphStdMap","1"),Xn=P("StdMap","1");function zc(a){return a.createValue(Fr,Buffer.from(JSON.stringify(null)))}function Yc(a,e){return a.createValue(Ir,Buffer.from(JSON.stringify(e)))}function Xc(a,e){return a.createValue(Lr,Buffer.from(JSON.stringify(e)))}function Zc(a,e){return a.createValue(Rr,Buffer.from(JSON.stringify(e)))}function Qc(a,e){return a.createValue(Ar,Buffer.from(JSON.stringify(e)))}function eu(a,e){return a.createValue(_r,Buffer.from(JSON.stringify(e)))}function Zn(a,e){return[a,e]}function Wr(a,e){return e===void 0?Object.entries(a):e.map(t=>Zn(t,a[t]))}function tu(a,e,t,r){const n=r??(t?Yn:Xn),s=t?a.createEphemeral(n):a.createStruct(n);for(const[u,l]of Array.isArray(e)?e:Wr(e))a.createField(we(s,u),"Input",l);return a.lock(s),s}function nu(a,e,t,r,n=""){return Object.fromEntries(t.map(s=>Zn(s,a.getFutureFieldValue(e,`${n}${s}`,r))))}const Ur=Xn,Br=Yn,be="ref";function ru(a,e){const t=a.createStruct(Ur),r=we(t,be);return a.createField(r,"Input",e),a.lock(t),t}function iu(a,e){const t=a.createEphemeral(Br),r=we(t,be);return a.createField(r,"Input",e),a.lock(t),t}function su(a,e){return a.getFutureFieldValue(e,be,"Input")}const ou=Object.freeze(Object.defineProperty({__proto__:null,ClientRoot:In,EphHolder:Br,EphStdMap:Yn,Holder:Ur,HolderRefField:be,JsonArray:Ar,JsonBool:Ir,JsonNull:Fr,JsonNumber:Lr,JsonObject:_r,JsonString:Rr,StdMap:Xn,StructTestResource:Gc,ValueTestResource:Jc,createPlArray:Qc,createPlBool:Yc,createPlMap:tu,createPlNull:zc,createPlNumber:Xc,createPlObject:eu,createPlString:Zc,futureRecord:nu,plEntries:Wr,plEntry:Zn,unwrapHolder:su,wrapInEphHolder:iu,wrapInHolder:ru},Symbol.toStringTag,{value:"Module"})),_n=2e3,An=3e4,Ln=31*24*60*60,Fn=12*24*60*60,Wn=35e6,Un="exponential",Bn=10,Nn=4,Mn=2,xn=50,En=.3;function _(a){if(!a)return;const e=Number(a);if(e===Number.NaN)throw new Error(`Can't parse number: ${a}`);return e}function J(a,e={}){if(a.indexOf("://")===-1)return{hostAndPort:a,ssl:!1,defaultRequestTimeout:_n,defaultTransactionTimeout:An,authTTLSeconds:Ln,authMaxRefreshSeconds:Fn,txDelay:0,forceSync:!1,maxCacheBytes:Wn,retryBackoffAlgorithm:Un,retryMaxAttempts:Bn,retryInitialDelay:Nn,retryExponentialBackoffMultiplier:Mn,retryLinearBackoffStep:xn,retryJitter:En,...e};const t=new URL(a);if(t.protocol!=="https:"&&t.protocol!=="http:"&&t.protocol!=="grpc:"&&t.protocol!=="tls:")throw new Error(`Unexpected URL schema: ${t.protocol}`);if(t.pathname!=="/"&&t.pathname!=="")throw new Error(`Unexpected URL path: ${t.pathname}`);return{hostAndPort:t.host,alternativeRoot:t.searchParams.get("alternative-root")??void 0,ssl:t.protocol==="https:"||t.protocol==="tls:",defaultRequestTimeout:_(t.searchParams.get("request-timeout"))??_n,defaultTransactionTimeout:_(t.searchParams.get("tx-timeout"))??An,authTTLSeconds:Ln,authMaxRefreshSeconds:Fn,grpcProxy:t.searchParams.get("grpc-proxy")??void 0,httpProxy:t.searchParams.get("http-proxy")??void 0,user:t.username===""?void 0:t.username,password:t.password===""?void 0:t.password,txDelay:_(t.searchParams.get("tx-delay"))??0,forceSync:!!t.searchParams.get("force-sync"),maxCacheBytes:_(t.searchParams.get("max-cache-bytes"))??Wn,retryBackoffAlgorithm:t.searchParams.get("retry-backoff-algorithm")??Un,retryMaxAttempts:_(t.searchParams.get("retry-max-attempts"))??Bn,retryInitialDelay:_(t.searchParams.get("retry-initial-delay"))??Nn,retryExponentialBackoffMultiplier:_(t.searchParams.get("retry-exp-backoff-multiplier"))??Mn,retryLinearBackoffStep:_(t.searchParams.get("retry-linear-backoff-step"))??xn,retryJitter:_(t.searchParams.get("retry-backoff-jitter"))??En,...e}}const au={};class lu{constructor(e){p(this,"typeName",Tn.typeName);p(this,"methods",Tn.methods);p(this,"options",Tn.options);this._transport=e}tx(e){const t=this.methods[0],r=this._transport.mergeOptions(e);return h.stackIntercept("duplex",this._transport,t,r)}txSync(e,t){const r=this.methods[1],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}subscriptionAttachFilter(e,t){const r=this.methods[2],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}subscriptionDetachFilter(e,t){const r=this.methods[3],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}notificationsGet(e,t){const r=this.methods[4],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerRegister(e,t){const r=this.methods[5],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerDeregister(e,t){const r=this.methods[6],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerCreate(e,t){const r=this.methods[7],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerExists(e,t){const r=this.methods[8],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerGet(e,t){const r=this.methods[9],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerUpdate(e,t){const r=this.methods[10],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerAttachSubscription(e,t){const r=this.methods[11],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}getControllerNotifications(e,t){const r=this.methods[12],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}writeControllerAliasesAndUrls(e,t){const r=this.methods[13],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}removeControllerAliasesAndUrls(e,t){const r=this.methods[14],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}getControllerUrl(e,t){const r=this.methods[15],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerSetFeatures(e,t){const r=this.methods[16],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}controllerClearFeatures(e,t){const r=this.methods[17],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}leaseResource(e,t){const r=this.methods[18],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}updateLease(e,t){const r=this.methods[19],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}releaseLease(e,t){const r=this.methods[20],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}authMethods(e,t){const r=this.methods[21],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}getJWTToken(e,t){const r=this.methods[22],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}listResourceTypes(e,t){const r=this.methods[23],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}ping(e,t){const r=this.methods[24],n=this._transport.mergeOptions(t);return h.stackIntercept("unary",this._transport,r,n,e)}}function cu(a,e,t,r){return{kind:a,expectMultiResponse:e,resolve:t,reject:r}}function uu(a){return a.code===Te}class v extends Error{constructor(e){super("Rethrow error, you should never see this one."),this.rethrowLambda=e}}class du{constructor(e){p(this,"stream");p(this,"abortController",new AbortController);p(this,"requestIdxCounter",0);p(this,"responseHandlerQueue",new qr);p(this,"localResourceIdCounter",0n);p(this,"closed",!1);p(this,"completed",!1);p(this,"errorFactory");p(this,"openTimestamp",Date.now());p(this,"incomingProcessorResult");p(this,"_completed",!1);this.stream=e(this.abortController.signal),this.incomingProcessorResult=this.incomingEventProcessor()}assignErrorFactoryIfNotSet(e,t){return t!==void 0&&t(new v(e)),this.errorFactory||(this.errorFactory=e),e}async incomingEventProcessor(){var n;let e=-1,t,r;try{for await(const s of this.stream.responses){if(t===void 0){if(t=this.responseHandlerQueue.shift(),t===void 0){this.assignErrorFactoryIfNotSet(()=>{throw new Error("orphan incoming message")});break}t.expectMultiResponse&&(r=[]),e++}if(s.requestId!==e){const u=`out of order messages, ${s.requestId} !== ${e}`;this.assignErrorFactoryIfNotSet(()=>{throw new Error(u)});break}if(s.error!==void 0){const u=s.error;if(uu(u)){if(t.reject(new v(()=>{throw new ke(u)})),t=void 0,s.multiMessage!==void 0&&!s.multiMessage.isLast){this.assignErrorFactoryIfNotSet(()=>{throw new Error("Unexpected message sequence.")});break}continue}else{this.assignErrorFactoryIfNotSet(()=>{throw new Tr(u)},t.reject),t=void 0;break}}if(t.kind!==s.response.oneofKind&&((n=s==null?void 0:s.multiMessage)==null?void 0:n.isEmpty)!==!0){const u=`inconsistent request response types: ${t.kind} !== ${s.response.oneofKind}`;this.assignErrorFactoryIfNotSet(()=>{throw new Error(u)},t.reject),t=void 0;break}if(t.expectMultiResponse!==(s.multiMessage!==void 0)){const u=`inconsistent multi state: ${t.expectMultiResponse} !== ${s.multiMessage!==void 0}`;this.assignErrorFactoryIfNotSet(()=>{throw new Error(u)},t.reject),t=void 0;break}if(s.multiMessage!==void 0){if(!s.multiMessage.isEmpty){if(s.multiMessage.id!==r.length+1){const u=`inconsistent multi id: ${s.multiMessage.id} !== ${r.length+1}`;this.assignErrorFactoryIfNotSet(()=>{throw new Error(u)},t.reject),t=void 0;break}r.push(s.response)}s.multiMessage.isLast&&(t.resolve(r),r=void 0,t=void 0)}else t.resolve(s.response),t=void 0}}catch(s){return this.assignErrorFactoryIfNotSet(()=>{kr(s,!0)},t==null?void 0:t.reject)}finally{await this.close()}return null}async close(){if(!this.closed){for(this.closed=!0;;){const e=this.responseHandlerQueue.shift();if(!e)break;this.errorFactory?e.reject(new v(this.errorFactory)):e.reject(new Error("no reply"))}await this.stream.requests.complete()}}abort(e){this.assignErrorFactoryIfNotSet(()=>{throw new Error("transaction aborted",{cause:e})}),this.abortController.abort(e)}async await(){const e=await this.incomingProcessorResult;e!==null&&e()}async send(e,t){if(this.errorFactory)return Promise.reject(new v(this.errorFactory));if(this.closed)return Promise.reject(new Error("Transaction already closed"));const r=new Promise((n,s)=>{this.responseHandlerQueue.push(cu(e.oneofKind,t,n,s))});await this.stream.requests.send({requestId:this.requestIdxCounter++,request:e});try{return await r}catch(n){throw n instanceof v&&n.rethrowLambda(),new Error("Error while waiting for response",{cause:n})}}async complete(){this._completed||(this._completed=!0,await this.stream.requests.complete())}}function Qn(a){return JSON.parse(Buffer.from(a.split(".")[1],"base64").toString())}function V(a,e){if(a.jwtToken===void 0)return;const{exp:t,iat:r}=Qn(a.jwtToken);return Math.min((r+t)/2,r+e)*1e3}function pu(a){return a.jwtToken===void 0?void 0:Qn(a.jwtToken).exp*1e3}class er{constructor(e,t={}){p(this,"conf");p(this,"authInformation");p(this,"onAuthUpdate");p(this,"onAuthError");p(this,"onAuthRefreshProblem");p(this,"refreshTimestamp");p(this,"_status","OK");p(this,"statusListener");p(this,"grpcTransport");p(this,"grpcPl");p(this,"httpDispatcher");p(this,"authRefreshInProgress",!1);this.conf=typeof e=="string"?J(e):e;const r=[],{auth:n,statusListener:s}=t;n!==void 0&&(this.refreshTimestamp=V(n.authInformation,this.conf.authMaxRefreshSeconds),r.push(this.createAuthInterceptor()),this.authInformation=n.authInformation,this.onAuthUpdate=n.onUpdate,this.onAuthRefreshProblem=n.onUpdateError,this.onAuthError=n.onAuthError),r.push(this.createErrorInterceptor());const u={host:this.conf.hostAndPort,timeout:this.conf.defaultRequestTimeout,channelCredentials:this.conf.ssl?E.ChannelCredentials.createSsl():E.ChannelCredentials.createInsecure(),clientOptions:{"grpc.keepalive_time_ms":3e4,interceptors:r}};this.conf.grpcProxy?process.env.grpc_proxy=this.conf.grpcProxy:delete process.env.grpc_proxy,this.grpcTransport=new Or.GrpcTransport(u),this.grpcPl=new lu(this.grpcTransport);const l=new Vr({resolver:new Kr.Resolver({tries:10})}),c={headersTimeout:5e3,keepAliveTimeout:3e3,keepAliveMaxTimeout:6e4,maxRedirections:6,connect:{lookup:l.lookup.bind(l)}};this.conf.httpProxy!==void 0?this.httpDispatcher=new sr.ProxyAgent({uri:this.conf.httpProxy,...c}):this.httpDispatcher=new sr.Agent(c),s!==void 0&&(this.statusListener=s,s(this._status))}get authenticated(){return this.authInformation!==void 0}get authUser(){var e,t;if(!this.authenticated)throw new Error("Client is not authenticated");return(e=this.authInformation)!=null&&e.jwtToken?Qn((t=this.authInformation)==null?void 0:t.jwtToken).user.login:null}updateStatus(e){process.nextTick(()=>{this._status!==e&&(this._status=e,this.statusListener!==void 0&&this.statusListener(this._status),this.onAuthError!==void 0&&this.onAuthError())})}get status(){return this._status}refreshAuthInformationIfNeeded(){this.refreshTimestamp===void 0||Date.now()<this.refreshTimestamp||this.authRefreshInProgress||this._status==="Unauthenticated"||(this.authRefreshInProgress=!0,(async()=>{try{const e=await this.grpcPl.getJWTToken({expiration:{seconds:BigInt(this.conf.authTTLSeconds),nanos:0}}).response;this.authInformation={jwtToken:e.token},this.refreshTimestamp=V(this.authInformation,this.conf.authMaxRefreshSeconds),this.onAuthUpdate&&this.onAuthUpdate(this.authInformation)}catch(e){this.onAuthRefreshProblem&&this.onAuthRefreshProblem(e)}finally{this.authRefreshInProgress=!1}})())}createErrorInterceptor(){return(e,t)=>new E.InterceptingCall(t(e),{start:(r,n,s)=>{s(r,{onReceiveStatus:(u,l)=>{u.code==E.status.UNAUTHENTICATED&&this.updateStatus("Unauthenticated"),u.code==E.status.UNAVAILABLE&&this.updateStatus("Disconnected"),l(u)}})}})}createAuthInterceptor(){return(e,t)=>new E.InterceptingCall(t(e),{start:(r,n,s)=>{var u;((u=this.authInformation)==null?void 0:u.jwtToken)!==void 0&&(r.set("authorization","Bearer "+this.authInformation.jwtToken),this.refreshAuthInformationIfNeeded()),s(r,n)}})}createTx(e={}){return new du(t=>{let r=t;return e.abortSignal&&(r=AbortSignal.any([r,e.abortSignal])),this.grpcPl.tx({abort:r,timeout:e.timeout??this.conf.defaultTransactionTimeout})})}async close(){this.grpcTransport.close(),await this.httpDispatcher.destroy()}}function ce(a){return a.resourceReady||B(a.originalResourceId)||B(a.error)}function fu(a){if(!ce(a)||!a.outputsLocked)return!1;if(a.fields===void 0)return!0;for(const e of a.fields)if(A(e.error)&&(A(e.value)||!e.valueIsFinal))return!1;return!0}const ar=new Set,Nr=a=>{switch(a.type.name){case"StreamManager":if(!ce(a))return!1;if(a.fields===void 0||B(a.error))return!0;const e=Pn(a,"downloadable");return Pn(a,"stream").value===e.value;case"StdMap":case"std/map":case"EphStdMap":case"PFrame":case"BContext":case"BlockPackCustom":case"BinaryMap":case"BinaryValue":case"BlobMap":case"BResolveSingle":case"BResolveSingleNoResult":case"BQueryResult":case"TengoTemplate":case"TengoLib":case"SoftwareInfo":case"Dummy":return ce(a);case"json/resourceError":return a.type.version==="1";case"json/object":case"json/string":case"json/array":case"json/number":case"BContextEnd":case"Frontend/FromUrl":case"Frontend/FromFolder":case"BObjectSpec":case"Blob":case"LSProvider":return!0;case"UserProject":case"Projects":case"ClientRoot":return!1;default:if(a.type.name.startsWith("Blob/"))return!0;if(a.type.name.startsWith("BlobUpload/")||a.type.name.startsWith("BlobIndex/"))return fu(a);if(a.type.name.startsWith("PColumnData/"))return ce(a);ar.has(a.type.name)||(console.log("UNKNOWN RESOURCE TYPE: "+a.type.name),ar.add(a.type.name))}return!1},kn={sync:!1},yu="AnonymousRoot";function lr(a){return`alternative_root_${a}`}class Y{constructor(e,t,r={}){p(this,"ll");p(this,"drivers",new Map);p(this,"txDelay");p(this,"forceSync");p(this,"defaultRetryOptions");p(this,"_clientRoot",U);p(this,"_serverInfo");p(this,"finalPredicate");p(this,"resourceDataCache");this.ll=new er(e,{auth:t,...r});const n=this.ll.conf;switch(this.txDelay=n.txDelay,this.forceSync=n.forceSync,this.finalPredicate=r.finalPredicate??Nr,this.resourceDataCache=new jr.LRUCache({maxSize:n.maxCacheBytes,sizeCalculation:s=>{var u;return(((u=s.basicData.data)==null?void 0:u.length)??0)+64}}),n.retryBackoffAlgorithm){case"exponential":this.defaultRetryOptions={type:"exponentialBackoff",initialDelay:n.retryInitialDelay,maxAttempts:n.retryMaxAttempts,backoffMultiplier:n.retryExponentialBackoffMultiplier,jitter:n.retryJitter};break;case"linear":this.defaultRetryOptions={type:"linearBackoff",initialDelay:n.retryInitialDelay,maxAttempts:n.retryMaxAttempts,backoffStep:n.retryLinearBackoffStep,jitter:n.retryJitter};break;default:g.assertNever(n.retryBackoffAlgorithm)}}async ping(){return(await this.ll.grpcPl.ping({})).response}get conf(){return this.ll.conf}get httpDispatcher(){return this.ll.httpDispatcher}get initialized(){return!A(this._clientRoot)}checkInitialized(){if(!this.initialized)throw new Error("Client not initialized")}get clientRoot(){return this.checkInitialized(),ue(this._clientRoot)}get serverInfo(){return this.checkInitialized(),this._serverInfo}async init(){if(this.initialized)throw new Error("Already initialized");const e=this.ll.authUser,t=e===null?yu:ye.createHash("sha256").update(e).digest("hex");this._serverInfo=await this.ping(),this._clientRoot=await this._withTx("initialization",!0,U,async r=>{let n;if(await r.checkResourceNameExists(t)?n=await r.getResourceByName(t):(n=r.createRoot(In),r.setResourceName(t,n)),this.conf.alternativeRoot===void 0)return await r.commit(),await Pr(n);{const s={resourceId:n,fieldName:lr(this.conf.alternativeRoot)},u=r.createEphemeral(In);return r.lock(u),r.createField(s,"Dynamic"),r.setField(s,u),await r.commit(),await u.globalId}})}async deleteAlternativeRoot(e){if(this.checkInitialized(),this.ll.conf.alternativeRoot!==void 0)throw new Error("Initialized with alternative root.");return await this.withWriteTx("delete-alternative-root",async t=>{const r={resourceId:t.clientRoot,fieldName:lr(e)},n=t.fieldExists(r);return t.removeField(r),await t.commit(),await n})}async _withTx(e,t,r,n,s){let u=g.createRetryState((s==null?void 0:s.retryOptions)??this.defaultRetryOptions);for(;;){const l=this.ll.createTx(s),c=new fe(l,e,t,r,this.finalPredicate,this.resourceDataCache);let o=!1,d,rr;try{d=await n(c),o=!0}catch(ir){if(!(ir instanceof zn))throw ir}finally{await c.complete(),await c.await(),rr=await c.getGlobalTxId()}if(o)return((s==null?void 0:s.sync)===void 0?this.forceSync:s!=null&&s.sync)&&await this.ll.grpcPl.txSync({txId:rr}),t&&this.txDelay>0&&await wn.setTimeout(this.txDelay,void 0,{signal:s==null?void 0:s.abortSignal}),d;await wn.setTimeout(u.nextDelay,void 0,{signal:s==null?void 0:s.abortSignal}),u=g.nextRetryStateOrError(u)}}async withTx(e,t,r,n={}){return this.checkInitialized(),await this._withTx(e,t,this.clientRoot,r,{...n,...kn})}async withWriteTx(e,t,r={}){return await this.withTx(e,!0,t,{...r,...kn})}async withReadTx(e,t,r={}){return await this.withTx(e,!1,t,{...r,...kn})}getDriver(e){const t=this.drivers.get(e.name);if(t!==void 0)return t;const r=e.init(this,this.ll.grpcTransport,this.ll.httpDispatcher);return this.drivers.set(e.name,r),r}async close(){await this.ll.close()}static async init(e,t,r={}){const n=new Y(e,t,r);return await n.init(),n}}function hu(a,e){return e=e??{},e.meta=e.meta??{},e.meta.resourceType=`${a.name}:${a.version}`,e}class tr{constructor(e){p(this,"ll");this.ll=new er(e)}async ping(){return(await this.ll.grpcPl.ping({})).response}async authMethods(){return(await this.ll.grpcPl.authMethods({})).response}async requireAuth(){return(await this.authMethods()).methods.length>0}async login(e,t){try{const r=await this.ll.grpcPl.getJWTToken({expiration:{seconds:BigInt(this.ll.conf.authTTLSeconds),nanos:0}},{meta:{authorization:"Basic "+Buffer.from(e+":"+t).toString("base64")}}).response,n=g.notEmpty(r.token);if(n==="")throw new Error("empty token");return{jwtToken:n}}catch(r){throw r.code==="UNAUTHENTICATED"?new me(r.message):new Error(r)}}}const gu="pl.json",Tu=Sn.join(pr.homedir(),".pl.json"),ku="pl.yaml",mu=Sn.join(pr.homedir(),".pl.yaml"),wu=[gu,ku,Tu,mu],H=".pl_auth.json",bu=["grpcProxy","httpProxy","user","password","alternativeRoot","defaultTransactionTimeout","defaultRequestTimeout","authTTLSeconds","authMaxRefreshSeconds"];function Mr(){for(const a of wu)if(F.existsSync(a)){const e=F.readFileSync(a,{encoding:"utf-8"});return a.endsWith("json")?[JSON.parse(e),a]:[Gr.parse(e),a]}}function Pu(a,e){return t=>{F.writeFileSync(H,Buffer.from(JSON.stringify({confHash:a,authInformation:t,expiration:V(t,e)})),"utf8")}}const cr=()=>{F.rmSync(H)};async function Ru(){let a;if(process.env.PL_ADDRESS!==void 0)a=J(process.env.PL_ADDRESS);else{const r=Mr();if(r!==void 0){const[n,s]=r,u=g.notEmpty(n.address,`no pl address in file: ${s}`);a=J(u);for(const l of bu)n[l]!==void 0&&(a[l]=n[l])}}if(a===void 0)throw new Error("Can't find configuration to create default platform client.");process.env.PL_USER!==void 0&&(a.user=process.env.PL_USER),process.env.PL_PASSWORD!==void 0&&(a.user=process.env.PL_PASSWORD);const e=ye.createHash("sha256").update(Buffer.from(Hr(a))).digest("base64");let t;if(F.existsSync(H)){const r=JSON.parse(F.readFileSync(H,{encoding:"utf-8"}));r.confHash===e&&r.expiration>Date.now()&&(t=r.authInformation)}if(t===void 0){const r=new tr(a);if(await r.requireAuth()){if(a.user===void 0||a.password===void 0)throw new Error("No auth information for found to authenticate with PL server.");t=await r.login(a.user,a.password)}else t={};F.writeFileSync(H,Buffer.from(JSON.stringify({confHash:e,authInformation:t,expiration:V(t,a.authMaxRefreshSeconds)})),"utf8")}return await Y.init(a,{authInformation:t,onUpdate:r=>Pu(e,a.authMaxRefreshSeconds),onUpdateError:cr,onAuthError:cr})}async function Iu(a,e){const t={valueId:e.value,errorId:e.error,error:""};if(B(e.error)){const r=await a.getResourceData(e.error,!0);t.error=JSON.parse(g.notEmpty(r.data).toString())}return t}class D extends Error{}const _u={failOnError:!0,onlyFinal:!1};class xr{constructor(e,t,r){this.tx=e,this.data=t,this.path=r}final(){if(!this.data.final)throw new D;return this}async requireNoError(){return A(this.data.error)?this:(await this.tx.throwError(this.data.error,this.path),this)}getFieldData(e,t){const r=this.data.fields.find(n=>n.name===e);if(r!==void 0){if(t!==void 0&&r.type!==t)throw new Error(`Unexpected field type. Expected ${t}, found ${r.type}`);return r}throw(t==="Input"||t==="Service")&&this.data.inputsLocked||t==="Output"&&this.data.outputsLocked?new Error(`Field "${e}" not found. Expected type: ${t}, state: ${this.data}`):new D}async get(e,t={}){const{expectedType:r,failOnError:n,onlyFinal:s}={..._u,...t},u=[...this.path,e],l=this.getFieldData(e,r);if(B(l.error)&&(n||A(l.value))&&await this.tx.throwError(l.error,u),A(l.value))throw new D;return await this.tx.get(l.value,n,u)}async getMulti(e,...t){return await Promise.all(t.map(r=>this.get(r,e)))}async getMultiObj(e,...t){return Object.fromEntries(await Promise.all(t.map(async r=>[r,await this.get(r,e)])))}async getAllFinal(e={}){return await this.getMultiObj(e,...this.data.fields.filter(t=>t.valueIsFinal||B(t.error)).map(t=>t.name))}async getKValue(e){const t=await this.tx.tx.getKValueStringIfExists(this.data.id,e);if(t===void 0)throw new D;return t}async getKValueObj(e){return JSON.parse(await this.getKValue(e))}}class Er{constructor(e){this.tx=e}async get(e,t=!0,r=[]){const n=await this.tx.getResourceData(e,!0),s=new xr(this,n,[...r,z(e)]);return t&&await s.requireNoError(),s}async throwError(e,t=[]){const r=await this.get(e);let n=Buffer.from(g.notEmpty(r.data.data)).toString();throw new Error(`${t.join(" -> ")} = ${n}`)}}const $r={type:"linearBackoff",jitter:0,maxAttempts:100,backoffStep:10,initialDelay:10};async function Au(a,e,t=$r,r="polling"){let n=g.createRetryState(t);for(;;){try{return await a.withReadTx(r,async s=>await e(new Er(s)))}catch(s){if(!(s instanceof D))throw s}await wn.setTimeout(n.nextDelay),n=g.nextRetryStateOrError(n)}}const G="test_config.json";let mn;function x(){return mn===void 0&&(mn=Sn.resolve(".test_auth.json")),mn}function Sr(){let a={};if(W.existsSync(G)&&(a=JSON.parse(W.readFileSync(G,{encoding:"utf-8"}))),process.env.PL_ADDRESS!==void 0&&(a.address=process.env.PL_ADDRESS),process.env.PL_TEST_USER!==void 0&&(a.test_user=process.env.PL_TEST_USER),process.env.PL_TEST_PASSWORD!==void 0&&(a.test_password=process.env.PL_TEST_PASSWORD),process.env.PL_TEST_PROXY!==void 0&&(a.test_proxy=process.env.PL_TEST_PROXY),a.address===void 0)throw new Error(`can't resolve platform address (checked ${G} file and PL_ADDRESS environment var)`);return a}function ur(a){return e=>{const t=x(),r=x()+ye.randomUUID();W.writeFileSync(r,Buffer.from(JSON.stringify({conf:a,authInformation:e,expiration:V(e,24*60*60)})),"utf8"),W.renameSync(r,t)}}const dr=()=>{console.warn(`Removing: ${x()}`),W.rmSync(x())};async function nr(){const a=Sr();let e;if(W.existsSync(x()))try{const s=JSON.parse(W.readFileSync(x(),{encoding:"utf-8"}));s.conf.address===a.address&&s.conf.test_user===a.test_user&&s.conf.test_password===a.test_password&&s.expiration>Date.now()&&(e=s.authInformation)}catch{W.rmSync(x())}const t=J(a.address),r=new tr(t),n=await r.requireAuth();if(!n&&(a.test_user!==void 0||a.test_password!==void 0))throw new Error(`Server require no auth, but test user name or test password are provided via (${G}) or env variables: PL_TEST_USER and PL_TEST_PASSWORD`);if(n&&(a.test_user===void 0||a.test_password===void 0))throw new Error(`No auth information found in config (${G}) or env variables: PL_TEST_USER and PL_TEST_PASSWORD`);return e===void 0&&(n?e=await r.login(a.test_user,a.test_password):e={},ur(a)(e)),{conf:t,auth:{authInformation:e,onUpdate:ur(a),onAuthError:dr,onUpdateError:dr}}}async function Lu(a={}){const{conf:e,auth:t}=await nr();return new er({...e,...a},{auth:t})}async function $n(a){const{conf:e,auth:t}=await nr();if(a!==void 0&&e.alternativeRoot!==void 0)throw new Error("test pl address configured with alternative root");return await Y.init({...e,alternativeRoot:a},t)}async function Fu(a){const e=`test_${Date.now()}_${ye.randomUUID()}`;let t=U;try{const r=await $n(e);t=r.clientRoot;const n=await a(r);return await(await $n()).deleteAlternativeRoot(e),n}catch(r){throw console.log(`ALTERNATIVE ROOT: ${e} (${z(t)})`),new Error(r.message,{cause:r})}}const Wu=Object.freeze(Object.defineProperty({__proto__:null,getTestClient:$n,getTestClientConf:nr,getTestConfig:Sr,getTestLLClient:Lu,withTempRoot:Fu},Symbol.toStringTag,{value:"Module"}));exports.AnonymousAuthInformation=au;exports.ContinuePolling=D;exports.DEFAULT_AUTH_MAX_REFRESH=Fn;exports.DEFAULT_MAX_CACHE_BYTES=Wn;exports.DEFAULT_REQUEST_TIMEOUT=_n;exports.DEFAULT_RETRY_BACKOFF_ALGORITHM=Un;exports.DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER=Mn;exports.DEFAULT_RETRY_INITIAL_DELAY=Nn;exports.DEFAULT_RETRY_JITTER=En;exports.DEFAULT_RETRY_LINEAR_BACKOFF_STEP=xn;exports.DEFAULT_RETRY_MAX_ATTEMPTS=Bn;exports.DEFAULT_TOKEN_TTL_SECONDS=Ln;exports.DEFAULT_TX_TIMEOUT=An;exports.DefaultFinalResourceDataPredicate=Nr;exports.DefaultPollingRetryOptions=$r;exports.DisconnectedError=Gn;exports.MaxLocalId=Dn;exports.MaxTxId=ge;exports.NullResourceId=U;exports.Pl=ou;exports.PlClient=Y;exports.PlError=jn;exports.PlErrorCodeNotFound=Te;exports.PlTransaction=fe;exports.PollResourceAccessor=xr;exports.PollTxAccessor=Er;exports.RecoverablePlError=ke;exports.TestHelpers=Wu;exports.TxCommitConflict=zn;exports.UnauthenticatedError=me;exports.UnauthenticatedPlClient=tr;exports.UnrecoverablePlError=Tr;exports.addRTypeToMetadata=hu;exports.bigintToResourceId=li;exports.checkLocalityOfResourceId=si;exports.createGlobalResourceId=hr;exports.createLocalResourceId=On;exports.defaultPlClient=Ru;exports.ensureResourceIdNotNull=ue;exports.expirationFromAuthInformation=pu;exports.extractBasicResourceData=bn;exports.extractTxId=qn;exports.field=we;exports.getField=Pn;exports.inferAuthRefreshTime=V;exports.isAnyResourceId=Yr;exports.isConnectionProblem=Kn;exports.isField=jc;exports.isFieldRef=Jn;exports.isLocalResourceId=N;exports.isNotFoundError=Hn;exports.isNotNullResourceId=B;exports.isNullResourceId=A;exports.isResource=br;exports.isResourceRef=M;exports.isRootResourceId=Rn;exports.isTimeoutOrCancelError=vn;exports.isUnauthenticated=Vn;exports.jsonToData=ei;exports.plAddressToConfig=J;exports.poll=Au;exports.resDataToJson=ti;exports.resourceIdFromString=ai;exports.resourceIdToString=z;exports.resourceType=Xr;exports.resourceTypeToString=Zr;exports.resourceTypesEqual=Qr;exports.rethrowMeaningfulError=kr;exports.stringifyWithResourceId=ci;exports.throwPlNotFoundError=gr;exports.toFieldId=R;exports.toGlobalFieldId=Hc;exports.toGlobalResourceId=Pr;exports.toResourceId=k;exports.tryGetFileConfig=Mr;exports.valErr=Iu;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|